Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start refactoring a couple things which should be common to all langu…
…age tokenizers, such as space characters and filenames
- Loading branch information
1 parent
613887a
commit 3c40ba3
Showing
3 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* \u3000 is ideographic space; \u205F is medium math space */ | ||
SPACE = [ \t\u00A0\u2000-\u200A\u202F\u20F5\u3000] | ||
SPACES = {SPACE}+ | ||
NEWLINE = \r|\r?\n|\u2028|\u2029|\u000B|\u000C|\u0085 | ||
SPACENL = ({SPACE}|{NEWLINE}) | ||
|
||
FILENAME_EXT = 3gp|avi|bat|bmp|bz2|c|class|cgi|cpp|dll|doc|docx|exe|flv|gif|gz|h|hei[cf]|htm|html|jar|java|jpeg|jpg|mov|mp[34g]|mpeg|o|pdf|php|pl|png|ppt|ps|py|sql|tar|txt|wav|x|xml|zip|wm[va] | ||
FILENAME = [\p{Alpha}\p{Digit}]+([-~.!_/#][\p{Alpha}\p{Digit}]+)*\.{FILENAME_EXT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters