public ContentParseNode(Token token) { Value = token.Value; Line = token.Line; Column = token.Column; }
public ProcessParseNode(Token token) { Value = token.Value; Line = token.Line; Column = token.Column; }
public ForeachParseNode(Token current, IEnumerator<Token> tokens) { Value = current.Value.Substring(current.Value.IndexOf(" ")).Trim(); Line = current.Line; Column = current.Column; _listToken = current; _block = new BlockParseNode(tokens); }
public IfElseParseNode(Token t, IEnumerator<Token> tokens) { Column = t.Column; Line = t.Line; Value = t.Value.Substring(t.Value.IndexOf(" ")).Trim(); _block = new BlockParseNode(tokens); if (tokens.Current.Type == TokenType.Else) { _elseBlock = new BlockParseNode(tokens); } else if (tokens.Current.Type == TokenType.ElseIf) { _elseBlock = new IfElseParseNode(tokens.Current, tokens); } else if (tokens.Current.Type != TokenType.End) { // Nothing; } else { throw new TemplateParseException(tokens.Current.Line, tokens.Current.Column, "Invalid If else block"); } }
public EvalParseNode(Token token) { Value = token.Value.Trim(); if (Value.StartsWith("Eval ", StringComparison.InvariantCultureIgnoreCase) && !String.Equals("Eval ", Value, StringComparison.InvariantCultureIgnoreCase)) { Value = Value.Substring(Value.IndexOf(" ")).Trim(); } Line = token.Line; Column = token.Column; }