Faulty code: improve error block node#13264
Faulty code: improve error block node#13264MarcusDenker merged 4 commits intopharo-project:Pharo12from
Conversation
|
windows CI felt into a hole I presume |
| (self new | ||
| source: '[ | 1'; | ||
| formattedCode: '[ | | 1'; | ||
| formattedCode: '[ | | . 1'; |
There was a problem hiding this comment.
There is a dot here because you consider that the end of a unclosed block is after its temporaries declaration?
There was a problem hiding this comment.
Bad temps are stored into a synthetic first statement of the statement sequence to prevent ast visitors to mistake them for legit temp declarations. It's a ok design I think.
The formatter was not developed to format fauly ast (sometimes even non faulty ast :p ) so it just prints both bar (because temp declarations have two bars) and a dot (because statement, even synthetic , have a dot).
I have a wip branch that tries to fix theses formatting things.
But it's more cosmetic than useful, because formatting broken ast make little sense. The idea to check it in snippets is more to verify that parts are not lost, not the punctuation.
There was a problem hiding this comment.
And why there wasn't a dot before the PR. Because the contents of faulty blocks were the content of the statement sequence, not the statement sequence itself. Therefore, losing possible legitimate temps, and losing the information that the contents are statements. So the content were separated with simple space instead of dots.
|
there is now a conflicet |
RBErrorBlockNode are produce on block with a missing closing
].Unfortunately, its contents did not include the temps possibly declared inside, and did have a bad stop value.