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 598c585
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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 598c585

Please # to comment.