UnrealScript-Language-Service
UnrealScript-Language-Service copied to clipboard
[Bug 0.6.3]: Expression does not evaluate to an iteratable
Describe the bug
I saw this error accidentally, don't know how to reliably reproduce it. Fixes when you add curly brackets.
Screenshots
Yeah, basically the parser picks this expression up as a binary expression.
UnrealScript has this odd feature where you can define a new binary operator with an [a-z] identifier, like for instance the Dot operator.
So, the parser sees this as follows:
forEachStatement > ExpressionStatement > BinaryExpression (left: DynamicActors(), operator: AddPRI, right: (PRI) as a ParenthesizedExpression)
A proper fix would be to delay the parsing of function blocks entirely until all related documents have been indexed. Once indexed, all the functions can be re-parsed with the knowledge of indexed binary operators, so that a non-binary identifier cannot be mistaken for one. (this is how the actual compiler works).