Пример #1
0
        public JSSymbol AddSymbol(string name)
        {
            Debug.Assert(!_name2symbol.ContainsKey(name), string.Format("Symbol {0} already exists in this scope", name));
            var symbol = new JSSymbol(name, this, _symbols.Count);

            _symbols.Add(symbol);

            if (name != null)
            {
                _name2symbol.Add(name, symbol);
            }
            else
            {
                symbol.SymbolType = JSSymbol.SymbolTypes.HiddenLocal;
            }

            return(symbol);
        }
Пример #2
0
    public JSSymbol AddSymbol(string name)
    {
      Debug.Assert(!_name2symbol.ContainsKey(name), string.Format("Symbol {0} already exists in this scope", name));
      var symbol = new JSSymbol(name, this, _symbols.Count);
      _symbols.Add(symbol);

      if (name != null)
        _name2symbol.Add(name, symbol);
      else
        symbol.SymbolType = JSSymbol.SymbolTypes.HiddenLocal;

      return symbol;
    }