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/tokentype
|
||||||
import meta/looptype
|
import meta/looptype
|
||||||
import types/japlvalue
|
import types/japlvalue
|
||||||
import types/string
|
import types/stringtype
|
||||||
import types/function
|
import types/function
|
||||||
import tables
|
import tables
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
|
|
|
@ -29,7 +29,7 @@ import strformat
|
||||||
import tables
|
import tables
|
||||||
import meta/tokentype
|
import meta/tokentype
|
||||||
import meta/tokenobject
|
import meta/tokenobject
|
||||||
import types/string
|
import types/stringtype
|
||||||
import types/japlvalue
|
import types/japlvalue
|
||||||
|
|
||||||
# Table of all tokens except reserved keywords
|
# Table of all tokens except reserved keywords
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
## Defines JAPL exceptions
|
## Defines JAPL exceptions
|
||||||
|
|
||||||
import string
|
import stringtype
|
||||||
import japlvalue
|
import japlvalue
|
||||||
import strformat
|
import strformat
|
||||||
import ../memory
|
import ../memory
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# code objects that can be compiled inside the JAPL runtime, pretty much
|
# code objects that can be compiled inside the JAPL runtime, pretty much
|
||||||
# like in Python
|
# like in Python
|
||||||
|
|
||||||
import string
|
import stringtype
|
||||||
import strformat
|
import strformat
|
||||||
import ../memory
|
import ../memory
|
||||||
import ../meta/opcode
|
import ../meta/opcode
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import japlvalue
|
import japlvalue
|
||||||
import string
|
import stringtype
|
||||||
import function
|
import function
|
||||||
import exceptions
|
import exceptions
|
||||||
import strutils
|
import strutils
|
||||||
|
|
5
vm.nim
5
vm.nim
|
@ -27,7 +27,7 @@ import tables
|
||||||
import meta/opcode
|
import meta/opcode
|
||||||
import types/exceptions
|
import types/exceptions
|
||||||
import types/japlvalue
|
import types/japlvalue
|
||||||
import types/string
|
import types/stringtype
|
||||||
import types/function
|
import types/function
|
||||||
import types/operations
|
import types/operations
|
||||||
import memory
|
import memory
|
||||||
|
@ -643,7 +643,8 @@ proc freeVM*(self: var VM) =
|
||||||
proc initVM*(): VM =
|
proc initVM*(): VM =
|
||||||
## Initializes the VM
|
## Initializes the VM
|
||||||
setControlCHook(handleInterrupt)
|
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() ?
|
# TODO asNil() ?
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue