Skip to content

Commit d08f1af

Browse files
committed
🎨
1 parent be71c6e commit d08f1af

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

lib/src/parser.c

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,25 +1865,31 @@ TSTree *ts_parser_parse(
18651865
LOG("new_parse");
18661866
}
18671867

1868-
uint32_t position = 0, last_position = 0, version_count = 0;
18691868
self->operation_count = 0;
18701869
if (self->timeout_duration) {
18711870
self->end_clock = clock_after(clock_now(), self->timeout_duration);
18721871
} else {
18731872
self->end_clock = clock_null();
18741873
}
18751874

1875+
uint32_t position = 0, last_position = 0, version_count = 0;
18761876
do {
1877-
for (StackVersion version = 0;
1878-
version_count = ts_stack_version_count(self->stack), version < version_count;
1879-
version++) {
1877+
for (
1878+
StackVersion version = 0;
1879+
version_count = ts_stack_version_count(self->stack),
1880+
version < version_count;
1881+
version++
1882+
) {
18801883
bool allow_node_reuse = version_count == 1;
18811884
while (ts_stack_is_active(self->stack, version)) {
1882-
LOG("process version:%d, version_count:%u, state:%d, row:%u, col:%u",
1883-
version, ts_stack_version_count(self->stack),
1884-
ts_stack_state(self->stack, version),
1885-
ts_stack_position(self->stack, version).extent.row,
1886-
ts_stack_position(self->stack, version).extent.column);
1885+
LOG(
1886+
"process version:%d, version_count:%u, state:%d, row:%u, col:%u",
1887+
version,
1888+
ts_stack_version_count(self->stack),
1889+
ts_stack_state(self->stack, version),
1890+
ts_stack_position(self->stack, version).extent.row,
1891+
ts_stack_position(self->stack, version).extent.column
1892+
);
18871893

18881894
if (!ts_parser__advance(self, version, allow_node_reuse)) return NULL;
18891895
LOG_STACK();
@@ -1935,8 +1941,13 @@ TSTree *ts_parser_parse_string(
19351941
return ts_parser_parse_string_encoding(self, old_tree, string, length, TSInputEncodingUTF8);
19361942
}
19371943

1938-
TSTree *ts_parser_parse_string_encoding(TSParser *self, const TSTree *old_tree,
1939-
const char *string, uint32_t length, TSInputEncoding encoding) {
1944+
TSTree *ts_parser_parse_string_encoding(
1945+
TSParser *self,
1946+
const TSTree *old_tree,
1947+
const char *string,
1948+
uint32_t length,
1949+
TSInputEncoding encoding
1950+
) {
19401951
TSStringInput input = {string, length};
19411952
return ts_parser_parse(self, old_tree, (TSInput) {
19421953
&input,

0 commit comments

Comments
 (0)