示例#1
0
 private Syntax.Value ParseValue(Declare assignTo)
 {
     try
     {
         // var _strval = getValue(Syntax.Value.ValueExpression, _current.Value);
         var val = new Syntax.Value(assignTo, _current.Span, _current.Value);
         return(val);
     }
     catch (Exception e)
     {
         AddError(Source.Severity.Error, e.Message, _current.Span);
         var val = new Syntax.Value(assignTo, _current.Span, "");
         return(val);
     }
 }
示例#2
0
        public static dynamic GetValue(Syntax.Value raw)
        {
            switch (raw)
            {
            case Syntax.BoolValue bValue:
                return(bValue.data);

            case Syntax.DigitValue dValue:
                return(dValue.digit);

            case Syntax.StringValue sValue:
                return(GetValueFunc(sValue.ToString()));

            default:
                throw new NotImplementedException();
            }
        }
示例#3
0
 public static void SetValue(string target, Syntax.Value raw)
 {
     SetValueFunc(target, GetValue(raw));
 }