Skip to content

Feature parenthesis prop #621

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

Closed

Conversation

zhuliquan
Copy link
Contributor

Add hasParen field for ast.Ndoe, which indicated add parenthesis when invoking String().
I've always thought that you should keep the parenthetical information of the node if the user input it.

@zhuliquan zhuliquan force-pushed the feature-parenthesis_prop branch 2 times, most recently from 47d7963 to 1fb32eb Compare April 7, 2024 15:57
@zhuliquan zhuliquan force-pushed the feature-parenthesis_prop branch from 1fb32eb to a7c3033 Compare April 7, 2024 16:02
@antonmedv
Copy link
Member

Although I think this is a cool idea, it shouldn't be a part of AST. And default print node to string should not rely on it.

Usually in other programming languages this is done by additional linters with little bit more sophisticated parsers which also keeps information about new lines, brackets, types of quotes, comments.

Creating such linter for expr will the super nice.

@antonmedv antonmedv closed this Mar 8, 2025
@zhuliquan zhuliquan deleted the feature-parenthesis_prop branch March 8, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants