aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler.rs b/src/compiler.rs
index b2900b6..c04a36f 100644
--- a/src/compiler.rs
+++ b/src/compiler.rs
@@ -186,6 +186,7 @@ nextable_enum!(Prec {
Comp,
Term,
Factor,
+ Index,
});
#[derive(Clone, Debug)]
@@ -603,6 +604,8 @@ impl Compiler {
fn precedence(&self, token: Token) -> Prec {
match token {
+ Token::LeftBracket => Prec::Index,
+
Token::Star | Token::Slash => Prec::Factor,
Token::Minus | Token::Plus => Prec::Term,