You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got confused here:
3 | |> List.map increment
I was surprised to find a |> here.
I was expecting one of these instead:
* bang
* binding
* do
* false
* force
* handle
* if
* lambda
* let
* pattern
* quote
* termLink
* true
* tuple
* typeLink
This error message doesn't highlight the issue properly, which is that it parsed a virtual semicolon followed by an expression that begins with an operator.
The parser could give a better error message like:
I was surprised to find a |> here, as an expression can't begin with an operator.
Add indentation if this line is supposed to be part of the expression on the previous line.
Better yet, we should just handle this as a special rule. Don't parse a virtual semicolon if the next line is at the same indentation and begins with an operator. Possibly also don't parse a virtual semicolon if the line ends with an operator and the next line is at the same indentation.
The text was updated successfully, but these errors were encountered:
runarorama
changed the title
Lexer fails on operator after newline without indentation, with bad message
Parser fails on operator after newline without indentation, with bad message
Jan 21, 2025
If you write
This results in an error:
This error message doesn't highlight the issue properly, which is that it parsed a virtual semicolon followed by an expression that begins with an operator.
The parser could give a better error message like:
Better yet, we should just handle this as a special rule. Don't parse a virtual semicolon if the next line is at the same indentation and begins with an operator. Possibly also don't parse a virtual semicolon if the line ends with an operator and the next line is at the same indentation.
The text was updated successfully, but these errors were encountered: