I'm trying to use Parsec for a language which have identifiers where
the '-' character is allowed only inside identifiers, not at the start
or the end.
ParsecToken has identStart to tell that the '-' is not allowed at the
start but I find no equivalent identEnd?
I tried also to express the same
Stephane Bortzmeyer [EMAIL PROTECTED] wrote:
identifier = do
start - letter
rest - many (alphaNum | char '-')
end - letter
return ([start] ++ rest ++ [end])
? characters authorized for identifiers
because the parser created by many is greedy: it consumes
Stephane Bortzmeyer wrote:
I'm trying to use Parsec for a language which have identifiers where
the '-' character is allowed only inside identifiers, not at the start
or the end.
ParsecToken has identStart to tell that the '-' is not allowed at the
start but I find no equivalent identEnd?
I
Stephane Bortzmeyer wrote:
I'm trying to use Parsec for a language which have identifiers where
the '-' character is allowed only inside identifiers, not at the start
or the end.
identifier = do
start - letter
rest - many (alphaNum | char '-')
end - letter
return