Example #1
0
        public LocalValue AddLocalName(string name)
        {
            LocalValue val = new LocalValue();

            this.cur_block.values[name] = val;
            return(val);
        }
Example #2
0
        public LocalValue GetName(string name, out bool is_global)
        {
            GenBlock   b   = this.cur_block;
            LocalValue ret = null;

            while (b != null)
            {
                if (b.values.TryGetValue(name, out ret))
                {
                    is_global = true;
                    return(ret);
                }
                b = b.parent;
            }
            is_global = this.func.upvalues.TryGetValue(name, out ret);
            return(ret);
        }