On Sun, Mar 11, 2012 at 08:26, Andrei Alexandrescu <[email protected]> wrote: > I, too, think this is very significant work! Suggestion for Philippe: > instead of this: > > > enum PEGCode = grammarCode!( > "Grammar <- S Definition+ EOI" > ,"Definition <- RuleName Arrow Expression" > ,"RuleName <- Identifier>(ParamList?)" > ,"Expression <- Sequence (OR Sequence)*" > ); > > how about this: > > enum PEGCode = grammarCode!(" > Grammar <- S Definition+ EOI; > > Definition <- RuleName Arrow Expression; > RuleName <- Identifier>(ParamList?); > Expression <- Sequence (OR Sequence)*; > "); > > Splitting on ";" is trivial and makes client code considerably easier to > play with.
It's already implemented! No need for ';' The docs are up to date, the internal code also. It's only an old bootstrapping file that Andrej cited that still contains multi-string definitions. I'll correct that, as that means I didn"t push dogfooding far enough. Now, just use one string: "Grammar <- ... Definition <- ... "
