-
-
Notifications
You must be signed in to change notification settings - Fork 59
add pipe operator #152
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 pipe operator #152
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,7 +250,7 @@ impl<'db> InferCtx<'db> { | |
| self.unify_var(lhs_ty, rhs_ty); | ||
| lhs_ty | ||
| } | ||
| BinaryOpKind::Concat => { | ||
| BinaryOpKind::Concat | BinaryOpKind::Pipe => { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't unity arguments of pipe operators to be List.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't quite follow this, need an example... speaking of the other threads, i can make the changes and push them right away |
||
| let ret_ty = Ty::List(self.new_ty_var()).intern(self); | ||
| self.unify_var(lhs_ty, ret_ty); | ||
| self.unify_var(rhs_ty, ret_ty); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -113,6 +113,7 @@ def! { | |||||
| LT_EQ = [<=], | ||||||
| MINUS_GT = [->], | ||||||
| NOT_EQ = [!=], | ||||||
| PIPE = [|>], | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Here we name symbols syntactically, not semantically. |
||||||
| OR2 = [||], | ||||||
| PLUS2 = [++], | ||||||
| QUOTE2 = ["''"], | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -884,6 +884,7 @@ impl SyntaxKind { | |
| T![*] | | ||
| T![/] => (17, 18), | ||
| T![++] => (20, 19), | ||
| T![|>] => (21, 22), | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This precedence is incorrect. According to Nix, it should have a lower precedence than logic-imply |
||
| // Postfix `?` => 21 | ||
| // Prefix `-` => 23 | ||
| _ if self.can_start_atom_expr() => (25, 26), // APPLY | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a collection operator. It may need another
HlOperatorvariant likePipe.