Commit 3661fd4e authored by Camil Staps's avatar Camil Staps 🍃

parser: remove exponentialness; allow empty files (fixes #3)

parent 2cafe6ba
......@@ -307,11 +307,9 @@ typed_fun name type ts =
skip_newlines [TEndOfLine:ts] = skip_newlines ts
skip_newlines ts = returnS ts
program ts fs =
skip_newlines ts
>>= \ts = func ts
>>= \(f, ts) = skip_newlines ts
>>= \ts = if (length ts == 0) (returnS ([f:fs], ts)) (program ts [f:fs])
program ts fs = skip_newlines ts >>= \ts
| isEmpty ts -> returnS (fs, ts)
| otherwise -> func ts >>= \(f, ts) -> program ts [f:fs]
parse :: [PosToken] -> MaybeError ErrorMsg ([FuncType],ParserState)
parse pts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment