diff options
author | Akshay <[email protected]> | 2020-10-13 13:37:29 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-10-13 13:37:29 +0100 |
commit | f943fc17e5f80f92d20c86de5ea499bbfbe0cd75 (patch) | |
tree | f2b25997e86bf09e3f3d88127883b96d0014acf0 /src | |
parent | 8641ce3e1a730c8195e5a74fabef8814f43b05f8 (diff) |
allow multiline expressionspretty-errors
Diffstat (limited to 'src')
-rw-r--r-- | src/Parser.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Parser.hs b/src/Parser.hs index 1242645..dc754d3 100644 --- a/src/Parser.hs +++ b/src/Parser.hs | |||
@@ -69,7 +69,10 @@ parseId = do | |||
69 | _ -> Id atom | 69 | _ -> Id atom |
70 | 70 | ||
71 | whiteSpace :: Parser () | 71 | whiteSpace :: Parser () |
72 | whiteSpace = skipMany1 space | 72 | whiteSpace = skipMany1 $ oneOf [' ', '\n'] |
73 | |||
74 | optionalWhiteSpace :: Parser () | ||
75 | optionalWhiteSpace = skipMany $ oneOf [' ', '\n'] | ||
73 | 76 | ||
74 | type Alias = String | 77 | type Alias = String |
75 | parseModifier :: Char -> Alias -> Parser Expr | 78 | parseModifier :: Char -> Alias -> Parser Expr |
@@ -98,7 +101,7 @@ parseLispValue = | |||
98 | x <- sepEndBy parseLispValue whiteSpace | 101 | x <- sepEndBy parseLispValue whiteSpace |
99 | spaces | 102 | spaces |
100 | t <- optionMaybe $ char '.' >> space >> parseLispValue | 103 | t <- optionMaybe $ char '.' >> space >> parseLispValue |
101 | spaces >> char ')' | 104 | optionalWhiteSpace >> char ')' |
102 | return $ maybe (List x) (DottedList x) t | 105 | return $ maybe (List x) (DottedList x) t |
103 | <?> "lisp value" | 106 | <?> "lisp value" |
104 | 107 | ||