From 9373c59c4472046f110935c8ea430457bf55e2d5 Mon Sep 17 00:00:00 2001 From: arookas Date: Mon, 1 Feb 2016 06:23:59 -0500 Subject: [PATCH] Minor cleanup --- ssc/ast/nodes.expressions.cs | 4 +--- ssc/context.cs | 4 +--- stdlib/system.sun | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ssc/ast/nodes.expressions.cs b/ssc/ast/nodes.expressions.cs index 9de3a3f..e334e31 100644 --- a/ssc/ast/nodes.expressions.cs +++ b/ssc/ast/nodes.expressions.cs @@ -21,9 +21,7 @@ namespace arookas { } static void CompileExpression(sunCompiler compiler, sunExpression expression, Stack 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; diff --git a/ssc/context.cs b/ssc/context.cs index 85cd779..afa0054 100644 --- a/ssc/context.cs +++ b/ssc/context.cs @@ -199,9 +199,7 @@ namespace arookas { mLocalStack.Push(mLocal++); } public void PopLocal() { - if (mLocalStack.Count > 0) { - mLocalStack.Pop(); - } + mLocalStack.Pop(); } // system symbols diff --git a/stdlib/system.sun b/stdlib/system.sun index bf023ce..e93181f 100644 --- a/stdlib/system.sun +++ b/stdlib/system.sun @@ -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) {