Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to inline branches not documented in the grammar reference #1384

Open
kpet opened this issue Jan 25, 2024 · 3 comments
Open

Ability to inline branches not documented in the grammar reference #1384

kpet opened this issue Jan 25, 2024 · 3 comments

Comments

@kpet
Copy link

kpet commented Jan 25, 2024

The JSON tutorial states:

The question-mark prefixing value (”?value”) tells the tree-builder to inline this branch if it has only one member. In this case, value will always have only one member, and will always be inlined.

Unless I've missed something, this feature is not documented in the grammar reference.

@erezsh
Copy link
Member

erezsh commented Jan 25, 2024

No, it's mentioned here: https://lark-parser.readthedocs.io/en/latest/tree_construction.html

But you might be right, that the grammar reference should mention it too.

@kpet
Copy link
Author

kpet commented Jan 25, 2024

Indeed it is, I'd missed that. I remembered reading about the feature in the tutorial but when I found a need for it in my grammar and wanted to look at the reference, I naturally found myself going to the grammar reference. Either way, I found the info in the tutorial in the end.

(BTW, I didn't open with this but: great project, thank you very much, it's made something really easy for me :))

@nchammas
Copy link
Contributor

I submitted #1381 for a similar reason, though that was just to make the features stand out more in the Tree Construction Reference, rather than add them to the Grammar Reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants