mirror of
https://github.com/danog/parser.git
synced 2024-11-27 04:14:55 +01:00
parser: create Precedence and Associativity enums
This commit is contained in:
parent
1c90b5e907
commit
860e16368b
@ -46,6 +46,7 @@ mod block;
|
|||||||
mod comments;
|
mod comments;
|
||||||
mod ident;
|
mod ident;
|
||||||
mod params;
|
mod params;
|
||||||
|
mod precedence;
|
||||||
mod punc;
|
mod punc;
|
||||||
|
|
||||||
pub struct ParserConfig {
|
pub struct ParserConfig {
|
||||||
|
34
trunk_parser/src/parser/precedence.rs
Normal file
34
trunk_parser/src/parser/precedence.rs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
|
pub enum Precedence {
|
||||||
|
CloneNew,
|
||||||
|
Pow,
|
||||||
|
Prefix,
|
||||||
|
Instanceof,
|
||||||
|
Bang,
|
||||||
|
MulDivMod,
|
||||||
|
AddSub,
|
||||||
|
BitShift,
|
||||||
|
Concat,
|
||||||
|
LtGt,
|
||||||
|
Equality,
|
||||||
|
BitwiseAnd,
|
||||||
|
BitwiseXor,
|
||||||
|
BitwiseOr,
|
||||||
|
And,
|
||||||
|
Or,
|
||||||
|
NullCoalesce,
|
||||||
|
Ternary,
|
||||||
|
Assignment,
|
||||||
|
YieldFrom,
|
||||||
|
Yield,
|
||||||
|
Print,
|
||||||
|
KeyAnd,
|
||||||
|
KeyXor,
|
||||||
|
KeyOr,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum Associativity {
|
||||||
|
None,
|
||||||
|
Left,
|
||||||
|
Right,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user