-
I have something like the following:
This works, but it's a bit messy to handle the Is there a way to allow "one foo without braces BUT require braces if there is more than one"? I tried what seems to be the obvious:
but that doesn't work. I assume because |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
That construct definitely does work, so there must be some other issue. It could be ambiguity in your grammar. Try putting the |
Beta Was this translation helpful? Give feedback.
-
But without an error or way to reproduce I can't be sure. |
Beta Was this translation helpful? Give feedback.
-
OK, thanks. If that's supposed to work I'll have to work on it some more to see what's going on. I had tried switching the order as well, but I'm just getting a non-obvious parse error. I'm not sure how collapsing my two (working) patterns into one could result in ambiguity. |
Beta Was this translation helpful? Give feedback.
-
Ah, well. I was missing parens in the pattern. So it needs to look like this:
That took far longer than it should have 😄 |
Beta Was this translation helpful? Give feedback.
Ah, well. I was missing parens in the pattern. So it needs to look like this:
That took far longer than it should have 😄