indentation-based blocks #716
-
hi, i am making a parser and i want to have significant indentation in my language. i have seen the other posts about indentation, but i'm not sure how to do something like this.
i want to be able to parse this example like this:
is this possible, if yes, how? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
see e.g. https://github.com/thomas9911/python_parser/blob/master/src/grammar.pest#L32 ? |
Beta Was this translation helpful? Give feedback.
-
I think you need to explicitly mark the NEWLINE after "foo" and add some indentation before "bar". |
Beta Was this translation helpful? Give feedback.
-
This seems to work for me:
With input:
the editor gives:
(don't know why the share button doesn't work for me?) |
Beta Was this translation helpful? Give feedback.
This seems to work for me:
With input:
the editor gives:
(don't know why the share button doesn't work for me?)