Beispiel #1
0
        private LocalVariable /*!*/ DefineParameter(string /*!*/ name, SourceSpan location)
        {
            // we are in a method:
            Debug.Assert(CurrentScope.IsTop && !(CurrentScope is TopStaticLexicalScope));

            LocalVariable variable;

            if (CurrentScope.TryGetValue(name, out variable))
            {
                _tokenizer.ReportError(Errors.DuplicateParameterName);
                return(variable);
            }

            return(CurrentScope.AddVariable(name, location));
        }