Skip to content

Implement Top level Language Parser #60

Answered by foonathan
chase-metzger asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, this is the one I think: https://lexy.foonathan.net/playground/?id=8xvo6zhvM&mode=tree

The idea is again to override whitespace while parsing a nested value. However, this doesn't handle func f() {\n} or func f(){\nnull;}, as whitespace is only skipped after something. So instead of dsl::curly_bracketed we can define or own brackets that skip whitespace after the initial {. It's not elegant, but it works.

You need to do something similar if you want newlines in the parameters as well.

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@foonathan
Comment options

@chase-metzger
Comment options

@foonathan
Comment options

Comment options

You must be logged in to vote
2 replies
@chase-metzger
Comment options

@foonathan
Comment options

Comment options

You must be logged in to vote
2 replies
@chase-metzger
Comment options

@foonathan
Comment options

Answer selected by foonathan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #59 on March 11, 2022 20:46.