Skip to content

Conversation

@InnocentZero
Copy link
Contributor

@InnocentZero InnocentZero commented Dec 8, 2024

  • Fixes match parsing to include optional comma at the end of match arm body.
  • Parses unit (()) properly now
  • Fixed parsing, and added resolution and typechecking for alias.

Depends on #19 so that needs to get merged first.

Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Both of them are redundant now given that blocks
return the type of the last statement

Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Implements OneOf for if-else and def nodes

Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
@InnocentZero InnocentZero force-pushed the parse-improvements branch 2 times, most recently from dcc76ff to 2f38bf7 Compare December 8, 2024 15:54
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
This is used to indicate the type status in case of an error to avoid
ambiguities around the usage of other types

Signed-off-by: innocentzero <[email protected]>

if self.is_operator() {
// TODO: flag parsing
self.next();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe throw an error here with a WIP note instead of silently ignoring flags.

@kubouch
Copy link
Contributor

kubouch commented Dec 15, 2024

Haven't checked it too thoroughly, but also seems good. Flags with aliases we can add once we have proper signatures etc.

Since params are not supposed to be evaluated,
their type is changed to Forbidden

Signed-off-by: innocentzero <[email protected]>
Match not returning anything should be a nothing
type as it is an expression. The type for a for
loop is now None, which matches the current
nushell implementation.

Signed-off-by: innocentzero <[email protected]>
@InnocentZero
Copy link
Contributor Author

I was going to add flags next, but it seems to be involved deeply with the parser and since you're rewriting the lexer which will move parts of the parser, I'll wait for it to settle a little bit. For now, I'll rebase once #19 is accepted and add the error for flags.

Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Define an alias node to parse, resolve and typecheck aliases

Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
@InnocentZero
Copy link
Contributor Author

I'm closing this in favour of #29

This one became a mess after my previous PR was merged and I wasn't able to resolve it easily.

@InnocentZero InnocentZero deleted the parse-improvements branch December 17, 2024 07:05
kubouch pushed a commit that referenced this pull request Jan 8, 2025
Supersedes #24 as it had too many merge conflicts with main.

---------

Signed-off-by: innocentzero <[email protected]>
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.

2 participants