-
Notifications
You must be signed in to change notification settings - Fork 97
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
Fixing various issues of multiblock expressions #822
Conversation
…e VS test adapter can run the tests.
…h other operators.
Fixed errors in multiblock expression tests.
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.
I like the Test Code : Actual Code ratio 😅
var first = ReadUnsupportedOperatorExpression(); | ||
if (Peek() is BindingToken operatorToken && operatorToken.Type == BindingTokenType.Semicolon) | ||
{ | ||
Read(); | ||
first = CreateVoidBlockIfBlankIdentifier(first, startFirstIndex); |
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.
This AFAIK also means that ; test
is allowed 🤔
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.
I think I'd just disallow that, it seems quite suspicious...
@@ -421,6 +434,7 @@ private BindingParserNode ReadAtomicExpression() | |||
else if (token != null && token.Type == BindingTokenType.StringLiteralToken) | |||
{ | |||
// string literal | |||
|
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.
:/
src/global.json
Outdated
"sdk": { | ||
"version": "3.0.100-preview5" | ||
} | ||
} |
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.
Perfect! And the CI also seems to be happy without it :)
While Testing multiblock expressions for use in intellisense of our VS extensions I noticed several imperfections.
Two semicolons one just after another are treated as single unknown operator.
test;;test
If white space is put between the semicolons like sotest; ;test
it registers as three separate blocks. This is inconsistent. Expected result is: Identifier, Void block, Identifier, grouped into a blocks expression appropriately. This should be the same no matter the white space.Depending on the position of empty block inside a multiblock expression it registers A)
test; ;test
as an empty identifier or B)test;test;
as a void block. This inconsistency should be removed. An empty block should be always represented by void block in the syntax tree.Void block nodes always have 0 start position, wherever they occur. Thereby making it impossible to mark void block related errors correctly.
All these issues are addressed in this pull request. Along with fixing the bugs, I updated the test framework and removed legacy test config. The config, along with old version of test framework prevented me from running tests from VS Test Explorer. I also added new tests for multiblock expressions to check my changes.