Exemple #1
0
        public TableKeyValue AddExplicitKeyField(ASTNode key, ASTNode value, String separator, IList <LToken> tokenList)
        {
            TableKeyValue keyValue;

            this.Fields.Add(keyValue = new TableKeyValue(this, this.Scope, tokenList)
            {
                Key       = key,
                Value     = value,
                Separator = separator
            });
            this.AddChild(keyValue);

            return(keyValue);
        }
Exemple #2
0
        public TableKeyValue AddSequentialField(ASTNode value, String separator, IList <LToken> tokenList)
        {
            TableKeyValue keyValue;

            this.Fields.Add(keyValue = new TableKeyValue(this, this.Scope, tokenList)
            {
                Value        = value,
                Separator    = separator,
                IsSequential = true
            });
            this.AddChild(keyValue);

            this.SequentialIndex++;
            keyValue.Key = new NumberExpression(keyValue, keyValue.Scope, new[] {
                new LToken("number", this.SequentialIndex.ToString( ), ( Double )this.SequentialIndex, TokenType.Number, SourceRange.Zero)
            });

            return(keyValue);
        }