Exemplo n.º 1
0
 public void WriteValue(StageValue v)
 {
     if (!v.isText)
     {
         this._b.Append(v.@value);
         return;
     }
     this._b.Append('\"');
     StringHandler.EscapeString(v.@value, this._b);
     this._b.Append('\"');
 }
 public void WriteValue(StageValue v)
 {
     if (v.isText)
     {
         _b.Append('"');
         StringHandler.EscapeString(v.value, _b);
         _b.Append('"');
     }
     else
     {
         _b.Append(v.value);
     }
 }
Exemplo n.º 3
0
        Expression AddArgument(Source src, StageValue v)
        {
            var key = v.Value.ToString();

            for (int i = 0; i < Arguments.Count; i++)
            {
                if (Arguments[i].Value.Value.ToString() == key)
                {
                    return(new PlaceholderArgument(src, Arguments[i].Value.Value.ReturnType, i));
                }
            }

            Arguments.Add(new Argument(src, v));
            return(new PlaceholderArgument(src, v.Value.ReturnType, Arguments.Count - 1));
        }
Exemplo n.º 4
0
 public Argument(Source src, StageValue val)
 {
     Source = src;
     Value  = val;
 }
Exemplo n.º 5
0
        private void ParseValue(string name, bool isAttribute)
        {
            StageValue stageAttribute;

            this._valStart = this._idx;
            this._valEnd   = -1;
            while (this._idx < this._length)
            {
                char chr = this._s[this._idx];
                if (chr <= ' ')
                {
                    switch (chr)
                    {
                    case '\t':
                    case '\n':
                    case '\f':
                    case '\r':
                    {
                        if (this._valEnd != -1)
                        {
                            goto Label0;
                        }
                        this._valStart++;
                        goto Label0;
                    }

                    case '\v':
                    {
                        break;
                    }

                    default:
                    {
                        if (chr == ' ')
                        {
                            goto case '\r';
                        }
                        break;
                    }
                    }
                }
                else if (chr == ',' || chr == ']' || chr == '}')
                {
                    if (this._valEnd >= 0)
                    {
                        this._b.Append(this._s, this._valStart, this._valEnd - this._valStart + 1);
                    }
                    if (isAttribute)
                    {
                        stageAttribute = new StageAttribute(name, this._b.Flush(), false);
                    }
                    else
                    {
                        stageAttribute = new StageValue(name, this._b.Flush(), false);
                    }
                    this._curRoot.Add(stageAttribute);
                    this._idx--;
                    return;
                }
                this._valEnd = this._idx;
Label0:
                this._idx++;
            }
        }
Exemplo n.º 6
0
        private void ParseItemType(string name, bool isAttribute)
        {
            StageValue stageAttribute;

            while (true)
            {
                if (this._idx >= this._length)
                {
                    return;
                }
                char chr = this._s[this._idx];
                if (chr > ' ')
                {
                    if (chr == '\"')
                    {
                        this._idx++;
                        this.ParseString();
                        if (isAttribute)
                        {
                            stageAttribute = new StageAttribute(name, this._b.Flush(), true);
                        }
                        else
                        {
                            stageAttribute = new StageValue(name, this._b.Flush(), true);
                        }
                        this._curRoot.Add(stageAttribute);
                        return;
                    }
                    if (chr == '[')
                    {
                        this._idx++;
                        this.ParseList(name);
                        return;
                    }
                    if (chr != '{')
                    {
                        break;
                    }
                    this._idx++;
                    this.ParseElement(name);
                    return;
                }
                else
                {
                    switch (chr)
                    {
                    case '\t':
                    case '\n':
                    case '\f':
                    case '\r':
                    {
                        this._idx++;
                        continue;
                    }

                    case '\v':
                    {
                        break;
                    }

                    default:
                    {
                        if (chr == ' ')
                        {
                            goto case '\r';
                        }
                        break;
                    }
                    }
                }
            }
            this.ParseValue(name, isAttribute);
        }