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 (class plain (char %20) (char %09) (char %0A) (char %0D) (char %0C) (char %0B) (char %EF%BB%BF) (char %09) (char %20) (char %0A) (char %0D)))
(extra (ref comma))
(extra (ref comment))
(rule source_file normal (ref document) (concept grammar.source-file))
(rule document normal (repeat1 (ref definition)) (concept grammar.document))
(rule definition normal (choice unordered (ref executable_definition) (ref type_system_definition) (ref type_system_extension)) (concept grammar.definition))
(rule executable_definition normal (choice unordered (ref operation_definition) (ref fragment_definition)) (concept grammar.executable-definition))
(rule type_system_definition normal (choice unordered (ref schema_definition) (ref type_definition) (ref directive_definition)) (concept grammar.type-system-definition))
(rule type_system_extension normal (choice unordered (ref schema_extension) (ref type_extension)) (concept grammar.type-system-extension))
(rule schema_definition normal (seq (optional (ref description)) (literal schema) (optional (ref directives)) (literal %7B) (repeat1 (ref root_operation_type_definition)) (literal %7D)) (concept grammar.schema-definition))
(rule schema_extension normal (seq (literal extend) (literal schema) (optional (ref directives)) (literal %7B) (ref root_operation_type_definition) (literal %7D)) (concept grammar.schema-extension))
(rule type_extension normal (choice unordered (ref scalar_type_extension) (ref object_type_extension) (ref interface_type_extension) (ref union_type_extension) (ref enumeration_type_extension) (ref input_object_type_extension)) (concept grammar.type-extension))
(rule scalar_type_extension normal (seq (literal extend) (literal scalar) (ref name) (ref directives)) (concept grammar.scalar-type-extension))
(rule object_type_extension normal (precedence 0 right (choice unordered (seq (literal extend) (literal type) (ref name) (optional (ref implements_interfaces)) (optional (ref directives)) (ref fields_definition)) (seq (literal extend) (literal type) (ref name) (optional (ref implements_interfaces)) (optional (ref directives))))) (concept grammar.object-type-extension))
(rule interface_type_extension normal (precedence 0 right (choice unordered (seq (literal extend) (literal interface) (ref name) (optional (ref implements_interfaces)) (optional (ref directives)) (ref fields_definition)) (seq (literal extend) (literal interface) (ref name) (optional (ref implements_interfaces)) (optional (ref directives))))) (concept grammar.interface-type-extension))
(rule union_type_extension normal (precedence 0 right (choice unordered (seq (literal extend) (literal union) (ref name) (optional (ref directives)) (ref union_member_types)) (seq (literal extend) (literal union) (ref name) (optional (ref directives))))) (concept grammar.union-type-extension))
(rule enumeration_type_extension normal (precedence 0 right (choice unordered (seq (literal extend) (literal enum) (ref name) (optional (ref directives)) (ref enumeration_values_definition)) (seq (literal extend) (literal enum) (ref name) (optional (ref directives))))) (concept grammar.enumeration-type-extension) (source-names (tree-sitter enum_type_extension)))
(rule input_object_type_extension normal (precedence 0 right (choice unordered (seq (literal extend) (literal input) (ref name) (optional (ref directives)) (repeat1 (ref input_fields_definition))) (seq (literal extend) (literal input) (ref name) (optional (ref directives))))) (concept grammar.input-object-type-extension))
(rule input_fields_definition normal (seq (literal %7B) (repeat1 (ref input_value_definition)) (literal %7D)) (concept grammar.input-fields-definition))
(rule enumeration_values_definition normal (seq (literal %7B) (repeat1 (ref enumeration_value_definition)) (literal %7D)) (concept grammar.enumeration-value-definition-list) (source-names (tree-sitter enum_values_definition)))
(rule enumeration_value_definition normal (seq (optional (ref description)) (ref enumeration_value) (optional (ref directives))) (concept grammar.enumeration-value-definition) (source-names (tree-sitter enum_value_definition)))
(rule implements_interfaces normal (choice unordered (seq (ref implements_interfaces) (literal %26) (ref named_type)) (seq (literal implements) (optional (literal %26)) (ref named_type))) (concept grammar.implements-interfaces))
(rule fields_definition normal (seq (literal %7B) (repeat1 (ref field_definition)) (literal %7D)) (concept grammar.field-definition-list))
(rule field_definition normal (seq (optional (ref description)) (ref name) (optional (ref arguments_definition)) (literal %3A) (ref type) (optional (ref directives))) (concept grammar.field-definition))
(rule arguments_definition normal (seq (literal %28) (repeat1 (ref input_value_definition)) (literal %29)) (concept grammar.arguments-definition))
(rule input_value_definition normal (seq (optional (ref description)) (ref name) (literal %3A) (ref type) (optional (ref default_value)) (optional (ref directives))) (concept grammar.input-value-definition))
(rule default_value normal (seq (literal %3D) (ref value)) (concept grammar.default-value))
(rule union_member_types normal (choice unordered (seq (ref union_member_types) (literal %7C) (ref named_type)) (seq (literal %3D) (optional (literal %7C)) (ref named_type))) (concept grammar.union-member-types))
(rule root_operation_type_definition normal (seq (ref operation_type) (literal %3A) (ref named_type)) (concept grammar.root-operation-type-definition))
(rule operation_definition normal (choice unordered (ref selection_set) (seq (ref operation_type) (optional (ref name)) (optional (ref variable_definitions)) (optional (ref directives)) (ref selection_set))) (concept grammar.operation-definition))
(rule operation_type normal (choice unordered (literal query) (literal mutation) (literal subscription)) (concept grammar.operation-type))
(rule type_definition normal (choice unordered (ref scalar_type_definition) (ref object_type_definition) (ref interface_type_definition) (ref union_type_definition) (ref enumeration_type_definition) (ref input_object_type_definition)) (concept grammar.type-definition))
(rule scalar_type_definition normal (precedence 0 right (seq (optional (ref description)) (literal scalar) (ref name) (optional (ref directives)))) (concept grammar.scalar-type-definition))
(rule object_type_definition normal (precedence 0 right (seq (optional (ref description)) (literal type) (ref name) (optional (ref implements_interfaces)) (optional (ref directives)) (optional (ref fields_definition)))) (concept grammar.object-type-definition))
(rule interface_type_definition normal (precedence 0 right (seq (optional (ref description)) (literal interface) (ref name) (optional (ref implements_interfaces)) (optional (ref directives)) (optional (ref fields_definition)))) (concept grammar.interface-type-definition))
(rule union_type_definition normal (precedence 0 right (seq (optional (ref description)) (literal union) (ref name) (optional (ref directives)) (optional (ref union_member_types)))) (concept grammar.union-type-definition))
(rule enumeration_type_definition normal (precedence 0 right (seq (optional (ref description)) (literal enum) (ref name) (optional (ref directives)) (optional (ref enumeration_values_definition)))) (concept grammar.enumeration-type-definition) (source-names (tree-sitter enum_type_definition)))
(rule input_object_type_definition normal (precedence 0 right (seq (optional (ref description)) (literal input) (ref name) (optional (ref directives)) (optional (ref input_fields_definition)))) (concept grammar.input-object-type-definition))
(rule variable_definitions normal (seq (literal %28) (repeat1 (ref variable_definition)) (literal %29)) (concept grammar.variable-definition-list))
(rule variable_definition normal (seq (ref variable) (literal %3A) (ref type) (optional (ref default_value)) (optional (ref directives)) (optional (ref comma))) (concept grammar.variable-definition))
(rule selection_set normal (seq (literal %7B) (repeat1 (ref selection)) (literal %7D)) (concept grammar.selection-set))
(rule selection normal (choice unordered (ref field) (ref inline_fragment) (ref fragment_spread)) (concept grammar.selection-set-member))
(rule field normal (seq (optional (ref alias)) (ref name) (optional (ref arguments)) (optional (ref directive)) (optional (ref selection_set))) (concept grammar.field))
(rule alias normal (seq (ref name) (literal %3A)) (concept grammar.alias))
(rule arguments normal (seq (literal %28) (repeat1 (ref argument)) (literal %29)) (concept grammar.argument-list))
(rule argument normal (seq (ref name) (literal %3A) (ref value)) (concept argument))
(rule value normal (choice unordered (ref variable) (ref string_value) (ref integer_value) (ref float_value) (ref boolean_value) (ref null_value) (ref enumeration_value) (ref list_value) (ref object_value)) (concept grammar.value))
(rule variable normal (seq (literal %24) (ref name)) (concept grammar.variable))
(rule string_value token (choice unordered (seq (literal %22%22%22) (repeat0 (choice unordered (class negated (char %22)) (literal %0A) (seq (literal %22) (optional (literal %22)) (class negated (char %22))))) (literal %22%22%22)) (seq (literal %22) (repeat0 (class negated (char %22) (char %5C) (char %0A))) (literal %22))) (concept grammar.string))
(rule integer_value token (seq (optional (literal -)) (choice unordered (literal 0) (seq (class plain (range 1 9)) (repeat0 (class plain (range 0 9)))))) (concept grammar.integer-literal) (source-names (tree-sitter int_value)))
(rule float_value token (seq (seq (optional (literal -)) (choice unordered (literal 0) (seq (class plain (range 1 9)) (repeat0 (class plain (range 0 9)))))) (choice unordered (seq (literal .) (repeat1 (class plain (range 0 9)))) (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (repeat1 (class plain (range 0 9)))) (seq (seq (literal .) (repeat1 (class plain (range 0 9)))) (seq (choice unordered (literal e) (literal E)) (optional (choice unordered (literal %2B) (literal -))) (repeat1 (class plain (range 0 9))))))) (concept grammar.float-literal))
(rule boolean_value normal (choice unordered (literal true) (literal false)) (concept grammar.boolean-value))
(rule null_value token (literal null) (concept grammar.null))
(rule enumeration_value normal (ref name) (concept grammar.enumeration-value) (source-names (tree-sitter enum_value)))
(rule list_value normal (seq (literal %5B) (repeat0 (ref value)) (literal %5D)) (concept grammar.list))
(rule object_value normal (seq (literal %7B) (repeat0 (ref object_field)) (literal %7D)) (concept grammar.object))
(rule object_field normal (seq (ref name) (literal %3A) (ref value) (optional (ref comma))) (concept grammar.member))
(rule fragment_spread normal (seq (literal ...) (ref fragment_name) (optional (ref directives))) (concept grammar.fragment-spread))
(rule fragment_definition normal (seq (literal fragment) (ref fragment_name) (ref type_condition) (optional (ref directives)) (ref selection_set)) (concept grammar.fragment-definition))
(rule fragment_name normal (ref name) (concept grammar.fragment-name))
(rule inline_fragment normal (seq (literal ...) (optional (ref type_condition)) (optional (ref directives)) (ref selection_set)) (concept grammar.inline-fragment))
(rule type_condition normal (seq (literal on) (ref named_type)) (concept grammar.type-condition))
(rule directives normal (repeat1 (ref directive)) (concept grammar.directive-list))
(rule directive normal (seq (literal %40) (ref name) (optional (ref arguments))) (concept grammar.directive))
(rule directive_definition normal (precedence 1 right (seq (optional (ref description)) (literal directive) (literal %40) (ref name) (optional (ref arguments_definition)) (optional (literal repeatable)) (literal on) (ref directive_locations))) (concept grammar.directive-definition))
(rule directive_locations normal (choice unordered (seq (ref directive_locations) (literal %7C) (ref directive_location)) (seq (optional (literal %7C)) (ref directive_location))) (concept grammar.directive-location-list))
(rule directive_location normal (choice unordered (ref executable_directive_location) (ref type_system_directive_location)) (concept grammar.directive-location))
(rule executable_directive_location normal (choice unordered (literal QUERY) (literal MUTATION) (literal SUBSCRIPTION) (literal FIELD) (literal FRAGMENT_DEFINITION) (literal FRAGMENT_SPREAD) (literal INLINE_FRAGMENT) (literal VARIABLE_DEFINITION)) (concept grammar.executable-directive-location))
(rule type_system_directive_location normal (choice unordered (literal SCHEMA) (literal SCALAR) (literal OBJECT) (literal FIELD_DEFINITION) (literal ARGUMENT_DEFINITION) (literal INTERFACE) (literal UNION) (literal ENUM) (literal ENUM_VALUE) (literal INPUT_OBJECT) (literal INPUT_FIELD_DEFINITION)) (concept grammar.type-system-directive-location))
(rule type normal (choice unordered (ref named_type) (ref list_type) (ref non_null_type)) (concept grammar.type))
(rule named_type normal (ref name) (concept grammar.named-type))
(rule list_type normal (seq (literal %5B) (ref type) (literal %5D)) (concept grammar.list-type))
(rule non_null_type normal (choice unordered (seq (ref named_type) (literal %21)) (seq (ref list_type) (literal %21))) (concept grammar.non-null-type))
(rule name token (seq (class plain (char _) (range A Z) (range a z)) (repeat0 (class plain (char _) (range 0 9) (range A Z) (range a z)))) (concept grammar.name))
(rule comment token (seq (literal %23) (repeat0 (class negated (char %0A)))) (concept grammar.comment))
(rule comma token (literal %2C) (concept grammar.comma))
(rule description normal (ref string_value) (concept grammar.description))