From 8b9a9d2ce14159541de1a0a7a7ef533c1983a516 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 8 May 2012 22:16:09 +1000 Subject: Names processed properly --- Semantic.hs | 9 +++++++-- 1 file 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 -- cgit