Parsing Expression Grammar (PEG) parser generator for Rust
Fix for libsyntax OneVector
rename
Fix for FileName change in libsyntax API
#[pub] rule_name = ...
syntax to pub rule_name = ...
. The old syntax is retained for backwards compatibility, but pub
is now a reserved keyword and cannot be used as an identifier.#infix
syntax for parsing binary infix expressions by precedence climbing.**<n,m>
.x*<{count}>
syntax for a repeat bounded by a Rust expression.#quiet<e>
and #expected("msg")
expressions for improved error reporting.as
in use
statements to match Rust syntax.&
and !
expressions.peg = "0.3.0"
with peg-syntax-ext = "0.4.0"
in your Cargo.toml
's [dependencies]
section. The library name in #![plugin(peg_syntax_ext)]
remains the same. Consider moving to the build script for compatibility with Rust stable.match_str
variable has been removed in favor of the $(expr)
syntax. Replace [0-9]+ { match_str.parse().unwrap() }
with n:$([0-9]+) { n.parse().unwrap() }
start_pos
and pos
variables have been removed. Use #position
as an expression, which returns a usize
offset into the source string. Replace foo:x { Span(start_pos, pos, foo) }
with start:#position foo:x end:#position { Span(start, end, foo) }
\u2029
unicode hex escape syntax has been removed, as it has long-since been removed from Rust. Use \u{2029}
instead.foo{x,y}
bounded-repeat syntax was replaced with foo*<x,y>
to avoid a grammar ambiguity (#74).