diff options
Diffstat (limited to 'src/PropsData.zig')
| -rw-r--r-- | src/PropsData.zig | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/PropsData.zig b/src/PropsData.zig index f6c8370..b77bf30 100644 --- a/src/PropsData.zig +++ b/src/PropsData.zig | |||
| @@ -81,62 +81,62 @@ pub fn deinit(self: *const Self) void { | |||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | /// True if `cp` is a mathematical symbol. | 83 | /// True if `cp` is a mathematical symbol. |
| 84 | pub inline fn isMath(self: Self, cp: u21) bool { | 84 | pub fn isMath(self: Self, cp: u21) bool { |
| 85 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 1 == 1; | 85 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 1 == 1; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | /// True if `cp` is an alphabetic character. | 88 | /// True if `cp` is an alphabetic character. |
| 89 | pub inline fn isAlphabetic(self: Self, cp: u21) bool { | 89 | pub fn isAlphabetic(self: Self, cp: u21) bool { |
| 90 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 2 == 2; | 90 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 2 == 2; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | /// True if `cp` is a valid identifier start character. | 93 | /// True if `cp` is a valid identifier start character. |
| 94 | pub inline fn isIdStart(self: Self, cp: u21) bool { | 94 | pub fn isIdStart(self: Self, cp: u21) bool { |
| 95 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 4 == 4; | 95 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 4 == 4; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | /// True if `cp` is a valid identifier continuation character. | 98 | /// True if `cp` is a valid identifier continuation character. |
| 99 | pub inline fn isIdContinue(self: Self, cp: u21) bool { | 99 | pub fn isIdContinue(self: Self, cp: u21) bool { |
| 100 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 8 == 8; | 100 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 8 == 8; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | /// True if `cp` is a valid extended identifier start character. | 103 | /// True if `cp` is a valid extended identifier start character. |
| 104 | pub inline fn isXidStart(self: Self, cp: u21) bool { | 104 | pub fn isXidStart(self: Self, cp: u21) bool { |
| 105 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 16 == 16; | 105 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 16 == 16; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | /// True if `cp` is a valid extended identifier continuation character. | 108 | /// True if `cp` is a valid extended identifier continuation character. |
| 109 | pub inline fn isXidContinue(self: Self, cp: u21) bool { | 109 | pub fn isXidContinue(self: Self, cp: u21) bool { |
| 110 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 32 == 32; | 110 | return self.core_s2[self.core_s1[cp >> 8] + (cp & 0xff)] & 32 == 32; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | /// True if `cp` is a whitespace character. | 113 | /// True if `cp` is a whitespace character. |
| 114 | pub inline fn isWhitespace(self: Self, cp: u21) bool { | 114 | pub fn isWhitespace(self: Self, cp: u21) bool { |
| 115 | return self.props_s2[self.props_s1[cp >> 8] + (cp & 0xff)] & 1 == 1; | 115 | return self.props_s2[self.props_s1[cp >> 8] + (cp & 0xff)] & 1 == 1; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | /// True if `cp` is a hexadecimal digit. | 118 | /// True if `cp` is a hexadecimal digit. |
| 119 | pub inline fn isHexDigit(self: Self, cp: u21) bool { | 119 | pub fn isHexDigit(self: Self, cp: u21) bool { |
| 120 | return self.props_s2[self.props_s1[cp >> 8] + (cp & 0xff)] & 2 == 2; | 120 | return self.props_s2[self.props_s1[cp >> 8] + (cp & 0xff)] & 2 == 2; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | /// True if `cp` is a diacritic mark. | 123 | /// True if `cp` is a diacritic mark. |
| 124 | pub inline fn isDiacritic(self: Self, cp: u21) bool { | 124 | pub fn isDiacritic(self: Self, cp: u21) bool { |
| 125 | return self.props_s2[self.props_s1[cp >> 8] + (cp & 0xff)] & 4 == 4; | 125 | return self.props_s2[self.props_s1[cp >> 8] + (cp & 0xff)] & 4 == 4; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | /// True if `cp` is numeric. | 128 | /// True if `cp` is numeric. |
| 129 | pub inline fn isNumeric(self: Self, cp: u21) bool { | 129 | pub fn isNumeric(self: Self, cp: u21) bool { |
| 130 | return self.num_s2[self.num_s1[cp >> 8] + (cp & 0xff)] & 1 == 1; | 130 | return self.num_s2[self.num_s1[cp >> 8] + (cp & 0xff)] & 1 == 1; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | /// True if `cp` is a digit. | 133 | /// True if `cp` is a digit. |
| 134 | pub inline fn isDigit(self: Self, cp: u21) bool { | 134 | pub fn isDigit(self: Self, cp: u21) bool { |
| 135 | return self.num_s2[self.num_s1[cp >> 8] + (cp & 0xff)] & 2 == 2; | 135 | return self.num_s2[self.num_s1[cp >> 8] + (cp & 0xff)] & 2 == 2; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /// True if `cp` is decimal. | 138 | /// True if `cp` is decimal. |
| 139 | pub inline fn isDecimal(self: Self, cp: u21) bool { | 139 | pub fn isDecimal(self: Self, cp: u21) bool { |
| 140 | return self.num_s2[self.num_s1[cp >> 8] + (cp & 0xff)] & 4 == 4; | 140 | return self.num_s2[self.num_s1[cp >> 8] + (cp & 0xff)] & 4 == 4; |
| 141 | } | 141 | } |
| 142 | 142 | ||