aboutsummaryrefslogtreecommitdiff
path: root/src/cljcc/token.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/cljcc/token.clj')
-rw-r--r--src/cljcc/token.clj14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cljcc/token.clj b/src/cljcc/token.clj
index 60f66ee..86231b8 100644
--- a/src/cljcc/token.clj
+++ b/src/cljcc/token.clj
@@ -126,6 +126,20 @@
(defn binary-op? [op]
(contains? bin-ops op))
+(defn logical? [v]
+ (contains? #{:logical-and
+ :logical-not
+ :logical-or} v))
+
+(defn arithmetic? [v]
+ (contains?
+ #{:multiply
+ :divide
+ :remainder
+ :plus
+ :hyphen}
+ v))
+
(defn precedence [op]
(op bin-ops))