fixing bug in the assembler; it didn't see the target from PushControlFrame
This commit is contained in:
parent
4a60a852e7
commit
55d84eec95
|
@ -171,7 +171,7 @@ EOF
|
||||||
[(PopEnvironment? stmt)
|
[(PopEnvironment? stmt)
|
||||||
empty]
|
empty]
|
||||||
[(PushControlFrame? stmt)
|
[(PushControlFrame? stmt)
|
||||||
empty]
|
(list (PushControlFrame-label stmt))]
|
||||||
[(PopControlFrame? stmt)
|
[(PopControlFrame? stmt)
|
||||||
empty])
|
empty])
|
||||||
(loop (rest stmts))))]))))
|
(loop (rest stmts))))]))))
|
||||||
|
|
|
@ -99,6 +99,14 @@ var Primitives = (function() {
|
||||||
'null?': function(arity, returnLabel) {
|
'null?': function(arity, returnLabel) {
|
||||||
var firstArg = MACHINE.env[MACHINE.env.length-1];
|
var firstArg = MACHINE.env[MACHINE.env.length-1];
|
||||||
return firstArg === NULL;
|
return firstArg === NULL;
|
||||||
|
},
|
||||||
|
'add1': function(arity, returnLabel) {
|
||||||
|
var firstArg = MACHINE.env[MACHINE.env.length-1];
|
||||||
|
return firstArg + 1;
|
||||||
|
},
|
||||||
|
'sub1': function(arity, returnLabel) {
|
||||||
|
var firstArg = MACHINE.env[MACHINE.env.length-1];
|
||||||
|
return firstArg - 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user