Open
Conversation
marvinborner
reviewed
Oct 6, 2025
| case _ => | ||
| val lhs = variable() | ||
| peek.kind match { | ||
| case `+=` | `-=` | `*=` | `/=` => |
dvdvgt
requested changes
Oct 6, 2025
Collaborator
dvdvgt
left a comment
There was a problem hiding this comment.
We decided to make some changes in the Effekt meeting. Thanks!
Comment on lines
+120
to
+121
| case `<|` | ||
| case `|>` |
Collaborator
There was a problem hiding this comment.
We decided to delete these.
Comment on lines
+1024
to
+1056
| case `||` => "infixOr" | ||
| case `&&` => "infixAnd" | ||
| case `===` => "infixEq" | ||
| case `!==` => "infixNeq" | ||
| case `<` => "infixLt" | ||
| case `>` => "infixGt" | ||
| case `<` => "infixLt" | ||
| case `>` => "infixGt" | ||
| case `<=` => "infixLte" | ||
| case `>=` => "infixGte" | ||
| case `+` => "infixAdd" | ||
| case `-` => "infixSub" | ||
| case `*` => "infixMul" | ||
| case `/` => "infixDiv" | ||
| case `+` => "infixAdd" | ||
| case `+=` => "infixAdd" | ||
| case `-` => "infixSub" | ||
| case `-=` => "infixSub" | ||
| case `*` => "infixMul" | ||
| case `*=` => "infixMul" | ||
| case `/` => "infixDiv" | ||
| case `/=` => "infixDiv" | ||
| case `++` => "infixConcat" | ||
| case `>>` => "infixShr" | ||
| case `<<` => "infixShl" | ||
| case `--` => "infixRemove" | ||
|
|
||
| case TokenKind.`~` => "infixTilde" | ||
| case TokenKind.`~>` => "infixTildeRight" | ||
| case TokenKind.`<~` => "infixTildeLeft" | ||
| case TokenKind.`|` => "infixPipe" | ||
| case TokenKind.`&` => "infixAmp" | ||
|
|
||
| case `<|` => "infixPipeLeft" | ||
| case `|>` => "infixPipeRight" | ||
| case `..` => "infixDotDot" | ||
| case `...` => "infixDotDotDot" | ||
| case `^^` => "infixHatHat" | ||
| case `^` => "infixHat" |
Collaborator
There was a problem hiding this comment.
Use syntactic not semantic names since they can be overloaded anyway.
Collaborator
There was a problem hiding this comment.
Claude suggested these names:
case `+` => "infixPlus"
case `+=` => "infixPlusEq"
case `-` => "infixMinus"
case `-=` => "infixMinusEq"
case `*` => "infixStar"
case `*=` => "infixStarEq"
case `/` => "infixSlash"
case `/=` => "infixSlashEq"
case `++` => "infixPlusPlus"
case `>>` => "infixGreaterGreater"
case `<<` => "infixLessLess"
case `--` => "infixMinusMinus"
case TokenKind.`~` => "infixTilde"
case TokenKind.`~>` => "infixTildeGreater"
case TokenKind.`<~` => "infixLessTilde"
case TokenKind.`|` => "infixBar"
case TokenKind.`&` => "infixAmp"
case `<|` => "infixLessBar"
case `|>` => "infixBarGreater"
case `..` => "infixDotDot"
case `...` => "infixDotDotDot"
case `^^` => "infixCaretCaret"
case `^` => "infixCaret"
Collaborator
There was a problem hiding this comment.
Of course, please also change the other operator names
Comment on lines
+1086
to
+1104
| // <EXPR>.[<EXPR>, ...] | ||
| case `[` => | ||
| val bracket = peek | ||
| val arguments = some(expr, `[`, `,`, `]`) | ||
| e = MethodCall(e, | ||
| IdRef(Nil, "postfixAccess", Span(source, dot.start, bracket.end, Synthesized)), | ||
| Nil, arguments.unspan.map(a => ValueArg.Unnamed(a)), Nil, | ||
| Span(source, e.span.from, arguments.span.to, Synthesized) | ||
| ) | ||
|
|
||
| case _ => | ||
| val member = idRef() | ||
| // method call | ||
| if (isArguments) { | ||
| val (targs, vargs, bargs) = arguments() | ||
| e = Term.MethodCall(e, member, targs, vargs, bargs, span()) | ||
| } else { | ||
| e = Term.MethodCall(e, member, Nil, Nil, Nil, span()) | ||
| } |
Collaborator
There was a problem hiding this comment.
Extract into separate PR. Needs further discussion, e.g. setting an array. Do we also want a dedicated syntax for that?
Member
|
bump also, what do you think about a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a few more infix operators. This is mostly just lexing and parsing so doesn't come with a lot of conceptual cost for the implementation.
A few things are not clear / implemented:
infixAddtoInfixPlus, but this will break a lot of things)a === banda !== bsince the tokens===are already used to represent==, ahhh.