Finished moving everything to types, now it compiles

This commit is contained in:
Productive2 2020-10-23 18:28:39 +02:00
parent 73009c669c
commit 8be057f3cc
7 changed files with 8 additions and 7 deletions

View File

@ -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:

View File

@ -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

View File

@ -15,7 +15,7 @@
## Defines JAPL exceptions
import string
import stringtype
import japlvalue
import strformat
import ../memory

View File

@ -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

View File

@ -13,7 +13,7 @@
# limitations under the License.
import japlvalue
import string
import stringtype
import function
import exceptions
import strutils

5
vm.nim
View File

@ -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() ?