Minor cleanup
This commit is contained in:
parent
f00b7c4296
commit
9373c59c44
3 changed files with 4 additions and 8 deletions
|
@ -21,9 +21,7 @@ namespace arookas {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CompileExpression(sunCompiler compiler, sunExpression expression, Stack<sunOperator> operatorStack) {
|
static void CompileExpression(sunCompiler compiler, sunExpression expression, Stack<sunOperator> operatorStack) {
|
||||||
// this implementation assumes that the expression production child list alternates between operand and operator
|
var stackCount = operatorStack.Count;
|
||||||
// we can safely assume this as the grammar "operand {binary_operator operand}" enforces it
|
|
||||||
int stackCount = operatorStack.Count;
|
|
||||||
foreach (var node in expression) {
|
foreach (var node in expression) {
|
||||||
if (node is sunOperand) {
|
if (node is sunOperand) {
|
||||||
var operand = node as sunOperand;
|
var operand = node as sunOperand;
|
||||||
|
|
|
@ -199,9 +199,7 @@ namespace arookas {
|
||||||
mLocalStack.Push(mLocal++);
|
mLocalStack.Push(mLocal++);
|
||||||
}
|
}
|
||||||
public void PopLocal() {
|
public void PopLocal() {
|
||||||
if (mLocalStack.Count > 0) {
|
mLocalStack.Pop();
|
||||||
mLocalStack.Pop();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// system symbols
|
// system symbols
|
||||||
|
|
|
@ -21,8 +21,8 @@ const SYS_GOLDCOINNUM = 0x40002;
|
||||||
builtin getSystemFlag(flag);
|
builtin getSystemFlag(flag);
|
||||||
builtin setSystemFlag(flag, value);
|
builtin setSystemFlag(flag, value);
|
||||||
|
|
||||||
function setOnSystemFlag(flag) { setSystemFlag(flag, true); }
|
function setOnSystemFlag(flag) { setSystemFlag(flag, true); }
|
||||||
function setOffSystemFlag(flag) { setSystemFlag(flag, false); }
|
function setOffSystemFlag(flag) { setSystemFlag(flag, false); }
|
||||||
|
|
||||||
// [arookas] custom utility
|
// [arookas] custom utility
|
||||||
function incSystemFlag(flag) {
|
function incSystemFlag(flag) {
|
||||||
|
|
Loading…
Reference in a new issue