diff options
author | Neil <nyamatongwe@gmail.com> | 2020-07-16 19:55:15 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-07-16 19:55:15 +1000 |
commit | b3c9933350e5c6b9d06a72034e681cecae52dc4b (patch) | |
tree | a733fba3b608ba75f4c55ec27cc6026697fdd3b0 /lexlib/CharacterCategory.cxx | |
parent | 08b502cac1f88bc511c324ab7eb23d34c4318bd7 (diff) | |
download | scintilla-mirror-b3c9933350e5c6b9d06a72034e681cecae52dc4b.tar.gz |
Add constexpr, const, noexcept and make other small improvements to lexlib.
Diffstat (limited to 'lexlib/CharacterCategory.cxx')
-rw-r--r-- | lexlib/CharacterCategory.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lexlib/CharacterCategory.cxx b/lexlib/CharacterCategory.cxx index 1e7ae8361..a2b0e0cca 100644 --- a/lexlib/CharacterCategory.cxx +++ b/lexlib/CharacterCategory.cxx @@ -3846,8 +3846,8 @@ const int catRanges[] = { //--Autogenerated -- end of section automatically generated }; -const int maxUnicode = 0x10ffff; -const int maskCategory = 0x1F; +constexpr int maxUnicode = 0x10ffff; +constexpr int maskCategory = 0x1F; } @@ -3880,7 +3880,7 @@ enum class OtherID { oidNone, oidStart, oidContinue }; // Some characters are treated as valid for identifiers even // though most characters from their category are not. // Values copied from http://www.unicode.org/Public/9.0.0/ucd/PropList.txt -OtherID OtherIDOfCharacter(int character) { +OtherID OtherIDOfCharacter(int character) noexcept { if ( (character == 0x1885) || // MONGOLIAN LETTER ALI GALI BALUDA (character == 0x1886) || // MONGOLIAN LETTER ALI GALI THREE BALUDA @@ -3904,11 +3904,11 @@ OtherID OtherIDOfCharacter(int character) { // Pattern_Syntax|Pattern_White_Space. // As of Unicode 9, only VERTICAL TILDE which is in Lm and has Pattern_Syntax matches. // Should really generate from PropList.txt a list of Pattern_Syntax and Pattern_White_Space. -bool IsIdPattern(int character) { +constexpr bool IsIdPattern(int character) noexcept { return character == 0x2E2F; } -bool OmitXidStart(int character) { +bool OmitXidStart(int character) noexcept { switch (character) { case 0x037A: // GREEK YPOGEGRAMMENI case 0x0E33: // THAI CHARACTER SARA AM @@ -3939,7 +3939,7 @@ bool OmitXidStart(int character) { } } -bool OmitXidContinue(int character) { +bool OmitXidContinue(int character) noexcept { switch (character) { case 0x037A: // GREEK YPOGEGRAMMENI case 0x309B: // KATAKANA-HIRAGANA VOICED SOUND MARK |