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

Add some operators #45

Merged
merged 3 commits into from
Jan 12, 2025
Merged

Add some operators #45

merged 3 commits into from
Jan 12, 2025

Conversation

ysthakur
Copy link
Member

@ysthakur ysthakur commented Jan 10, 2025

As part of #21, this PR adds binary operators that are either symbols or single barewords. I couldn't figure out an easy way to handle operators that span multiple tokens, such as starts-with. I also didn't add not.

I threw in some code for ++= but no tests. I assume we'll get to that once we implement typechecking for assignment oeprators, which this PR doesn't do.

@@ -74,29 +74,34 @@ pub enum AstNode {
Null,

// Operators
Copy link
Member Author

Choose a reason for hiding this comment

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

Rearranged the operators list by precedence (highest to lowest)

@kubouch
Copy link
Collaborator

kubouch commented Jan 12, 2025

Thanks! No need to add everything, it's better to do it in steps.

@kubouch kubouch merged commit 2984e62 into nushell:main Jan 12, 2025
4 checks passed
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