[cling] Rewrite implementation of InputValidator::validate(); fixes ROOT-9202#8771
Conversation
|
Starting build on |
|
@Axel-Naumann, @vgvassilev, as I will be off in August, again feel free to merge this if, after the review, it can be merged right away. |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
da769b9 to
30b1783
Compare
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
vgvassilev
left a comment
There was a problem hiding this comment.
Thanks for working on this!
30b1783 to
ccbf00d
Compare
|
Starting build on |
…Line()` This commit includes the following changes to MetaLexer: - Update `MetaLexer::Lex()` to return `/*` (tok::l_comment), `*/` (tok::r_comment), and `<` (tok::less) as tokens. - Added `MetaLexer::ReadToEndOfLine()` function: consume input until `\r` or `\n`. - Added `MetaLexer::RAII`, a RAII object that saves/restores the current position.
Replace implementation of `InputValidator::validate()` by simpler, more maintainable code that also fixes ROOT-9202. The previous implementation was unable to properly handle line continuation after ',' or '\'. Specifically, it skipped over non-punctuation tokens, entering continuation mode even if ',' or '\' were not the last tokens in the input, e.g. `int a, b` or 'int a \ b'. Fixes ROOT-9202.
ccbf00d to
79653e4
Compare
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on mac11.0/cxx17. Failing tests:
|
|
@phsft-bot build just on mac11.0/cxx17 |
|
Starting build on |
This pull request replaces the implementation of
InputValidator::validate()by simpler, more maintainable code that also fixes JIRA issue ROOT-9202.The previous implementation was unable to properly handle line continuation after ',' or '\'. Specifically, it skipped over non-punctuation tokens, entering continuation mode even if ',' or '' were not the last tokens in the input, e.g.
or
caused cling to request more input, where it shouldn't.
Changes or fixes:
/*and*/as independent tokens.ReadToEndOfLine()function (consume input until '\r', '\n', or EOF).MetaLexer::RAIIthat saves the current lexing position and restores it on destruction.LexPunctuatorAndAdvance().InputValidator::validate().Checklist:
Fixes ROOT-9202.