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) (char %EF%BB%BF) (char %E2%81%A0) (char %E2%80%8B) (char %C2%A0)))
(conflict primary_expression type_name)
(conflict primary_expression identifier_path)
(conflict primary_expression member_expression identifier_path)
(conflict member_expression identifier_path)
(conflict layout_specifier structure_expression)
(conflict nameless_parameter parameter)
(conflict primary_expression type_cast_expression)
(conflict variable_declaration_tuple tuple_expression)
(conflict yul_expression yul_assignment)
(conflict yul_label yul_identifier)
(conflict fallback_receive_definition function_type)
(kind enumeration_value (source-names (tree-sitter enum_value)))
(rule source_file normal (repeat0 (ref source_unit)) (concept grammar.source-file))
(rule source_unit silent (choice unordered (ref directive) (ref declaration)) (concept grammar.source-unit) (source-names (tree-sitter _source_unit)))
(rule directive silent (choice unordered (ref pragma_directive) (ref import_directive)) (concept grammar.source-file-directive) (source-names (tree-sitter _directive)))
(rule pragma_directive normal (seq (token (seq (literal pragma) (not (ref word_characters)))) (choice unordered (ref solidity_pragma_token) (ref any_pragma_token)) (ref semicolon)) (concept grammar.pragma-directive))
(rule solidity_pragma_token normal (precedence 10 none (seq (ref solidity) (repeat0 (seq (capture labeled version_constraint (ref pragma_version_constraint)) (optional (choice unordered (literal %7C%7C) (literal -))))))) (concept grammar.solidity-pragma-token))
(rule any_pragma_token normal (seq (ref identifier) (ref pragma_value)) (concept grammar.any-pragma-token))
(rule solidity silent (precedence 1 none (token (seq (literal solidity) (not (ref word_characters))))) (concept grammar.solidity) (source-names (tree-sitter _solidity)))
(rule pragma_value normal (precedence 0 none (alias unnamed_token (token (repeat1 (class negated (char %3B)))))) (concept grammar.pragma-value))
(rule pragma_version_constraint silent (seq (optional (ref solidity_version_comparison_operator)) (ref solidity_version)) (concept grammar.pragma-version-constraint) (source-names (tree-sitter _pragma_version_constraint)))
(rule solidity_version token (seq (optional (literal %22)) (optional (literal .)) (optional (literal %20)) (repeat1 (choice unordered (class plain (range 0 9)) (literal %2A))) (optional (seq (literal .) (optional (literal %20)) (repeat1 (choice unordered (class plain (range 0 9)) (literal %2A))) (optional (literal %20)) (optional (seq (literal .) (repeat1 (choice unordered (class plain (range 0 9)) (literal %2A))))))) (optional (literal %22))) (concept grammar.solidity-version))
(rule solidity_version_comparison_operator normal (choice unordered (literal %3C%3D) (literal %3C) (literal %5E) (literal %3E) (literal %3E%3D) (literal %7E) (literal %3D)) (concept grammar.solidity-version-comparison-operator))
(rule import_directive normal (seq (token (seq (literal import) (not (ref word_characters)))) (choice unordered (ref source_import) (seq (ref import_clause) (ref from_clause))) (ref semicolon)) (concept grammar.import-directive))
(rule source_import silent (seq (capture labeled source (ref string)) (optional (ref import_alias))) (concept grammar.source-import) (source-names (tree-sitter _source_import)))
(rule import_clause silent (choice unordered (ref single_import) (ref multiple_import)) (concept grammar.import-clause) (source-names (tree-sitter _import_clause)))
(rule from_clause silent (seq (token (seq (literal from) (not (ref word_characters)))) (capture labeled source (ref string))) (concept grammar.from-clause) (source-names (tree-sitter _from_clause)))
(rule single_import silent (seq (choice unordered (literal %2A) (capture labeled import_name (ref identifier))) (optional (ref import_alias))) (concept grammar.single-import) (source-names (tree-sitter _single_import)))
(rule multiple_import silent (seq (literal %7B) (optional (seq (ref import_declaration) (repeat0 (seq (literal %2C) (ref import_declaration))) (optional (literal %2C)))) (literal %7D)) (concept grammar.multiple-import) (source-names (tree-sitter _multiple_import)))
(rule import_declaration silent (seq (capture labeled import_name (ref identifier)) (optional (ref import_alias))) (concept grammar.import-declaration) (source-names (tree-sitter _import_declaration)))
(rule import_alias silent (seq (token (seq (literal as) (not (ref word_characters)))) (capture labeled alias (ref identifier))) (concept grammar.import-alias) (source-names (tree-sitter _import_alias)))
(rule declaration silent (choice unordered (ref contract_declaration) (ref interface_declaration) (ref error_declaration) (ref library_declaration) (ref structure_declaration) (ref enumeration_declaration) (ref function_definition) (ref constant_variable_declaration) (ref user_defined_type_definition) (ref event_definition) (ref using_directive)) (concept grammar.declaration) (source-names (tree-sitter _declaration)))
(rule user_defined_type_definition normal (seq (token (seq (literal type) (not (ref word_characters)))) (capture labeled name (ref identifier)) (token (seq (literal is) (not (ref word_characters)))) (ref primitive_type) (ref semicolon)) (concept grammar.user-defined-type-definition))
(rule constant_variable_declaration normal (seq (capture labeled type (ref type_name)) (token (seq (literal constant) (not (ref word_characters)))) (capture labeled name (ref identifier)) (literal %3D) (capture labeled value (ref expression)) (ref semicolon)) (concept grammar.constant-variable-declaration))
(rule contract_declaration normal (seq (optional (token (seq (literal abstract) (not (ref word_characters))))) (token (seq (literal contract) (not (ref word_characters)))) (capture labeled name (ref identifier)) (repeat0 (choice unordered (ref class_heritage) (ref layout_specifier))) (capture labeled body (ref contract_body))) (concept grammar.contract-declaration))
(rule error_declaration normal (seq (token (seq (literal error) (not (ref word_characters)))) (capture labeled name (ref identifier)) (literal %28) (optional (seq (ref error_parameter) (repeat0 (seq (literal %2C) (ref error_parameter))) (optional (literal %2C)))) (literal %29) (ref semicolon)) (concept grammar.error-declaration))
(rule error_parameter normal (seq (capture labeled type (ref type_name)) (capture labeled name (optional (ref identifier)))) (concept grammar.error-parameter))
(rule interface_declaration normal (seq (token (seq (literal interface) (not (ref word_characters)))) (capture labeled name (ref identifier)) (optional (ref class_heritage)) (capture labeled body (ref contract_body))) (concept grammar.interface-declaration))
(rule library_declaration normal (seq (token (seq (literal library) (not (ref word_characters)))) (capture labeled name (ref identifier)) (capture labeled body (ref contract_body))) (concept grammar.library-declaration))
(rule class_heritage silent (seq (token (seq (literal is) (not (ref word_characters)))) (seq (ref inheritance_specifier) (repeat0 (seq (literal %2C) (ref inheritance_specifier))) (optional (literal %2C)))) (concept grammar.class-heritage) (source-names (tree-sitter _class_heritage)))
(rule layout_specifier normal (seq (token (seq (literal layout) (not (ref word_characters)))) (token (seq (literal at) (not (ref word_characters)))) (ref expression)) (concept grammar.layout-specifier))
(rule inheritance_specifier normal (seq (capture labeled ancestor (ref user_defined_type)) (optional (capture labeled ancestor_arguments (ref call_arguments)))) (concept grammar.inheritance-specifier))
(rule contract_body normal (seq (literal %7B) (repeat0 (ref contract_member)) (literal %7D)) (concept grammar.declaration-body))
(rule contract_member silent (choice unordered (ref function_definition) (ref modifier_definition) (ref error_declaration) (ref state_variable_declaration) (ref structure_declaration) (ref enumeration_declaration) (ref event_definition) (ref using_directive) (ref constructor_definition) (ref fallback_receive_definition) (ref user_defined_type_definition)) (concept grammar.contract-member) (source-names (tree-sitter _contract_member)))
(rule structure_declaration normal (seq (token (seq (literal struct) (not (ref word_characters)))) (capture labeled name (ref identifier)) (capture labeled body (ref structure_body))) (concept grammar.structure-declaration) (source-names (tree-sitter struct_declaration)))
(rule structure_member normal (seq (capture labeled type (ref type_name)) (capture labeled name (ref identifier)) (ref semicolon)) (concept grammar.structure-member) (source-names (tree-sitter struct_member)))
(rule structure_body normal (seq (literal %7B) (repeat1 (ref structure_member)) (literal %7D)) (concept grammar.structure-body) (source-names (tree-sitter struct_body)))
(rule enumeration_declaration normal (seq (token (seq (literal enum) (not (ref word_characters)))) (capture labeled name (ref identifier)) (capture labeled body (ref enumeration_body))) (concept grammar.enumeration-declaration) (source-names (tree-sitter enum_declaration)))
(rule enumeration_body normal (seq (literal %7B) (optional (seq (alias enumeration_value (ref identifier)) (repeat0 (seq (literal %2C) (alias enumeration_value (ref identifier)))) (optional (literal %2C)))) (literal %7D)) (concept grammar.enumeration-body) (source-names (tree-sitter enum_body)))
(rule event_definition normal (seq (token (seq (literal event) (not (ref word_characters)))) (capture labeled name (ref identifier)) (ref event_parameter_list) (optional (token (seq (literal anonymous) (not (ref word_characters))))) (ref semicolon)) (concept grammar.event-definition))
(rule event_parameter_list silent (seq (literal %28) (optional (seq (ref event_parameter) (repeat0 (seq (literal %2C) (ref event_parameter))) (optional (literal %2C)))) (literal %29)) (concept grammar.event-parameter-list) (source-names (tree-sitter _event_parameter_list)))
(rule event_parameter normal (seq (capture labeled type (ref type_name)) (optional (token (seq (literal indexed) (not (ref word_characters))))) (optional (capture labeled name (ref identifier)))) (concept grammar.event-parameter))
(rule user_definable_operator normal (choice unordered (literal %26) (literal %7E) (literal %7C) (literal %5E) (literal %2B) (literal -) (literal %2F) (literal %25) (literal %2A) (literal -) (literal %3D%3D) (literal %3E) (literal %3E%3D) (literal %3C) (literal %3C%3D) (literal %21%3D)) (concept grammar.user-definable-operator))
(rule using_directive normal (seq (token (seq (literal using) (not (ref word_characters)))) (choice unordered (alias type_alias (ref user_defined_type)) (seq (literal %7B) (seq (ref using_alias) (repeat0 (seq (literal %2C) (ref using_alias))) (optional (literal %2C))) (literal %7D))) (token (seq (literal for) (not (ref word_characters)))) (capture labeled source (choice unordered (ref any_source_type) (ref type_name))) (optional (token (seq (literal global) (not (ref word_characters))))) (ref semicolon)) (concept grammar.using-directive))
(rule using_alias normal (seq (ref user_defined_type) (optional (seq (token (seq (literal as) (not (ref word_characters)))) (ref user_definable_operator)))) (concept grammar.using-alias))
(rule any_source_type normal (literal %2A) (concept grammar.any-source-type))
(rule statement normal (choice unordered (ref block_statement) (ref expression_statement) (ref variable_declaration_statement) (ref if_statement) (ref for_statement) (ref while_statement) (ref do_while_statement) (ref continue_statement) (ref break_statement) (ref try_statement) (ref return_statement) (ref emit_statement) (ref assembly_statement) (ref revert_statement)) (concept grammar.statement))
(rule assembly_statement normal (seq (token (seq (literal assembly) (not (ref word_characters)))) (optional (literal %22evmasm%22)) (optional (ref assembly_flags)) (literal %7B) (repeat0 (ref yul_statement)) (literal %7D)) (concept grammar.assembly-statement))
(rule assembly_flags normal (seq (literal %28) (optional (seq (ref string) (repeat0 (seq (literal %2C) (ref string))) (optional (literal %2C)))) (literal %29)) (concept grammar.assembly-flags))
(rule yul_statement silent (choice unordered (ref yul_block) (ref yul_variable_declaration) (ref yul_assignment) (ref yul_function_call) (ref yul_if_statement) (ref yul_for_statement) (ref yul_switch_statement) (ref yul_leave) (ref yul_break) (ref yul_continue) (ref yul_function_definition) (ref yul_label) (ref yul_literal)) (concept grammar.yul-statement) (source-names (tree-sitter _yul_statement)))
(rule yul_label normal (seq (ref identifier) (literal %3A)) (concept grammar.yul-label))
(rule yul_leave token (seq (literal leave) (not (ref word_characters))) (concept grammar.yul-leave))
(rule yul_break normal (token (seq (literal break) (not (ref word_characters)))) (concept grammar.yul-break))
(rule yul_continue normal (token (seq (literal continue) (not (ref word_characters)))) (concept grammar.yul-continue-statement))
(rule yul_identifier normal (ref identifier) (concept grammar.yul-identifier))
(rule yul_expression silent (choice unordered (ref yul_path) (ref yul_function_call) (ref yul_literal)) (concept grammar.yul-expression) (source-names (tree-sitter _yul_expression)))
(rule yul_path normal (precedence 0 left (seq (ref yul_identifier) (repeat0 (seq (literal .) (ref yul_identifier))))) (concept grammar.yul-path))
(rule yul_literal silent (choice unordered (ref yul_decimal_number) (ref yul_string_literal) (ref yul_hex_number) (ref yul_boolean) (ref yul_hex_string_literal)) (concept grammar.yul-literal) (source-names (tree-sitter _yul_literal)))
(rule yul_decimal_number token (choice unordered (literal 0) (seq (class plain (range 1 9)) (repeat0 (class plain (range 0 9))))) (concept grammar.yul-decimal-number))
(rule yul_string_literal normal (ref string) (concept grammar.yul-string-literal))
(rule yul_hex_number token (seq (literal 0x) (repeat0 (class plain (range 0 9) (range A F) (range a f)))) (concept grammar.yul-hex-number))
(rule yul_boolean normal (choice unordered (token (seq (literal true) (not (ref word_characters)))) (token (seq (literal false) (not (ref word_characters))))) (concept grammar.yul-boolean-literal))
(rule yul_hex_string_literal normal (seq (token (seq (literal hex) (not (ref word_characters)))) (choice unordered (seq (literal %22) (optional (seq (ref hex_digit) (repeat0 (seq (optional (literal _)) (ref hex_digit))))) (literal %22)) (seq (literal %27) (optional (seq (ref hex_digit) (repeat0 (seq (optional (literal _)) (ref hex_digit))))) (literal %27)))) (concept grammar.yul-hex-string-literal))
(rule yul_block normal (seq (literal %7B) (repeat0 (ref yul_statement)) (literal %7D)) (concept grammar.yul-block))
(rule yul_variable_declaration normal (precedence 1 left (choice unordered (seq (token (seq (literal let) (not (ref word_characters)))) (capture labeled left (ref yul_identifier)) (optional (seq (literal %3A%3D) (capture labeled right (ref yul_expression))))) (seq (token (seq (literal let) (not (ref word_characters)))) (capture labeled left (choice unordered (seq (ref yul_identifier) (repeat0 (seq (literal %2C) (ref yul_identifier))) (optional (literal %2C))) (seq (literal %28) (seq (ref yul_identifier) (repeat0 (seq (literal %2C) (ref yul_identifier))) (optional (literal %2C))) (literal %29)))) (optional (seq (literal %3A%3D) (capture labeled right (ref yul_function_call))))))) (concept grammar.yul-variable-declaration))
(rule yul_assignment_operator silent (choice unordered (literal %3A%3D) (seq (literal %3A) (literal %3D))) (concept grammar.yul-assignment-operator) (source-names (tree-sitter _yul_assignment_operator)))
(rule yul_assignment normal (precedence 0 left (choice unordered (seq (ref yul_path) (ref yul_assignment_operator) (ref yul_expression)) (seq (seq (ref yul_path) (repeat0 (seq (literal %2C) (ref yul_path))) (optional (literal %2C))) (optional (seq (ref yul_assignment_operator) (ref yul_function_call)))))) (concept grammar.yul-assignment))
(rule yul_function_call normal (choice unordered (seq (capture labeled function (choice unordered (ref yul_identifier) (ref yul_built_in_function))) (literal %28) (optional (seq (ref yul_expression) (repeat0 (seq (literal %2C) (ref yul_expression))) (optional (literal %2C)))) (literal %29)) (capture labeled function (ref yul_built_in_function))) (concept grammar.yul-function-call))
(rule yul_if_statement normal (seq (token (seq (literal if) (not (ref word_characters)))) (ref yul_expression) (ref yul_block)) (concept grammar.yul-if-statement))
(rule yul_for_statement normal (seq (token (seq (literal for) (not (ref word_characters)))) (ref yul_block) (ref yul_expression) (ref yul_block) (ref yul_block)) (concept grammar.yul-for-statement))
(rule yul_switch_statement normal (seq (token (seq (literal switch) (not (ref word_characters)))) (ref yul_expression) (choice unordered (seq (token (seq (literal default) (not (ref word_characters)))) (ref yul_block)) (seq (repeat1 (seq (token (seq (literal case) (not (ref word_characters)))) (ref yul_literal) (ref yul_block))) (optional (seq (token (seq (literal default) (not (ref word_characters)))) (ref yul_block)))))) (concept grammar.yul-switch-statement))
(rule yul_function_definition normal (seq (token (seq (literal function) (not (ref word_characters)))) (ref yul_identifier) (literal %28) (optional (seq (ref yul_identifier) (repeat0 (seq (literal %2C) (ref yul_identifier))) (optional (literal %2C)))) (literal %29) (optional (seq (literal -%3E) (seq (ref yul_identifier) (repeat0 (seq (literal %2C) (ref yul_identifier))) (optional (literal %2C))))) (ref yul_block)) (concept grammar.yul-function-definition))
(rule yul_built_in_function normal (precedence 1 none (choice unordered (token (seq (literal stop) (not (ref word_characters)))) (token (seq (literal add) (not (ref word_characters)))) (token (seq (literal sub) (not (ref word_characters)))) (token (seq (literal mul) (not (ref word_characters)))) (token (seq (literal div) (not (ref word_characters)))) (token (seq (literal sdiv) (not (ref word_characters)))) (token (seq (literal mod) (not (ref word_characters)))) (token (seq (literal smod) (not (ref word_characters)))) (token (seq (literal exp) (not (ref word_characters)))) (token (seq (literal not) (not (ref word_characters)))) (token (seq (literal lt) (not (ref word_characters)))) (token (seq (literal gt) (not (ref word_characters)))) (token (seq (literal slt) (not (ref word_characters)))) (token (seq (literal sgt) (not (ref word_characters)))) (token (seq (literal eq) (not (ref word_characters)))) (token (seq (literal iszero) (not (ref word_characters)))) (token (seq (literal and) (not (ref word_characters)))) (token (seq (literal or) (not (ref word_characters)))) (token (seq (literal xor) (not (ref word_characters)))) (token (seq (literal byte) (not (ref word_characters)))) (token (seq (literal shl) (not (ref word_characters)))) (token (seq (literal shr) (not (ref word_characters)))) (token (seq (literal sar) (not (ref word_characters)))) (token (seq (literal addmod) (not (ref word_characters)))) (token (seq (literal mulmod) (not (ref word_characters)))) (token (seq (literal signextend) (not (ref word_characters)))) (token (seq (literal keccak256) (not (ref word_characters)))) (token (seq (literal pop) (not (ref word_characters)))) (token (seq (literal mload) (not (ref word_characters)))) (token (seq (literal mcopy) (not (ref word_characters)))) (token (seq (literal tload) (not (ref word_characters)))) (token (seq (literal tstore) (not (ref word_characters)))) (token (seq (literal mstore) (not (ref word_characters)))) (token (seq (literal mstore8) (not (ref word_characters)))) (token (seq (literal sload) (not (ref word_characters)))) (token (seq (literal sstore) (not (ref word_characters)))) (token (seq (literal msize) (not (ref word_characters)))) (token (seq (literal gas) (not (ref word_characters)))) (token (seq (literal address) (not (ref word_characters)))) (token (seq (literal balance) (not (ref word_characters)))) (token (seq (literal selfbalance) (not (ref word_characters)))) (token (seq (literal caller) (not (ref word_characters)))) (token (seq (literal callvalue) (not (ref word_characters)))) (token (seq (literal calldataload) (not (ref word_characters)))) (token (seq (literal calldatasize) (not (ref word_characters)))) (token (seq (literal calldatacopy) (not (ref word_characters)))) (token (seq (literal extcodesize) (not (ref word_characters)))) (token (seq (literal extcodecopy) (not (ref word_characters)))) (token (seq (literal returndatasize) (not (ref word_characters)))) (token (seq (literal returndatacopy) (not (ref word_characters)))) (token (seq (literal extcodehash) (not (ref word_characters)))) (token (seq (literal create) (not (ref word_characters)))) (token (seq (literal create2) (not (ref word_characters)))) (token (seq (literal call) (not (ref word_characters)))) (token (seq (literal callcode) (not (ref word_characters)))) (token (seq (literal delegatecall) (not (ref word_characters)))) (token (seq (literal staticcall) (not (ref word_characters)))) (token (seq (literal return) (not (ref word_characters)))) (token (seq (literal revert) (not (ref word_characters)))) (token (seq (literal selfdestruct) (not (ref word_characters)))) (token (seq (literal invalid) (not (ref word_characters)))) (token (seq (literal log0) (not (ref word_characters)))) (token (seq (literal log1) (not (ref word_characters)))) (token (seq (literal log2) (not (ref word_characters)))) (token (seq (literal log3) (not (ref word_characters)))) (token (seq (literal log4) (not (ref word_characters)))) (token (seq (literal chainid) (not (ref word_characters)))) (token (seq (literal origin) (not (ref word_characters)))) (token (seq (literal gasprice) (not (ref word_characters)))) (token (seq (literal blockhash) (not (ref word_characters)))) (token (seq (literal blobhash) (not (ref word_characters)))) (token (seq (literal basefee) (not (ref word_characters)))) (token (seq (literal blobfee) (not (ref word_characters)))) (token (seq (literal coinbase) (not (ref word_characters)))) (token (seq (literal timestamp) (not (ref word_characters)))) (token (seq (literal number) (not (ref word_characters)))) (token (seq (literal difficulty) (not (ref word_characters)))) (token (seq (literal gaslimit) (not (ref word_characters)))) (token (seq (literal prevrandao) (not (ref word_characters)))) (token (seq (literal blobbasefee) (not (ref word_characters)))) (token (seq (literal blobfee) (not (ref word_characters)))))) (concept grammar.yul-built-in-function) (source-names (tree-sitter yul_evm_builtin)))
(rule unchecked token (seq (literal unchecked) (not (ref word_characters))) (concept grammar.unchecked-keyword))
(rule block_statement normal (seq (optional (ref unchecked)) (literal %7B) (repeat0 (ref statement)) (literal %7D)) (concept grammar.block-statement))
(rule variable_declaration_statement normal (precedence 1 none (seq (choice unordered (seq (ref variable_declaration) (optional (seq (literal %3D) (capture labeled value (ref expression))))) (seq (ref variable_declaration_tuple) (literal %3D) (capture labeled value (ref expression)))) (ref semicolon))) (concept grammar.variable-declaration-statement))
(rule variable_declaration normal (seq (capture labeled type (ref type_name)) (capture labeled location (optional (choice unordered (token (seq (literal memory) (not (ref word_characters)))) (token (seq (literal storage) (not (ref word_characters)))) (token (seq (literal calldata) (not (ref word_characters))))))) (capture labeled name (ref identifier))) (concept grammar.variable-declaration))
(rule variable_declaration_tuple normal (precedence 3 none (choice unordered (seq (literal %28) (optional (seq (optional (ref variable_declaration)) (repeat0 (seq (literal %2C) (optional (ref variable_declaration)))) (optional (literal %2C)))) (literal %29)) (seq (token (seq (literal var) (not (ref word_characters)))) (literal %28) (optional (seq (optional (ref identifier)) (repeat0 (seq (literal %2C) (optional (ref identifier)))) (optional (literal %2C)))) (literal %29)))) (concept grammar.variable-declaration-tuple))
(rule expression_statement normal (seq (ref expression) (ref semicolon)) (concept grammar.expression-statement))
(rule if_statement normal (precedence 0 right (seq (token (seq (literal if) (not (ref word_characters)))) (literal %28) (capture labeled condition (ref expression)) (literal %29) (capture labeled body (ref statement)) (capture labeled else (optional (seq (token (seq (literal else) (not (ref word_characters)))) (capture labeled body (ref statement))))))) (concept grammar.if-statement))
(rule for_statement normal (seq (token (seq (literal for) (not (ref word_characters)))) (literal %28) (capture labeled initial (choice unordered (ref variable_declaration_statement) (ref expression_statement) (ref semicolon))) (capture labeled condition (choice unordered (ref expression_statement) (ref semicolon))) (capture labeled update (optional (ref expression))) (literal %29) (capture labeled body (ref statement))) (concept grammar.for-statement))
(rule while_statement normal (seq (token (seq (literal while) (not (ref word_characters)))) (literal %28) (capture labeled condition (ref expression)) (literal %29) (capture labeled body (ref statement))) (concept grammar.while-statement))
(rule do_while_statement normal (seq (token (seq (literal do) (not (ref word_characters)))) (capture labeled body (ref statement)) (token (seq (literal while) (not (ref word_characters)))) (literal %28) (capture labeled condition (ref expression)) (literal %29) (ref semicolon)) (concept grammar.do-while-statement))
(rule continue_statement normal (seq (token (seq (literal continue) (not (ref word_characters)))) (ref semicolon)) (concept grammar.continue-statement))
(rule break_statement normal (seq (token (seq (literal break) (not (ref word_characters)))) (ref semicolon)) (concept grammar.break-statement))
(rule revert_statement normal (precedence 13 none (seq (token (seq (literal revert) (not (ref word_characters)))) (optional (capture labeled error (ref expression))) (optional (alias revert_arguments (ref call_arguments))) (ref semicolon))) (concept grammar.revert-statement))
(rule try_statement normal (seq (token (seq (literal try) (not (ref word_characters)))) (capture labeled attempt (ref expression)) (optional (seq (token (seq (literal returns) (not (ref word_characters)))) (ref parameter_list))) (capture labeled body (ref block_statement)) (repeat1 (ref catch_clause))) (concept grammar.try-statement))
(rule catch_clause normal (seq (token (seq (literal catch) (not (ref word_characters)))) (optional (seq (optional (ref identifier)) (ref parameter_list))) (capture labeled body (ref block_statement))) (concept grammar.catch-clause))
(rule return_statement normal (seq (token (seq (literal return) (not (ref word_characters)))) (optional (ref expression)) (ref semicolon)) (concept grammar.return-statement))
(rule emit_statement normal (seq (token (seq (literal emit) (not (ref word_characters)))) (capture labeled name (ref expression)) (ref call_arguments) (ref semicolon)) (concept grammar.emit-statement))
(rule state_variable_declaration normal (seq (capture labeled type (ref type_name)) (repeat0 (choice unordered (capture labeled visibility (ref visibility)) (token (seq (literal constant) (not (ref word_characters)))) (ref override_specifier) (ref immutable) (capture labeled location (ref state_location)))) (capture labeled name (ref identifier)) (optional (seq (literal %3D) (capture labeled value (ref expression)))) (ref semicolon)) (concept grammar.state-variable-declaration))
(rule visibility normal (choice unordered (token (seq (literal public) (not (ref word_characters)))) (token (seq (literal internal) (not (ref word_characters)))) (token (seq (literal private) (not (ref word_characters)))) (token (seq (literal external) (not (ref word_characters))))) (concept grammar.visibility))
(rule state_mutability normal (choice unordered (token (seq (literal pure) (not (ref word_characters)))) (token (seq (literal view) (not (ref word_characters)))) (token (seq (literal payable) (not (ref word_characters))))) (concept grammar.state-mutability))
(rule state_location normal (token (seq (literal transient) (not (ref word_characters)))) (concept grammar.state-location))
(rule immutable token (seq (literal immutable) (not (ref word_characters))) (concept grammar.immutable-keyword))
(rule override_specifier normal (seq (token (seq (literal override) (not (ref word_characters)))) (optional (seq (literal %28) (seq (ref user_defined_type) (repeat0 (seq (literal %2C) (ref user_defined_type))) (optional (literal %2C))) (literal %29)))) (concept grammar.override-specifier))
(rule modifier_definition normal (seq (token (seq (literal modifier) (not (ref word_characters)))) (capture labeled name (ref identifier)) (optional (ref parameter_list)) (repeat0 (choice unordered (ref virtual) (ref override_specifier))) (choice unordered (ref semicolon) (capture labeled body (ref function_body)))) (concept grammar.modifier-definition))
(rule constructor_definition normal (seq (token (seq (literal constructor) (not (ref word_characters)))) (ref parameter_list) (repeat0 (choice unordered (ref modifier_invocation) (token (seq (literal payable) (not (ref word_characters)))) (choice unordered (token (seq (literal internal) (not (ref word_characters)))) (token (seq (literal public) (not (ref word_characters))))))) (capture labeled body (ref function_body))) (concept grammar.constructor-definition))
(rule fallback_receive_definition normal (seq (choice unordered (choice unordered (token (seq (literal fallback) (not (ref word_characters)))) (token (seq (literal receive) (not (ref word_characters)))) (token (seq (literal function) (not (ref word_characters))))) (token (seq (literal function) (not (ref word_characters))))) (ref parameter_list) (repeat0 (choice unordered (ref visibility) (ref modifier_invocation) (ref state_mutability) (ref virtual) (ref override_specifier))) (optional (seq (token (seq (literal returns) (not (ref word_characters)))) (ref parameter_list))) (choice unordered (ref semicolon) (capture labeled body (ref function_body)))) (concept grammar.fallback-receive-definition))
(rule function_definition normal (seq (token (seq (literal function) (not (ref word_characters)))) (capture labeled name (ref identifier)) (ref parameter_list) (repeat0 (choice unordered (ref modifier_invocation) (ref visibility) (ref state_mutability) (ref virtual) (ref override_specifier))) (capture labeled return_type (optional (ref return_type_definition))) (choice unordered (ref semicolon) (capture labeled body (ref function_body)))) (concept grammar.function-definition))
(rule return_type_definition normal (seq (token (seq (literal returns) (not (ref word_characters)))) (ref parameter_list)) (concept grammar.return-type-definition))
(rule virtual token (seq (literal virtual) (not (ref word_characters))) (concept grammar.virtual-keyword))
(rule modifier_invocation normal (seq (ref identifier_path) (optional (ref call_arguments))) (concept grammar.modifier-invocation))
(rule call_arguments silent (precedence 4 none (seq (literal %28) (optional (seq (ref call_argument) (repeat0 (seq (literal %2C) (ref call_argument))) (optional (literal %2C)))) (literal %29))) (concept grammar.call-arguments) (source-names (tree-sitter _call_arguments)))
(rule call_argument normal (choice unordered (ref expression) (seq (literal %7B) (optional (seq (ref call_structure_argument) (repeat0 (seq (literal %2C) (ref call_structure_argument))) (optional (literal %2C)))) (literal %7D))) (concept grammar.call-argument-value))
(rule call_structure_argument normal (seq (capture labeled name (ref identifier)) (literal %3A) (capture labeled value (ref expression))) (concept grammar.call-structure-argument) (source-names (tree-sitter call_struct_argument)))
(rule function_body normal (seq (literal %7B) (repeat0 (ref statement)) (literal %7D)) (concept grammar.function-body))
(rule expression normal (choice unordered (ref binary_expression) (ref unary_expression) (ref update_expression) (ref call_expression) (ref payable_conversion_expression) (ref meta_type_expression) (ref primary_expression) (ref structure_expression) (ref ternary_expression) (ref type_cast_expression)) (concept grammar.expression))
(rule primary_expression silent (choice unordered (ref parenthesized_expression) (ref member_expression) (ref array_access) (ref slice_access) (ref primitive_type) (ref assignment_expression) (ref augmented_assignment_expression) (ref user_defined_type) (ref tuple_expression) (ref inline_array_expression) (ref identifier) (ref literal) (ref new_expression)) (concept grammar.primary-expression) (source-names (tree-sitter _primary_expression)))
(rule type_cast_expression normal (precedence 0 left (seq (ref primitive_type) (ref call_arguments))) (concept grammar.type-cast-expression))
(rule ternary_expression normal (precedence 0 left (seq (ref expression) (literal %3F) (ref expression) (literal %3A) (ref expression))) (concept grammar.ternary-expression))
(rule new_expression normal (precedence 0 left (seq (token (seq (literal new) (not (ref word_characters)))) (capture labeled name (ref type_name)) (optional (ref call_arguments)))) (concept grammar.new-expression))
(rule tuple_expression normal (precedence 1 none (seq (literal %28) (optional (seq (optional (ref expression)) (repeat0 (seq (literal %2C) (optional (ref expression)))) (optional (literal %2C)))) (literal %29))) (concept grammar.tuple-expression))
(rule inline_array_expression normal (seq (literal %5B) (optional (seq (ref expression) (repeat0 (seq (literal %2C) (ref expression))) (optional (literal %2C)))) (literal %5D)) (concept grammar.inline-array-expression))
(rule binary_expression normal (choice unordered (precedence 1 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %7C%7C)) (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 3 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3D%3D)) (capture labeled right (ref expression)))) (precedence 3 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %21%3D)) (capture labeled right (ref expression)))) (precedence 4 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3C)) (capture labeled right (ref expression)))) (precedence 4 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3E)) (capture labeled right (ref expression)))) (precedence 4 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3C%3D)) (capture labeled right (ref expression)))) (precedence 4 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3E%3D)) (capture labeled right (ref expression)))) (precedence 5 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %7C)) (capture labeled right (ref expression)))) (precedence 6 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %5E)) (capture labeled right (ref expression)))) (precedence 7 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %26)) (capture labeled right (ref expression)))) (precedence 8 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3C%3C)) (capture labeled right (ref expression)))) (precedence 8 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %3E%3E)) (capture labeled right (ref expression)))) (precedence 9 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %2B)) (capture labeled right (ref expression)))) (precedence 9 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal -)) (capture labeled right (ref expression)))) (precedence 10 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %2A)) (capture labeled right (ref expression)))) (precedence 10 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %2F)) (capture labeled right (ref expression)))) (precedence 10 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %25)) (capture labeled right (ref expression)))) (precedence 11 left (seq (capture labeled left (ref expression)) (capture labeled operator (literal %2A%2A)) (capture labeled right (ref expression))))) (concept grammar.binary-expression))
(rule unary_expression normal (choice unordered (precedence 12 left (seq (capture labeled operator (literal -)) (capture labeled argument (ref expression)))) (precedence 12 left (seq (capture labeled operator (token (seq (literal delete) (not (ref word_characters))))) (capture labeled argument (ref expression)))) (precedence 12 left (seq (capture labeled operator (literal %21)) (capture labeled argument (ref expression)))) (precedence 12 left (seq (capture labeled operator (literal %7E)) (capture labeled argument (ref expression))))) (concept grammar.unary-expression))
(rule update_expression normal (choice unordered (precedence 13 left (seq (capture labeled argument (ref expression)) (capture labeled operator (choice unordered (literal %2B%2B) (literal --))))) (precedence 12 left (seq (capture labeled operator (choice unordered (literal %2B%2B) (literal --))) (capture labeled argument (ref expression))))) (concept grammar.update-expression))
(rule member_expression normal (dynamicPrecedence 1 (seq (capture labeled object (choice unordered (ref expression) (ref identifier))) (literal .) (capture labeled property (ref identifier)))) (concept grammar.member-expression))
(rule array_access normal (seq (capture labeled base (ref expression)) (literal %5B) (optional (capture labeled index (ref expression))) (literal %5D)) (concept grammar.array-access))
(rule slice_access normal (seq (capture labeled base (ref expression)) (literal %5B) (optional (capture labeled from (ref expression))) (literal %3A) (optional (capture labeled to (ref expression))) (literal %5D)) (concept grammar.slice-access))
(rule structure_expression normal (seq (capture labeled type (ref expression)) (literal %7B) (optional (seq (ref structure_field_assignment) (repeat0 (seq (literal %2C) (ref structure_field_assignment))) (optional (literal %2C)))) (literal %7D)) (concept grammar.structure-expression) (source-names (tree-sitter struct_expression)))
(rule structure_field_assignment normal (seq (capture labeled name (ref identifier)) (literal %3A) (capture labeled value (ref expression))) (concept grammar.structure-field-assignment) (source-names (tree-sitter struct_field_assignment)))
(rule parenthesized_expression normal (precedence 2 none (seq (literal %28) (ref expression) (literal %29))) (concept grammar.parenthesized-expression))
(rule assignment_expression normal (precedence 0 right (seq (capture labeled left (ref expression)) (literal %3D) (capture labeled right (ref expression)))) (concept grammar.assignment-expression))
(rule augmented_assignment_expression normal (precedence 0 right (seq (capture labeled left (ref expression)) (choice unordered (literal %2B%3D) (literal -%3D) (literal %2A%3D) (literal %2F%3D) (literal %25%3D) (literal %5E%3D) (literal %26%3D) (literal %7C%3D) (literal %3E%3E%3D) (literal %3C%3C%3D)) (capture labeled right (ref expression)))) (concept grammar.augmented-assignment-expression))
(rule call_expression normal (precedence 13 right (seq (capture labeled function (ref expression)) (ref call_arguments))) (concept grammar.call-expression))
(rule payable_conversion_expression normal (seq (token (seq (literal payable) (not (ref word_characters)))) (ref call_arguments)) (concept grammar.payable-conversion-expression))
(rule meta_type_expression normal (seq (token (seq (literal type) (not (ref word_characters)))) (literal %28) (ref type_name) (literal %29)) (concept grammar.meta-type-expression))
(rule type_name normal (choice unordered (ref primitive_type) (ref user_defined_type) (ref mapping) (ref array_type) (ref function_type)) (concept grammar.type-name))
(rule array_type silent (precedence 1 none (seq (ref type_name) (literal %5B) (optional (ref expression)) (literal %5D))) (concept grammar.array-type) (source-names (tree-sitter _array_type)))
(rule function_type silent (precedence 0 right (seq (token (seq (literal function) (not (ref word_characters)))) (capture labeled parameters (ref parameter_list)) (repeat0 (choice unordered (ref visibility) (ref state_mutability))) (optional (ref return_parameters)))) (concept grammar.function-type) (source-names (tree-sitter _function_type)))
(rule parameter_list silent (seq (literal %28) (optional (seq (ref parameter) (repeat0 (seq (literal %2C) (ref parameter))) (optional (literal %2C)))) (literal %29)) (concept grammar.parameter-list) (source-names (tree-sitter _parameter_list)))
(rule return_parameters silent (seq (token (seq (literal returns) (not (ref word_characters)))) (literal %28) (seq (alias return_parameter (ref nameless_parameter)) (repeat0 (seq (literal %2C) (alias return_parameter (ref nameless_parameter)))) (optional (literal %2C))) (literal %29)) (concept grammar.return-parameters) (source-names (tree-sitter _return_parameters)))
(rule nameless_parameter silent (seq (capture labeled type (ref type_name)) (capture labeled location (optional (ref storage_location)))) (concept grammar.nameless-parameter) (source-names (tree-sitter _nameless_parameter)))
(rule parameter normal (seq (capture labeled type (ref type_name)) (optional (capture labeled location (ref storage_location))) (optional (capture labeled name (ref identifier)))) (concept parameter))
(rule storage_location silent (choice unordered (token (seq (literal memory) (not (ref word_characters)))) (token (seq (literal storage) (not (ref word_characters)))) (token (seq (literal calldata) (not (ref word_characters))))) (concept grammar.storage-location) (source-names (tree-sitter _storage_location)))
(rule user_defined_type normal (ref identifier_path) (concept grammar.user-defined-type))
(rule identifier_path silent (precedence 0 left (seq (ref identifier) (repeat0 (seq (literal .) (ref identifier))))) (concept grammar.identifier-path) (source-names (tree-sitter _identifier_path)))
(rule mapping silent (seq (token (seq (literal mapping) (not (ref word_characters)))) (literal %28) (capture labeled key_type (ref mapping_key)) (optional (capture labeled key_identifier (ref identifier))) (literal %3D%3E) (capture labeled value_type (ref type_name)) (optional (capture labeled value_identifier (ref identifier))) (literal %29)) (concept grammar.map-type) (source-names (tree-sitter _mapping)))
(rule mapping_key silent (choice unordered (ref primitive_type) (ref user_defined_type)) (concept grammar.mapping-key) (source-names (tree-sitter _mapping_key)))
(rule primitive_type normal (precedence 0 left (choice unordered (seq (token (seq (literal address) (not (ref word_characters)))) (optional (token (seq (literal payable) (not (ref word_characters)))))) (token (seq (literal bool) (not (ref word_characters)))) (token (seq (literal string) (not (ref word_characters)))) (token (seq (literal var) (not (ref word_characters)))) (ref signed_integer_type) (ref unsigned_integer_type) (ref bytes) (ref fixed_point_type) (ref unsigned_fixed_point_type))) (concept grammar.primitive-type))
(rule signed_integer_type silent (choice unordered (token (seq (literal int) (not (ref word_characters)))) (token (seq (literal int8) (not (ref word_characters)))) (token (seq (literal int16) (not (ref word_characters)))) (token (seq (literal int24) (not (ref word_characters)))) (token (seq (literal int32) (not (ref word_characters)))) (token (seq (literal int40) (not (ref word_characters)))) (token (seq (literal int48) (not (ref word_characters)))) (token (seq (literal int56) (not (ref word_characters)))) (token (seq (literal int64) (not (ref word_characters)))) (token (seq (literal int72) (not (ref word_characters)))) (token (seq (literal int80) (not (ref word_characters)))) (token (seq (literal int88) (not (ref word_characters)))) (token (seq (literal int96) (not (ref word_characters)))) (token (seq (literal int104) (not (ref word_characters)))) (token (seq (literal int112) (not (ref word_characters)))) (token (seq (literal int120) (not (ref word_characters)))) (token (seq (literal int128) (not (ref word_characters)))) (token (seq (literal int136) (not (ref word_characters)))) (token (seq (literal int144) (not (ref word_characters)))) (token (seq (literal int152) (not (ref word_characters)))) (token (seq (literal int160) (not (ref word_characters)))) (token (seq (literal int168) (not (ref word_characters)))) (token (seq (literal int176) (not (ref word_characters)))) (token (seq (literal int184) (not (ref word_characters)))) (token (seq (literal int192) (not (ref word_characters)))) (token (seq (literal int200) (not (ref word_characters)))) (token (seq (literal int208) (not (ref word_characters)))) (token (seq (literal int216) (not (ref word_characters)))) (token (seq (literal int224) (not (ref word_characters)))) (token (seq (literal int232) (not (ref word_characters)))) (token (seq (literal int240) (not (ref word_characters)))) (token (seq (literal int248) (not (ref word_characters)))) (token (seq (literal int256) (not (ref word_characters))))) (concept grammar.signed-integer-type) (source-names (tree-sitter _int)))
(rule unsigned_integer_type silent (choice unordered (token (seq (literal uint) (not (ref word_characters)))) (token (seq (literal uint8) (not (ref word_characters)))) (token (seq (literal uint16) (not (ref word_characters)))) (token (seq (literal uint24) (not (ref word_characters)))) (token (seq (literal uint32) (not (ref word_characters)))) (token (seq (literal uint40) (not (ref word_characters)))) (token (seq (literal uint48) (not (ref word_characters)))) (token (seq (literal uint56) (not (ref word_characters)))) (token (seq (literal uint64) (not (ref word_characters)))) (token (seq (literal uint72) (not (ref word_characters)))) (token (seq (literal uint80) (not (ref word_characters)))) (token (seq (literal uint88) (not (ref word_characters)))) (token (seq (literal uint96) (not (ref word_characters)))) (token (seq (literal uint104) (not (ref word_characters)))) (token (seq (literal uint112) (not (ref word_characters)))) (token (seq (literal uint120) (not (ref word_characters)))) (token (seq (literal uint128) (not (ref word_characters)))) (token (seq (literal uint136) (not (ref word_characters)))) (token (seq (literal uint144) (not (ref word_characters)))) (token (seq (literal uint152) (not (ref word_characters)))) (token (seq (literal uint160) (not (ref word_characters)))) (token (seq (literal uint168) (not (ref word_characters)))) (token (seq (literal uint176) (not (ref word_characters)))) (token (seq (literal uint184) (not (ref word_characters)))) (token (seq (literal uint192) (not (ref word_characters)))) (token (seq (literal uint200) (not (ref word_characters)))) (token (seq (literal uint208) (not (ref word_characters)))) (token (seq (literal uint216) (not (ref word_characters)))) (token (seq (literal uint224) (not (ref word_characters)))) (token (seq (literal uint232) (not (ref word_characters)))) (token (seq (literal uint240) (not (ref word_characters)))) (token (seq (literal uint248) (not (ref word_characters)))) (token (seq (literal uint256) (not (ref word_characters))))) (concept grammar.unsigned-integer-type) (source-names (tree-sitter _uint)))
(rule bytes silent (choice unordered (token (seq (literal byte) (not (ref word_characters)))) (token (seq (literal bytes) (not (ref word_characters)))) (token (seq (literal bytes1) (not (ref word_characters)))) (token (seq (literal bytes2) (not (ref word_characters)))) (token (seq (literal bytes3) (not (ref word_characters)))) (token (seq (literal bytes4) (not (ref word_characters)))) (token (seq (literal bytes5) (not (ref word_characters)))) (token (seq (literal bytes6) (not (ref word_characters)))) (token (seq (literal bytes7) (not (ref word_characters)))) (token (seq (literal bytes8) (not (ref word_characters)))) (token (seq (literal bytes9) (not (ref word_characters)))) (token (seq (literal bytes10) (not (ref word_characters)))) (token (seq (literal bytes11) (not (ref word_characters)))) (token (seq (literal bytes12) (not (ref word_characters)))) (token (seq (literal bytes13) (not (ref word_characters)))) (token (seq (literal bytes14) (not (ref word_characters)))) (token (seq (literal bytes15) (not (ref word_characters)))) (token (seq (literal bytes16) (not (ref word_characters)))) (token (seq (literal bytes17) (not (ref word_characters)))) (token (seq (literal bytes18) (not (ref word_characters)))) (token (seq (literal bytes19) (not (ref word_characters)))) (token (seq (literal bytes20) (not (ref word_characters)))) (token (seq (literal bytes21) (not (ref word_characters)))) (token (seq (literal bytes22) (not (ref word_characters)))) (token (seq (literal bytes23) (not (ref word_characters)))) (token (seq (literal bytes24) (not (ref word_characters)))) (token (seq (literal bytes25) (not (ref word_characters)))) (token (seq (literal bytes26) (not (ref word_characters)))) (token (seq (literal bytes27) (not (ref word_characters)))) (token (seq (literal bytes28) (not (ref word_characters)))) (token (seq (literal bytes29) (not (ref word_characters)))) (token (seq (literal bytes30) (not (ref word_characters)))) (token (seq (literal bytes31) (not (ref word_characters)))) (token (seq (literal bytes32) (not (ref word_characters))))) (concept grammar.bytes) (source-names (tree-sitter _bytes)))
(rule fixed_point_type silent (choice unordered (token (seq (literal fixed) (not (ref word_characters)))) (alias unnamed_token (token (seq (literal fixed) (repeat1 (class plain (range 0 9))) (literal x) (repeat1 (class plain (range 0 9))))))) (concept grammar.fixed-point-type) (source-names (tree-sitter _fixed)))
(rule unsigned_fixed_point_type silent (choice unordered (token (seq (literal ufixed) (not (ref word_characters)))) (alias unnamed_token (token (seq (literal ufixed) (repeat1 (class plain (range 0 9))) (literal x) (repeat1 (class plain (range 0 9))))))) (concept grammar.unsigned-fixed-point-type) (source-names (tree-sitter _ufixed)))
(rule semicolon silent (literal %3B) (concept grammar.semicolon) (source-names (tree-sitter _semicolon)))
(rule identifier token (seq (class plain (range a z) (range A Z) (char %24) (char _)) (repeat0 (class plain (range a z) (range A Z) (range 0 9) (char %24) (char _)))) (concept grammar.identifier))
(rule number token (repeat1 (class plain (range 0 9))) (concept grammar.number))
(rule literal silent (choice unordered (ref string_literal) (ref number_literal) (ref boolean_literal) (ref hex_string_literal) (ref unicode_string_literal)) (concept grammar.literal) (source-names (tree-sitter _literal)))
(rule string_literal normal (precedence 0 left (repeat1 (ref string))) (concept grammar.string-literal))
(rule number_literal normal (seq (choice unordered (ref decimal_number) (ref hex_number)) (optional (ref number_unit))) (concept grammar.number-literal))
(rule decimal_number silent (choice unordered (alias unnamed_token (token (seq (repeat1 (choice unordered (class plain (range 0 9)) (literal _))) (optional (seq (literal .) (repeat1 (choice unordered (class plain (range 0 9)) (literal _))))) (optional (seq (class plain (char e) (char E)) (optional (literal -)) (repeat1 (choice unordered (class plain (range 0 9)) (literal _)))))))) (alias unnamed_token (token (seq (literal .) (repeat1 (choice unordered (class plain (range 0 9)) (literal _))) (optional (seq (class plain (char e) (char E)) (optional (literal -)) (repeat1 (choice unordered (class plain (range 0 9)) (literal _))))))))) (concept grammar.decimal-number) (source-names (tree-sitter _decimal_number)))
(rule hex_number silent (precedence 10 none (alias unnamed_token (token (seq (literal 0) (class plain (char x) (char X)) (repeat1 (seq (class plain (range a f) (range A F) (range 0 9)) (optional (class plain (range a f) (range A F) (range 0 9))) (optional (literal _)))))))) (concept grammar.hex-number) (source-names (tree-sitter _hex_number)))
(rule hex_digit token (seq (class plain (range a f) (range A F) (range 0 9)) (class plain (range a f) (range A F) (range 0 9))) (concept grammar.hexadecimal-digit) (source-names (tree-sitter _hex_digit)))
(rule number_unit normal (choice unordered (token (seq (literal wei) (not (ref word_characters)))) (token (seq (literal szabo) (not (ref word_characters)))) (token (seq (literal finney) (not (ref word_characters)))) (token (seq (literal gwei) (not (ref word_characters)))) (token (seq (literal ether) (not (ref word_characters)))) (token (seq (literal seconds) (not (ref word_characters)))) (token (seq (literal minutes) (not (ref word_characters)))) (token (seq (literal hours) (not (ref word_characters)))) (token (seq (literal days) (not (ref word_characters)))) (token (seq (literal weeks) (not (ref word_characters)))) (token (seq (literal years) (not (ref word_characters))))) (concept grammar.number-unit))
(rule true normal (token (seq (literal true) (not (ref word_characters)))) (concept grammar.true-value))
(rule false normal (token (seq (literal false) (not (ref word_characters)))) (concept grammar.false-value))
(rule boolean_literal normal (choice unordered (ref true) (ref false)) (concept grammar.boolean-literal))
(rule hex_string_literal normal (precedence 0 left (repeat1 (seq (token (seq (literal hex) (not (ref word_characters)))) (choice unordered (seq (literal %22) (optional (seq (ref hex_digit) (repeat0 (seq (optional (literal _)) (ref hex_digit))))) (literal %22)) (seq (literal %27) (optional (seq (ref hex_digit) (repeat0 (seq (optional (literal _)) (ref hex_digit))))) (literal %27)))))) (concept grammar.hex-string-literal))
(rule escape_sequence silent (alias unnamed_token (immediateToken (seq (literal %5C) (choice unordered (class negated (char x) (char u) (range 0 7)) (repeat 1 3 (class plain (range 0 7))) (seq (literal x) (repeat 2 2 (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%7B) (repeat1 (class plain (range 0 9) (range a f) (range A F))) (literal %7D)))))) (concept grammar.escape-sequence) (source-names (tree-sitter _escape_sequence)))
(rule single_quoted_unicode_character silent (alias unnamed_token (immediateToken (lexicalPrecedence 2 (choice unordered (repeat1 (class negated (char %27) (char %5C) (char %0A))) (seq (literal %5C) (optional (literal %0D)) (literal %0A)))))) (concept grammar.single-quoted-unicode-character) (source-names (tree-sitter _single_quoted_unicode_char)))
(rule double_quoted_unicode_character silent (alias unnamed_token (immediateToken (lexicalPrecedence 2 (choice unordered (repeat1 (class negated (char %22) (char %5C) (char %0A))) (seq (literal %5C) (optional (literal %0D)) (literal %0A)))))) (concept grammar.double-quoted-unicode-character) (source-names (tree-sitter _double_quoted_unicode_char)))
(rule unicode_string_literal normal (precedence 0 left (repeat1 (seq (token (seq (literal unicode) (not (ref word_characters)))) (choice unordered (seq (literal %22) (repeat0 (ref double_quoted_unicode_character)) (literal %22)) (seq (literal %27) (repeat0 (ref single_quoted_unicode_character)) (literal %27)))))) (concept grammar.unicode-string-literal))
(rule string normal (choice unordered (seq (literal %22) (repeat0 (choice unordered (ref string_immediate_element_inside_double_quote) (ref escape_sequence))) (literal %22)) (seq (literal %27) (repeat0 (choice unordered (ref string_immediate_element_inside_quote) (ref escape_sequence))) (literal %27))) (concept grammar.string))
(rule string_immediate_element_inside_double_quote silent (alias unnamed_token (immediateToken (lexicalPrecedence 2 (choice unordered (repeat1 (class negated (char %22) (char %5C) (char %0A))) (seq (literal %5C) (optional (literal %0D)) (literal %0A)))))) (concept grammar.string-immediate-element-inside-double-quote) (source-names (tree-sitter _string_immediate_elt_inside_double_quote)))
(rule string_immediate_element_inside_quote silent (alias unnamed_token (immediateToken (lexicalPrecedence 2 (choice unordered (repeat1 (class negated (char %27) (char %5C) (char %0A))) (seq (literal %5C) (optional (literal %0D)) (literal %0A)))))) (concept grammar.string-immediate-element-inside-quote) (source-names (tree-sitter _string_immediate_elt_inside_quote)))
(rule comment token (lexicalPrecedence 1 (choice unordered (seq (literal %2F%2F) (repeat0 (class negated (char %0D) (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 (range a z) (range A Z) (char %24) (char _)) (repeat0 (class plain (range a z) (range A Z) (range 0 9) (char %24) (char _)))) (concept grammar.word-characters))