We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ecd618b commit 27a6faeCopy full SHA for 27a6fae
std/jule/parser/scope.jule
@@ -1009,7 +1009,20 @@ impl scopeParser {
1009
info.setter = token
1010
if i+1 >= len(tokens) {
1011
info.r = nil
1012
- info.ok = token::IsPostfix(info.setter.ID)
+ // Expression is missing.
1013
+ // If the setter token is a postfix operator, accept it.
1014
+ if token::IsPostfix(info.setter.ID) {
1015
+ info.ok = true
1016
+ break
1017
+ }
1018
+ // The setter token is not a postfix operator.
1019
+ // Probably the following statement is the expression.
1020
+ // We must try to handle next statement as expression.
1021
+ if self.isLastSt() {
1022
+ self.pushErr(info.setter, "expected expression")
1023
1024
1025
+ info.r = self.next().tokens
1026
break
1027
}
1028
info.r = tokens[i+1:]
0 commit comments