Exemple #1
0
        sunStorableSymbol AddSystemVariable(string name)
        {
            var symbol = Scopes.DeclareVariable(MangleSystemSymbol(name));

            SymbolTable.Add(symbol);
            return(symbol);
        }
Exemple #2
0
        sunVariableSymbol DeclareVariable(sunIdentifier node, sunSymbolModifiers modifiers)
        {
            var local  = (modifiers & sunSymbolModifiers.Local) != 0;
            var name   = MangleSymbolName(node.Value, node.Location.ScriptId, false, local);
            var symbol = Scopes.DeclareVariable(name);

            if (symbol == null)
            {
                throw new sunRedeclaredVariableException(node);
            }
#if SSC_SCOPES
            if (Scopes.Top.Type == sunScopeType.Script)
            {
#else
            if (Scopes.Count == 1)
            {
#endif
                SymbolTable.Add(symbol);
            }
            return(symbol);
        }