Ejemplo n.º 1
0
        public sunCallableSymbol MustResolveCallable(sunFunctionCall node)
        {
            var symbol = ResolveCallable(node);

            if (symbol == null)
            {
                throw new sunUndefinedFunctionException(node);
            }
            return(symbol);
        }
Ejemplo n.º 2
0
        public sunCallableSymbol ResolveCallable(sunFunctionCall node)
        {
            var global = node.Name.Value;
            var local  = MangleSymbolName(global, node.Location.ScriptId, false, true);
            var symbol = SymbolTable.Get <sunCallableSymbol>().FirstOrDefault(i => i.Name == local);

            if (symbol != null)
            {
                return(symbol);
            }
            symbol = SymbolTable.Get <sunCallableSymbol>().FirstOrDefault(i => i.Name == global);
            if (symbol != null)
            {
                return(symbol);
            }
            return(null);
        }