-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Both 'is_ident1' and 'is_ident2' are now macros instead of function calls, and they are tweaked for ASCII detection in advance with the fallback to table lookup for non-ASCII characters. Also discard unnecessary variable and add safe guard: - Variable is_first can be replaced with boolean expression "p == start" - Add safe guard for ascii character checking to ensure starting identifier character must not be numberic Additionally, replace first ascii character check with macro is_ident2_ascii to keep readability. The later is_ident2 function call is replaced with is_ident2_non_ascii because the expanded macro function will result in multiple decode_utf8 function call, also it's redundant to check if it's an ascii character or not. Co-authored-by: Jim Huang <[email protected]>
- Loading branch information
1 parent
3dcb97f
commit 644be33
Showing
3 changed files
with
15 additions
and
13 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
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