summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2012-05-08 22:16:09 +1000
committerJed Barber <jjbarber@y7mail.com>2012-05-08 22:16:09 +1000
commit8b9a9d2ce14159541de1a0a7a7ef533c1983a516 (patch)
treeff0ece6f82447bbe03e74cd07ca577d7b48781b3
parentffdef9e0462d00ce0286af4705a0e1292df60ad7 (diff)
Names processed properly
-rw-r--r--Semantic.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Semantic.hs b/Semantic.hs
index 1ffe57f..09c1b68 100644
--- a/Semantic.hs
+++ b/Semantic.hs
@@ -140,7 +140,12 @@ parse n = Command (number n)
name :: String -> ((Stack,Dictionary,Assumptions,Theorems) -> (Stack,Dictionary,Assumptions,Theorems))
-name str = \(stack,d,a,t) -> (Stack $ ObjName (Name [] str) : (stackList stack), d, a, t)
+name str = \(s,d,a,t) ->
+ let unQuoted = init . tail $ str
+ wordList = words . (map (\x -> if (x == '.') then ' ' else x)) $ unQuoted
+ name = Name (init wordList) (last wordList)
+ s' = Stack $ ObjName name : (stackList s)
+ in (s',d,a,t)
number :: String -> ((Stack,Dictionary,Assumptions,Theorems) -> (Stack,Dictionary,Assumptions,Theorems))
@@ -548,7 +553,7 @@ getrhs (TApp (TApp eq _) rhs) =
isEq :: Term -> Bool
-isEq (TApp (TApp (TConst (Const (Name [] "=")) _) _) _) = True
+isEq (TConst (Const (Name [] "=")) _) = True
isEq _ = False