Debian Codegraph @

tests/run-pass/test-hygiene.rs

raw symbols SCIP
1 use ::peg as realpeg;
2 struct Result;
3 struct ParseResult;
4 struct Parse;
5 struct Input;
6 struct ParseState;
7 struct ErrorState;
8 struct Vec;
9 struct HashMap;
10 mod peg {}
11
12 realpeg::parser!{
13 grammar p() for str {
14 pub rule number() -> f64 = n:$(['0'..='9']+) { n.parse().unwrap() }
15
16 #[cache]
17 pub rule cached() = "x"
18
19 pub rule prec() -> () = precedence!{
20 "x" { () }
21 }
22 }
23 }
24
25 fn main() {
26 assert_eq!(p::number("12345"), Ok(12345.0))
27 }
28