@@ -4,7 +4,8 @@ module AST.Helpers where
4import qualified Data.Char as Char
4import qualified Data.Char as Char
6splitDots :: String -> [String]
6splitDots :: String -> [String]
7−splitDots = go []
7+splitDots variable =
9 go vars str =
10 go vars str =
10 case break (=='.') str of
11 case break (=='.') str of
@@ -12,16 +13,17 @@ splitDots = go []
12 | otherwise -> go (vars ++ [x]) rest
13 | otherwise -> go (vars ++ [x]) rest
13 (x,[]) -> vars ++ [x]
14 (x,[]) -> vars ++ [x]
15−brkt :: String -> String
16−brkt s = "{ " ++ s ++ " }"
18isTuple :: String -> Bool
17isTuple :: String -> Bool
19isTuple name =
18isTuple name =
20− take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
19+ take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
22isOp :: String -> Bool
22isOp :: String -> Bool
23−isOp = all isSymbol
24+ all isSymbol name
25isSymbol :: Char -> Bool
27isSymbol :: Char -> Bool
26isSymbol c =
28isSymbol c =
27− Char.isSymbol c || elem c "+-/*=.$<>:&|^?%#@~!"
29+ Char.isSymbol c || elem c "+-/*=.$<>:&|^?%#@~!"