|
|
|
|
|
by ericn
5951 days ago
|
|
I have a question. With the backtracking parser, does this mean that you can rewrite parse-number like this? : (def parse-number
(domonad [sign (optional parse-sign "+")
[type digits] (choice parse-integer
parse-float)
_ eof]
[type (apply str (cons sign digits))]))) The fact that you can fail on the eof and backtrack into the choice (if it is possible) is the main advantage. It lets you lay out your parser in a logical way. |
|