On 3/27/12, Philippe Sigaud <[email protected]> wrote: > snip
Philippe your example on this wiki page doesn't seem to work: https://github.com/PhilippeSigaud/Pegged/wiki/ import pegged.grammar; mixin(grammar( "Expr <- Factor AddExpr* AddExpr <- ('+'/'-') Factor Factor <- Primary MulExpr* MulExpr <- ('*'/'/') Primary Primary <- Parens / Number / Variable / '-' Primary Parens <- '(' Expr ')' Number <~ [0-9]+ Variable <- Identifier")); void main() { auto parseTree2 = Expr.parse(" 0 + 123 - 456 "); writeln(parseTree2.capture); } ["Expr failure at pos [index: 0, line: 0, col: 0]", "Factor failure at pos [index: 0, line: 0, col: 0]", "Primary failure at pos [index: 0, line: 0, col: 0]", "Parens failure at pos [index: 0, line: 0, col: 0]", "Lit!(() failure at pos [index: 0, line: 0, col: 0]"]
