Skip to content

Conversation

@WindSoilder
Copy link
Contributor

I plan to add parser keywords as AstNode variants. I'm not sure if it's a right direction, so here is a small pr about def parsing, it adds env: bool and wrapped: bool as part of a def ast node.

Then these information can be used after parsing.

Copy link
Member

@ysthakur ysthakur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick changes! Not too familiar with the new parser but this looks simple enough. Let's go for it

@ysthakur ysthakur merged commit f850fff into nushell:main Jan 17, 2026
4 checks passed
@kubouch
Copy link
Contributor

kubouch commented Jan 17, 2026

About these, I was thinking we could first implement general-purpose flag parsing logic for custom commands and then reuse that for --env and --wrapped. But this is fine for now.

One more thing to keep in mind when adding fields to the AstNode enums is to keep track of the enum size. If one enum variant grows too large, we could optimize it, e.g., by using a separate storage for it with a new Id type, like BlockId or PipelineId. This is just an optimization, not necessary to do now.

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

Successfully merging this pull request may close these issues.

3 participants