You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use cakeparse to write the grammar for my shell, https://github.com/cbeust/kash and I can't seem to define a simple grammar to allow either "and" commands:
a && b && c
or "pipe" commands:
a | b | c
Here is what I have, in short:
val andCommand = singleCommand and zeroOrMore(andAnd and singleCommand)
val pipeCommand = singleCommand and zeroOrMore(pipe and singleCommand)
val goal = andCommand or pipeCommand
With that goal, I can only parse one of these two lines but never both.
Am I missing something?
The text was updated successfully, but these errors were encountered:
Btw, I should warn you that I've only used this library for small toy projects, so it's not very well battle tested. If you do decide to continue to use it anyway, I'd love to hear your feedback and experiences with it.
On second reading, if you mean parsing something like:
a && b && c
a | b | c
but not something like
a && b | c
then the grammar would look like
val andCommand = singleCommand and zeroOrMore(andAnd and singleCommand)
val pipeCommand = singleCommand and zeroOrMore(pipe and singleCommand)
val command = (andCommand or pipeCommand) before terminator
val goal = zeroOrMore(command)
I'm trying to use cakeparse to write the grammar for my shell, https://github.com/cbeust/kash and I can't seem to define a simple grammar to allow either "and" commands:
or "pipe" commands:
Here is what I have, in short:
With that goal, I can only parse one of these two lines but never both.
Am I missing something?
The text was updated successfully, but these errors were encountered: