Skip to content

Commit

Permalink
Treat codepoints U+00 up to U+20 as whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneduffield committed Oct 6, 2023
1 parent ae9c752 commit db418d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `add` is no longer colorized as a keyword in the SonarQube web interface.
- `remove` is no longer colorized as a keyword in the SonarQube web interface.
- `variant` is no longer colorized as a keyword in the SonarQube web interface.
- Parsing errors on unusual whitespace characters.

## [0.40.0] - 2023-01-10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ COMMENT : '//' ~('\n'|'\r')* {$channel
}
}
;
WHITESPACE : (' '|'\t'|'\r'|'\n'|'\f')+ {$channel=HIDDEN;}
WHITESPACE : ('\u0000'..'\u0020' | '\u3000')+ {$channel=HIDDEN;}
;
UnicodeBOM : '\uFEFF' {$channel=HIDDEN;}
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,9 @@ void testEmptyFileShouldThrow() {
DelphiFileUtils.mockConfig()))
.isInstanceOf(DelphiFileConstructionException.class);
}

@Test
void testUnusualWhitespace() {
parseFile("UnusualWhitespace.pas");
}
}
Binary file not shown.

0 comments on commit db418d6

Please # to comment.