[x] allow semicolons and curly brackets to be virtual (versus real). Store this information as TokenData
[x] emit a virtual semicolon token for line breaks in line-break-sensitive sections
[x] properly implement delimited sections i.e. curly bracket and semicolon syntax
[ ] (I think we should) disallow indented sections inside delimited ones (impossible by definition)
[ ] alternative to above checkpoint: on syntax errors (e.g. expected delimiter) check if the relevant spans of the tokens suggest indentation in delimited sections and add a subdiagnostic to the error pointing out the possibility that they (the user) attempted to use an indented section inside of a delimited one
[x] don't emit virtual semicolons before virtual closing curly brackets
[x] and make the parse able to handle this (that part is more difficult). The parser should also handle do { 5 }, not just
do { 5; }
[ ] heavily improve the diagnostics emitted for unbalanced and wrongly nested brackets (be guided by rustc's output); see #113
[x] write more the lexer tests
[ ] remove lexer tests inside lexer/tests.rs of the form assert_err and make them UI tests: move them to tests/parsing/ and add --only-parse to them
[ ] extend the parser test suite (UI and in-file)
[ ] clean up parser/tests.rs
[x] fix the spans of virtual curly brackets
[ ] improve syntax errors involving virtual curly brackets: Stop saying something like found opening curly bracket, … / found indentation, …, and start saying something akin to did not expect the following section to be indented (if possible) not entirely sure but I think it's impossible to encounter this scenario at all
[x] clean up / refactor the lexer
[ ] the lexer cannot handle (some forms of) indented comments, fix that
TokenData
(I think we should) disallow indented sections inside delimited ones(impossible by definition)do { 5 }
, not justdo { 5; }
lexer/tests.rs
of the formassert_err
and make them UI tests: move them totests/parsing/
and add--only-parse
to themparser/tests.rs
improve syntax errors involving virtual curly brackets: Stop saying something like found opening curly bracket, … / found indentation, …, and start saying something akin to did not expect the following section to be indented (if possible)not entirely sure but I think it's impossible to encounter this scenario at all