zepto-lang / zepto

A schemy Lisp backed by Haskell
GNU General Public License v2.0
60 stars 2 forks source link

RFC: Better Parser #25

Closed hellerve closed 7 years ago

hellerve commented 7 years ago

This PR adds a better parser to zepto, namely, better error reporting and trailing whitespace in datastructures. A few examples:

["a",
 "list",
 "of",
 "strings"
]

#{:a "hashmap"
   :with "linebreaks"
}

(map add1 [1 2 3] )
; Parse error at line 1, column 9:
;  (map add1 [1 2 3] )
;                    ^
;unexpected ")"
;expecting ";", "r/", "-", digit, "+", "#d", "#x", "#o", "#b", "#(", "{", "b(","b{", "#u8(", ",@", "\"", "'", "#", ;"`", ",", "#\\", "#{", "(", "[", letter, "nil" or "."

I hopes this makes formatting a bit easier.

Cheers