private static bool _1(Parser parser) { if (!parser.Terminal("*")) { return(false); } parser.AddNode(new Ast(Ast.NodeTypes.String, "*")); return(true); }
public static bool Consume(Parser parser) { Ast node = new Ast(Ast.NodeTypes.String, parser.CurrentValue); // must start with a letter (bool match, bool end) = parser.ConsumeLetter(); if (!match) { return(false); } while (!end) { (match, end) = parser.ConsumeLetterOrDigit(); if (!match) { return(false); } } parser.AddNode(node); return(true); }