1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-01 08:03:02 +00:00

Use fewer special forms in c compiler. This should

make the self hosted compiler easier to make. The
C version of the compiler does not need to be efficient.
This commit is contained in:
Calvin Rose
2017-04-12 10:31:50 -04:00
parent a0d3600ac0
commit ded3d06387
11 changed files with 634 additions and 859 deletions

30
libs/compile.gst Normal file
View File

@@ -0,0 +1,30 @@
# Real compiler
# Make compiler
(: make-compiler (fn [] {
'scopes []
'env []
'labels {}
}))
# Make default form options
(: make-formopts (fn [] {
'target nil
'resultUnused false
'canChoose true
'isTail false
}))
# Make scope
(: make-scope (fn [] {
'level 0
'nextSlot 0
'frameSize 0
'freeSlots []
'literals {}
'literalsArray []
'slotMap []
}))
# Push a scope onto the compiler