summaryrefslogtreecommitdiff
path: root/usr/gri/pretty/scanner.go
diff options
context:
space:
mode:
Diffstat (limited to 'usr/gri/pretty/scanner.go')
-rw-r--r--usr/gri/pretty/scanner.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/gri/pretty/scanner.go b/usr/gri/pretty/scanner.go
index 3af53c068..fcca40d5a 100644
--- a/usr/gri/pretty/scanner.go
+++ b/usr/gri/pretty/scanner.go
@@ -210,6 +210,13 @@ export func TokenString(tok int) string {
}
+export const (
+ LowestPrec = -1;
+ UnaryPrec = 7;
+ HighestPrec = 8;
+)
+
+
export func Precedence(tok int) int {
switch tok {
case COLON:
@@ -227,7 +234,7 @@ export func Precedence(tok int) int {
case MUL, QUO, REM, SHL, SHR, AND:
return 6;
}
- return -1;
+ return LowestPrec;
}