Made exponentiation higher precedence than multiplication

Fixed shebang
This commit is contained in:
Productive2 2021-01-05 13:02:14 +01:00
parent de65ca3374
commit 9e4329981c
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
# Copyright 2020 Mattia Giambirtone
#

View File

@ -71,6 +71,7 @@ type
Comparison,
Term,
Factor,
Exponentiation,
Unary,
Call,
Primary
@ -1092,7 +1093,7 @@ var rules: array[TokenType, ParseRule] = [
makeRule(nil, binary, Precedence.Comparison), # GE
makeRule(nil, binary, Precedence.Comparison), # LE
makeRule(nil, binary, Precedence.Factor), # MOD
makeRule(nil, binary, Precedence.Factor), # POW
makeRule(nil, binary, Precedence.Exponentiation), # POW
makeRule(nil, binary, Precedence.Comparison), # GT
makeRule(grouping, call, Precedence.Call), # LP
makeRule(nil, nil, Precedence.None), # RP