mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 17:27:18 +00:00
ded3d06387
make the self hosted compiler easier to make. The C version of the compiler does not need to be efficient.
31 lines
437 B
Plaintext
31 lines
437 B
Plaintext
# 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
|
|
|