mirror of https://github.com/japl-lang/japl.git
Finished moving everything to types, now it compiles
This commit is contained in:
parent
73009c669c
commit
8be057f3cc
|
@ -25,7 +25,7 @@ import meta/tokenobject
|
|||
import meta/tokentype
|
||||
import meta/looptype
|
||||
import types/japlvalue
|
||||
import types/string
|
||||
import types/stringtype
|
||||
import types/function
|
||||
import tables
|
||||
when isMainModule:
|
||||
|
|
|
@ -29,7 +29,7 @@ import strformat
|
|||
import tables
|
||||
import meta/tokentype
|
||||
import meta/tokenobject
|
||||
import types/string
|
||||
import types/stringtype
|
||||
import types/japlvalue
|
||||
|
||||
# Table of all tokens except reserved keywords
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
## Defines JAPL exceptions
|
||||
|
||||
import string
|
||||
import stringtype
|
||||
import japlvalue
|
||||
import strformat
|
||||
import ../memory
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# code objects that can be compiled inside the JAPL runtime, pretty much
|
||||
# like in Python
|
||||
|
||||
import string
|
||||
import stringtype
|
||||
import strformat
|
||||
import ../memory
|
||||
import ../meta/opcode
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
import japlvalue
|
||||
import string
|
||||
import stringtype
|
||||
import function
|
||||
import exceptions
|
||||
import strutils
|
||||
|
|
5
vm.nim
5
vm.nim
|
@ -27,7 +27,7 @@ import tables
|
|||
import meta/opcode
|
||||
import types/exceptions
|
||||
import types/japlvalue
|
||||
import types/string
|
||||
import types/stringtype
|
||||
import types/function
|
||||
import types/operations
|
||||
import memory
|
||||
|
@ -643,7 +643,8 @@ proc freeVM*(self: var VM) =
|
|||
proc initVM*(): VM =
|
||||
## Initializes the VM
|
||||
setControlCHook(handleInterrupt)
|
||||
result = VM(lastPop: Value(kind: ValueType.Nil), objects: @[], globals: initTable[string, Value](), source: "", file: "")
|
||||
var globals: Table[string, Value] = initTable[string, Value]()
|
||||
result = VM(lastPop: Value(kind: ValueType.Nil), objects: @[], globals: globals, source: "", file: "")
|
||||
# TODO asNil() ?
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue