Closed ylixir closed 5 years ago
let's just steal the functions provided by elm's parser for now. these include
int
float
(don't forget exponential notationhex
octal
(optional)binary
(optional)keyword
(require trailing whitespace)~spaces
(' ','\t'
)end_of_line
or('\r\n','\n','\r')
white_space
(' ','\t','\n','\r'
)block
for comments and strings. needs start, end, and escape combinators. note that the escape combinator can be used for nestingline_comment
pass it a parser that the comment starts with~https://package.elm-lang.org/packages/elm/parser/latest/Parser
when implementing this, i have discovered that much richer type expression is possible if we rearrange the order of arguments given to our fold application function.
this is a breaking change, so these features will need to be moved to version 0.5.0 instead of 0.4.1 as originally planned
dropping the keyword
functions, since it is too domain specific. it really matches whitespace languages only
i'm not convinced that the line comment is a useful shortcut for block(start,eol,fail)
.
we will leave it out for now
i'm a little worried about not having a recursive or nestable thing. i guess i will handle that if needed
consider adding some boilerplate parsers
things to consider are thing as simple as a decimal integer parser, and things as complex as a json parser