File: rule_args_errors.rs

package info (click to toggle)
rust-peg 0.8.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 756 kB
  • sloc: makefile: 20; sh: 12
file content (13 lines) | stat: -rw-r--r-- 299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
extern crate peg;

peg::parser!(grammar foo() for str {
    rule foo(x: i32, y: rule<()>) = "foo"
    rule ok() = foo(1, <[_] {}>) 

    rule too_few() = foo(1) //~ ERROR
    rule too_many() = foo(1, <[_] {}>, 2)  //~ ERROR

    pub rule pub_rule_arg(x: rule<()>) = "foo" //~ ERROR
});

fn main() {}