meta-language 1.0.0

A self-describing links-network core for lossless language representation
Documentation
(grammar (start source_file) (matching longest) (settling tokens precedence dynamic ambiguity))
(extra (ref comment))
(extra (class plain (char %20) (char %09) (char %0A) (char %0D) (char %0C) (char %0B)))
(conflict simple_type expression)
(conflict simple_type generic_type expression)
(conflict qualified_type expression)
(conflict generic_type simple_type)
(conflict parameter_declaration simple_type)
(conflict type_parameter_declaration simple_type expression)
(conflict type_parameter_declaration expression)
(conflict type_parameter_declaration simple_type generic_type expression)
(rule source_file normal (seq (repeat0 (choice unordered (seq (ref statement) (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00))) (seq (ref top_level_declaration) (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00))))) (optional (ref top_level_declaration))) (concept grammar.source-file))
(rule top_level_declaration silent (choice unordered (ref package_clause) (ref function_declaration) (ref method_declaration) (ref import_declaration)) (concept grammar.top-level-declaration) (source-names (tree-sitter _top_level_declaration)))
(rule package_clause normal (seq (token (seq (literal package) (not (ref word_characters)))) (ref package_identifier_alias)) (concept grammar.package-clause))
(rule import_declaration normal (seq (token (seq (literal import) (not (ref word_characters)))) (choice unordered (ref import_specification) (ref import_specification_list))) (concept grammar.import-declaration))
(rule import_specification normal (seq (optional (capture labeled name (choice unordered (ref dot) (ref blank_identifier) (ref package_identifier_alias)))) (capture labeled path (ref string_literal))) (concept grammar.import-specification) (source-names (tree-sitter import_spec)))
(rule dot normal (literal .) (concept grammar.dot))
(rule blank_identifier token (seq (literal _) (not (ref word_characters))) (concept grammar.blank-identifier))
(rule import_specification_list normal (seq (literal %28) (optional (seq (ref import_specification) (repeat0 (seq (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)) (ref import_specification))) (optional (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00))))) (literal %29)) (concept grammar.import-specification-list) (source-names (tree-sitter import_spec_list)))
(rule declaration silent (choice unordered (ref constant_declaration) (ref type_declaration) (ref variable_declaration)) (concept grammar.declaration) (source-names (tree-sitter _declaration)))
(rule constant_declaration normal (seq (token (seq (literal const) (not (ref word_characters)))) (choice unordered (ref constant_specification) (seq (literal %28) (repeat0 (seq (ref constant_specification) (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)))) (literal %29)))) (concept grammar.constant-declaration) (source-names (tree-sitter const_declaration)))
(rule constant_specification normal (precedence 0 left (seq (capture labeled name (seq (ref identifier) (repeat0 (seq (literal %2C) (ref identifier))))) (optional (seq (optional (capture labeled type (ref type))) (literal %3D) (capture labeled value (ref expression_list)))))) (concept grammar.constant-specification) (source-names (tree-sitter const_spec)))
(rule variable_declaration normal (seq (token (seq (literal var) (not (ref word_characters)))) (choice unordered (ref variable_specification) (ref variable_specification_list))) (concept grammar.variable-declaration) (source-names (tree-sitter var_declaration)))
(rule variable_specification normal (seq (seq (capture labeled name (ref identifier)) (repeat0 (seq (literal %2C) (capture labeled name (ref identifier))))) (choice unordered (seq (capture labeled type (ref type)) (optional (seq (literal %3D) (capture labeled value (ref expression_list))))) (seq (literal %3D) (capture labeled value (ref expression_list))))) (concept grammar.variable-specification) (source-names (tree-sitter var_spec)))
(rule variable_specification_list normal (seq (literal %28) (repeat0 (seq (ref variable_specification) (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)))) (literal %29)) (concept grammar.variable-specification-list) (source-names (tree-sitter var_spec_list)))
(rule function_declaration normal (precedence 1 right (seq (token (seq (literal func) (not (ref word_characters)))) (capture labeled name (ref identifier)) (capture labeled type_parameters (optional (ref type_parameter_list))) (capture labeled parameters (ref parameter_list)) (capture labeled result (optional (choice unordered (ref parameter_list) (ref simple_type)))) (capture labeled body (optional (ref block))))) (concept grammar.function-declaration))
(rule method_declaration normal (precedence 1 right (seq (token (seq (literal func) (not (ref word_characters)))) (capture labeled receiver (ref parameter_list)) (capture labeled name (ref field_identifier_alias)) (capture labeled parameters (ref parameter_list)) (capture labeled result (optional (choice unordered (ref parameter_list) (ref simple_type)))) (capture labeled body (optional (ref block))))) (concept grammar.method-declaration))
(rule type_parameter_list normal (seq (literal %5B) (seq (ref type_parameter_declaration) (repeat0 (seq (literal %2C) (ref type_parameter_declaration)))) (optional (literal %2C)) (literal %5D)) (concept grammar.type-parameter-list))
(rule type_parameter_declaration normal (seq (seq (capture labeled name (ref identifier)) (repeat0 (seq (literal %2C) (capture labeled name (ref identifier))))) (capture labeled type (alias type_constraint (ref type_element)))) (concept grammar.type-parameter-declaration))
(rule parameter_list normal (seq (literal %28) (optional (seq (optional (seq (choice unordered (ref parameter_declaration) (ref variadic_parameter_declaration)) (repeat0 (seq (literal %2C) (choice unordered (ref parameter_declaration) (ref variadic_parameter_declaration)))))) (optional (literal %2C)))) (literal %29)) (concept grammar.parameter-list))
(rule parameter_declaration normal (seq (optional (seq (capture labeled name (ref identifier)) (repeat0 (seq (literal %2C) (capture labeled name (ref identifier)))))) (capture labeled type (ref type))) (concept grammar.parameter-declaration))
(rule variadic_parameter_declaration normal (seq (capture labeled name (optional (ref identifier))) (literal ...) (capture labeled type (ref type))) (concept grammar.variadic-parameter-declaration))
(rule type_alias normal (seq (capture labeled name (ref type_identifier_alias)) (capture labeled type_parameters (optional (ref type_parameter_list))) (literal %3D) (capture labeled type (ref type))) (concept grammar.type-alias))
(rule type_declaration normal (seq (token (seq (literal type) (not (ref word_characters)))) (choice unordered (ref type_specification) (ref type_alias) (seq (literal %28) (optional (seq (choice unordered (ref type_specification) (ref type_alias)) (repeat0 (seq (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)) (choice unordered (ref type_specification) (ref type_alias)))) (optional (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00))))) (literal %29)))) (concept grammar.type-declaration))
(rule type_specification normal (seq (capture labeled name (ref type_identifier_alias)) (capture labeled type_parameters (optional (ref type_parameter_list))) (capture labeled type (ref type))) (concept grammar.type-specification) (source-names (tree-sitter type_spec)))
(rule field_name_list normal (seq (ref field_identifier_alias) (repeat0 (seq (literal %2C) (ref field_identifier_alias)))) (concept grammar.field-name-list))
(rule expression_list normal (seq (ref expression) (repeat0 (seq (literal %2C) (ref expression)))) (concept grammar.expression-list))
(rule type silent (choice unordered (ref simple_type) (ref parenthesized_type)) (concept grammar.type) (source-names (tree-sitter _type)))
(rule parenthesized_type normal (seq (literal %28) (ref type) (literal %29)) (concept grammar.parenthesized-type))
(rule simple_type silent (choice unordered (dynamicPrecedence -1 (ref type_identifier_alias)) (ref generic_type) (ref qualified_type) (ref pointer_type) (ref structure_type) (ref interface_type) (ref array_type) (ref slice_type) (dynamicPrecedence 3 (ref map_type)) (ref channel_type) (ref function_type) (ref negated_type)) (concept grammar.simple-type) (source-names (tree-sitter _simple_type)))
(rule generic_type normal (dynamicPrecedence 1 (seq (capture labeled type (choice unordered (ref type_identifier_alias) (ref qualified_type) (ref negated_type))) (capture labeled type_arguments (ref type_arguments)))) (concept grammar.generic-type))
(rule type_arguments normal (dynamicPrecedence 2 (seq (literal %5B) (seq (ref type_element) (repeat0 (seq (literal %2C) (ref type_element)))) (optional (literal %2C)) (literal %5D))) (concept grammar.type-argument-list))
(rule pointer_type normal (precedence 6 none (seq (literal %2A) (ref type))) (concept grammar.pointer-type))
(rule array_type normal (precedence 0 right (seq (literal %5B) (capture labeled length (ref expression)) (literal %5D) (capture labeled element (ref type)))) (concept grammar.array-type))
(rule implicit_length_array_type normal (seq (literal %5B) (literal ...) (literal %5D) (capture labeled element (ref type))) (concept grammar.implicit-length-array-type))
(rule slice_type normal (precedence 0 right (seq (literal %5B) (literal %5D) (capture labeled element (ref type)))) (concept grammar.slice-type))
(rule structure_type normal (seq (token (seq (literal struct) (not (ref word_characters)))) (ref field_declaration_list)) (concept grammar.structure-type) (source-names (tree-sitter struct_type)))
(rule negated_type normal (precedence 0 left (seq (literal %7E) (ref type))) (concept grammar.negated-type))
(rule field_declaration_list normal (seq (literal %7B) (optional (seq (ref field_declaration) (repeat0 (seq (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)) (ref field_declaration))) (optional (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00))))) (literal %7D)) (concept grammar.field-declaration-list))
(rule field_declaration normal (seq (choice unordered (seq (seq (capture labeled name (ref field_identifier_alias)) (repeat0 (seq (literal %2C) (capture labeled name (ref field_identifier_alias))))) (capture labeled type (ref type))) (seq (optional (literal %2A)) (capture labeled type (choice unordered (ref type_identifier_alias) (ref qualified_type) (ref generic_type))))) (capture labeled tag (optional (ref string_literal)))) (concept grammar.field-declaration))
(rule interface_type normal (seq (token (seq (literal interface) (not (ref word_characters)))) (literal %7B) (optional (seq (ref interface_element) (repeat0 (seq (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)) (ref interface_element))) (optional (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00))))) (literal %7D)) (concept grammar.interface-type))
(rule interface_element silent (choice unordered (ref method_element) (ref type_element)) (concept grammar.interface-element) (source-names (tree-sitter _interface_elem)))
(rule method_element normal (seq (capture labeled name (ref field_identifier_alias)) (capture labeled parameters (ref parameter_list)) (capture labeled result (optional (choice unordered (ref parameter_list) (ref simple_type))))) (concept grammar.method-element) (source-names (tree-sitter method_elem)))
(rule type_element normal (seq (ref type) (repeat0 (seq (literal %7C) (ref type)))) (concept grammar.type-element) (source-names (tree-sitter type_elem)))
(rule map_type normal (precedence 0 right (seq (token (seq (literal map) (not (ref word_characters)))) (literal %5B) (capture labeled key (ref type)) (literal %5D) (capture labeled value (ref type)))) (concept grammar.map-type))
(rule channel_type normal (precedence 0 left (choice unordered (seq (token (seq (literal chan) (not (ref word_characters)))) (capture labeled value (ref type))) (seq (token (seq (literal chan) (not (ref word_characters)))) (literal %3C-) (capture labeled value (ref type))) (precedence 6 none (seq (literal %3C-) (token (seq (literal chan) (not (ref word_characters)))) (capture labeled value (ref type)))))) (concept grammar.channel-type))
(rule function_type normal (precedence 0 right (seq (token (seq (literal func) (not (ref word_characters)))) (capture labeled parameters (ref parameter_list)) (capture labeled result (optional (choice unordered (ref parameter_list) (ref simple_type)))))) (concept grammar.function-type))
(rule block normal (seq (literal %7B) (optional (ref statement_list)) (literal %7D)) (concept grammar.block))
(rule statement_list normal (choice unordered (seq (ref statement) (repeat0 (seq (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)) (ref statement))) (optional (seq (choice unordered (alias unnamed_token (token (literal %0A))) (literal %3B) (literal %00)) (optional (alias labeled_statement (ref empty_labeled_statement)))))) (alias labeled_statement (ref empty_labeled_statement))) (concept grammar.statement-list))
(rule statement silent (choice unordered (ref declaration) (ref simple_statement) (ref return_statement) (ref go_statement) (ref defer_statement) (ref if_statement) (ref for_statement) (ref expression_switch_statement) (ref type_switch_statement) (ref select_statement) (ref labeled_statement) (ref fall_through_statement) (ref break_statement) (ref continue_statement) (ref go_to_statement) (ref block) (ref empty_statement)) (concept grammar.statement) (source-names (tree-sitter _statement)))
(rule empty_statement normal (literal %3B) (concept grammar.empty-statement))
(rule simple_statement silent (choice unordered (ref expression_statement) (ref send_statement) (ref inc_statement) (ref dec_statement) (ref assignment_statement) (ref short_variable_declaration)) (concept grammar.simple-statement) (source-names (tree-sitter _simple_statement)))
(rule expression_statement normal (ref expression) (concept grammar.expression-statement))
(rule send_statement normal (seq (capture labeled channel (ref expression)) (literal %3C-) (capture labeled value (ref expression))) (concept grammar.send-statement))
(rule receive_statement normal (seq (optional (seq (capture labeled left (ref expression_list)) (choice unordered (literal %3D) (literal %3A%3D)))) (capture labeled right (ref expression))) (concept grammar.receive-statement))
(rule inc_statement normal (seq (ref expression) (literal %2B%2B)) (concept grammar.inc-statement))
(rule dec_statement normal (seq (ref expression) (literal --)) (concept grammar.dec-statement))
(rule assignment_statement normal (seq (capture labeled left (ref expression_list)) (capture labeled operator (choice unordered (literal %2A%3D) (literal %2F%3D) (literal %25%3D) (literal %3C%3C%3D) (literal %3E%3E%3D) (literal %26%3D) (literal %26%5E%3D) (literal %2B%3D) (literal -%3D) (literal %7C%3D) (literal %5E%3D) (literal %3D))) (capture labeled right (ref expression_list))) (concept grammar.assignment-statement))
(rule short_variable_declaration normal (seq (capture labeled left (ref expression_list)) (literal %3A%3D) (capture labeled right (ref expression_list))) (concept grammar.short-variable-declaration) (source-names (tree-sitter short_var_declaration)))
(rule labeled_statement normal (seq (capture labeled label (alias label_name (ref identifier))) (literal %3A) (ref statement)) (concept grammar.labeled-statement))
(rule empty_labeled_statement normal (seq (capture labeled label (alias label_name (ref identifier))) (literal %3A)) (concept grammar.empty-labeled-statement))
(rule fall_through_statement normal (precedence 0 left (token (seq (literal fallthrough) (not (ref word_characters))))) (concept grammar.fall-through-statement) (source-names (tree-sitter fallthrough_statement)))
(rule break_statement normal (seq (token (seq (literal break) (not (ref word_characters)))) (optional (alias label_name (ref identifier)))) (concept grammar.break-statement))
(rule continue_statement normal (seq (token (seq (literal continue) (not (ref word_characters)))) (optional (alias label_name (ref identifier)))) (concept grammar.continue-statement))
(rule go_to_statement normal (seq (token (seq (literal goto) (not (ref word_characters)))) (alias label_name (ref identifier))) (concept grammar.go-to-statement) (source-names (tree-sitter goto_statement)))
(rule return_statement normal (seq (token (seq (literal return) (not (ref word_characters)))) (optional (ref expression_list))) (concept grammar.return-statement))
(rule go_statement normal (seq (token (seq (literal go) (not (ref word_characters)))) (ref expression)) (concept grammar.go-statement))
(rule defer_statement normal (seq (token (seq (literal defer) (not (ref word_characters)))) (ref expression)) (concept grammar.defer-statement))
(rule if_statement normal (seq (token (seq (literal if) (not (ref word_characters)))) (optional (seq (capture labeled initializer (ref simple_statement)) (literal %3B))) (capture labeled condition (ref expression)) (capture labeled consequence (ref block)) (optional (seq (token (seq (literal else) (not (ref word_characters)))) (capture labeled alternative (choice unordered (ref block) (ref if_statement)))))) (concept grammar.if-statement))
(rule for_statement normal (seq (token (seq (literal for) (not (ref word_characters)))) (optional (choice unordered (ref expression) (ref for_clause) (ref range_clause))) (capture labeled body (ref block))) (concept grammar.for-statement))
(rule for_clause normal (seq (capture labeled initializer (optional (ref simple_statement))) (literal %3B) (capture labeled condition (optional (ref expression))) (literal %3B) (capture labeled update (optional (ref simple_statement)))) (concept grammar.for-clause))
(rule range_clause normal (seq (optional (seq (capture labeled left (ref expression_list)) (choice unordered (literal %3D) (literal %3A%3D)))) (token (seq (literal range) (not (ref word_characters)))) (capture labeled right (ref expression))) (concept grammar.range-clause))
(rule expression_switch_statement normal (seq (token (seq (literal switch) (not (ref word_characters)))) (optional (seq (capture labeled initializer (ref simple_statement)) (literal %3B))) (capture labeled value (optional (ref expression))) (literal %7B) (repeat0 (choice unordered (ref expression_case) (ref default_case))) (literal %7D)) (concept grammar.expression-switch-statement))
(rule expression_case normal (seq (token (seq (literal case) (not (ref word_characters)))) (capture labeled value (ref expression_list)) (literal %3A) (optional (ref statement_list))) (concept grammar.expression-case))
(rule default_case normal (seq (token (seq (literal default) (not (ref word_characters)))) (literal %3A) (optional (ref statement_list))) (concept grammar.default-case))
(rule type_switch_statement normal (seq (token (seq (literal switch) (not (ref word_characters)))) (ref type_switch_header) (literal %7B) (repeat0 (choice unordered (ref type_case) (ref default_case))) (literal %7D)) (concept grammar.type-switch-statement))
(rule type_switch_header silent (seq (optional (seq (capture labeled initializer (ref simple_statement)) (literal %3B))) (optional (seq (capture labeled alias (ref expression_list)) (literal %3A%3D))) (capture labeled value (ref expression)) (literal .) (literal %28) (token (seq (literal type) (not (ref word_characters)))) (literal %29)) (concept grammar.type-switch-header) (source-names (tree-sitter _type_switch_header)))
(rule type_case normal (seq (token (seq (literal case) (not (ref word_characters)))) (capture labeled type (seq (ref type) (repeat0 (seq (literal %2C) (ref type))))) (literal %3A) (optional (ref statement_list))) (concept grammar.type-case))
(rule select_statement normal (seq (token (seq (literal select) (not (ref word_characters)))) (literal %7B) (repeat0 (choice unordered (ref communication_case) (ref default_case))) (literal %7D)) (concept grammar.select-statement))
(rule communication_case normal (seq (token (seq (literal case) (not (ref word_characters)))) (capture labeled communication (choice unordered (ref send_statement) (ref receive_statement))) (literal %3A) (optional (ref statement_list))) (concept grammar.communication-case))
(rule expression silent (choice unordered (ref unary_expression) (ref binary_expression) (ref selector_expression) (ref index_expression) (ref slice_expression) (ref call_expression) (ref type_assertion_expression) (ref type_conversion_expression) (ref type_instantiation_expression) (ref identifier) (alias identifier (choice unordered (token (seq (literal new) (not (ref word_characters)))) (token (seq (literal make) (not (ref word_characters)))))) (ref composite_literal) (ref function_literal) (ref string_literal) (ref integer_literal) (ref float_literal) (ref imaginary_literal) (ref rune_literal) (ref nil) (ref true) (ref false) (ref iota) (ref parenthesized_expression)) (concept grammar.expression) (source-names (tree-sitter _expression)))
(rule parenthesized_expression normal (seq (literal %28) (ref expression) (literal %29)) (concept grammar.parenthesized-expression))
(rule call_expression normal (precedence 7 none (choice unordered (seq (capture labeled function (alias identifier (choice unordered (token (seq (literal new) (not (ref word_characters)))) (token (seq (literal make) (not (ref word_characters))))))) (capture labeled arguments (alias argument_list (ref special_argument_list)))) (seq (capture labeled function (ref expression)) (capture labeled type_arguments (optional (ref type_arguments))) (capture labeled arguments (ref argument_list))))) (concept grammar.call-expression))
(rule variadic_argument normal (precedence 0 right (seq (ref expression) (literal ...))) (concept grammar.variadic-argument))
(rule special_argument_list normal (seq (literal %28) (optional (seq (ref type) (repeat0 (seq (literal %2C) (ref expression))) (optional (literal %2C)))) (literal %29)) (concept grammar.special-argument-list))
(rule argument_list normal (seq (literal %28) (optional (seq (choice unordered (ref expression) (ref variadic_argument)) (repeat0 (seq (literal %2C) (choice unordered (ref expression) (ref variadic_argument)))) (optional (literal %2C)))) (literal %29)) (concept grammar.argument-list))
(rule selector_expression normal (precedence 7 none (seq (capture labeled operand (ref expression)) (literal .) (capture labeled field (ref field_identifier_alias)))) (concept grammar.selector-expression))
(rule index_expression normal (precedence 7 none (dynamicPrecedence 1 (seq (capture labeled operand (ref expression)) (literal %5B) (capture labeled index (ref expression)) (literal %5D)))) (concept grammar.index-expression))
(rule slice_expression normal (precedence 7 none (seq (capture labeled operand (ref expression)) (literal %5B) (choice unordered (seq (capture labeled start (optional (ref expression))) (literal %3A) (capture labeled end (optional (ref expression)))) (seq (capture labeled start (optional (ref expression))) (literal %3A) (capture labeled end (ref expression)) (literal %3A) (capture labeled capacity (ref expression)))) (literal %5D))) (concept grammar.slice-expression))
(rule type_assertion_expression normal (precedence 7 none (seq (capture labeled operand (ref expression)) (literal .) (literal %28) (capture labeled type (ref type)) (literal %29))) (concept grammar.type-assertion-expression))
(rule type_conversion_expression normal (dynamicPrecedence -1 (seq (capture labeled type (ref type)) (literal %28) (capture labeled operand (ref expression)) (optional (literal %2C)) (literal %29))) (concept grammar.type-conversion-expression))
(rule type_instantiation_expression normal (dynamicPrecedence -1 (seq (capture labeled type (ref type)) (literal %5B) (seq (ref type) (repeat0 (seq (literal %2C) (ref type)))) (optional (literal %2C)) (literal %5D))) (concept grammar.type-instantiation-expression))
(rule composite_literal normal (precedence -1 none (seq (capture labeled type (choice unordered (ref map_type) (ref slice_type) (ref array_type) (ref implicit_length_array_type) (ref structure_type) (ref type_identifier_alias) (ref generic_type) (ref qualified_type))) (capture labeled body (ref literal_value)))) (concept grammar.composite-literal))
(rule literal_value normal (seq (literal %7B) (optional (seq (optional (seq (choice unordered (ref literal_element) (ref keyed_element)) (repeat0 (seq (literal %2C) (choice unordered (ref literal_element) (ref keyed_element)))))) (optional (literal %2C)))) (literal %7D)) (concept grammar.literal-value))
(rule literal_element normal (choice unordered (ref expression) (ref literal_value)) (concept grammar.literal-element))
(rule keyed_element normal (seq (capture labeled key (ref literal_element)) (literal %3A) (capture labeled value (ref literal_element))) (concept grammar.keyed-element))
(rule function_literal normal (seq (token (seq (literal func) (not (ref word_characters)))) (capture labeled parameters (ref parameter_list)) (capture labeled result (optional (choice unordered (ref parameter_list) (ref simple_type)))) (capture labeled body (ref block))) (concept grammar.function-literal) (source-names (tree-sitter func_literal)))
(rule unary_expression normal (precedence 6 none (seq (capture labeled operator (choice unordered (literal %2B) (literal -) (literal %21) (literal %5E) (literal %2A) (literal %26) (literal %3C-))) (capture labeled operand (ref expression)))) (concept grammar.unary-expression))
(rule binary_expression normal (choice unordered (precedence 5 left (seq (capture labeled left (ref expression)) (capture labeled operator (choice unordered (literal %2A) (literal %2F) (literal %25) (literal %3C%3C) (literal %3E%3E) (literal %26) (literal %26%5E))) (capture labeled right (ref expression)))) (precedence 4 left (seq (capture labeled left (ref expression)) (capture labeled operator (choice unordered (literal %2B) (literal -) (literal %7C) (literal %5E))) (capture labeled right (ref expression)))) (precedence 3 left (seq (capture labeled left (ref expression)) (capture labeled operator (choice unordered (literal %3D%3D) (literal %21%3D) (literal %3C) (literal %3C%3D) (literal %3E) (literal %3E%3D))) (capture labeled right (ref expression)))) (precedence 2 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %26%26)) (capture labeled right (ref expression)))) (precedence 1 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %7C%7C)) (capture labeled right (ref expression))))) (concept grammar.binary-expression))
(rule qualified_type normal (seq (capture labeled package (ref package_identifier_alias)) (literal .) (capture labeled name (ref type_identifier_alias))) (concept grammar.qualified-type))
(rule identifier token (seq (class plain (char _) (category Lu) (category Ll) (category Lt) (category Lm) (category Lo) (category Nl)) (repeat0 (class plain (char _) (category Lu) (category Ll) (category Lt) (category Lm) (category Lo) (category Nl) (category Mn) (category Mc) (category Nd) (category Pc)))) (concept grammar.identifier))
(rule type_identifier_alias silent (alias type_identifier (ref identifier)) (concept grammar.type-identifier-alias) (source-names (tree-sitter _type_identifier)))
(rule field_identifier_alias silent (alias field_identifier (ref identifier)) (concept grammar.field-identifier-alias) (source-names (tree-sitter _field_identifier)))
(rule package_identifier_alias silent (alias package_identifier (ref identifier)) (concept grammar.package-identifier-alias) (source-names (tree-sitter _package_identifier)))
(rule string_literal silent (choice unordered (ref raw_string_literal) (ref interpreted_string_literal)) (concept grammar.string-literal) (source-names (tree-sitter _string_literal)))
(rule raw_string_literal normal (seq (literal %60) (alias raw_string_literal_content (token (lexicalPrecedence 1 (repeat0 (class negated (char %60)))))) (literal %60)) (concept grammar.raw-string-literal))
(rule interpreted_string_literal normal (seq (literal %22) (repeat0 (choice unordered (alias interpreted_string_literal_content (immediateToken (lexicalPrecedence 1 (repeat1 (class negated (char %22) (char %0A) (char %5C)))))) (ref escape_sequence))) (immediateToken (literal %22))) (concept grammar.interpreted-string-literal))
(rule escape_sequence silent (alias escape_sequence (immediateToken (seq (literal %5C) (choice unordered (class negated (char x) (char u) (char U)) (repeat 2 3 (class plain (range 0 9))) (seq (literal x) (repeat 2 unbounded (class plain (range 0 9) (range a f) (range A F)))) (seq (literal u) (repeat 4 4 (class plain (range 0 9) (range a f) (range A F)))) (seq (literal U) (repeat 8 8 (class plain (range 0 9) (range a f) (range A F)))))))) (concept grammar.escape-sequence))
(rule integer_literal token (choice unordered (seq (literal 0) (choice unordered (literal b) (literal B)) (optional (literal _)) (seq (class plain (char 0) (char 1)) (repeat0 (seq (optional (literal _)) (class plain (char 0) (char 1)))))) (choice unordered (literal 0) (seq (class plain (range 1 9)) (optional (seq (optional (literal _)) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))))) (seq (literal 0) (optional (choice unordered (literal o) (literal O))) (optional (literal _)) (seq (class plain (range 0 7)) (repeat0 (seq (optional (literal _)) (class plain (range 0 7)))))) (seq (literal 0) (choice unordered (literal x) (literal X)) (optional (literal _)) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))))) (concept grammar.integer-literal) (source-names (tree-sitter int_literal)))
(rule float_literal token (choice unordered (choice unordered (seq (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (literal .) (optional (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9)))))) (optional (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9)))))))) (seq (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))) (seq (literal .) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (optional (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))))) (seq (literal 0) (choice unordered (literal x) (literal X)) (choice unordered (seq (optional (literal _)) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))) (literal .) (optional (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))))) (seq (optional (literal _)) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F)))))) (seq (literal .) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))))) (seq (choice unordered (literal p) (literal P)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9)))))))) (concept grammar.float-literal))
(rule imaginary_literal token (seq (choice unordered (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (choice unordered (seq (literal 0) (choice unordered (literal b) (literal B)) (optional (literal _)) (seq (class plain (char 0) (char 1)) (repeat0 (seq (optional (literal _)) (class plain (char 0) (char 1)))))) (choice unordered (literal 0) (seq (class plain (range 1 9)) (optional (seq (optional (literal _)) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))))) (seq (literal 0) (optional (choice unordered (literal o) (literal O))) (optional (literal _)) (seq (class plain (range 0 7)) (repeat0 (seq (optional (literal _)) (class plain (range 0 7)))))) (seq (literal 0) (choice unordered (literal x) (literal X)) (optional (literal _)) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))))) (choice unordered (choice unordered (seq (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (literal .) (optional (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9)))))) (optional (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9)))))))) (seq (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))) (seq (literal .) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))) (optional (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))))) (seq (literal 0) (choice unordered (literal x) (literal X)) (choice unordered (seq (optional (literal _)) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))) (literal .) (optional (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))))) (seq (optional (literal _)) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F)))))) (seq (literal .) (seq (class plain (range 0 9) (range a f) (range A F)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9) (range a f) (range A F))))))) (seq (choice unordered (literal p) (literal P)) (optional (choice unordered (literal %2B) (literal -))) (seq (class plain (range 0 9)) (repeat0 (seq (optional (literal _)) (class plain (range 0 9))))))))) (literal i)) (concept grammar.imaginary-literal))
(rule rune_literal token (seq (literal %27) (choice unordered (class negated (char %27) (char %5C)) (seq (literal %5C) (choice unordered (seq (literal x) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F))) (seq (class plain (range 0 7)) (class plain (range 0 7)) (class plain (range 0 7))) (seq (literal u) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F))) (seq (literal U) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F)) (class plain (range 0 9) (range a f) (range A F))) (choice unordered (literal a) (literal b) (literal f) (literal n) (literal r) (literal t) (literal v) (literal %5C) (literal %27) (literal %22))))) (literal %27)) (concept grammar.rune-literal))
(rule nil token (seq (literal nil) (not (ref word_characters))) (concept grammar.null))
(rule true token (seq (literal true) (not (ref word_characters))) (concept grammar.true-value))
(rule false token (seq (literal false) (not (ref word_characters))) (concept grammar.false-value))
(rule iota token (seq (literal iota) (not (ref word_characters))) (concept grammar.iota))
(rule comment token (choice unordered (seq (literal %2F%2F) (repeat0 (class negated (char %0A)))) (seq (literal %2F%2A) (seq (repeat0 (class negated (char %2A))) (repeat1 (literal %2A)) (repeat0 (seq (class negated (char %2F) (char %2A)) (repeat0 (class negated (char %2A))) (repeat1 (literal %2A))))) (literal %2F))) (concept grammar.comment))
(rule word_characters token (seq (class plain (char _) (category Lu) (category Ll) (category Lt) (category Lm) (category Lo) (category Nl)) (repeat0 (class plain (char _) (category Lu) (category Ll) (category Lt) (category Lm) (category Lo) (category Nl) (category Mn) (category Mc) (category Nd) (category Pc)))) (concept grammar.word-characters))