diff --git a/ssc/compiler.cs b/ssc/compiler.cs index d99801f..b6ff27e 100644 --- a/ssc/compiler.cs +++ b/ssc/compiler.cs @@ -55,9 +55,9 @@ namespace arookas { } results.DataCount = mContext.DataTable.Count; results.SymbolCount = mContext.SymbolTable.Count; - results.BuiltinCount = mContext.SymbolTable.BuiltinCount; - results.FunctionCount = mContext.SymbolTable.FunctionCount; - results.VariableCount = mContext.SymbolTable.VariableCount; + results.BuiltinCount = mContext.SymbolTable.GetCount(); + results.FunctionCount = mContext.SymbolTable.GetCount(); + results.VariableCount = mContext.SymbolTable.GetCount(); } catch (sunCompilerException ex) { results.Error = ex; @@ -79,7 +79,7 @@ namespace arookas { } int DoCompileFunctions() { var count = 0; - foreach (var callable in mContext.SymbolTable.Callables.Where(i => i.HasRelocations && i.CompileCount == 0)) { + foreach (var callable in mContext.SymbolTable.Get().Where(i => i.HasRelocations && i.CompileCount == 0)) { callable.Compile(this); ++count; } diff --git a/ssc/context.cs b/ssc/context.cs index 82b259d..63487ba 100644 --- a/ssc/context.cs +++ b/ssc/context.cs @@ -45,7 +45,7 @@ namespace arookas { // callables public sunBuiltinSymbol DeclareBuiltin(sunBuiltinDeclaration node) { - if (SymbolTable.Callables.Any(i => i.Name == node.Name.Value)) { + if (SymbolTable.Get().Any(i => i.Name == node.Name.Value)) { throw new sunRedeclaredBuiltinException(node); } var symbol = new sunBuiltinSymbol(node.Name.Value, node.Parameters.ParameterInfo, SymbolTable.Count); @@ -58,7 +58,7 @@ namespace arookas { if (node.Parameters.IsVariadic) { throw new sunVariadicFunctionException(node); } - if (SymbolTable.Callables.Any(i => i.Name == name)) { + if (SymbolTable.Get().Any(i => i.Name == name)) { throw new sunRedefinedFunctionException(node); } var symbol = new sunFunctionSymbol(name, node.Parameters.ParameterInfo, node.Body); @@ -69,11 +69,11 @@ namespace arookas { public sunCallableSymbol ResolveCallable(sunFunctionCall node) { var global = node.Name.Value; var local = MangleSymbolName(global, node.Location.ScriptId, false, true); - var symbol = SymbolTable.Callables.FirstOrDefault(i => i.Name == local); + var symbol = SymbolTable.Get().FirstOrDefault(i => i.Name == local); if (symbol != null) { return symbol; } - symbol = SymbolTable.Callables.FirstOrDefault(i => i.Name == global); + symbol = SymbolTable.Get().FirstOrDefault(i => i.Name == global); if (symbol != null) { return symbol; } diff --git a/ssc/symbol.cs b/ssc/symbol.cs index 09ce728..63626fd 100644 --- a/ssc/symbol.cs +++ b/ssc/symbol.cs @@ -9,19 +9,6 @@ namespace arookas { List mSymbols; public int Count { get { return mSymbols.Count; } } - public int CallableCount { get { return Callables.Count(); } } - public int BuiltinCount { get { return Builtins.Count(); } } - public int FunctionCount { get { return Functions.Count(); } } - public int StorableCount { get { return Storables.Count(); } } - public int VariableCount { get { return Variables.Count(); } } - public int ConstantCount { get { return Constants.Count(); } } - - public IEnumerable Callables { get { return mSymbols.OfType(); } } - public IEnumerable Builtins { get { return mSymbols.OfType(); } } - public IEnumerable Functions { get { return mSymbols.OfType(); } } - public IEnumerable Storables { get { return mSymbols.OfType(); } } - public IEnumerable Variables { get { return mSymbols.OfType(); } } - public IEnumerable Constants { get { return mSymbols.OfType(); } } public sunSymbol this[int index] { get { return mSymbols[index]; }