tree-sitter grammar update

This commit is contained in:
2026-07-19 01:46:35 +02:00
parent 95f90cc306
commit 2e09864adf
6 changed files with 246106 additions and 213982 deletions
@@ -643,3 +643,86 @@ ops func(value u8, count u8) u8 {
(identifier))
(expression
(integer)))))))))))))
==================
Struct field defaults and grouped types
==================
Config :: struct {
capacity usize = 8
}
work func() void ! (Config | errors.Full) {}
clear func($K, $V type) void {
for 0..entries.len |i| {
entries[i].hash = 0
}
}
---
(source_file
(type_declaration
(identifier)
(struct_type
(record_body
(record_field
(identifier)
(type
(builtin_type))
(expression
(integer))))))
(function_declaration
(identifier)
(parameter_list)
(type
(builtin_type))
(type
(parenthesized_type
(type
(named_type
(qualified_identifier
(identifier)))
(named_type
(qualified_identifier
(identifier)
(identifier))))))
(block))
(function_declaration
(identifier)
(parameter_list
(parameter
(identifier)
(identifier)
(type
(builtin_type))))
(type
(builtin_type))
(block
(statement
(for_statement
(expression
(binary_expression
(expression
(integer))
(expression
(field_expression
(expression
(identifier))
(identifier)))))
(identifier)
(block
(statement
(assignment_statement
(expression
(field_expression
(expression
(index_expression
(expression
(identifier))
(expression
(identifier))))
(identifier)))
(expression
(integer))))))))))
@@ -0,0 +1,21 @@
Config :: struct {
# ^^^^^^ type
capacity usize = 8
# ^^^^^^^^ property
# ^ operator
}
work func() void ! (Config | errors.Full) {}
# ^^^^ keyword
# ^ operator
# ^^^^^^ type
# ^ operator
clear func($K, $V type) void {
# ^ variable.parameter
# ^ variable.parameter
# ^^^^ type.builtin
for 0..entries.len |i| {}
# ^^^ keyword
# ^ operator
}