diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-22 05:48:55 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-22 05:48:55 +0000 |
commit | 2a6544f906818263e2791bc4cdf4fcbdf7260ab9 (patch) | |
tree | 12cc178506343e5dbbea0285e1dcd0bd0035398c /crates/ra_syntax/src/string_lexing/parser.rs | |
parent | ed823cb38d6c6852b2645f6bcd4c3b699b4b7539 (diff) | |
parent | bf8e7930daa3fb168106534b1cc418f5bc44e8c0 (diff) |
Merge #1013
1013: Fuzz reparsing and fix found bugs r=matklad a=pcpthm
Add fuzz test for reparsing which:
- Checks reparsing doesn't panic and validate result syntax tree.
- Checks that incremental reparsing produces the same syntax tree as full reparse.
- Check for that errors are the same as full reparsing is disabled because errors are less important than syntax tree and produce failures which I couldn't figure out how to fix immediately (FIXME comment).
I guess the current input generation is inefficient but still found several bugs:
- Arithmetic overflow (negative result on an unsigned type). I changed the signature of `SyntaxError::add_offset` to solve this problem.
- When reparsing a leaf, the token of the leaf can be joined to the next characters. Such case was not considered.
- UNDERSCORE token was not produced when text length is exactly 1 (not a reparsing bug).
- When reparsing a block, *inner* curly braces should be balanced. i.e. `{}{}` is invalid.
- Effects of deleting newlines were not considered.
Co-authored-by: pcpthm <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/string_lexing/parser.rs')
0 files changed, 0 insertions, 0 deletions