mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
Code blocks need a =>
This commit is contained in:
parent
3ab3bee0e1
commit
2186eed80b
@ -55,6 +55,9 @@ rusty_peg! {
|
||||
action: a
|
||||
};
|
||||
|
||||
ACTION: String =
|
||||
("=>", <c:CODE_BLOCK>) => c;
|
||||
|
||||
// Symbol items
|
||||
|
||||
SYMBOL_ARG: SymbolArg =
|
||||
@ -177,9 +180,9 @@ rusty_peg! {
|
||||
|
||||
// Custom symbols.
|
||||
|
||||
struct ACTION;
|
||||
struct CODE_BLOCK;
|
||||
|
||||
impl<'input> rusty_peg::Symbol<'input,Parser<'input>> for ACTION {
|
||||
impl<'input> rusty_peg::Symbol<'input,Parser<'input>> for CODE_BLOCK {
|
||||
type Output = String;
|
||||
|
||||
fn pretty_print(&self) -> String {
|
||||
|
@ -46,3 +46,8 @@ fn token_expr() {
|
||||
assert!(parse_grammar(r#"grammar Foo { token Expr where { "foo" => "bar"; } }"#).is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn map() {
|
||||
assert!(parse_grammar(r#"grammar Foo { Expr = <n:Alt+> => { { foo } }; }"#).is_ok());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user