about summary refs log tree commit diff stats
path: root/shen/basic.shen
diff options
context:
space:
mode:
Diffstat (limited to 'shen/basic.shen')
-rw-r--r--shen/basic.shen18
1 files changed, 18 insertions, 0 deletions
diff --git a/shen/basic.shen b/shen/basic.shen
new file mode 100644
index 0000000..89a998e
--- /dev/null
+++ b/shen/basic.shen
@@ -0,0 +1,18 @@
+(define priority-op
+  { symbol --> number }
+  not -> 1
+  uminus -> 7)
+
+(define pp-binop
+  { symbol --> string }
+  plus -> "+"
+  mult -> "*")
+
+(define parenthesis
+  { string --> string }
+  X -> (@s "(" X ")"))
+
+(define isdigit
+  { string --> boolean }
+  C -> (let CN (string->n C)
+         (and (>= CN (string->n "0")) (<= CN (string->n "9")))))