fixing bug in the assembler; it didn't see the target from PushControlFrame

This commit is contained in:
Danny Yoo 2011-03-10 15:02:42 -05:00
parent 4a60a852e7
commit 55d84eec95
2 changed files with 9 additions and 1 deletions

View File

@ -171,7 +171,7 @@ EOF
[(PopEnvironment? stmt)
empty]
[(PushControlFrame? stmt)
empty]
(list (PushControlFrame-label stmt))]
[(PopControlFrame? stmt)
empty])
(loop (rest stmts))))]))))

View File

@ -99,6 +99,14 @@ var Primitives = (function() {
'null?': function(arity, returnLabel) {
var firstArg = MACHINE.env[MACHINE.env.length-1];
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;
}
};
})();