parser: create Precedence and Associativity enums

This commit is contained in:
Ryan Chandler 2022-09-12 16:09:27 +01:00
parent 1c90b5e907
commit 860e16368b
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA
2 changed files with 35 additions and 0 deletions

View File

@ -46,6 +46,7 @@ mod block;
mod comments;
mod ident;
mod params;
mod precedence;
mod punc;
pub struct ParserConfig {

View 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,
}