mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-28 06:01:02 +00:00
Added module_annotation to grammar
This commit is contained in:
parent
8b0b06965c
commit
72d8efcc00
@ -26,6 +26,7 @@ pub struct Grammar {
|
|||||||
pub where_clauses: Vec<String>,
|
pub where_clauses: Vec<String>,
|
||||||
pub items: Vec<GrammarItem>,
|
pub items: Vec<GrammarItem>,
|
||||||
pub annotations: Vec<Annotation>,
|
pub annotations: Vec<Annotation>,
|
||||||
|
pub module_annotations: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
@ -9,6 +9,7 @@ use util::strip;
|
|||||||
grammar<'input>(text: &'input str);
|
grammar<'input>(text: &'input str);
|
||||||
|
|
||||||
pub Grammar: Grammar =
|
pub Grammar: Grammar =
|
||||||
|
<module_annotations:ShebangAttribute*>
|
||||||
<uses:Use*>
|
<uses:Use*>
|
||||||
<annotations:Annotation*>
|
<annotations:Annotation*>
|
||||||
<lo:@L> "grammar" <hi:@R>
|
<lo:@L> "grammar" <hi:@R>
|
||||||
@ -30,7 +31,8 @@ pub Grammar: Grammar =
|
|||||||
parameters: parameters.unwrap_or(vec![]),
|
parameters: parameters.unwrap_or(vec![]),
|
||||||
where_clauses: where_clauses,
|
where_clauses: where_clauses,
|
||||||
items: uses.into_iter().chain(items).collect(),
|
items: uses.into_iter().chain(items).collect(),
|
||||||
annotations: annotations }
|
annotations: annotations,
|
||||||
|
module_annotations: module_annotations }
|
||||||
};
|
};
|
||||||
|
|
||||||
GrammarTypeParameters: Vec<TypeParameter> =
|
GrammarTypeParameters: Vec<TypeParameter> =
|
||||||
@ -361,6 +363,9 @@ Comma<E>: Vec<E> =
|
|||||||
<v0:(<E> ",")*> <e1:E?> =>
|
<v0:(<E> ",")*> <e1:E?> =>
|
||||||
v0.into_iter().chain(e1).collect();
|
v0.into_iter().chain(e1).collect();
|
||||||
|
|
||||||
|
ShebangAttribute: String =
|
||||||
|
<s:"#![...]"> => s.to_string();
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
type Location = usize;
|
type Location = usize;
|
||||||
type Error = tok::Error;
|
type Error = tok::Error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user