From fd21da09821d801868f5bc3f30900a99c411f39d Mon Sep 17 00:00:00 2001 From: arookas Date: Mon, 28 Dec 2015 01:22:26 -0500 Subject: [PATCH] Fixed: don't count constants when calculating global/local counts. --- ssc/scope stack.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssc/scope stack.cs b/ssc/scope stack.cs index 379beca..4711541 100644 --- a/ssc/scope stack.cs +++ b/ssc/scope stack.cs @@ -7,10 +7,10 @@ namespace arookas class sunScopeStack : IEnumerable { List Stack { get; set; } - int GlobalCount { get { return Stack.Where(i => i.Type == sunScopeType.Script).Sum(i => i.StorableCount); } } - int LocalCount { get { return Stack.Where(i => i.Type == sunScopeType.Function).Sum(i => i.StorableCount); } } public int Count { get { return Stack.Count; } } + int GlobalCount { get { return Stack.Where(i => i.Type == sunScopeType.Script).Sum(i => i.VariableCount); } } + int LocalCount { get { return Stack.Where(i => i.Type == sunScopeType.Function).Sum(i => i.VariableCount); } } public sunScope Root { get { return this.FirstOrDefault(i => i.Type == Top.Type); } } public sunScope Script { get { return this.FirstOrDefault(i => i.Type == sunScopeType.Script); } }