Minor cleanup

This commit is contained in:
arookas 2016-02-01 06:23:59 -05:00
parent f00b7c4296
commit 9373c59c44
3 changed files with 4 additions and 8 deletions

View file

@ -21,9 +21,7 @@ namespace arookas {
}
static void CompileExpression(sunCompiler compiler, sunExpression expression, Stack<sunOperator> operatorStack) {
// this implementation assumes that the expression production child list alternates between operand and operator
// we can safely assume this as the grammar "operand {binary_operator operand}" enforces it
int stackCount = operatorStack.Count;
var stackCount = operatorStack.Count;
foreach (var node in expression) {
if (node is sunOperand) {
var operand = node as sunOperand;

View file

@ -199,9 +199,7 @@ namespace arookas {
mLocalStack.Push(mLocal++);
}
public void PopLocal() {
if (mLocalStack.Count > 0) {
mLocalStack.Pop();
}
mLocalStack.Pop();
}
// system symbols

View file

@ -21,8 +21,8 @@ const SYS_GOLDCOINNUM = 0x40002;
builtin getSystemFlag(flag);
builtin setSystemFlag(flag, value);
function setOnSystemFlag(flag) { setSystemFlag(flag, true); }
function setOffSystemFlag(flag) { setSystemFlag(flag, false); }
function setOnSystemFlag(flag) { setSystemFlag(flag, true); }
function setOffSystemFlag(flag) { setSystemFlag(flag, false); }
// [arookas] custom utility
function incSystemFlag(flag) {