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

Missing then_clause #212

Open
ahlinc opened this issue Aug 28, 2023 · 4 comments
Open

Missing then_clause #212

ahlinc opened this issue Aug 28, 2023 · 4 comments

Comments

@ahlinc
Copy link
Contributor

ahlinc commented Aug 28, 2023

image

@amaanq
Copy link
Member

amaanq commented Aug 30, 2023

Is this needed? It just seems to me that the body of the if statement that follows after then, maybe a field of 'body' for that can be added instead

@ahlinc
Copy link
Contributor Author

ahlinc commented Aug 30, 2023

It's needed because it makes easier to work with a tree when things grouped into own nodes that are at stable offsets in a parent node instead of while having variable length things that been appended on a previous siblings.

Also on 0:7 there shouldn't be a condition field on the ";" token.

@ahlinc
Copy link
Contributor Author

ahlinc commented Aug 30, 2023

ts p --scope source.bash -oc - 'if true; false; true; then echo foo; echo bar; echo then; else echo baz; echo flux; echo else; fi'

image

Above is a more longer example of why parent nodes are needed.
A statement like parent node even needed on the if's condition to group all sequence of commands into one node. Also this will automatically solve the issue of the condition field on the ";" token.

@amaanq
Copy link
Member

amaanq commented Aug 30, 2023

yeah, makes sense

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

2 participants