Example #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));
        }
Example #2
0
 public void SetDim(string name, int index, InjectionValue value)
 {
     if (CurrentScope.TryGetValue(name, out var dim))
     {
         if (dim.Kind == InjectionValueKind.Array)
         {
             dim.Array[index] = value;
         }
         else
         {
             throw new NotImplementedException();
         }
     }
     else
     {
         throw new NotImplementedException();
     }
 }