summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-06-14 09:40:25 +1000
committerJed Barber <jjbarber@y7mail.com>2012-06-14 09:40:25 +1000
commitbd7d6db4cee36a3535f8de97c1c0642e1b31106b (patch)
treea87ef9e9769ebccc818cc990bdfb99e5998ca95f
parent8ad06c403574b47e8cce845bf3a3816d841777b9 (diff)
Changed numbers to be handled specially since they're only used by def/ref/remove
-rw-r--r--Graph.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Graph.hs b/Graph.hs
index 80f2536..7b034bc 100644
--- a/Graph.hs
+++ b/Graph.hs
@@ -49,7 +49,7 @@ argMap "typeOp" = IO 1 1
argMap "var" = IO 2 1
argMap "varTerm" = IO 1 1
argMap "varType" = IO 1 1
-argMap x | (isNumber x || isName x) = IO 0 1
+argMap x | (isName x) = IO 0 1
@@ -88,6 +88,10 @@ parse gs@(graph,stack,dictionary) str =
'#':rest -> gs
+ n | (isNumber n) -> let node = Node n Set.empty
+ stack' = node <:> stack
+ in (graph, stack', dictionary)
+
x -> let (graph', stack') = process x (argMap x) graph stack
in (graph', stack', dictionary)