swaroopch / edn_format

EDN reader and writer implementation in Python, using PLY (lex, yacc)
https://swaroopch.com/2012/12/24/edn-format-python/
Other
131 stars 31 forks source link

Parse nil and booleans as symbols #54

Closed bfontaine closed 5 years ago

bfontaine commented 5 years ago

From a grammar perspective, nil, true, and false, are symbols just like a or foobar. This allows us to factorize the way we parse all of them.

This also fixes an issue where nil. was lexed as NIL Symbol(.) because t_NIL’s regex doesn’t have the lookahead part t_BOOLEAN’s has.