Ejemplo n.º 1
0
        public bool TryLookupLabel(string name, out LabelSymbol label)
        {
            label = null;
            // We only search for labels inside the current function
            var scope = this;
            var key   = SymbolKey.FromLabel(name);

            while (true)
            {
                if (TryLookupSymbol(scope, key, out label, _ => false))
                {
                    return(true);
                }

                if (scope.Kind == ScopeKind.Function) // Not found in this function
                {
                    return(false);
                }

                scope = scope.Parent;
            }
        }