-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
File affected: reader.rs
Reader right now is
-
Often using nom's
ws
macro to consume whitespace around a read, and to my knowledge this is deprecated. -
Only looking for traditional whitespace. In Clojure, however,
,
is considered whitespace as well, and this case needs to be added, as well as any edge case I've never heard of if one exists
So, the preferable solution is to create a parsing function for clojure whitespace, ie something like
// This is named clojure_whitespace rather than whitespace to emphasize this is consuming
// what Clojure considers to be whitespace, including the ,
// Am open to a better name
pub fn clojure_whitespace_parser(input:&[u8]) -> IResult<&[u8], String> {
...
}
And then, instead of combining this with another parser with nom's macros like
named!(someParserThatConsumesWhitespaceFirst,
ws!(tag!("}")));
We would use some function combinator, like preceded
let someParserThatConsumesWhitespaceFirst = preceded(clojure_whitespace_parser, ... )
This would involve updating all spots that currently consume whitespace, which should be
try_read
try_read_map
try_read_string
try_read_vector
try_read_list
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers