diff options
| author | 2024-02-15 10:28:17 -0400 | |
|---|---|---|
| committer | 2024-02-15 10:28:17 -0400 | |
| commit | 1da3bbfea4d8a8f6f0e0b0442a7cd633709f0f2d (patch) | |
| tree | ccbe141968f50ac1ddc0042789772836328ac7be /src | |
| parent | Removed codegen/indic.zig (diff) | |
| download | zg-1da3bbfea4d8a8f6f0e0b0442a7cd633709f0f2d.tar.gz zg-1da3bbfea4d8a8f6f0e0b0442a7cd633709f0f2d.tar.xz zg-1da3bbfea4d8a8f6f0e0b0442a7cd633709f0f2d.zip | |
Removed inline from fns
Diffstat (limited to 'src')
| -rw-r--r-- | src/Grapheme.zig | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Grapheme.zig b/src/Grapheme.zig index ba90b24..41f3e16 100644 --- a/src/Grapheme.zig +++ b/src/Grapheme.zig | |||
| @@ -78,14 +78,14 @@ pub const GraphemeIterator = struct { | |||
| 78 | }; | 78 | }; |
| 79 | 79 | ||
| 80 | // Predicates | 80 | // Predicates |
| 81 | inline fn isBreaker(cp: u21) bool { | 81 | fn isBreaker(cp: u21) bool { |
| 82 | // Extract relevant properties. | 82 | // Extract relevant properties. |
| 83 | const cp_props_byte = gbp.stage_3[gbp.stage_2[gbp.stage_1[cp >> 8] + (cp & 0xff)]]; | 83 | const cp_props_byte = gbp.stage_3[gbp.stage_2[gbp.stage_1[cp >> 8] + (cp & 0xff)]]; |
| 84 | const cp_gbp_prop: gbp.Gbp = @enumFromInt(cp_props_byte >> 4); | 84 | const cp_gbp_prop: gbp.Gbp = @enumFromInt(cp_props_byte >> 4); |
| 85 | return cp == '\x0d' or cp == '\x0a' or cp_gbp_prop == .Control; | 85 | return cp == '\x0d' or cp == '\x0a' or cp_gbp_prop == .Control; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | inline fn isIgnorable(cp: u21) bool { | 88 | fn isIgnorable(cp: u21) bool { |
| 89 | const cp_gbp_prop = gbp.stage_3[gbp.stage_2[gbp.stage_1[cp >> 8] + (cp & 0xff)]]; | 89 | const cp_gbp_prop = gbp.stage_3[gbp.stage_2[gbp.stage_1[cp >> 8] + (cp & 0xff)]]; |
| 90 | return cp_gbp_prop == .extend or cp_gbp_prop == .spacing or cp == '\u{200d}'; | 90 | return cp_gbp_prop == .extend or cp_gbp_prop == .spacing or cp == '\u{200d}'; |
| 91 | } | 91 | } |
| @@ -128,33 +128,33 @@ test "Segmentation ZWJ and ZWSP emoji sequences" { | |||
| 128 | 128 | ||
| 129 | // Grapheme break state. | 129 | // Grapheme break state. |
| 130 | // Extended Pictographic (emoji) | 130 | // Extended Pictographic (emoji) |
| 131 | inline fn hasXpic(state: *const u3) bool { | 131 | fn hasXpic(state: *const u3) bool { |
| 132 | return state.* & 1 == 1; | 132 | return state.* & 1 == 1; |
| 133 | } | 133 | } |
| 134 | inline fn setXpic(state: *u3) void { | 134 | fn setXpic(state: *u3) void { |
| 135 | state.* |= 1; | 135 | state.* |= 1; |
| 136 | } | 136 | } |
| 137 | inline fn unsetXpic(state: *u3) void { | 137 | fn unsetXpic(state: *u3) void { |
| 138 | state.* ^= 1; | 138 | state.* ^= 1; |
| 139 | } | 139 | } |
| 140 | // Regional Indicatior (flags) | 140 | // Regional Indicatior (flags) |
| 141 | inline fn hasRegional(state: *const u3) bool { | 141 | fn hasRegional(state: *const u3) bool { |
| 142 | return state.* & 2 == 2; | 142 | return state.* & 2 == 2; |
| 143 | } | 143 | } |
| 144 | inline fn setRegional(state: *u3) void { | 144 | fn setRegional(state: *u3) void { |
| 145 | state.* |= 2; | 145 | state.* |= 2; |
| 146 | } | 146 | } |
| 147 | inline fn unsetRegional(state: *u3) void { | 147 | fn unsetRegional(state: *u3) void { |
| 148 | state.* ^= 2; | 148 | state.* ^= 2; |
| 149 | } | 149 | } |
| 150 | // Indic Conjunct | 150 | // Indic Conjunct |
| 151 | inline fn hasIndic(state: *const u3) bool { | 151 | fn hasIndic(state: *const u3) bool { |
| 152 | return state.* & 4 == 4; | 152 | return state.* & 4 == 4; |
| 153 | } | 153 | } |
| 154 | inline fn setIndic(state: *u3) void { | 154 | fn setIndic(state: *u3) void { |
| 155 | state.* |= 4; | 155 | state.* |= 4; |
| 156 | } | 156 | } |
| 157 | inline fn unsetIndic(state: *u3) void { | 157 | fn unsetIndic(state: *u3) void { |
| 158 | state.* ^= 4; | 158 | state.* ^= 4; |
| 159 | } | 159 | } |
| 160 | 160 | ||