-
Trying to figure out the syntax to allow lists to have support for multiple types of delimiters, ie comma and newline
This should fail (space is not a delimiter):
Best code so far:
But this doesn't recognize the newlines at all. Changing the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Darren, If your language has significant newlines, it probably makes sense to redefine the
Alternatively you could use
Does that help? |
Beta Was this translation helpful? Give feedback.
Hi Darren,
If your language has significant newlines, it probably makes sense to redefine the
space
rule. That will change the behavior of the implicit space skipping. The built-in definition includes any character from\x00
up to and including\x20
(space). E.g., you might want to define thespace
rule like this:Alternatively you could use
listOf
rather thanListOf
, which would eliminate implicit space skipping, so you'd need to do it yourself. E.g., something like this may work:Does that help?