mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
Merge pull request #294 from ahmedcharles/pubmacro
Add error when macros are marked public.
This commit is contained in:
commit
6a48b9f070
@ -124,6 +124,9 @@ impl<'grammar> Validator<'grammar> {
|
||||
}
|
||||
}
|
||||
GrammarItem::Nonterminal(ref data) => {
|
||||
if data.public && !data.args.is_empty() {
|
||||
return_err!(data.span, "macros cannot be marked public");
|
||||
}
|
||||
let inline_annotation = intern(INLINE);
|
||||
let known_annotations = vec![inline_annotation];
|
||||
let mut found_annotations = set();
|
||||
|
@ -125,4 +125,12 @@ fn mixing_names_and_anonymous_values() {
|
||||
r#"anonymous symbols like this one cannot be combined with named symbols like `b:B`"#,
|
||||
r#"grammar; Term = { <A> <b:B> => Alien: Eighth passanger of Nostromo};"#,
|
||||
r#" ~~~ "#);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn public_macros() {
|
||||
check_err(
|
||||
r#"macros cannot be marked public"#,
|
||||
r#"grammar; pub Comma<T> = (T ",")* T?;"#,
|
||||
r#" ~~~~~~~~ "#);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user