From 3e08dbeeb939375868864a4c40e0d615501124fb Mon Sep 17 00:00:00 2001 From: hewigovens <360470+hewigovens@users.noreply.github.com> Date: Wed, 25 Nov 2026 21:32:05 +0900 Subject: [PATCH] build(jj-diff): depend on the tree-sitter-fluent crate instead of vendoring the grammar The grammar is now published from our fluent-tooling fork, so jj-diff stays publishable without a git dependency. Its license reaches the bundles through cargo-about like other grammar crates. --- Cargo.lock | 13 +- Cargo.toml | 2 +- crates/jj-diff/Cargo.toml | 7 +- crates/jj-diff/build.rs | 15 - crates/jj-diff/grammars/fluent/LICENSE | 19 - crates/jj-diff/grammars/fluent/README.md | 1 - crates/jj-diff/grammars/fluent/highlights.scm | 82 - crates/jj-diff/grammars/fluent/src/parser.c | 3364 ----------------- crates/jj-diff/grammars/fluent/src/scanner.c | 378 -- .../grammars/fluent/src/tree_sitter/alloc.h | 54 - .../grammars/fluent/src/tree_sitter/array.h | 330 -- .../grammars/fluent/src/tree_sitter/parser.h | 286 -- crates/jj-diff/src/syntax.rs | 4 +- crates/jj-diff/src/syntax/fluent.rs | 8 - dist/appimage/build.sh | 1 - dist/windows/build.ps1 | 1 - scripts/grammar-wasm.sh | 6 +- scripts/macos/build.sh | 1 - scripts/web-grammars.sh | 9 +- 19 files changed, 20 insertions(+), 4561 deletions(-) delete mode 100644 crates/jj-diff/grammars/fluent/LICENSE delete mode 100644 crates/jj-diff/grammars/fluent/README.md delete mode 100644 crates/jj-diff/grammars/fluent/highlights.scm delete mode 100644 crates/jj-diff/grammars/fluent/src/parser.c delete mode 100644 crates/jj-diff/grammars/fluent/src/scanner.c delete mode 100644 crates/jj-diff/grammars/fluent/src/tree_sitter/alloc.h delete mode 100644 crates/jj-diff/grammars/fluent/src/tree_sitter/array.h delete mode 100644 crates/jj-diff/grammars/fluent/src/tree_sitter/parser.h delete mode 100644 crates/jj-diff/src/syntax/fluent.rs diff --git a/Cargo.lock b/Cargo.lock index b8a3e34f2..36d4560ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5007,7 +5007,6 @@ dependencies = [ name = "jj-diff" version = "0.1.1" dependencies = [ - "cc", "flate2", "hex", "hotpath", @@ -5025,6 +5024,7 @@ dependencies = [ "tree-sitter-css", "tree-sitter-dart", "tree-sitter-fish", + "tree-sitter-fluent", "tree-sitter-go", "tree-sitter-highlight", "tree-sitter-html", @@ -5033,7 +5033,6 @@ dependencies = [ "tree-sitter-javascript", "tree-sitter-json", "tree-sitter-kotlin-sg", - "tree-sitter-language", "tree-sitter-lua", "tree-sitter-make", "tree-sitter-md", @@ -8811,6 +8810,16 @@ dependencies = [ "tree-sitter", ] +[[package]] +name = "tree-sitter-fluent" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd927a3f3d838158d544f262af1c615fcadb0ea8689c8182a5ee931578ddf630" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "tree-sitter-go" version = "0.25.0" diff --git a/Cargo.toml b/Cargo.toml index 2de93111a..921f05847 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,10 +104,10 @@ tree-sitter-containerfile = "0.9" tree-sitter-dart = "0.3" tree-sitter-proto = "0.6" tree-sitter-r = "1.3" +tree-sitter-fluent = "0.1.1" tree-sitter-language = "0.1" # Pinned to the wasmtime tree-sitter's wasm feature resolves, so feature unification turns on Pulley in that copy. wasmtime = { version = "=48.0.10", default-features = false, features = ["pulley"] } -cc = "1.2" [profile.dev] debug = "line-tables-only" diff --git a/crates/jj-diff/Cargo.toml b/crates/jj-diff/Cargo.toml index bbb8f5b9a..9e6feaf3e 100644 --- a/crates/jj-diff/Cargo.toml +++ b/crates/jj-diff/Cargo.toml @@ -66,7 +66,7 @@ lang-css = ["dep:tree-sitter-css", "syntax"] lang-dart = ["wasm-grammars"] lang-dockerfile = ["wasm-grammars"] lang-fish = ["dep:tree-sitter-fish", "syntax"] -lang-fluent = ["dep:tree-sitter-language", "syntax"] +lang-fluent = ["dep:tree-sitter-fluent", "syntax"] lang-go = ["dep:tree-sitter-go", "syntax"] lang-html = ["dep:tree-sitter-html", "syntax"] lang-ini = ["dep:tree-sitter-ini", "syntax"] @@ -153,13 +153,10 @@ tree-sitter-batch = { workspace = true, optional = true } tree-sitter-ini = { workspace = true, optional = true } tree-sitter-cmake = { workspace = true, optional = true } tree-sitter-lua = { workspace = true, optional = true } -tree-sitter-language = { workspace = true, optional = true } +tree-sitter-fluent = { workspace = true, optional = true } tree-sitter = { workspace = true, features = ["wasm"], optional = true } wasmtime = { workspace = true, optional = true } flate2 = { workspace = true, optional = true } -[build-dependencies] -cc = { workspace = true } - [lints] workspace = true diff --git a/crates/jj-diff/build.rs b/crates/jj-diff/build.rs index f3bf688de..039b70cdb 100644 --- a/crates/jj-diff/build.rs +++ b/crates/jj-diff/build.rs @@ -7,19 +7,4 @@ fn main() { if std::env::var_os("CARGO_FEATURE_WASM_GRAMMARS").is_some() { println!("cargo::rustc-cfg=wasm_grammars"); } - if std::env::var_os("CARGO_FEATURE_LANG_FLUENT").is_none() { - return; - } - let src = std::path::Path::new("grammars/fluent/src"); - println!("cargo:rerun-if-changed={}", src.display()); - let mut build = cc::Build::new(); - build - .std("c11") - .include(src) - .file(src.join("parser.c")) - .file(src.join("scanner.c")); - if std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") { - build.flag("-utf-8"); - } - build.compile("tree-sitter-fluent"); } diff --git a/crates/jj-diff/grammars/fluent/LICENSE b/crates/jj-diff/grammars/fluent/LICENSE deleted file mode 100644 index 072beae5a..000000000 --- a/crates/jj-diff/grammars/fluent/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -MIT License - -Copyright (c) 2017-present David Rios -Copyright (c) 2026 Casey Link - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO -EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/crates/jj-diff/grammars/fluent/README.md b/crates/jj-diff/grammars/fluent/README.md deleted file mode 100644 index 59acb8370..000000000 --- a/crates/jj-diff/grammars/fluent/README.md +++ /dev/null @@ -1 +0,0 @@ -Vendored from [outskirtslabs/fluent-tooling](https://github.com/outskirtslabs/fluent-tooling) at `cb95e082c5a1fbef06e42bbc27a03a191720278c` (`src/parser.c`, `src/scanner.c`, `src/tree_sitter/`, `queries/highlights.scm`, `LICENSE`) because the grammar is not on crates.io. Update by copying those files from a newer commit. diff --git a/crates/jj-diff/grammars/fluent/highlights.scm b/crates/jj-diff/grammars/fluent/highlights.scm deleted file mode 100644 index 19f53aaba..000000000 --- a/crates/jj-diff/grammars/fluent/highlights.scm +++ /dev/null @@ -1,82 +0,0 @@ -(comment_block) @comment - -(file_comment) @comment.file - -(group_comment) @comment.group - -(doc_comment_block) @comment.documentation - -(number_literal) @number - -(string_literal) @string - -(escaped_literal) @string.escape - -(message - id: (identifier) @tag) - -(message_reference - id: (identifier) @tag) - -(message_reference - attribute: (identifier) @tag.attribute) - -(message - (attributes - (attribute - id: (identifier) @tag.attribute))) - -(term_reference - attribute: (identifier) @function.macro) - -(term_identifier) @function.macro - -(term - (attributes - (attribute - id: (identifier) @function.macro))) - -(variable) @variable.parameter - -(selector_variant - key: (identifier) @property) - -(default_variant - key: (identifier) @property) - -(default_variant - "*" @punctuation.special) - -(function_reference - id: (function_name) @function) - -((function_reference - id: (function_name) @function.builtin) - (#match? @function.builtin "^(NUMBER|DATETIME)$")) - -(named_argument - id: (identifier) @variable.parameter) - -[ - "[" - "]" - "(" - ")" - "{" - "}" -] @punctuation.bracket - -(placeable - "{" @punctuation.special - "}" @punctuation.special) - -[ - "=" - "->" - ":" -] @operator - -[ - "." - "," -] @punctuation.delimiter diff --git a/crates/jj-diff/grammars/fluent/src/parser.c b/crates/jj-diff/grammars/fluent/src/parser.c deleted file mode 100644 index 273c0c475..000000000 --- a/crates/jj-diff/grammars/fluent/src/parser.c +++ /dev/null @@ -1,3364 +0,0 @@ -/* Automatically @generated by tree-sitter */ - -#include "tree_sitter/parser.h" - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic ignored "-Wmissing-field-initializers" -#endif - -#define LANGUAGE_VERSION 15 -#define STATE_COUNT 170 -#define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 72 -#define ALIAS_COUNT 4 -#define TOKEN_COUNT 36 -#define EXTERNAL_TOKEN_COUNT 9 -#define FIELD_COUNT 5 -#define MAX_ALIAS_SEQUENCE_LENGTH 5 -#define MAX_RESERVED_WORD_SET_SIZE 0 -#define PRODUCTION_ID_COUNT 17 -#define SUPERTYPE_COUNT 0 - -enum ts_symbol_identifiers { - sym__base_comment = 1, - sym__group_comment_line = 2, - sym__file_comment_line = 3, - anon_sym_EQ = 4, - anon_sym_DOT = 5, - sym_identifier = 6, - anon_sym_DASH = 7, - anon_sym_DOLLAR = 8, - aux_sym_positional_arguments_token1 = 9, - aux_sym_named_argument_token1 = 10, - aux_sym_function_call_token1 = 11, - aux_sym_function_call_token2 = 12, - aux_sym_function_reference_token1 = 13, - aux_sym_selector_variant_token1 = 14, - aux_sym_selector_variant_token2 = 15, - anon_sym_STAR = 16, - aux_sym_selectors_token1 = 17, - anon_sym_RBRACE = 18, - aux_sym_placeable_token1 = 19, - aux_sym_placeable_token2 = 20, - sym_number_literal = 21, - anon_sym_DQUOTE = 22, - aux_sym_string_literal_token1 = 23, - sym_escaped_literal = 24, - sym__s = 25, - sym__ws = 26, - sym__pattern_start = 27, - sym_pure_text = 28, - sym__pattern_end = 29, - sym__pattern_skip = 30, - sym__blank_lines = 31, - sym_unfinished_line = 32, - sym__close_comment_block = 33, - sym__end_positional_args = 34, - sym__error_sentinel = 35, - sym_fluent_file = 36, - aux_sym__comment_block = 37, - sym_comment_block = 38, - sym_group_comment = 39, - sym_file_comment = 40, - sym_doc_commented = 41, - sym_message = 42, - sym_attribute = 43, - sym_term = 44, - sym_term_identifier = 45, - sym_variable = 46, - sym_pattern = 47, - sym_positional_arguments = 48, - sym_named_argument = 49, - sym_named_arguments = 50, - sym_function_call = 51, - sym_function_reference = 52, - sym_message_reference = 53, - sym_term_reference = 54, - sym__expression = 55, - sym_selector_expression = 56, - sym__selector_key = 57, - sym_selector_variant = 58, - sym_default_variant = 59, - sym_selectors = 60, - sym_placeable = 61, - sym_string_literal = 62, - aux_sym_fluent_file_repeat1 = 63, - aux_sym_group_comment_repeat1 = 64, - aux_sym_file_comment_repeat1 = 65, - aux_sym_message_repeat1 = 66, - aux_sym_pattern_repeat1 = 67, - aux_sym_positional_arguments_repeat1 = 68, - aux_sym_named_arguments_repeat1 = 69, - aux_sym_selectors_repeat1 = 70, - aux_sym_string_literal_repeat1 = 71, - alias_sym_attributes = 72, - alias_sym_doc_comment_block = 73, - anon_alias_sym_identifier = 74, - alias_sym_inline_placeable = 75, -}; - -static const char * const ts_symbol_names[] = { - [ts_builtin_sym_end] = "end", - [sym__base_comment] = "_base_comment", - [sym__group_comment_line] = "_group_comment_line", - [sym__file_comment_line] = "_file_comment_line", - [anon_sym_EQ] = "=", - [anon_sym_DOT] = ".", - [sym_identifier] = "identifier", - [anon_sym_DASH] = "-", - [anon_sym_DOLLAR] = "$", - [aux_sym_positional_arguments_token1] = ",", - [aux_sym_named_argument_token1] = ":", - [aux_sym_function_call_token1] = "(", - [aux_sym_function_call_token2] = ")", - [aux_sym_function_reference_token1] = "function_name", - [aux_sym_selector_variant_token1] = "[", - [aux_sym_selector_variant_token2] = "]", - [anon_sym_STAR] = "*", - [aux_sym_selectors_token1] = "->", - [anon_sym_RBRACE] = "}", - [aux_sym_placeable_token1] = "{", - [aux_sym_placeable_token2] = "}", - [sym_number_literal] = "number_literal", - [anon_sym_DQUOTE] = "\"", - [aux_sym_string_literal_token1] = "string_literal_token1", - [sym_escaped_literal] = "escaped_literal", - [sym__s] = "_s", - [sym__ws] = "_ws", - [sym__pattern_start] = "_pattern_start", - [sym_pure_text] = "pure_text", - [sym__pattern_end] = "_pattern_end", - [sym__pattern_skip] = "_pattern_skip", - [sym__blank_lines] = "_blank_lines", - [sym_unfinished_line] = "unfinished_line", - [sym__close_comment_block] = "_close_comment_block", - [sym__end_positional_args] = ",", - [sym__error_sentinel] = "_error_sentinel", - [sym_fluent_file] = "fluent_file", - [aux_sym__comment_block] = "_comment_block", - [sym_comment_block] = "comment_block", - [sym_group_comment] = "group_comment", - [sym_file_comment] = "file_comment", - [sym_doc_commented] = "doc_commented", - [sym_message] = "message", - [sym_attribute] = "attribute", - [sym_term] = "term", - [sym_term_identifier] = "term_identifier", - [sym_variable] = "variable", - [sym_pattern] = "pattern", - [sym_positional_arguments] = "positional_arguments", - [sym_named_argument] = "named_argument", - [sym_named_arguments] = "named_arguments", - [sym_function_call] = "function_call", - [sym_function_reference] = "function_reference", - [sym_message_reference] = "message_reference", - [sym_term_reference] = "term_reference", - [sym__expression] = "_expression", - [sym_selector_expression] = "selector_expression", - [sym__selector_key] = "_selector_key", - [sym_selector_variant] = "selector_variant", - [sym_default_variant] = "default_variant", - [sym_selectors] = "selectors", - [sym_placeable] = "placeable", - [sym_string_literal] = "string_literal", - [aux_sym_fluent_file_repeat1] = "fluent_file_repeat1", - [aux_sym_group_comment_repeat1] = "group_comment_repeat1", - [aux_sym_file_comment_repeat1] = "file_comment_repeat1", - [aux_sym_message_repeat1] = "message_repeat1", - [aux_sym_pattern_repeat1] = "pattern_repeat1", - [aux_sym_positional_arguments_repeat1] = "positional_arguments_repeat1", - [aux_sym_named_arguments_repeat1] = "named_arguments_repeat1", - [aux_sym_selectors_repeat1] = "selectors_repeat1", - [aux_sym_string_literal_repeat1] = "string_literal_repeat1", - [alias_sym_attributes] = "attributes", - [alias_sym_doc_comment_block] = "doc_comment_block", - [anon_alias_sym_identifier] = "identifier", - [alias_sym_inline_placeable] = "inline_placeable", -}; - -static const TSSymbol ts_symbol_map[] = { - [ts_builtin_sym_end] = ts_builtin_sym_end, - [sym__base_comment] = sym__base_comment, - [sym__group_comment_line] = sym__group_comment_line, - [sym__file_comment_line] = sym__file_comment_line, - [anon_sym_EQ] = anon_sym_EQ, - [anon_sym_DOT] = anon_sym_DOT, - [sym_identifier] = sym_identifier, - [anon_sym_DASH] = anon_sym_DASH, - [anon_sym_DOLLAR] = anon_sym_DOLLAR, - [aux_sym_positional_arguments_token1] = sym__end_positional_args, - [aux_sym_named_argument_token1] = aux_sym_named_argument_token1, - [aux_sym_function_call_token1] = aux_sym_function_call_token1, - [aux_sym_function_call_token2] = aux_sym_function_call_token2, - [aux_sym_function_reference_token1] = aux_sym_function_reference_token1, - [aux_sym_selector_variant_token1] = aux_sym_selector_variant_token1, - [aux_sym_selector_variant_token2] = aux_sym_selector_variant_token2, - [anon_sym_STAR] = anon_sym_STAR, - [aux_sym_selectors_token1] = aux_sym_selectors_token1, - [anon_sym_RBRACE] = anon_sym_RBRACE, - [aux_sym_placeable_token1] = aux_sym_placeable_token1, - [aux_sym_placeable_token2] = anon_sym_RBRACE, - [sym_number_literal] = sym_number_literal, - [anon_sym_DQUOTE] = anon_sym_DQUOTE, - [aux_sym_string_literal_token1] = aux_sym_string_literal_token1, - [sym_escaped_literal] = sym_escaped_literal, - [sym__s] = sym__s, - [sym__ws] = sym__ws, - [sym__pattern_start] = sym__pattern_start, - [sym_pure_text] = sym_pure_text, - [sym__pattern_end] = sym__pattern_end, - [sym__pattern_skip] = sym__pattern_skip, - [sym__blank_lines] = sym__blank_lines, - [sym_unfinished_line] = sym_unfinished_line, - [sym__close_comment_block] = sym__close_comment_block, - [sym__end_positional_args] = sym__end_positional_args, - [sym__error_sentinel] = sym__error_sentinel, - [sym_fluent_file] = sym_fluent_file, - [aux_sym__comment_block] = aux_sym__comment_block, - [sym_comment_block] = sym_comment_block, - [sym_group_comment] = sym_group_comment, - [sym_file_comment] = sym_file_comment, - [sym_doc_commented] = sym_doc_commented, - [sym_message] = sym_message, - [sym_attribute] = sym_attribute, - [sym_term] = sym_term, - [sym_term_identifier] = sym_term_identifier, - [sym_variable] = sym_variable, - [sym_pattern] = sym_pattern, - [sym_positional_arguments] = sym_positional_arguments, - [sym_named_argument] = sym_named_argument, - [sym_named_arguments] = sym_named_arguments, - [sym_function_call] = sym_function_call, - [sym_function_reference] = sym_function_reference, - [sym_message_reference] = sym_message_reference, - [sym_term_reference] = sym_term_reference, - [sym__expression] = sym__expression, - [sym_selector_expression] = sym_selector_expression, - [sym__selector_key] = sym__selector_key, - [sym_selector_variant] = sym_selector_variant, - [sym_default_variant] = sym_default_variant, - [sym_selectors] = sym_selectors, - [sym_placeable] = sym_placeable, - [sym_string_literal] = sym_string_literal, - [aux_sym_fluent_file_repeat1] = aux_sym_fluent_file_repeat1, - [aux_sym_group_comment_repeat1] = aux_sym_group_comment_repeat1, - [aux_sym_file_comment_repeat1] = aux_sym_file_comment_repeat1, - [aux_sym_message_repeat1] = aux_sym_message_repeat1, - [aux_sym_pattern_repeat1] = aux_sym_pattern_repeat1, - [aux_sym_positional_arguments_repeat1] = aux_sym_positional_arguments_repeat1, - [aux_sym_named_arguments_repeat1] = aux_sym_named_arguments_repeat1, - [aux_sym_selectors_repeat1] = aux_sym_selectors_repeat1, - [aux_sym_string_literal_repeat1] = aux_sym_string_literal_repeat1, - [alias_sym_attributes] = alias_sym_attributes, - [alias_sym_doc_comment_block] = alias_sym_doc_comment_block, - [anon_alias_sym_identifier] = anon_alias_sym_identifier, - [alias_sym_inline_placeable] = alias_sym_inline_placeable, -}; - -static const TSSymbolMetadata ts_symbol_metadata[] = { - [ts_builtin_sym_end] = { - .visible = false, - .named = true, - }, - [sym__base_comment] = { - .visible = false, - .named = true, - }, - [sym__group_comment_line] = { - .visible = false, - .named = true, - }, - [sym__file_comment_line] = { - .visible = false, - .named = true, - }, - [anon_sym_EQ] = { - .visible = true, - .named = false, - }, - [anon_sym_DOT] = { - .visible = true, - .named = false, - }, - [sym_identifier] = { - .visible = true, - .named = true, - }, - [anon_sym_DASH] = { - .visible = true, - .named = false, - }, - [anon_sym_DOLLAR] = { - .visible = true, - .named = false, - }, - [aux_sym_positional_arguments_token1] = { - .visible = true, - .named = false, - }, - [aux_sym_named_argument_token1] = { - .visible = true, - .named = false, - }, - [aux_sym_function_call_token1] = { - .visible = true, - .named = false, - }, - [aux_sym_function_call_token2] = { - .visible = true, - .named = false, - }, - [aux_sym_function_reference_token1] = { - .visible = true, - .named = true, - }, - [aux_sym_selector_variant_token1] = { - .visible = true, - .named = false, - }, - [aux_sym_selector_variant_token2] = { - .visible = true, - .named = false, - }, - [anon_sym_STAR] = { - .visible = true, - .named = false, - }, - [aux_sym_selectors_token1] = { - .visible = true, - .named = false, - }, - [anon_sym_RBRACE] = { - .visible = true, - .named = false, - }, - [aux_sym_placeable_token1] = { - .visible = true, - .named = false, - }, - [aux_sym_placeable_token2] = { - .visible = true, - .named = false, - }, - [sym_number_literal] = { - .visible = true, - .named = true, - }, - [anon_sym_DQUOTE] = { - .visible = true, - .named = false, - }, - [aux_sym_string_literal_token1] = { - .visible = false, - .named = false, - }, - [sym_escaped_literal] = { - .visible = true, - .named = true, - }, - [sym__s] = { - .visible = false, - .named = true, - }, - [sym__ws] = { - .visible = false, - .named = true, - }, - [sym__pattern_start] = { - .visible = false, - .named = true, - }, - [sym_pure_text] = { - .visible = true, - .named = true, - }, - [sym__pattern_end] = { - .visible = false, - .named = true, - }, - [sym__pattern_skip] = { - .visible = false, - .named = true, - }, - [sym__blank_lines] = { - .visible = false, - .named = true, - }, - [sym_unfinished_line] = { - .visible = true, - .named = true, - }, - [sym__close_comment_block] = { - .visible = false, - .named = true, - }, - [sym__end_positional_args] = { - .visible = true, - .named = false, - }, - [sym__error_sentinel] = { - .visible = false, - .named = true, - }, - [sym_fluent_file] = { - .visible = true, - .named = true, - }, - [aux_sym__comment_block] = { - .visible = false, - .named = false, - }, - [sym_comment_block] = { - .visible = true, - .named = true, - }, - [sym_group_comment] = { - .visible = true, - .named = true, - }, - [sym_file_comment] = { - .visible = true, - .named = true, - }, - [sym_doc_commented] = { - .visible = true, - .named = true, - }, - [sym_message] = { - .visible = true, - .named = true, - }, - [sym_attribute] = { - .visible = true, - .named = true, - }, - [sym_term] = { - .visible = true, - .named = true, - }, - [sym_term_identifier] = { - .visible = true, - .named = true, - }, - [sym_variable] = { - .visible = true, - .named = true, - }, - [sym_pattern] = { - .visible = true, - .named = true, - }, - [sym_positional_arguments] = { - .visible = true, - .named = true, - }, - [sym_named_argument] = { - .visible = true, - .named = true, - }, - [sym_named_arguments] = { - .visible = true, - .named = true, - }, - [sym_function_call] = { - .visible = true, - .named = true, - }, - [sym_function_reference] = { - .visible = true, - .named = true, - }, - [sym_message_reference] = { - .visible = true, - .named = true, - }, - [sym_term_reference] = { - .visible = true, - .named = true, - }, - [sym__expression] = { - .visible = false, - .named = true, - }, - [sym_selector_expression] = { - .visible = true, - .named = true, - }, - [sym__selector_key] = { - .visible = false, - .named = true, - }, - [sym_selector_variant] = { - .visible = true, - .named = true, - }, - [sym_default_variant] = { - .visible = true, - .named = true, - }, - [sym_selectors] = { - .visible = true, - .named = true, - }, - [sym_placeable] = { - .visible = true, - .named = true, - }, - [sym_string_literal] = { - .visible = true, - .named = true, - }, - [aux_sym_fluent_file_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_group_comment_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_file_comment_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_message_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_pattern_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_positional_arguments_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_named_arguments_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_selectors_repeat1] = { - .visible = false, - .named = false, - }, - [aux_sym_string_literal_repeat1] = { - .visible = false, - .named = false, - }, - [alias_sym_attributes] = { - .visible = true, - .named = true, - }, - [alias_sym_doc_comment_block] = { - .visible = true, - .named = true, - }, - [anon_alias_sym_identifier] = { - .visible = true, - .named = false, - }, - [alias_sym_inline_placeable] = { - .visible = true, - .named = true, - }, -}; - -enum ts_field_identifiers { - field_attribute = 1, - field_attributes = 2, - field_id = 3, - field_key = 4, - field_value = 5, -}; - -static const char * const ts_field_names[] = { - [0] = NULL, - [field_attribute] = "attribute", - [field_attributes] = "attributes", - [field_id] = "id", - [field_key] = "key", - [field_value] = "value", -}; - -static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { - [3] = {.index = 0, .length = 1}, - [4] = {.index = 1, .length = 2}, - [5] = {.index = 3, .length = 2}, - [6] = {.index = 5, .length = 3}, - [7] = {.index = 8, .length = 2}, - [9] = {.index = 10, .length = 2}, - [10] = {.index = 12, .length = 3}, - [11] = {.index = 15, .length = 2}, - [12] = {.index = 17, .length = 1}, - [13] = {.index = 18, .length = 2}, - [14] = {.index = 20, .length = 2}, - [15] = {.index = 22, .length = 2}, - [16] = {.index = 24, .length = 2}, -}; - -static const TSFieldMapEntry ts_field_map_entries[] = { - [0] = - {field_id, 0}, - [1] = - {field_id, 0}, - {field_value, 2}, - [3] = - {field_attributes, 3}, - {field_id, 0}, - [5] = - {field_attributes, 3}, - {field_id, 0}, - {field_value, 2}, - [8] = - {field_id, 0}, - {field_value, 3}, - [10] = - {field_attributes, 4}, - {field_id, 0}, - [12] = - {field_attributes, 4}, - {field_id, 0}, - {field_value, 3}, - [15] = - {field_attribute, 2}, - {field_id, 0}, - [17] = - {field_id, 1}, - [18] = - {field_id, 1}, - {field_value, 3}, - [20] = - {field_id, 1}, - {field_value, 4}, - [22] = - {field_key, 1}, - {field_value, 3}, - [24] = - {field_key, 2}, - {field_value, 4}, -}; - -static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { - [0] = {0}, - [1] = { - [1] = anon_alias_sym_identifier, - }, - [2] = { - [0] = alias_sym_doc_comment_block, - }, - [5] = { - [3] = alias_sym_attributes, - }, - [6] = { - [3] = alias_sym_attributes, - }, - [8] = { - [0] = alias_sym_inline_placeable, - }, - [9] = { - [4] = alias_sym_attributes, - }, - [10] = { - [4] = alias_sym_attributes, - }, -}; - -static const uint16_t ts_non_terminal_alias_map[] = { - aux_sym__comment_block, 2, - aux_sym__comment_block, - alias_sym_doc_comment_block, - sym_placeable, 2, - sym_placeable, - alias_sym_inline_placeable, - aux_sym_message_repeat1, 2, - aux_sym_message_repeat1, - alias_sym_attributes, - 0, -}; - -static const TSStateId ts_primary_state_ids[STATE_COUNT] = { - [0] = 0, - [1] = 1, - [2] = 2, - [3] = 3, - [4] = 4, - [5] = 4, - [6] = 6, - [7] = 6, - [8] = 6, - [9] = 9, - [10] = 10, - [11] = 11, - [12] = 12, - [13] = 13, - [14] = 14, - [15] = 15, - [16] = 16, - [17] = 17, - [18] = 18, - [19] = 19, - [20] = 20, - [21] = 21, - [22] = 22, - [23] = 23, - [24] = 24, - [25] = 25, - [26] = 26, - [27] = 27, - [28] = 28, - [29] = 29, - [30] = 30, - [31] = 31, - [32] = 32, - [33] = 33, - [34] = 34, - [35] = 35, - [36] = 36, - [37] = 37, - [38] = 36, - [39] = 37, - [40] = 40, - [41] = 36, - [42] = 42, - [43] = 42, - [44] = 44, - [45] = 45, - [46] = 46, - [47] = 47, - [48] = 44, - [49] = 46, - [50] = 50, - [51] = 50, - [52] = 50, - [53] = 53, - [54] = 54, - [55] = 55, - [56] = 56, - [57] = 57, - [58] = 58, - [59] = 59, - [60] = 59, - [61] = 54, - [62] = 56, - [63] = 57, - [64] = 64, - [65] = 65, - [66] = 66, - [67] = 67, - [68] = 55, - [69] = 67, - [70] = 70, - [71] = 71, - [72] = 72, - [73] = 73, - [74] = 27, - [75] = 75, - [76] = 76, - [77] = 77, - [78] = 78, - [79] = 79, - [80] = 80, - [81] = 81, - [82] = 82, - [83] = 83, - [84] = 84, - [85] = 85, - [86] = 80, - [87] = 87, - [88] = 88, - [89] = 89, - [90] = 90, - [91] = 91, - [92] = 92, - [93] = 93, - [94] = 94, - [95] = 95, - [96] = 96, - [97] = 97, - [98] = 98, - [99] = 99, - [100] = 100, - [101] = 101, - [102] = 102, - [103] = 103, - [104] = 104, - [105] = 105, - [106] = 106, - [107] = 46, - [108] = 108, - [109] = 109, - [110] = 58, - [111] = 111, - [112] = 95, - [113] = 113, - [114] = 105, - [115] = 111, - [116] = 65, - [117] = 117, - [118] = 118, - [119] = 119, - [120] = 72, - [121] = 93, - [122] = 91, - [123] = 101, - [124] = 103, - [125] = 78, - [126] = 83, - [127] = 118, - [128] = 97, - [129] = 129, - [130] = 130, - [131] = 131, - [132] = 108, - [133] = 97, - [134] = 130, - [135] = 135, - [136] = 109, - [137] = 119, - [138] = 138, - [139] = 139, - [140] = 140, - [141] = 141, - [142] = 142, - [143] = 78, - [144] = 144, - [145] = 106, - [146] = 141, - [147] = 147, - [148] = 148, - [149] = 149, - [150] = 150, - [151] = 151, - [152] = 149, - [153] = 153, - [154] = 154, - [155] = 155, - [156] = 156, - [157] = 151, - [158] = 156, - [159] = 150, - [160] = 144, - [161] = 149, - [162] = 162, - [163] = 163, - [164] = 164, - [165] = 113, - [166] = 83, - [167] = 153, - [168] = 144, - [169] = 155, -}; - -static bool ts_lex(TSLexer *lexer, TSStateId state) { - START_LEXER(); - eof = lexer->eof(lexer); - switch (state) { - case 0: - if (eof) ADVANCE(21); - ADVANCE_MAP( - ' ', 59, - '"', 56, - '#', 25, - '$', 40, - '(', 43, - '*', 48, - '-', 39, - '.', 36, - '=', 35, - '[', 46, - '\\', 12, - '{', 52, - '}', 51, - '\n', 7, - '\r', 7, - ); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(54); - if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(45); - if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(37); - END_STATE(); - case 1: - if (lookahead == '\n') ADVANCE(50); - if (lookahead == '\r') ADVANCE(49); - if (lookahead == ' ') ADVANCE(1); - END_STATE(); - case 2: - if (lookahead == ' ') ADVANCE(60); - if (lookahead == '=') ADVANCE(35); - END_STATE(); - case 3: - ADVANCE_MAP( - '"', 56, - '$', 40, - ')', 44, - ',', 41, - '-', 39, - '.', 36, - ':', 42, - ']', 47, - '{', 52, - '}', 53, - '\n', 9, - '\r', 9, - ' ', 9, - ); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(54); - if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(45); - if (('a' <= lookahead && lookahead <= 'z')) ADVANCE(37); - END_STATE(); - case 4: - if (lookahead == '"') ADVANCE(56); - if (lookahead == '\\') ADVANCE(12); - if (lookahead != 0 && - lookahead != '\n' && - lookahead != '\r') ADVANCE(57); - END_STATE(); - case 5: - if (lookahead == '#') ADVANCE(24); - if (lookahead == ')') ADVANCE(44); - if (lookahead == '-') ADVANCE(38); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(10); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(37); - END_STATE(); - case 6: - if (lookahead == '(') ADVANCE(43); - if (lookahead == '-') ADVANCE(11); - if (lookahead == '.') ADVANCE(36); - if (lookahead == '}') ADVANCE(53); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(62); - END_STATE(); - case 7: - if (lookahead == '(') ADVANCE(43); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(7); - END_STATE(); - case 8: - if (lookahead == ')') ADVANCE(44); - if (lookahead == ',') ADVANCE(41); - if (lookahead == '-') ADVANCE(11); - if (lookahead == '}') ADVANCE(53); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(8); - END_STATE(); - case 9: - ADVANCE_MAP( - ')', 44, - ',', 41, - ':', 42, - ']', 47, - '}', 53, - '\n', 9, - '\r', 9, - ' ', 9, - ); - END_STATE(); - case 10: - if (lookahead == ')') ADVANCE(44); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(10); - END_STATE(); - case 11: - if (lookahead == '>') ADVANCE(1); - END_STATE(); - case 12: - if (lookahead == 'U') ADVANCE(19); - if (lookahead == 'u') ADVANCE(17); - if (lookahead == '"' || - lookahead == '\\') ADVANCE(58); - END_STATE(); - case 13: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(55); - END_STATE(); - case 14: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(58); - END_STATE(); - case 15: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(14); - END_STATE(); - case 16: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(15); - END_STATE(); - case 17: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(16); - END_STATE(); - case 18: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(17); - END_STATE(); - case 19: - if (('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'F') || - ('a' <= lookahead && lookahead <= 'f')) ADVANCE(18); - END_STATE(); - case 20: - if (eof) ADVANCE(21); - ADVANCE_MAP( - '#', 25, - '(', 43, - ',', 41, - '-', 39, - '.', 36, - '\n', 61, - '\r', 61, - ' ', 61, - ); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(54); - if (('A' <= lookahead && lookahead <= 'Z') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(37); - END_STATE(); - case 21: - ACCEPT_TOKEN(ts_builtin_sym_end); - END_STATE(); - case 22: - ACCEPT_TOKEN(sym__base_comment); - END_STATE(); - case 23: - ACCEPT_TOKEN(sym__base_comment); - if (lookahead == '\n') ADVANCE(22); - END_STATE(); - case 24: - ACCEPT_TOKEN(sym__base_comment); - if (lookahead == '\n') ADVANCE(22); - if (lookahead == '\r') ADVANCE(23); - if (lookahead == ' ') ADVANCE(26); - END_STATE(); - case 25: - ACCEPT_TOKEN(sym__base_comment); - if (lookahead == '\n') ADVANCE(22); - if (lookahead == '\r') ADVANCE(23); - if (lookahead == ' ') ADVANCE(26); - if (lookahead == '#') ADVANCE(29); - END_STATE(); - case 26: - ACCEPT_TOKEN(sym__base_comment); - if (lookahead == '\n') ADVANCE(22); - if (lookahead == '\r') ADVANCE(23); - if (lookahead != 0) ADVANCE(26); - END_STATE(); - case 27: - ACCEPT_TOKEN(sym__group_comment_line); - END_STATE(); - case 28: - ACCEPT_TOKEN(sym__group_comment_line); - if (lookahead == '\n') ADVANCE(27); - END_STATE(); - case 29: - ACCEPT_TOKEN(sym__group_comment_line); - if (lookahead == '\n') ADVANCE(27); - if (lookahead == '\r') ADVANCE(28); - if (lookahead == ' ') ADVANCE(30); - if (lookahead == '#') ADVANCE(33); - END_STATE(); - case 30: - ACCEPT_TOKEN(sym__group_comment_line); - if (lookahead == '\n') ADVANCE(27); - if (lookahead == '\r') ADVANCE(28); - if (lookahead != 0) ADVANCE(30); - END_STATE(); - case 31: - ACCEPT_TOKEN(sym__file_comment_line); - END_STATE(); - case 32: - ACCEPT_TOKEN(sym__file_comment_line); - if (lookahead == '\n') ADVANCE(31); - END_STATE(); - case 33: - ACCEPT_TOKEN(sym__file_comment_line); - if (lookahead == '\n') ADVANCE(31); - if (lookahead == '\r') ADVANCE(32); - if (lookahead == ' ') ADVANCE(34); - END_STATE(); - case 34: - ACCEPT_TOKEN(sym__file_comment_line); - if (lookahead == '\n') ADVANCE(31); - if (lookahead == '\r') ADVANCE(32); - if (lookahead != 0) ADVANCE(34); - END_STATE(); - case 35: - ACCEPT_TOKEN(anon_sym_EQ); - END_STATE(); - case 36: - ACCEPT_TOKEN(anon_sym_DOT); - END_STATE(); - case 37: - ACCEPT_TOKEN(sym_identifier); - if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(37); - END_STATE(); - case 38: - ACCEPT_TOKEN(anon_sym_DASH); - END_STATE(); - case 39: - ACCEPT_TOKEN(anon_sym_DASH); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(54); - END_STATE(); - case 40: - ACCEPT_TOKEN(anon_sym_DOLLAR); - END_STATE(); - case 41: - ACCEPT_TOKEN(aux_sym_positional_arguments_token1); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(41); - END_STATE(); - case 42: - ACCEPT_TOKEN(aux_sym_named_argument_token1); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(42); - END_STATE(); - case 43: - ACCEPT_TOKEN(aux_sym_function_call_token1); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(43); - END_STATE(); - case 44: - ACCEPT_TOKEN(aux_sym_function_call_token2); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(44); - END_STATE(); - case 45: - ACCEPT_TOKEN(aux_sym_function_reference_token1); - if (lookahead == '-' || - ('0' <= lookahead && lookahead <= '9') || - ('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_') ADVANCE(45); - END_STATE(); - case 46: - ACCEPT_TOKEN(aux_sym_selector_variant_token1); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(46); - END_STATE(); - case 47: - ACCEPT_TOKEN(aux_sym_selector_variant_token2); - END_STATE(); - case 48: - ACCEPT_TOKEN(anon_sym_STAR); - END_STATE(); - case 49: - ACCEPT_TOKEN(aux_sym_selectors_token1); - if (lookahead == '\n') ADVANCE(50); - if (lookahead == '\r' || - lookahead == ' ') ADVANCE(50); - END_STATE(); - case 50: - ACCEPT_TOKEN(aux_sym_selectors_token1); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(50); - END_STATE(); - case 51: - ACCEPT_TOKEN(anon_sym_RBRACE); - END_STATE(); - case 52: - ACCEPT_TOKEN(aux_sym_placeable_token1); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(52); - END_STATE(); - case 53: - ACCEPT_TOKEN(aux_sym_placeable_token2); - END_STATE(); - case 54: - ACCEPT_TOKEN(sym_number_literal); - if (lookahead == '.') ADVANCE(13); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(54); - END_STATE(); - case 55: - ACCEPT_TOKEN(sym_number_literal); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(55); - END_STATE(); - case 56: - ACCEPT_TOKEN(anon_sym_DQUOTE); - END_STATE(); - case 57: - ACCEPT_TOKEN(aux_sym_string_literal_token1); - if (lookahead != 0 && - lookahead != '\n' && - lookahead != '\r' && - lookahead != '"' && - lookahead != '\\') ADVANCE(57); - END_STATE(); - case 58: - ACCEPT_TOKEN(sym_escaped_literal); - END_STATE(); - case 59: - ACCEPT_TOKEN(sym__s); - if (lookahead == ' ') ADVANCE(59); - if (lookahead == '(') ADVANCE(43); - if (lookahead == '\n' || - lookahead == '\r') ADVANCE(7); - END_STATE(); - case 60: - ACCEPT_TOKEN(sym__s); - if (lookahead == ' ') ADVANCE(60); - END_STATE(); - case 61: - ACCEPT_TOKEN(sym__ws); - if (lookahead == '(') ADVANCE(43); - if (lookahead == ',') ADVANCE(41); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(61); - END_STATE(); - case 62: - ACCEPT_TOKEN(sym__ws); - if (lookahead == '(') ADVANCE(43); - if (lookahead == '-') ADVANCE(11); - if (lookahead == '}') ADVANCE(53); - if (lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') ADVANCE(62); - END_STATE(); - default: - return false; - } -} - -static const TSLexerMode ts_lex_modes[STATE_COUNT] = { - [0] = {.lex_state = 0, .external_lex_state = 1}, - [1] = {.lex_state = 20, .external_lex_state = 2}, - [2] = {.lex_state = 20, .external_lex_state = 2}, - [3] = {.lex_state = 20, .external_lex_state = 2}, - [4] = {.lex_state = 3}, - [5] = {.lex_state = 3}, - [6] = {.lex_state = 0}, - [7] = {.lex_state = 0}, - [8] = {.lex_state = 0}, - [9] = {.lex_state = 0}, - [10] = {.lex_state = 20, .external_lex_state = 2}, - [11] = {.lex_state = 20, .external_lex_state = 2}, - [12] = {.lex_state = 20, .external_lex_state = 2}, - [13] = {.lex_state = 20, .external_lex_state = 2}, - [14] = {.lex_state = 20, .external_lex_state = 2}, - [15] = {.lex_state = 20, .external_lex_state = 2}, - [16] = {.lex_state = 20, .external_lex_state = 2}, - [17] = {.lex_state = 20, .external_lex_state = 2}, - [18] = {.lex_state = 20, .external_lex_state = 2}, - [19] = {.lex_state = 20, .external_lex_state = 2}, - [20] = {.lex_state = 20, .external_lex_state = 2}, - [21] = {.lex_state = 20, .external_lex_state = 2}, - [22] = {.lex_state = 20, .external_lex_state = 2}, - [23] = {.lex_state = 20, .external_lex_state = 2}, - [24] = {.lex_state = 20, .external_lex_state = 2}, - [25] = {.lex_state = 20, .external_lex_state = 2}, - [26] = {.lex_state = 20, .external_lex_state = 2}, - [27] = {.lex_state = 20, .external_lex_state = 2}, - [28] = {.lex_state = 20, .external_lex_state = 2}, - [29] = {.lex_state = 20, .external_lex_state = 2}, - [30] = {.lex_state = 20, .external_lex_state = 2}, - [31] = {.lex_state = 20, .external_lex_state = 2}, - [32] = {.lex_state = 20, .external_lex_state = 2}, - [33] = {.lex_state = 20, .external_lex_state = 2}, - [34] = {.lex_state = 20, .external_lex_state = 2}, - [35] = {.lex_state = 5, .external_lex_state = 3}, - [36] = {.lex_state = 0}, - [37] = {.lex_state = 6}, - [38] = {.lex_state = 0}, - [39] = {.lex_state = 20, .external_lex_state = 4}, - [40] = {.lex_state = 0}, - [41] = {.lex_state = 0}, - [42] = {.lex_state = 0, .external_lex_state = 5}, - [43] = {.lex_state = 0, .external_lex_state = 5}, - [44] = {.lex_state = 6}, - [45] = {.lex_state = 0, .external_lex_state = 5}, - [46] = {.lex_state = 6}, - [47] = {.lex_state = 5, .external_lex_state = 3}, - [48] = {.lex_state = 20, .external_lex_state = 4}, - [49] = {.lex_state = 20, .external_lex_state = 4}, - [50] = {.lex_state = 0}, - [51] = {.lex_state = 0}, - [52] = {.lex_state = 0}, - [53] = {.lex_state = 5, .external_lex_state = 3}, - [54] = {.lex_state = 6}, - [55] = {.lex_state = 5}, - [56] = {.lex_state = 4}, - [57] = {.lex_state = 4}, - [58] = {.lex_state = 8}, - [59] = {.lex_state = 6}, - [60] = {.lex_state = 20, .external_lex_state = 4}, - [61] = {.lex_state = 20, .external_lex_state = 4}, - [62] = {.lex_state = 4}, - [63] = {.lex_state = 4}, - [64] = {.lex_state = 3, .external_lex_state = 4}, - [65] = {.lex_state = 8}, - [66] = {.lex_state = 4}, - [67] = {.lex_state = 0, .external_lex_state = 6}, - [68] = {.lex_state = 5}, - [69] = {.lex_state = 0, .external_lex_state = 6}, - [70] = {.lex_state = 20, .external_lex_state = 4}, - [71] = {.lex_state = 3}, - [72] = {.lex_state = 20, .external_lex_state = 4}, - [73] = {.lex_state = 0, .external_lex_state = 7}, - [74] = {.lex_state = 0}, - [75] = {.lex_state = 0}, - [76] = {.lex_state = 20, .external_lex_state = 4}, - [77] = {.lex_state = 3}, - [78] = {.lex_state = 0, .external_lex_state = 5}, - [79] = {.lex_state = 0, .external_lex_state = 7}, - [80] = {.lex_state = 0}, - [81] = {.lex_state = 0, .external_lex_state = 7}, - [82] = {.lex_state = 20}, - [83] = {.lex_state = 0, .external_lex_state = 5}, - [84] = {.lex_state = 0, .external_lex_state = 7}, - [85] = {.lex_state = 20}, - [86] = {.lex_state = 0}, - [87] = {.lex_state = 3}, - [88] = {.lex_state = 20, .external_lex_state = 4}, - [89] = {.lex_state = 0}, - [90] = {.lex_state = 0}, - [91] = {.lex_state = 6}, - [92] = {.lex_state = 2}, - [93] = {.lex_state = 6}, - [94] = {.lex_state = 0, .external_lex_state = 8}, - [95] = {.lex_state = 6}, - [96] = {.lex_state = 6}, - [97] = {.lex_state = 6}, - [98] = {.lex_state = 3}, - [99] = {.lex_state = 3}, - [100] = {.lex_state = 20, .external_lex_state = 4}, - [101] = {.lex_state = 6}, - [102] = {.lex_state = 0, .external_lex_state = 8}, - [103] = {.lex_state = 6}, - [104] = {.lex_state = 0, .external_lex_state = 8}, - [105] = {.lex_state = 6}, - [106] = {.lex_state = 20, .external_lex_state = 4}, - [107] = {.lex_state = 2}, - [108] = {.lex_state = 20, .external_lex_state = 4}, - [109] = {.lex_state = 20, .external_lex_state = 4}, - [110] = {.lex_state = 20, .external_lex_state = 4}, - [111] = {.lex_state = 6}, - [112] = {.lex_state = 20, .external_lex_state = 4}, - [113] = {.lex_state = 20, .external_lex_state = 4}, - [114] = {.lex_state = 20, .external_lex_state = 4}, - [115] = {.lex_state = 20, .external_lex_state = 4}, - [116] = {.lex_state = 20, .external_lex_state = 4}, - [117] = {.lex_state = 2}, - [118] = {.lex_state = 20, .external_lex_state = 4}, - [119] = {.lex_state = 20, .external_lex_state = 4}, - [120] = {.lex_state = 3}, - [121] = {.lex_state = 20, .external_lex_state = 4}, - [122] = {.lex_state = 20, .external_lex_state = 4}, - [123] = {.lex_state = 20, .external_lex_state = 4}, - [124] = {.lex_state = 20, .external_lex_state = 4}, - [125] = {.lex_state = 20, .external_lex_state = 4}, - [126] = {.lex_state = 20, .external_lex_state = 4}, - [127] = {.lex_state = 6}, - [128] = {.lex_state = 6}, - [129] = {.lex_state = 0, .external_lex_state = 8}, - [130] = {.lex_state = 0}, - [131] = {.lex_state = 2}, - [132] = {.lex_state = 6}, - [133] = {.lex_state = 6}, - [134] = {.lex_state = 0}, - [135] = {.lex_state = 20}, - [136] = {.lex_state = 6}, - [137] = {.lex_state = 6}, - [138] = {.lex_state = 6}, - [139] = {.lex_state = 3}, - [140] = {.lex_state = 3}, - [141] = {.lex_state = 20}, - [142] = {.lex_state = 0}, - [143] = {.lex_state = 3}, - [144] = {.lex_state = 20}, - [145] = {.lex_state = 3}, - [146] = {.lex_state = 20}, - [147] = {.lex_state = 20}, - [148] = {.lex_state = 0}, - [149] = {.lex_state = 3}, - [150] = {.lex_state = 3}, - [151] = {.lex_state = 20}, - [152] = {.lex_state = 3}, - [153] = {.lex_state = 0, .external_lex_state = 4}, - [154] = {.lex_state = 0}, - [155] = {.lex_state = 20}, - [156] = {.lex_state = 3}, - [157] = {.lex_state = 20}, - [158] = {.lex_state = 3}, - [159] = {.lex_state = 3}, - [160] = {.lex_state = 20}, - [161] = {.lex_state = 3}, - [162] = {.lex_state = 0}, - [163] = {.lex_state = 0}, - [164] = {.lex_state = 3}, - [165] = {.lex_state = 3}, - [166] = {.lex_state = 3}, - [167] = {.lex_state = 0, .external_lex_state = 4}, - [168] = {.lex_state = 20}, - [169] = {.lex_state = 20}, -}; - -static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { - [STATE(0)] = { - [ts_builtin_sym_end] = ACTIONS(1), - [sym__base_comment] = ACTIONS(1), - [sym__group_comment_line] = ACTIONS(1), - [sym__file_comment_line] = ACTIONS(1), - [anon_sym_EQ] = ACTIONS(1), - [anon_sym_DOT] = ACTIONS(1), - [sym_identifier] = ACTIONS(1), - [anon_sym_DASH] = ACTIONS(1), - [anon_sym_DOLLAR] = ACTIONS(1), - [aux_sym_function_call_token1] = ACTIONS(1), - [aux_sym_function_reference_token1] = ACTIONS(1), - [aux_sym_selector_variant_token1] = ACTIONS(1), - [anon_sym_STAR] = ACTIONS(1), - [anon_sym_RBRACE] = ACTIONS(1), - [aux_sym_placeable_token1] = ACTIONS(1), - [sym_number_literal] = ACTIONS(1), - [anon_sym_DQUOTE] = ACTIONS(1), - [sym_escaped_literal] = ACTIONS(1), - [sym__s] = ACTIONS(1), - [sym__pattern_start] = ACTIONS(1), - [sym_pure_text] = ACTIONS(1), - [sym__pattern_end] = ACTIONS(1), - [sym__pattern_skip] = ACTIONS(1), - [sym__blank_lines] = ACTIONS(1), - [sym_unfinished_line] = ACTIONS(1), - [sym__close_comment_block] = ACTIONS(1), - [sym__end_positional_args] = ACTIONS(1), - [sym__error_sentinel] = ACTIONS(1), - }, - [STATE(1)] = { - [sym_fluent_file] = STATE(142), - [aux_sym__comment_block] = STATE(35), - [sym_comment_block] = STATE(2), - [sym_group_comment] = STATE(2), - [sym_file_comment] = STATE(2), - [sym_doc_commented] = STATE(2), - [sym_message] = STATE(2), - [sym_term] = STATE(2), - [sym_term_identifier] = STATE(92), - [aux_sym_fluent_file_repeat1] = STATE(2), - [aux_sym_group_comment_repeat1] = STATE(26), - [aux_sym_file_comment_repeat1] = STATE(24), - [ts_builtin_sym_end] = ACTIONS(3), - [sym__base_comment] = ACTIONS(5), - [sym__group_comment_line] = ACTIONS(7), - [sym__file_comment_line] = ACTIONS(9), - [sym_identifier] = ACTIONS(11), - [anon_sym_DASH] = ACTIONS(13), - [sym__blank_lines] = ACTIONS(15), - [sym_unfinished_line] = ACTIONS(15), - }, -}; - -static const uint16_t ts_small_parse_table[] = { - [0] = 12, - ACTIONS(5), 1, - sym__base_comment, - ACTIONS(7), 1, - sym__group_comment_line, - ACTIONS(9), 1, - sym__file_comment_line, - ACTIONS(11), 1, - sym_identifier, - ACTIONS(13), 1, - anon_sym_DASH, - ACTIONS(17), 1, - ts_builtin_sym_end, - STATE(24), 1, - aux_sym_file_comment_repeat1, - STATE(26), 1, - aux_sym_group_comment_repeat1, - STATE(35), 1, - aux_sym__comment_block, - STATE(92), 1, - sym_term_identifier, - ACTIONS(19), 2, - sym__blank_lines, - sym_unfinished_line, - STATE(3), 7, - sym_comment_block, - sym_group_comment, - sym_file_comment, - sym_doc_commented, - sym_message, - sym_term, - aux_sym_fluent_file_repeat1, - [44] = 12, - ACTIONS(21), 1, - ts_builtin_sym_end, - ACTIONS(23), 1, - sym__base_comment, - ACTIONS(26), 1, - sym__group_comment_line, - ACTIONS(29), 1, - sym__file_comment_line, - ACTIONS(32), 1, - sym_identifier, - ACTIONS(35), 1, - anon_sym_DASH, - STATE(24), 1, - aux_sym_file_comment_repeat1, - STATE(26), 1, - aux_sym_group_comment_repeat1, - STATE(35), 1, - aux_sym__comment_block, - STATE(92), 1, - sym_term_identifier, - ACTIONS(38), 2, - sym__blank_lines, - sym_unfinished_line, - STATE(3), 7, - sym_comment_block, - sym_group_comment, - sym_file_comment, - sym_doc_commented, - sym_message, - sym_term, - aux_sym_fluent_file_repeat1, - [88] = 14, - ACTIONS(41), 1, - sym_identifier, - ACTIONS(43), 1, - anon_sym_DASH, - ACTIONS(45), 1, - anon_sym_DOLLAR, - ACTIONS(47), 1, - aux_sym_function_call_token2, - ACTIONS(49), 1, - aux_sym_function_reference_token1, - ACTIONS(51), 1, - aux_sym_placeable_token1, - ACTIONS(53), 1, - sym_number_literal, - ACTIONS(55), 1, - anon_sym_DQUOTE, - STATE(39), 1, - sym_term_identifier, - STATE(71), 1, - sym_named_argument, - STATE(106), 1, - sym_placeable, - STATE(153), 1, - sym_positional_arguments, - STATE(158), 1, - sym_named_arguments, - STATE(76), 6, - sym_variable, - sym_function_reference, - sym_message_reference, - sym_term_reference, - sym__expression, - sym_string_literal, - [136] = 14, - ACTIONS(41), 1, - sym_identifier, - ACTIONS(43), 1, - anon_sym_DASH, - ACTIONS(45), 1, - anon_sym_DOLLAR, - ACTIONS(49), 1, - aux_sym_function_reference_token1, - ACTIONS(51), 1, - aux_sym_placeable_token1, - ACTIONS(53), 1, - sym_number_literal, - ACTIONS(55), 1, - anon_sym_DQUOTE, - ACTIONS(57), 1, - aux_sym_function_call_token2, - STATE(39), 1, - sym_term_identifier, - STATE(71), 1, - sym_named_argument, - STATE(106), 1, - sym_placeable, - STATE(156), 1, - sym_named_arguments, - STATE(167), 1, - sym_positional_arguments, - STATE(76), 6, - sym_variable, - sym_function_reference, - sym_message_reference, - sym_term_reference, - sym__expression, - sym_string_literal, - [184] = 13, - ACTIONS(59), 1, - sym_identifier, - ACTIONS(61), 1, - anon_sym_DASH, - ACTIONS(63), 1, - anon_sym_DOLLAR, - ACTIONS(65), 1, - aux_sym_function_reference_token1, - ACTIONS(67), 1, - aux_sym_placeable_token1, - ACTIONS(69), 1, - sym_number_literal, - ACTIONS(71), 1, - anon_sym_DQUOTE, - STATE(37), 1, - sym_term_identifier, - STATE(96), 1, - sym_function_reference, - STATE(97), 1, - sym_selector_expression, - STATE(145), 1, - sym_placeable, - STATE(152), 2, - sym_message_reference, - sym__expression, - STATE(138), 3, - sym_variable, - sym_term_reference, - sym_string_literal, - [227] = 13, - ACTIONS(59), 1, - sym_identifier, - ACTIONS(61), 1, - anon_sym_DASH, - ACTIONS(63), 1, - anon_sym_DOLLAR, - ACTIONS(65), 1, - aux_sym_function_reference_token1, - ACTIONS(67), 1, - aux_sym_placeable_token1, - ACTIONS(69), 1, - sym_number_literal, - ACTIONS(71), 1, - anon_sym_DQUOTE, - STATE(37), 1, - sym_term_identifier, - STATE(96), 1, - sym_function_reference, - STATE(128), 1, - sym_selector_expression, - STATE(145), 1, - sym_placeable, - STATE(149), 2, - sym_message_reference, - sym__expression, - STATE(138), 3, - sym_variable, - sym_term_reference, - sym_string_literal, - [270] = 13, - ACTIONS(59), 1, - sym_identifier, - ACTIONS(61), 1, - anon_sym_DASH, - ACTIONS(63), 1, - anon_sym_DOLLAR, - ACTIONS(65), 1, - aux_sym_function_reference_token1, - ACTIONS(67), 1, - aux_sym_placeable_token1, - ACTIONS(69), 1, - sym_number_literal, - ACTIONS(71), 1, - anon_sym_DQUOTE, - STATE(37), 1, - sym_term_identifier, - STATE(96), 1, - sym_function_reference, - STATE(133), 1, - sym_selector_expression, - STATE(145), 1, - sym_placeable, - STATE(161), 2, - sym_message_reference, - sym__expression, - STATE(138), 3, - sym_variable, - sym_term_reference, - sym_string_literal, - [313] = 10, - ACTIONS(43), 1, - anon_sym_DASH, - ACTIONS(45), 1, - anon_sym_DOLLAR, - ACTIONS(49), 1, - aux_sym_function_reference_token1, - ACTIONS(51), 1, - aux_sym_placeable_token1, - ACTIONS(55), 1, - anon_sym_DQUOTE, - ACTIONS(73), 1, - sym_identifier, - ACTIONS(75), 1, - sym_number_literal, - STATE(39), 1, - sym_term_identifier, - STATE(106), 1, - sym_placeable, - STATE(100), 6, - sym_variable, - sym_function_reference, - sym_message_reference, - sym_term_reference, - sym__expression, - sym_string_literal, - [349] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(13), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(79), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(77), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [371] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(14), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(85), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(83), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [393] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(18), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(89), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(87), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [415] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(93), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(91), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [437] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(97), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(95), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [459] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(17), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(101), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(99), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [481] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(22), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(105), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(103), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [503] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(109), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(107), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [525] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(113), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(111), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [547] = 5, - ACTIONS(119), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(117), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(115), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [569] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(124), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(122), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [591] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(20), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(128), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(126), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [613] = 5, - ACTIONS(81), 1, - anon_sym_DOT, - STATE(19), 1, - aux_sym_message_repeat1, - STATE(25), 1, - sym_attribute, - ACTIONS(132), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(130), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [635] = 2, - ACTIONS(136), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(134), 7, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - anon_sym_DOT, - sym_identifier, - anon_sym_DASH, - [649] = 4, - ACTIONS(142), 1, - sym__file_comment_line, - STATE(32), 1, - aux_sym_file_comment_repeat1, - ACTIONS(140), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(138), 5, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym_identifier, - anon_sym_DASH, - [667] = 2, - ACTIONS(146), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(144), 7, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - anon_sym_DOT, - sym_identifier, - anon_sym_DASH, - [681] = 4, - ACTIONS(150), 1, - sym__base_comment, - ACTIONS(152), 1, - sym__group_comment_line, - STATE(29), 1, - aux_sym_group_comment_repeat1, - ACTIONS(148), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [699] = 2, - ACTIONS(156), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(154), 7, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - anon_sym_DOT, - sym_identifier, - anon_sym_DASH, - [713] = 2, - ACTIONS(160), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(158), 7, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - anon_sym_DOT, - sym_identifier, - anon_sym_DASH, - [727] = 4, - ACTIONS(164), 1, - sym__base_comment, - ACTIONS(166), 1, - sym__group_comment_line, - STATE(29), 1, - aux_sym_group_comment_repeat1, - ACTIONS(162), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [745] = 2, - ACTIONS(171), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(169), 7, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - anon_sym_DOT, - sym_identifier, - anon_sym_DASH, - [759] = 2, - ACTIONS(175), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(173), 7, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - anon_sym_DOT, - sym_identifier, - anon_sym_DASH, - [773] = 4, - ACTIONS(181), 1, - sym__file_comment_line, - STATE(32), 1, - aux_sym_file_comment_repeat1, - ACTIONS(179), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(177), 5, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym_identifier, - anon_sym_DASH, - [791] = 2, - ACTIONS(186), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(184), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [804] = 2, - ACTIONS(190), 2, - sym__base_comment, - sym__group_comment_line, - ACTIONS(188), 6, - sym__blank_lines, - sym_unfinished_line, - ts_builtin_sym_end, - sym__file_comment_line, - sym_identifier, - anon_sym_DASH, - [817] = 7, - ACTIONS(11), 1, - sym_identifier, - ACTIONS(13), 1, - anon_sym_DASH, - ACTIONS(192), 1, - sym__base_comment, - ACTIONS(194), 1, - sym__close_comment_block, - STATE(47), 1, - aux_sym__comment_block, - STATE(92), 1, - sym_term_identifier, - STATE(34), 2, - sym_message, - sym_term, - [840] = 4, - ACTIONS(196), 1, - aux_sym_selector_variant_token1, - ACTIONS(198), 1, - anon_sym_STAR, - ACTIONS(200), 1, - anon_sym_RBRACE, - STATE(40), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [855] = 5, - ACTIONS(202), 1, - anon_sym_DOT, - ACTIONS(204), 1, - aux_sym_function_call_token1, - ACTIONS(208), 1, - sym__ws, - STATE(95), 1, - sym_function_call, - ACTIONS(206), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [872] = 4, - ACTIONS(196), 1, - aux_sym_selector_variant_token1, - ACTIONS(198), 1, - anon_sym_STAR, - ACTIONS(210), 1, - anon_sym_RBRACE, - STATE(40), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [887] = 5, - ACTIONS(212), 1, - anon_sym_DOT, - ACTIONS(214), 1, - aux_sym_function_call_token1, - ACTIONS(216), 1, - sym__ws, - STATE(112), 1, - sym_function_call, - ACTIONS(206), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [904] = 4, - ACTIONS(218), 1, - aux_sym_selector_variant_token1, - ACTIONS(221), 1, - anon_sym_STAR, - ACTIONS(224), 1, - anon_sym_RBRACE, - STATE(40), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [919] = 4, - ACTIONS(196), 1, - aux_sym_selector_variant_token1, - ACTIONS(198), 1, - anon_sym_STAR, - ACTIONS(226), 1, - anon_sym_RBRACE, - STATE(40), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [934] = 4, - ACTIONS(228), 1, - aux_sym_placeable_token1, - ACTIONS(230), 1, - sym_pure_text, - ACTIONS(232), 1, - sym__pattern_end, - STATE(45), 2, - sym_placeable, - aux_sym_pattern_repeat1, - [948] = 4, - ACTIONS(228), 1, - aux_sym_placeable_token1, - ACTIONS(230), 1, - sym_pure_text, - ACTIONS(234), 1, - sym__pattern_end, - STATE(45), 2, - sym_placeable, - aux_sym_pattern_repeat1, - [962] = 4, - ACTIONS(204), 1, - aux_sym_function_call_token1, - ACTIONS(238), 1, - sym__ws, - STATE(93), 1, - sym_function_call, - ACTIONS(236), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [976] = 4, - ACTIONS(240), 1, - aux_sym_placeable_token1, - ACTIONS(243), 1, - sym_pure_text, - ACTIONS(246), 1, - sym__pattern_end, - STATE(45), 2, - sym_placeable, - aux_sym_pattern_repeat1, - [990] = 2, - ACTIONS(250), 1, - sym__ws, - ACTIONS(248), 4, - anon_sym_DOT, - aux_sym_function_call_token1, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1000] = 3, - ACTIONS(252), 1, - sym__base_comment, - STATE(47), 1, - aux_sym__comment_block, - ACTIONS(255), 3, - sym__close_comment_block, - sym_identifier, - anon_sym_DASH, - [1012] = 4, - ACTIONS(214), 1, - aux_sym_function_call_token1, - ACTIONS(257), 1, - sym__ws, - STATE(121), 1, - sym_function_call, - ACTIONS(236), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1026] = 2, - ACTIONS(250), 1, - sym__ws, - ACTIONS(248), 4, - sym__end_positional_args, - anon_sym_DOT, - aux_sym_positional_arguments_token1, - aux_sym_function_call_token1, - [1036] = 3, - ACTIONS(196), 1, - aux_sym_selector_variant_token1, - ACTIONS(198), 1, - anon_sym_STAR, - STATE(38), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [1048] = 3, - ACTIONS(196), 1, - aux_sym_selector_variant_token1, - ACTIONS(198), 1, - anon_sym_STAR, - STATE(41), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [1060] = 3, - ACTIONS(196), 1, - aux_sym_selector_variant_token1, - ACTIONS(198), 1, - anon_sym_STAR, - STATE(36), 3, - sym_selector_variant, - sym_default_variant, - aux_sym_selectors_repeat1, - [1072] = 1, - ACTIONS(259), 4, - sym__close_comment_block, - sym__base_comment, - sym_identifier, - anon_sym_DASH, - [1079] = 3, - ACTIONS(204), 1, - aux_sym_function_call_token1, - STATE(101), 1, - sym_function_call, - ACTIONS(261), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1090] = 4, - ACTIONS(263), 1, - sym_identifier, - ACTIONS(265), 1, - aux_sym_function_call_token2, - STATE(71), 1, - sym_named_argument, - STATE(150), 1, - sym_named_arguments, - [1103] = 3, - ACTIONS(267), 1, - anon_sym_DQUOTE, - STATE(57), 1, - aux_sym_string_literal_repeat1, - ACTIONS(269), 2, - aux_sym_string_literal_token1, - sym_escaped_literal, - [1114] = 3, - ACTIONS(271), 1, - anon_sym_DQUOTE, - STATE(66), 1, - aux_sym_string_literal_repeat1, - ACTIONS(273), 2, - aux_sym_string_literal_token1, - sym_escaped_literal, - [1125] = 1, - ACTIONS(275), 4, - aux_sym_positional_arguments_token1, - aux_sym_function_call_token2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1132] = 3, - ACTIONS(204), 1, - aux_sym_function_call_token1, - STATE(127), 1, - sym_function_call, - ACTIONS(277), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1143] = 3, - ACTIONS(214), 1, - aux_sym_function_call_token1, - STATE(118), 1, - sym_function_call, - ACTIONS(277), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1154] = 3, - ACTIONS(214), 1, - aux_sym_function_call_token1, - STATE(123), 1, - sym_function_call, - ACTIONS(261), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1165] = 3, - ACTIONS(279), 1, - anon_sym_DQUOTE, - STATE(63), 1, - aux_sym_string_literal_repeat1, - ACTIONS(281), 2, - aux_sym_string_literal_token1, - sym_escaped_literal, - [1176] = 3, - ACTIONS(283), 1, - anon_sym_DQUOTE, - STATE(66), 1, - aux_sym_string_literal_repeat1, - ACTIONS(273), 2, - aux_sym_string_literal_token1, - sym_escaped_literal, - [1187] = 3, - ACTIONS(285), 1, - anon_sym_DOT, - ACTIONS(289), 1, - aux_sym_named_argument_token1, - ACTIONS(287), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1198] = 1, - ACTIONS(291), 4, - aux_sym_positional_arguments_token1, - aux_sym_function_call_token2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1205] = 3, - ACTIONS(293), 1, - anon_sym_DQUOTE, - STATE(66), 1, - aux_sym_string_literal_repeat1, - ACTIONS(295), 2, - aux_sym_string_literal_token1, - sym_escaped_literal, - [1216] = 3, - ACTIONS(228), 1, - aux_sym_placeable_token1, - ACTIONS(298), 1, - sym_pure_text, - STATE(42), 2, - sym_placeable, - aux_sym_pattern_repeat1, - [1227] = 4, - ACTIONS(263), 1, - sym_identifier, - ACTIONS(300), 1, - aux_sym_function_call_token2, - STATE(71), 1, - sym_named_argument, - STATE(159), 1, - sym_named_arguments, - [1240] = 3, - ACTIONS(228), 1, - aux_sym_placeable_token1, - ACTIONS(302), 1, - sym_pure_text, - STATE(43), 2, - sym_placeable, - aux_sym_pattern_repeat1, - [1251] = 3, - ACTIONS(304), 1, - aux_sym_positional_arguments_token1, - ACTIONS(306), 1, - sym__end_positional_args, - STATE(88), 1, - aux_sym_positional_arguments_repeat1, - [1261] = 3, - ACTIONS(308), 1, - aux_sym_positional_arguments_token1, - ACTIONS(310), 1, - aux_sym_function_call_token2, - STATE(77), 1, - aux_sym_named_arguments_repeat1, - [1271] = 2, - ACTIONS(285), 1, - anon_sym_DOT, - ACTIONS(287), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1279] = 3, - ACTIONS(312), 1, - sym__pattern_start, - ACTIONS(314), 1, - sym__pattern_skip, - STATE(30), 1, - sym_pattern, - [1289] = 1, - ACTIONS(154), 3, - aux_sym_selector_variant_token1, - anon_sym_STAR, - anon_sym_RBRACE, - [1295] = 3, - ACTIONS(71), 1, - anon_sym_DQUOTE, - ACTIONS(316), 1, - sym_number_literal, - STATE(98), 1, - sym_string_literal, - [1305] = 3, - ACTIONS(304), 1, - aux_sym_positional_arguments_token1, - ACTIONS(318), 1, - sym__end_positional_args, - STATE(70), 1, - aux_sym_positional_arguments_repeat1, - [1315] = 3, - ACTIONS(308), 1, - aux_sym_positional_arguments_token1, - ACTIONS(320), 1, - aux_sym_function_call_token2, - STATE(87), 1, - aux_sym_named_arguments_repeat1, - [1325] = 1, - ACTIONS(322), 3, - sym_pure_text, - sym__pattern_end, - aux_sym_placeable_token1, - [1331] = 3, - ACTIONS(312), 1, - sym__pattern_start, - ACTIONS(324), 1, - sym__pattern_skip, - STATE(16), 1, - sym_pattern, - [1341] = 3, - ACTIONS(214), 1, - aux_sym_function_call_token1, - ACTIONS(326), 1, - sym__s, - STATE(109), 1, - sym_function_call, - [1351] = 3, - ACTIONS(312), 1, - sym__pattern_start, - ACTIONS(328), 1, - sym__pattern_skip, - STATE(11), 1, - sym_pattern, - [1361] = 2, - STATE(140), 1, - sym__selector_key, - ACTIONS(330), 2, - sym_identifier, - sym_number_literal, - [1369] = 1, - ACTIONS(332), 3, - sym_pure_text, - sym__pattern_end, - aux_sym_placeable_token1, - [1375] = 3, - ACTIONS(312), 1, - sym__pattern_start, - ACTIONS(334), 1, - sym__pattern_skip, - STATE(28), 1, - sym_pattern, - [1385] = 2, - STATE(164), 1, - sym__selector_key, - ACTIONS(336), 2, - sym_identifier, - sym_number_literal, - [1393] = 3, - ACTIONS(204), 1, - aux_sym_function_call_token1, - ACTIONS(338), 1, - sym__s, - STATE(136), 1, - sym_function_call, - [1403] = 3, - ACTIONS(340), 1, - aux_sym_positional_arguments_token1, - ACTIONS(343), 1, - aux_sym_function_call_token2, - STATE(87), 1, - aux_sym_named_arguments_repeat1, - [1413] = 3, - ACTIONS(345), 1, - aux_sym_positional_arguments_token1, - ACTIONS(348), 1, - sym__end_positional_args, - STATE(88), 1, - aux_sym_positional_arguments_repeat1, - [1423] = 1, - ACTIONS(350), 3, - aux_sym_selector_variant_token1, - anon_sym_STAR, - anon_sym_RBRACE, - [1429] = 1, - ACTIONS(352), 3, - aux_sym_selector_variant_token1, - anon_sym_STAR, - anon_sym_RBRACE, - [1435] = 1, - ACTIONS(354), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1440] = 2, - ACTIONS(356), 1, - anon_sym_EQ, - ACTIONS(358), 1, - sym__s, - [1447] = 1, - ACTIONS(261), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1452] = 2, - ACTIONS(312), 1, - sym__pattern_start, - STATE(21), 1, - sym_pattern, - [1459] = 1, - ACTIONS(277), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1464] = 2, - ACTIONS(360), 1, - aux_sym_selectors_token1, - ACTIONS(362), 1, - aux_sym_placeable_token2, - [1471] = 2, - ACTIONS(364), 1, - aux_sym_selectors_token1, - STATE(78), 1, - sym_selectors, - [1478] = 1, - ACTIONS(366), 2, - aux_sym_positional_arguments_token1, - aux_sym_function_call_token2, - [1483] = 1, - ACTIONS(343), 2, - aux_sym_positional_arguments_token1, - aux_sym_function_call_token2, - [1488] = 1, - ACTIONS(348), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1493] = 1, - ACTIONS(368), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1498] = 2, - ACTIONS(370), 1, - sym__pattern_start, - STATE(89), 1, - sym_pattern, - [1505] = 1, - ACTIONS(372), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1510] = 2, - ACTIONS(370), 1, - sym__pattern_start, - STATE(90), 1, - sym_pattern, - [1517] = 1, - ACTIONS(374), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1522] = 1, - ACTIONS(376), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1527] = 1, - ACTIONS(248), 2, - anon_sym_EQ, - sym__s, - [1532] = 1, - ACTIONS(378), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1537] = 1, - ACTIONS(380), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1542] = 1, - ACTIONS(275), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1547] = 1, - ACTIONS(382), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1552] = 1, - ACTIONS(277), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1557] = 1, - ACTIONS(384), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1562] = 1, - ACTIONS(374), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1567] = 1, - ACTIONS(382), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1572] = 1, - ACTIONS(291), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1577] = 2, - ACTIONS(386), 1, - anon_sym_EQ, - ACTIONS(388), 1, - sym__s, - [1584] = 1, - ACTIONS(390), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1589] = 1, - ACTIONS(392), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1594] = 2, - ACTIONS(287), 1, - aux_sym_placeable_token2, - ACTIONS(394), 1, - anon_sym_DOT, - [1601] = 1, - ACTIONS(261), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1606] = 1, - ACTIONS(354), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1611] = 1, - ACTIONS(368), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1616] = 1, - ACTIONS(372), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1621] = 1, - ACTIONS(322), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1626] = 1, - ACTIONS(332), 2, - sym__end_positional_args, - aux_sym_positional_arguments_token1, - [1631] = 1, - ACTIONS(390), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1636] = 2, - ACTIONS(396), 1, - aux_sym_selectors_token1, - STATE(143), 1, - sym_selectors, - [1643] = 2, - ACTIONS(312), 1, - sym__pattern_start, - STATE(12), 1, - sym_pattern, - [1650] = 2, - ACTIONS(214), 1, - aux_sym_function_call_token1, - STATE(115), 1, - sym_function_call, - [1657] = 2, - ACTIONS(398), 1, - anon_sym_EQ, - ACTIONS(400), 1, - sym__s, - [1664] = 1, - ACTIONS(378), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1669] = 2, - ACTIONS(402), 1, - aux_sym_selectors_token1, - STATE(125), 1, - sym_selectors, - [1676] = 2, - ACTIONS(204), 1, - aux_sym_function_call_token1, - STATE(111), 1, - sym_function_call, - [1683] = 2, - ACTIONS(263), 1, - sym_identifier, - STATE(99), 1, - sym_named_argument, - [1690] = 1, - ACTIONS(380), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1695] = 1, - ACTIONS(392), 2, - aux_sym_selectors_token1, - aux_sym_placeable_token2, - [1700] = 2, - ACTIONS(360), 1, - aux_sym_selectors_token1, - ACTIONS(362), 1, - aux_sym_placeable_token2, - [1707] = 1, - ACTIONS(289), 1, - aux_sym_named_argument_token1, - [1711] = 1, - ACTIONS(404), 1, - aux_sym_selector_variant_token2, - [1715] = 1, - ACTIONS(406), 1, - sym_identifier, - [1719] = 1, - ACTIONS(408), 1, - ts_builtin_sym_end, - [1723] = 1, - ACTIONS(322), 1, - aux_sym_placeable_token2, - [1727] = 1, - ACTIONS(410), 1, - sym_identifier, - [1731] = 1, - ACTIONS(376), 1, - aux_sym_placeable_token2, - [1735] = 1, - ACTIONS(412), 1, - sym_identifier, - [1739] = 1, - ACTIONS(414), 1, - sym_identifier, - [1743] = 1, - ACTIONS(416), 1, - aux_sym_selector_variant_token1, - [1747] = 1, - ACTIONS(418), 1, - aux_sym_placeable_token2, - [1751] = 1, - ACTIONS(420), 1, - aux_sym_function_call_token2, - [1755] = 1, - ACTIONS(422), 1, - sym_identifier, - [1759] = 1, - ACTIONS(424), 1, - aux_sym_placeable_token2, - [1763] = 1, - ACTIONS(426), 1, - sym__end_positional_args, - [1767] = 1, - ACTIONS(428), 1, - anon_sym_EQ, - [1771] = 1, - ACTIONS(430), 1, - sym_identifier, - [1775] = 1, - ACTIONS(432), 1, - aux_sym_function_call_token2, - [1779] = 1, - ACTIONS(434), 1, - sym_identifier, - [1783] = 1, - ACTIONS(436), 1, - aux_sym_function_call_token2, - [1787] = 1, - ACTIONS(438), 1, - aux_sym_function_call_token2, - [1791] = 1, - ACTIONS(440), 1, - sym_identifier, - [1795] = 1, - ACTIONS(442), 1, - aux_sym_placeable_token2, - [1799] = 1, - ACTIONS(444), 1, - anon_sym_EQ, - [1803] = 1, - ACTIONS(446), 1, - anon_sym_EQ, - [1807] = 1, - ACTIONS(448), 1, - aux_sym_selector_variant_token2, - [1811] = 1, - ACTIONS(384), 1, - aux_sym_placeable_token2, - [1815] = 1, - ACTIONS(332), 1, - aux_sym_placeable_token2, - [1819] = 1, - ACTIONS(450), 1, - sym__end_positional_args, - [1823] = 1, - ACTIONS(452), 1, - sym_identifier, - [1827] = 1, - ACTIONS(454), 1, - sym_identifier, -}; - -static const uint32_t ts_small_parse_table_map[] = { - [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 44, - [SMALL_STATE(4)] = 88, - [SMALL_STATE(5)] = 136, - [SMALL_STATE(6)] = 184, - [SMALL_STATE(7)] = 227, - [SMALL_STATE(8)] = 270, - [SMALL_STATE(9)] = 313, - [SMALL_STATE(10)] = 349, - [SMALL_STATE(11)] = 371, - [SMALL_STATE(12)] = 393, - [SMALL_STATE(13)] = 415, - [SMALL_STATE(14)] = 437, - [SMALL_STATE(15)] = 459, - [SMALL_STATE(16)] = 481, - [SMALL_STATE(17)] = 503, - [SMALL_STATE(18)] = 525, - [SMALL_STATE(19)] = 547, - [SMALL_STATE(20)] = 569, - [SMALL_STATE(21)] = 591, - [SMALL_STATE(22)] = 613, - [SMALL_STATE(23)] = 635, - [SMALL_STATE(24)] = 649, - [SMALL_STATE(25)] = 667, - [SMALL_STATE(26)] = 681, - [SMALL_STATE(27)] = 699, - [SMALL_STATE(28)] = 713, - [SMALL_STATE(29)] = 727, - [SMALL_STATE(30)] = 745, - [SMALL_STATE(31)] = 759, - [SMALL_STATE(32)] = 773, - [SMALL_STATE(33)] = 791, - [SMALL_STATE(34)] = 804, - [SMALL_STATE(35)] = 817, - [SMALL_STATE(36)] = 840, - [SMALL_STATE(37)] = 855, - [SMALL_STATE(38)] = 872, - [SMALL_STATE(39)] = 887, - [SMALL_STATE(40)] = 904, - [SMALL_STATE(41)] = 919, - [SMALL_STATE(42)] = 934, - [SMALL_STATE(43)] = 948, - [SMALL_STATE(44)] = 962, - [SMALL_STATE(45)] = 976, - [SMALL_STATE(46)] = 990, - [SMALL_STATE(47)] = 1000, - [SMALL_STATE(48)] = 1012, - [SMALL_STATE(49)] = 1026, - [SMALL_STATE(50)] = 1036, - [SMALL_STATE(51)] = 1048, - [SMALL_STATE(52)] = 1060, - [SMALL_STATE(53)] = 1072, - [SMALL_STATE(54)] = 1079, - [SMALL_STATE(55)] = 1090, - [SMALL_STATE(56)] = 1103, - [SMALL_STATE(57)] = 1114, - [SMALL_STATE(58)] = 1125, - [SMALL_STATE(59)] = 1132, - [SMALL_STATE(60)] = 1143, - [SMALL_STATE(61)] = 1154, - [SMALL_STATE(62)] = 1165, - [SMALL_STATE(63)] = 1176, - [SMALL_STATE(64)] = 1187, - [SMALL_STATE(65)] = 1198, - [SMALL_STATE(66)] = 1205, - [SMALL_STATE(67)] = 1216, - [SMALL_STATE(68)] = 1227, - [SMALL_STATE(69)] = 1240, - [SMALL_STATE(70)] = 1251, - [SMALL_STATE(71)] = 1261, - [SMALL_STATE(72)] = 1271, - [SMALL_STATE(73)] = 1279, - [SMALL_STATE(74)] = 1289, - [SMALL_STATE(75)] = 1295, - [SMALL_STATE(76)] = 1305, - [SMALL_STATE(77)] = 1315, - [SMALL_STATE(78)] = 1325, - [SMALL_STATE(79)] = 1331, - [SMALL_STATE(80)] = 1341, - [SMALL_STATE(81)] = 1351, - [SMALL_STATE(82)] = 1361, - [SMALL_STATE(83)] = 1369, - [SMALL_STATE(84)] = 1375, - [SMALL_STATE(85)] = 1385, - [SMALL_STATE(86)] = 1393, - [SMALL_STATE(87)] = 1403, - [SMALL_STATE(88)] = 1413, - [SMALL_STATE(89)] = 1423, - [SMALL_STATE(90)] = 1429, - [SMALL_STATE(91)] = 1435, - [SMALL_STATE(92)] = 1440, - [SMALL_STATE(93)] = 1447, - [SMALL_STATE(94)] = 1452, - [SMALL_STATE(95)] = 1459, - [SMALL_STATE(96)] = 1464, - [SMALL_STATE(97)] = 1471, - [SMALL_STATE(98)] = 1478, - [SMALL_STATE(99)] = 1483, - [SMALL_STATE(100)] = 1488, - [SMALL_STATE(101)] = 1493, - [SMALL_STATE(102)] = 1498, - [SMALL_STATE(103)] = 1505, - [SMALL_STATE(104)] = 1510, - [SMALL_STATE(105)] = 1517, - [SMALL_STATE(106)] = 1522, - [SMALL_STATE(107)] = 1527, - [SMALL_STATE(108)] = 1532, - [SMALL_STATE(109)] = 1537, - [SMALL_STATE(110)] = 1542, - [SMALL_STATE(111)] = 1547, - [SMALL_STATE(112)] = 1552, - [SMALL_STATE(113)] = 1557, - [SMALL_STATE(114)] = 1562, - [SMALL_STATE(115)] = 1567, - [SMALL_STATE(116)] = 1572, - [SMALL_STATE(117)] = 1577, - [SMALL_STATE(118)] = 1584, - [SMALL_STATE(119)] = 1589, - [SMALL_STATE(120)] = 1594, - [SMALL_STATE(121)] = 1601, - [SMALL_STATE(122)] = 1606, - [SMALL_STATE(123)] = 1611, - [SMALL_STATE(124)] = 1616, - [SMALL_STATE(125)] = 1621, - [SMALL_STATE(126)] = 1626, - [SMALL_STATE(127)] = 1631, - [SMALL_STATE(128)] = 1636, - [SMALL_STATE(129)] = 1643, - [SMALL_STATE(130)] = 1650, - [SMALL_STATE(131)] = 1657, - [SMALL_STATE(132)] = 1664, - [SMALL_STATE(133)] = 1669, - [SMALL_STATE(134)] = 1676, - [SMALL_STATE(135)] = 1683, - [SMALL_STATE(136)] = 1690, - [SMALL_STATE(137)] = 1695, - [SMALL_STATE(138)] = 1700, - [SMALL_STATE(139)] = 1707, - [SMALL_STATE(140)] = 1711, - [SMALL_STATE(141)] = 1715, - [SMALL_STATE(142)] = 1719, - [SMALL_STATE(143)] = 1723, - [SMALL_STATE(144)] = 1727, - [SMALL_STATE(145)] = 1731, - [SMALL_STATE(146)] = 1735, - [SMALL_STATE(147)] = 1739, - [SMALL_STATE(148)] = 1743, - [SMALL_STATE(149)] = 1747, - [SMALL_STATE(150)] = 1751, - [SMALL_STATE(151)] = 1755, - [SMALL_STATE(152)] = 1759, - [SMALL_STATE(153)] = 1763, - [SMALL_STATE(154)] = 1767, - [SMALL_STATE(155)] = 1771, - [SMALL_STATE(156)] = 1775, - [SMALL_STATE(157)] = 1779, - [SMALL_STATE(158)] = 1783, - [SMALL_STATE(159)] = 1787, - [SMALL_STATE(160)] = 1791, - [SMALL_STATE(161)] = 1795, - [SMALL_STATE(162)] = 1799, - [SMALL_STATE(163)] = 1803, - [SMALL_STATE(164)] = 1807, - [SMALL_STATE(165)] = 1811, - [SMALL_STATE(166)] = 1815, - [SMALL_STATE(167)] = 1819, - [SMALL_STATE(168)] = 1823, - [SMALL_STATE(169)] = 1827, -}; - -static const TSParseActionEntry ts_parse_actions[] = { - [0] = {.entry = {.count = 0, .reusable = false}}, - [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), - [3] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fluent_file, 0, 0, 0), - [5] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53), - [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(26), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(131), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(168), - [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), - [17] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_fluent_file, 1, 0, 0), - [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), - [23] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), SHIFT_REPEAT(53), - [26] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), SHIFT_REPEAT(26), - [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), SHIFT_REPEAT(24), - [32] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), SHIFT_REPEAT(131), - [35] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), SHIFT_REPEAT(168), - [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_fluent_file_repeat1, 2, 0, 0), SHIFT_REPEAT(3), - [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(64), - [43] = {.entry = {.count = 1, .reusable = false}}, SHIFT(160), - [45] = {.entry = {.count = 1, .reusable = true}}, SHIFT(146), - [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(105), - [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(80), - [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), - [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), - [55] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), - [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(114), - [59] = {.entry = {.count = 1, .reusable = false}}, SHIFT(120), - [61] = {.entry = {.count = 1, .reusable = false}}, SHIFT(144), - [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(141), - [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), - [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), - [69] = {.entry = {.count = 1, .reusable = true}}, SHIFT(138), - [71] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), - [73] = {.entry = {.count = 1, .reusable = false}}, SHIFT(72), - [75] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), - [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 3, 0, 3), - [79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 3, 0, 3), - [81] = {.entry = {.count = 1, .reusable = true}}, SHIFT(147), - [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 3, 0, 4), - [85] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 3, 0, 4), - [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 3, 0, 4), - [89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 3, 0, 4), - [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 4, 0, 5), - [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 4, 0, 5), - [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 4, 0, 6), - [97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 4, 0, 6), - [99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 4, 0, 3), - [101] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 4, 0, 3), - [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 4, 0, 7), - [105] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 4, 0, 7), - [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 5, 0, 9), - [109] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 5, 0, 9), - [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 4, 0, 6), - [113] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 4, 0, 6), - [115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_message_repeat1, 2, 0, 0), - [117] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_message_repeat1, 2, 0, 0), - [119] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_message_repeat1, 2, 0, 0), SHIFT_REPEAT(147), - [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 5, 0, 10), - [124] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 5, 0, 10), - [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term, 4, 0, 7), - [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term, 4, 0, 7), - [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message, 5, 0, 10), - [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_message, 5, 0, 10), - [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 4, 0, 12), - [136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute, 4, 0, 12), - [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file_comment, 1, 0, 0), - [140] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_file_comment, 1, 0, 0), - [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), - [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_message_repeat1, 1, 0, 0), - [146] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_message_repeat1, 1, 0, 0), - [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group_comment, 1, 0, 0), - [150] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_group_comment, 1, 0, 0), - [152] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), - [154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 3, 0, 0), - [156] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pattern, 3, 0, 0), - [158] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 4, 0, 13), - [160] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute, 4, 0, 13), - [162] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_group_comment_repeat1, 2, 0, 0), - [164] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_group_comment_repeat1, 2, 0, 0), - [166] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_group_comment_repeat1, 2, 0, 0), SHIFT_REPEAT(29), - [169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 5, 0, 14), - [171] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute, 5, 0, 14), - [173] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 5, 0, 12), - [175] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attribute, 5, 0, 12), - [177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_file_comment_repeat1, 2, 0, 0), - [179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_file_comment_repeat1, 2, 0, 0), - [181] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_file_comment_repeat1, 2, 0, 0), SHIFT_REPEAT(32), - [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment_block, 2, 0, 0), - [186] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment_block, 2, 0, 0), - [188] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_doc_commented, 2, 0, 2), - [190] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_doc_commented, 2, 0, 2), - [192] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), - [194] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), - [196] = {.entry = {.count = 1, .reusable = true}}, SHIFT(85), - [198] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), - [200] = {.entry = {.count = 1, .reusable = true}}, SHIFT(126), - [202] = {.entry = {.count = 1, .reusable = true}}, SHIFT(169), - [204] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [206] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 1, 0, 3), - [208] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59), - [210] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), - [212] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), - [214] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [216] = {.entry = {.count = 1, .reusable = false}}, SHIFT(60), - [218] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_selectors_repeat1, 2, 0, 0), SHIFT_REPEAT(85), - [221] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_selectors_repeat1, 2, 0, 0), SHIFT_REPEAT(148), - [224] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_selectors_repeat1, 2, 0, 0), - [226] = {.entry = {.count = 1, .reusable = true}}, SHIFT(166), - [228] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), - [230] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), - [232] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), - [234] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [236] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 3, 0, 11), - [238] = {.entry = {.count = 1, .reusable = false}}, SHIFT(54), - [240] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(6), - [243] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(45), - [246] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), - [248] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_identifier, 2, 0, 1), - [250] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_term_identifier, 2, 0, 1), - [252] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__comment_block, 2, 0, 0), SHIFT_REPEAT(53), - [255] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__comment_block, 2, 0, 0), - [257] = {.entry = {.count = 1, .reusable = false}}, SHIFT(61), - [259] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__comment_block, 1, 0, 0), - [261] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 4, 0, 11), - [263] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), - [265] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), - [267] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), - [269] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), - [271] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), - [273] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), - [275] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 2, 0, 0), - [277] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 2, 0, 3), - [279] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), - [281] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), - [283] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), - [285] = {.entry = {.count = 1, .reusable = true}}, SHIFT(151), - [287] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message_reference, 1, 0, 3), - [289] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), - [291] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string_literal, 3, 0, 0), - [293] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_string_literal_repeat1, 2, 0, 0), - [295] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_string_literal_repeat1, 2, 0, 0), SHIFT_REPEAT(66), - [298] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), - [300] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122), - [302] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), - [304] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [306] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_positional_arguments, 2, 0, 0), - [308] = {.entry = {.count = 1, .reusable = true}}, SHIFT(135), - [310] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_named_arguments, 1, 0, 0), - [312] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), - [314] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [316] = {.entry = {.count = 1, .reusable = true}}, SHIFT(98), - [318] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_positional_arguments, 1, 0, 0), - [320] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_named_arguments, 2, 0, 0), - [322] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_placeable, 3, 0, 0), - [324] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), - [326] = {.entry = {.count = 1, .reusable = false}}, SHIFT(130), - [328] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), - [330] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), - [332] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selectors, 3, 0, 0), - [334] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), - [336] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), - [338] = {.entry = {.count = 1, .reusable = false}}, SHIFT(134), - [340] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_named_arguments_repeat1, 2, 0, 0), SHIFT_REPEAT(135), - [343] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_named_arguments_repeat1, 2, 0, 0), - [345] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_positional_arguments_repeat1, 2, 0, 0), SHIFT_REPEAT(9), - [348] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_positional_arguments_repeat1, 2, 0, 0), - [350] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selector_variant, 4, 0, 15), - [352] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_default_variant, 5, 0, 16), - [354] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 4, 0, 0), - [356] = {.entry = {.count = 1, .reusable = true}}, SHIFT(129), - [358] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), - [360] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_selector_expression, 1, 0, 0), - [362] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression, 1, 0, 0), - [364] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), - [366] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_named_argument, 3, 0, 4), - [368] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 5, 0, 11), - [370] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), - [372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 5, 0, 0), - [374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 2, 0, 0), - [376] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__expression, 1, 0, 8), - [378] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_variable, 2, 0, 1), - [380] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_reference, 2, 0, 3), - [382] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_reference, 3, 0, 3), - [384] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_message_reference, 3, 0, 11), - [386] = {.entry = {.count = 1, .reusable = true}}, SHIFT(84), - [388] = {.entry = {.count = 1, .reusable = true}}, SHIFT(162), - [390] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_term_reference, 3, 0, 3), - [392] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_function_call, 3, 0, 0), - [394] = {.entry = {.count = 1, .reusable = true}}, SHIFT(157), - [396] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), - [398] = {.entry = {.count = 1, .reusable = true}}, SHIFT(81), - [400] = {.entry = {.count = 1, .reusable = true}}, SHIFT(154), - [402] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), - [404] = {.entry = {.count = 1, .reusable = true}}, SHIFT(104), - [406] = {.entry = {.count = 1, .reusable = true}}, SHIFT(132), - [408] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [410] = {.entry = {.count = 1, .reusable = true}}, SHIFT(46), - [412] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), - [414] = {.entry = {.count = 1, .reusable = true}}, SHIFT(117), - [416] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), - [418] = {.entry = {.count = 1, .reusable = true}}, SHIFT(143), - [420] = {.entry = {.count = 1, .reusable = true}}, SHIFT(103), - [422] = {.entry = {.count = 1, .reusable = true}}, SHIFT(113), - [424] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), - [426] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), - [428] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), - [430] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), - [432] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), - [434] = {.entry = {.count = 1, .reusable = true}}, SHIFT(165), - [436] = {.entry = {.count = 1, .reusable = true}}, SHIFT(137), - [438] = {.entry = {.count = 1, .reusable = true}}, SHIFT(124), - [440] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), - [442] = {.entry = {.count = 1, .reusable = true}}, SHIFT(125), - [444] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), - [446] = {.entry = {.count = 1, .reusable = true}}, SHIFT(94), - [448] = {.entry = {.count = 1, .reusable = true}}, SHIFT(102), - [450] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), - [452] = {.entry = {.count = 1, .reusable = true}}, SHIFT(107), - [454] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44), -}; - -enum ts_external_scanner_symbol_identifiers { - ts_external_token__pattern_start = 0, - ts_external_token_pure_text = 1, - ts_external_token__pattern_end = 2, - ts_external_token__pattern_skip = 3, - ts_external_token__blank_lines = 4, - ts_external_token_unfinished_line = 5, - ts_external_token__close_comment_block = 6, - ts_external_token__end_positional_args = 7, - ts_external_token__error_sentinel = 8, -}; - -static const TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { - [ts_external_token__pattern_start] = sym__pattern_start, - [ts_external_token_pure_text] = sym_pure_text, - [ts_external_token__pattern_end] = sym__pattern_end, - [ts_external_token__pattern_skip] = sym__pattern_skip, - [ts_external_token__blank_lines] = sym__blank_lines, - [ts_external_token_unfinished_line] = sym_unfinished_line, - [ts_external_token__close_comment_block] = sym__close_comment_block, - [ts_external_token__end_positional_args] = sym__end_positional_args, - [ts_external_token__error_sentinel] = sym__error_sentinel, -}; - -static const bool ts_external_scanner_states[9][EXTERNAL_TOKEN_COUNT] = { - [1] = { - [ts_external_token__pattern_start] = true, - [ts_external_token_pure_text] = true, - [ts_external_token__pattern_end] = true, - [ts_external_token__pattern_skip] = true, - [ts_external_token__blank_lines] = true, - [ts_external_token_unfinished_line] = true, - [ts_external_token__close_comment_block] = true, - [ts_external_token__end_positional_args] = true, - [ts_external_token__error_sentinel] = true, - }, - [2] = { - [ts_external_token__blank_lines] = true, - [ts_external_token_unfinished_line] = true, - }, - [3] = { - [ts_external_token__close_comment_block] = true, - }, - [4] = { - [ts_external_token__end_positional_args] = true, - }, - [5] = { - [ts_external_token_pure_text] = true, - [ts_external_token__pattern_end] = true, - }, - [6] = { - [ts_external_token_pure_text] = true, - }, - [7] = { - [ts_external_token__pattern_start] = true, - [ts_external_token__pattern_skip] = true, - }, - [8] = { - [ts_external_token__pattern_start] = true, - }, -}; - -#ifdef __cplusplus -extern "C" { -#endif -void *tree_sitter_fluent_external_scanner_create(void); -void tree_sitter_fluent_external_scanner_destroy(void *); -bool tree_sitter_fluent_external_scanner_scan(void *, TSLexer *, const bool *); -unsigned tree_sitter_fluent_external_scanner_serialize(void *, char *); -void tree_sitter_fluent_external_scanner_deserialize(void *, const char *, unsigned); - -#ifdef TREE_SITTER_HIDE_SYMBOLS -#define TS_PUBLIC -#elif defined(_WIN32) -#define TS_PUBLIC __declspec(dllexport) -#else -#define TS_PUBLIC __attribute__((visibility("default"))) -#endif - -TS_PUBLIC const TSLanguage *tree_sitter_fluent(void) { - static const TSLanguage language = { - .abi_version = LANGUAGE_VERSION, - .symbol_count = SYMBOL_COUNT, - .alias_count = ALIAS_COUNT, - .token_count = TOKEN_COUNT, - .external_token_count = EXTERNAL_TOKEN_COUNT, - .state_count = STATE_COUNT, - .large_state_count = LARGE_STATE_COUNT, - .production_id_count = PRODUCTION_ID_COUNT, - .supertype_count = SUPERTYPE_COUNT, - .field_count = FIELD_COUNT, - .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, - .parse_table = &ts_parse_table[0][0], - .small_parse_table = ts_small_parse_table, - .small_parse_table_map = ts_small_parse_table_map, - .parse_actions = ts_parse_actions, - .symbol_names = ts_symbol_names, - .field_names = ts_field_names, - .field_map_slices = ts_field_map_slices, - .field_map_entries = ts_field_map_entries, - .symbol_metadata = ts_symbol_metadata, - .public_symbol_map = ts_symbol_map, - .alias_map = ts_non_terminal_alias_map, - .alias_sequences = &ts_alias_sequences[0][0], - .lex_modes = (const void*)ts_lex_modes, - .lex_fn = ts_lex, - .external_scanner = { - &ts_external_scanner_states[0][0], - ts_external_scanner_symbol_map, - tree_sitter_fluent_external_scanner_create, - tree_sitter_fluent_external_scanner_destroy, - tree_sitter_fluent_external_scanner_scan, - tree_sitter_fluent_external_scanner_serialize, - tree_sitter_fluent_external_scanner_deserialize, - }, - .primary_state_ids = ts_primary_state_ids, - .name = "fluent", - .max_reserved_word_set_size = 0, - .metadata = { - .major_version = 0, - .minor_version = 0, - .patch_version = 1, - }, - }; - return &language; -} -#ifdef __cplusplus -} -#endif diff --git a/crates/jj-diff/grammars/fluent/src/scanner.c b/crates/jj-diff/grammars/fluent/src/scanner.c deleted file mode 100644 index b112bc61c..000000000 --- a/crates/jj-diff/grammars/fluent/src/scanner.c +++ /dev/null @@ -1,378 +0,0 @@ -#include "tree_sitter/alloc.h" -#include "tree_sitter/parser.h" - -// #define FLUENT_IS_DEBUG - -#ifdef FLUENT_IS_DEBUG -#define FLUENT_DEBUG(...) lexer->log(lexer, __VA_ARGS__); -#else -#define FLUENT_DEBUG(...) -#endif - -enum TokenType { - PATTERN_START, - PATTERN_PURE_TEXT, - PATTERN_END, - PATTERN_SKIP, - BLANK_LINES, - UNFINISHED_LINE, - CLOSE_COMMENT_BLOCK, - END_POSITIONAL_ARGS, - ERROR_SENTINEL, -}; - -typedef struct { - uint16_t in_pattern; - bool is_skip; -} Scanner; - -void *tree_sitter_fluent_external_scanner_create() { - Scanner *s = (Scanner *)ts_malloc(sizeof(Scanner)); - s->in_pattern = 0; - s->is_skip = false; - return s; -} - -void tree_sitter_fluent_external_scanner_destroy(void *payload) { - ts_free(payload); -} - -unsigned tree_sitter_fluent_external_scanner_serialize(void *payload, - char *buffer) { - Scanner *s = (Scanner *)payload; - buffer[0] = s->in_pattern & 0xff; - buffer[1] = (s->in_pattern >> 8) & 0xff; - buffer[2] = s->is_skip ? 1 : 0; - return 3; -} - -void tree_sitter_fluent_external_scanner_deserialize(void *payload, - const char *buffer, - unsigned length) { - Scanner *s = (Scanner *)payload; - if (length >= 3) { - s->in_pattern = (uint8_t)buffer[0] | ((uint16_t)(uint8_t)buffer[1] << 8); - s->is_skip = buffer[2]; - } else { - s->in_pattern = 0; - s->is_skip = false; - } -} - -static bool is_line_end(int32_t character) { - return character == '\n' || character == '\r'; -} - -// returns true if it stopped at a special stop char -static bool consume_spaces_and_newlines_count(TSLexer *lexer, int *count) { - FLUENT_DEBUG("start consuming spaces and newlines") - - while (lexer->lookahead == ' ') { - lexer->advance(lexer, false); - *count = *count + 1; - FLUENT_DEBUG("consumed initial space"); - } - - while (is_line_end(lexer->lookahead)) { - lexer->advance(lexer, false); - *count = *count + 1; - if (is_line_end(lexer->lookahead)) { - continue; - } - - if (lexer->lookahead == '{') { - return false; - } - - if (lexer->lookahead != ' ') { - FLUENT_DEBUG("stop non space: '%c'", lexer->lookahead) - return true; - } - - while (lexer->lookahead == ' ') { - lexer->advance(lexer, false); - *count = *count + 1; - } - - if (lexer->lookahead == '.' || lexer->lookahead == '}' || - lexer->lookahead == '[' || lexer->lookahead == '*') { - FLUENT_DEBUG("stop special: '%c'", lexer->lookahead) - return true; - } - } - - FLUENT_DEBUG("finished consuming") - - return false; -} - -static bool consume_spaces_and_newlines(TSLexer *lexer) { - int count = 0; - return consume_spaces_and_newlines_count(lexer, &count); -} - -static bool consume_blank_lines(TSLexer *lexer) { - bool consumed_line = false; - - while (lexer->lookahead == ' ' || is_line_end(lexer->lookahead)) { - while (lexer->lookahead == ' ') { - lexer->advance(lexer, false); - } - if (!is_line_end(lexer->lookahead)) { - break; - } - lexer->advance(lexer, false); - consumed_line = true; - lexer->mark_end(lexer); - } - - return consumed_line; -} - -static bool is_close_comment_block(TSLexer *lexer) { - if (is_line_end(lexer->lookahead)) { - return true; - } - - bool is_hash = lexer->lookahead == '#'; - - if (!is_line_end(lexer->lookahead) && !is_hash) { - return false; - } - - lexer->mark_end(lexer); - lexer->advance(lexer, false); - - if (!is_hash && lexer->lookahead == '#') { - lexer->advance(lexer, false); - } - - if (lexer->lookahead != ' ') { - return true; - } - - return false; -} - -static bool consume_identifier(TSLexer *lexer) { - if (!((lexer->lookahead >= 'a' && lexer->lookahead <= 'z') || - (lexer->lookahead >= 'A' && lexer->lookahead <= 'Z'))) { - return false; - } - - lexer->advance(lexer, false); - - while ((lexer->lookahead >= 'a' && lexer->lookahead <= 'z') || - (lexer->lookahead >= 'A' && lexer->lookahead <= 'Z') || - (lexer->lookahead >= '0' && lexer->lookahead <= '9') || - lexer->lookahead == '_' || lexer->lookahead == '-') { - lexer->advance(lexer, false); - } - - return true; -} - -static bool is_end_positional_args(TSLexer *lexer) { - lexer->mark_end(lexer); - consume_spaces_and_newlines(lexer); - - if (lexer->lookahead == ')') { - return true; - } - - if (lexer->lookahead != ',') { - return false; - } - lexer->advance(lexer, false); - - consume_spaces_and_newlines(lexer); - lexer->mark_end(lexer); - - if (!consume_identifier(lexer)) { - return false; - } - - consume_spaces_and_newlines(lexer); - - return lexer->lookahead == ':'; -} - -bool tree_sitter_fluent_external_scanner_scan(void *payload, TSLexer *lexer, - const bool *valid_symbols) { - Scanner *s = (Scanner *)payload; - - FLUENT_DEBUG("starting scan") - - if (valid_symbols[ERROR_SENTINEL]) { - return false; - } - - if (lexer->lookahead == 0) { - FLUENT_DEBUG("lookahead is 0") - - if (valid_symbols[PATTERN_END] && s->in_pattern > 0) { - s->in_pattern -= 1; - lexer->result_symbol = PATTERN_END; - FLUENT_DEBUG("return PATTERN_END") - return true; - } - if (valid_symbols[CLOSE_COMMENT_BLOCK]) { - lexer->result_symbol = CLOSE_COMMENT_BLOCK; - FLUENT_DEBUG("return CLOSE_COMMENT_BLOCK") - return true; - } - FLUENT_DEBUG("return false") - return false; - } - - if (valid_symbols[PATTERN_SKIP]) { - FLUENT_DEBUG("test PATTERN_SKIP") - if (is_line_end(lexer->lookahead) || lexer->lookahead == ' ') { - if (consume_spaces_and_newlines(lexer)) { - s->is_skip = true; - lexer->result_symbol = PATTERN_SKIP; - FLUENT_DEBUG("return PATTERN_SKIP") - return true; - } - } - FLUENT_DEBUG("no PATTERN_SKIP") - } - - if (valid_symbols[PATTERN_START] && s->in_pattern < UINT16_MAX && - lexer->lookahead != 0) { - FLUENT_DEBUG("start PATTERN_START") - s->in_pattern += 1; - s->is_skip = false; - while (lexer->lookahead == ' ') { - lexer->advance(lexer, false); - } - lexer->result_symbol = PATTERN_START; - FLUENT_DEBUG("return PATTERN_START") - return true; - } - - bool encountered_special = false; - - if (valid_symbols[PATTERN_PURE_TEXT] && s->in_pattern && !s->is_skip) { - FLUENT_DEBUG("test PATTERN_PURE_TEXT") - bool has_content = false; - - while (lexer->lookahead != 0) { - bool started_with_space = false; - if (lexer->lookahead == ' ') { - FLUENT_DEBUG("consuming spaces") - lexer->mark_end(lexer); - started_with_space = true; - while (lexer->lookahead == ' ') { - lexer->advance(lexer, false); - } - } - - if (is_line_end(lexer->lookahead)) { - FLUENT_DEBUG("detected nl") - if (!started_with_space) { - FLUENT_DEBUG("marking end") - lexer->mark_end(lexer); - } - - if (consume_spaces_and_newlines(lexer)) { - encountered_special = true; - FLUENT_DEBUG("breaking special") - break; - } - - FLUENT_DEBUG("mark has_content") - has_content = true; - lexer->mark_end(lexer); - } - - if (lexer->lookahead == '{' || lexer->lookahead == '}') { - if (started_with_space) { - has_content = true; - lexer->mark_end(lexer); - } - FLUENT_DEBUG("break placeable start") - break; - } - - lexer->advance(lexer, false); - has_content = true; - lexer->mark_end(lexer); - } - - if (has_content) { - FLUENT_DEBUG("returning PATTERN_PURE_TEXT") - lexer->result_symbol = PATTERN_PURE_TEXT; - return true; - } - - FLUENT_DEBUG("no PATTERN_PURE_TEXT") - } - - if (valid_symbols[PATTERN_END] && s->in_pattern) { - FLUENT_DEBUG("test PATTERN_END") - int count = 0; - bool stopped = false; - if (!encountered_special) { - stopped = consume_spaces_and_newlines_count(lexer, &count); - } - if (encountered_special || lexer->lookahead == '}' || - (count > 0 && stopped)) { - s->in_pattern -= 1; - lexer->mark_end(lexer); - lexer->result_symbol = PATTERN_END; - FLUENT_DEBUG("return PATTERN_END") - return true; - } - FLUENT_DEBUG("no PATTERN_END") - } - - if (valid_symbols[BLANK_LINES] && - (lexer->lookahead == ' ' || is_line_end(lexer->lookahead))) { - FLUENT_DEBUG("start BLANK_LINES") - if (consume_blank_lines(lexer)) { - lexer->result_symbol = BLANK_LINES; - FLUENT_DEBUG("return BLANK_LINES") - return true; - } - } - - if (valid_symbols[UNFINISHED_LINE] && s->in_pattern == UINT16_MAX) { - FLUENT_DEBUG("start UNFINISHED_LINE") - while (lexer->lookahead != 0 && !is_line_end(lexer->lookahead)) { - lexer->advance(lexer, false); - } - if (is_line_end(lexer->lookahead)) { - lexer->advance(lexer, false); - } - lexer->mark_end(lexer); - lexer->result_symbol = UNFINISHED_LINE; - s->is_skip = false; - s->in_pattern = 0; - FLUENT_DEBUG("return UNFINISHED_LINE") - return true; - } - - if (valid_symbols[CLOSE_COMMENT_BLOCK]) { - FLUENT_DEBUG("test CLOSE_COMMENT_BLOCK") - if (is_close_comment_block(lexer)) { - lexer->result_symbol = CLOSE_COMMENT_BLOCK; - FLUENT_DEBUG("return CLOSE_COMMENT_BLOCK") - return true; - } - FLUENT_DEBUG("no CLOSE_COMMENT_BLOCK") - } - - if (valid_symbols[END_POSITIONAL_ARGS]) { - FLUENT_DEBUG("test END_POSITIONAL_ARGS") - if (is_end_positional_args(lexer)) { - lexer->result_symbol = END_POSITIONAL_ARGS; - FLUENT_DEBUG("return END_POSITIONAL_ARGS") - return true; - } - FLUENT_DEBUG("no END_POSITIONAL_ARGS") - } - - FLUENT_DEBUG("scan ended with false") - return false; -} diff --git a/crates/jj-diff/grammars/fluent/src/tree_sitter/alloc.h b/crates/jj-diff/grammars/fluent/src/tree_sitter/alloc.h deleted file mode 100644 index 1abdd1201..000000000 --- a/crates/jj-diff/grammars/fluent/src/tree_sitter/alloc.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef TREE_SITTER_ALLOC_H_ -#define TREE_SITTER_ALLOC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -// Allow clients to override allocation functions -#ifdef TREE_SITTER_REUSE_ALLOCATOR - -extern void *(*ts_current_malloc)(size_t size); -extern void *(*ts_current_calloc)(size_t count, size_t size); -extern void *(*ts_current_realloc)(void *ptr, size_t size); -extern void (*ts_current_free)(void *ptr); - -#ifndef ts_malloc -#define ts_malloc ts_current_malloc -#endif -#ifndef ts_calloc -#define ts_calloc ts_current_calloc -#endif -#ifndef ts_realloc -#define ts_realloc ts_current_realloc -#endif -#ifndef ts_free -#define ts_free ts_current_free -#endif - -#else - -#ifndef ts_malloc -#define ts_malloc malloc -#endif -#ifndef ts_calloc -#define ts_calloc calloc -#endif -#ifndef ts_realloc -#define ts_realloc realloc -#endif -#ifndef ts_free -#define ts_free free -#endif - -#endif - -#ifdef __cplusplus -} -#endif - -#endif // TREE_SITTER_ALLOC_H_ diff --git a/crates/jj-diff/grammars/fluent/src/tree_sitter/array.h b/crates/jj-diff/grammars/fluent/src/tree_sitter/array.h deleted file mode 100644 index 56fc8cd47..000000000 --- a/crates/jj-diff/grammars/fluent/src/tree_sitter/array.h +++ /dev/null @@ -1,330 +0,0 @@ -#ifndef TREE_SITTER_ARRAY_H_ -#define TREE_SITTER_ARRAY_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "./alloc.h" - -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4101) -#elif defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-variable" -#endif - -#define Array(T) \ - struct { \ - T *contents; \ - uint32_t size; \ - uint32_t capacity; \ - } - -/// Initialize an array. -#define array_init(self) \ - ((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL) - -/// Create an empty array. -#define array_new() \ - { NULL, 0, 0 } - -/// Get a pointer to the element at a given `index` in the array. -#define array_get(self, _index) \ - (assert((uint32_t)(_index) < (self)->size), &(self)->contents[_index]) - -/// Get a pointer to the first element in the array. -#define array_front(self) array_get(self, 0) - -/// Get a pointer to the last element in the array. -#define array_back(self) array_get(self, (self)->size - 1) - -/// Clear the array, setting its size to zero. Note that this does not free any -/// memory allocated for the array's contents. -#define array_clear(self) ((self)->size = 0) - -/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is -/// less than the array's current capacity, this function has no effect. -#define array_reserve(self, new_capacity) \ - ((self)->contents = _array__reserve( \ - (void *)(self)->contents, &(self)->capacity, \ - array_elem_size(self), new_capacity) \ - ) - -/// Free any memory allocated for this array. Note that this does not free any -/// memory allocated for the array's contents. -#define array_delete(self) \ - do { \ - if ((self)->contents) ts_free((self)->contents); \ - (self)->contents = NULL; \ - (self)->size = 0; \ - (self)->capacity = 0; \ - } while (0) - -/// Push a new `element` onto the end of the array. -#define array_push(self, element) \ - do { \ - (self)->contents = _array__grow( \ - (void *)(self)->contents, (self)->size, &(self)->capacity, \ - 1, array_elem_size(self) \ - ); \ - (self)->contents[(self)->size++] = (element); \ - } while(0) - -/// Increase the array's size by `count` elements. -/// New elements are zero-initialized. -#define array_grow_by(self, count) \ - do { \ - if ((count) == 0) break; \ - (self)->contents = _array__grow( \ - (self)->contents, (self)->size, &(self)->capacity, \ - count, array_elem_size(self) \ - ); \ - memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \ - (self)->size += (count); \ - } while (0) - -/// Append all elements from one array to the end of another. -#define array_push_all(self, other) \ - array_extend((self), (other)->size, (other)->contents) - -/// Append `count` elements to the end of the array, reading their values from the -/// `contents` pointer. -#define array_extend(self, count, other_contents) \ - (self)->contents = _array__splice( \ - (void*)(self)->contents, &(self)->size, &(self)->capacity, \ - array_elem_size(self), (self)->size, 0, count, other_contents \ - ) - -/// Remove `old_count` elements from the array starting at the given `index`. At -/// the same index, insert `new_count` new elements, reading their values from the -/// `new_contents` pointer. -#define array_splice(self, _index, old_count, new_count, new_contents) \ - (self)->contents = _array__splice( \ - (void *)(self)->contents, &(self)->size, &(self)->capacity, \ - array_elem_size(self), _index, old_count, new_count, new_contents \ - ) - -/// Insert one `element` into the array at the given `index`. -#define array_insert(self, _index, element) \ - (self)->contents = _array__splice( \ - (void *)(self)->contents, &(self)->size, &(self)->capacity, \ - array_elem_size(self), _index, 0, 1, &(element) \ - ) - -/// Remove one element from the array at the given `index`. -#define array_erase(self, _index) \ - _array__erase((void *)(self)->contents, &(self)->size, array_elem_size(self), _index) - -/// Pop the last element off the array, returning the element by value. -#define array_pop(self) ((self)->contents[--(self)->size]) - -/// Assign the contents of one array to another, reallocating if necessary. -#define array_assign(self, other) \ - (self)->contents = _array__assign( \ - (void *)(self)->contents, &(self)->size, &(self)->capacity, \ - (const void *)(other)->contents, (other)->size, array_elem_size(self) \ - ) - -/// Swap one array with another -#define array_swap(self, other) \ - do { \ - void *_array_swap_tmp = (void *)(self)->contents; \ - (self)->contents = (other)->contents; \ - (other)->contents = _array_swap_tmp; \ - _array__swap(&(self)->size, &(self)->capacity, \ - &(other)->size, &(other)->capacity); \ - } while (0) - -/// Get the size of the array contents -#define array_elem_size(self) (sizeof *(self)->contents) - -/// Search a sorted array for a given `needle` value, using the given `compare` -/// callback to determine the order. -/// -/// If an existing element is found to be equal to `needle`, then the `index` -/// out-parameter is set to the existing value's index, and the `exists` -/// out-parameter is set to true. Otherwise, `index` is set to an index where -/// `needle` should be inserted in order to preserve the sorting, and `exists` -/// is set to false. -#define array_search_sorted_with(self, compare, needle, _index, _exists) \ - _array__search_sorted(self, 0, compare, , needle, _index, _exists) - -/// Search a sorted array for a given `needle` value, using integer comparisons -/// of a given struct field (specified with a leading dot) to determine the order. -/// -/// See also `array_search_sorted_with`. -#define array_search_sorted_by(self, field, needle, _index, _exists) \ - _array__search_sorted(self, 0, _compare_int, field, needle, _index, _exists) - -/// Insert a given `value` into a sorted array, using the given `compare` -/// callback to determine the order. -#define array_insert_sorted_with(self, compare, value) \ - do { \ - unsigned _index, _exists; \ - array_search_sorted_with(self, compare, &(value), &_index, &_exists); \ - if (!_exists) array_insert(self, _index, value); \ - } while (0) - -/// Insert a given `value` into a sorted array, using integer comparisons of -/// a given struct field (specified with a leading dot) to determine the order. -/// -/// See also `array_search_sorted_by`. -#define array_insert_sorted_by(self, field, value) \ - do { \ - unsigned _index, _exists; \ - array_search_sorted_by(self, field, (value) field, &_index, &_exists); \ - if (!_exists) array_insert(self, _index, value); \ - } while (0) - -// Private - -// Pointers to individual `Array` fields (rather than the entire `Array` itself) -// are passed to the various `_array__*` functions below to address strict aliasing -// violations that arises when the _entire_ `Array` struct is passed as `Array(void)*`. -// -// The `Array` type itself was not altered as a solution in order to avoid breakage -// with existing consumers (in particular, parsers with external scanners). - -/// This is not what you're looking for, see `array_erase`. -static inline void _array__erase(void* self_contents, uint32_t *size, - size_t element_size, uint32_t index) { - assert(index < *size); - char *contents = (char *)self_contents; - memmove(contents + index * element_size, contents + (index + 1) * element_size, - (*size - index - 1) * element_size); - (*size)--; -} - -/// This is not what you're looking for, see `array_reserve`. -static inline void *_array__reserve(void *contents, uint32_t *capacity, - size_t element_size, uint32_t new_capacity) { - void *new_contents = contents; - if (new_capacity > *capacity) { - if (contents) { - new_contents = ts_realloc(contents, new_capacity * element_size); - } else { - new_contents = ts_malloc(new_capacity * element_size); - } - *capacity = new_capacity; - } - return new_contents; -} - -/// This is not what you're looking for, see `array_assign`. -static inline void *_array__assign(void* self_contents, uint32_t *self_size, uint32_t *self_capacity, - const void *other_contents, uint32_t other_size, size_t element_size) { - void *new_contents = _array__reserve(self_contents, self_capacity, element_size, other_size); - *self_size = other_size; - memcpy(new_contents, other_contents, *self_size * element_size); - return new_contents; -} - -/// This is not what you're looking for, see `array_swap`. -static inline void _array__swap(uint32_t *self_size, uint32_t *self_capacity, - uint32_t *other_size, uint32_t *other_capacity) { - uint32_t tmp_size = *self_size; - uint32_t tmp_capacity = *self_capacity; - *self_size = *other_size; - *self_capacity = *other_capacity; - *other_size = tmp_size; - *other_capacity = tmp_capacity; -} - -/// This is not what you're looking for, see `array_push` or `array_grow_by`. -static inline void *_array__grow(void *contents, uint32_t size, uint32_t *capacity, - uint32_t count, size_t element_size) { - void *new_contents = contents; - uint32_t new_size = size + count; - if (new_size > *capacity) { - uint32_t new_capacity = *capacity * 2; - if (new_capacity < 8) new_capacity = 8; - if (new_capacity < new_size) new_capacity = new_size; - new_contents = _array__reserve(contents, capacity, element_size, new_capacity); - } - return new_contents; -} - -/// This is not what you're looking for, see `array_splice`. -static inline void *_array__splice(void *self_contents, uint32_t *size, uint32_t *capacity, - size_t element_size, - uint32_t index, uint32_t old_count, - uint32_t new_count, const void *elements) { - uint32_t new_size = *size + new_count - old_count; - uint32_t old_end = index + old_count; - uint32_t new_end = index + new_count; - assert(old_end <= *size); - - void *new_contents = _array__reserve(self_contents, capacity, element_size, new_size); - - char *contents = (char *)new_contents; - if (*size > old_end) { - memmove( - contents + new_end * element_size, - contents + old_end * element_size, - (*size - old_end) * element_size - ); - } - if (new_count > 0) { - if (elements) { - memcpy( - (contents + index * element_size), - elements, - new_count * element_size - ); - } else { - memset( - (contents + index * element_size), - 0, - new_count * element_size - ); - } - } - *size += new_count - old_count; - - return new_contents; -} - -/// A binary search routine, based on Rust's `std::slice::binary_search_by`. -/// This is not what you're looking for, see `array_search_sorted_with` or `array_search_sorted_by`. -#define _array__search_sorted(self, start, compare, suffix, needle, _index, _exists) \ - do { \ - *(_index) = start; \ - *(_exists) = false; \ - uint32_t size = (self)->size - *(_index); \ - if (size == 0) break; \ - int comparison; \ - while (size > 1) { \ - uint32_t half_size = size / 2; \ - uint32_t mid_index = *(_index) + half_size; \ - comparison = compare(&((self)->contents[mid_index] suffix), (needle)); \ - if (comparison <= 0) *(_index) = mid_index; \ - size -= half_size; \ - } \ - comparison = compare(&((self)->contents[*(_index)] suffix), (needle)); \ - if (comparison == 0) *(_exists) = true; \ - else if (comparison < 0) *(_index) += 1; \ - } while (0) - -/// Helper macro for the `_sorted_by` routines below. This takes the left (existing) -/// parameter by reference in order to work with the generic sorting function above. -#define _compare_int(a, b) ((int)*(a) - (int)(b)) - -#ifdef _MSC_VER -#pragma warning(pop) -#elif defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif // TREE_SITTER_ARRAY_H_ diff --git a/crates/jj-diff/grammars/fluent/src/tree_sitter/parser.h b/crates/jj-diff/grammars/fluent/src/tree_sitter/parser.h deleted file mode 100644 index 858107deb..000000000 --- a/crates/jj-diff/grammars/fluent/src/tree_sitter/parser.h +++ /dev/null @@ -1,286 +0,0 @@ -#ifndef TREE_SITTER_PARSER_H_ -#define TREE_SITTER_PARSER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#define ts_builtin_sym_error ((TSSymbol)-1) -#define ts_builtin_sym_end 0 -#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 - -#ifndef TREE_SITTER_API_H_ -typedef uint16_t TSStateId; -typedef uint16_t TSSymbol; -typedef uint16_t TSFieldId; -typedef struct TSLanguage TSLanguage; -typedef struct TSLanguageMetadata { - uint8_t major_version; - uint8_t minor_version; - uint8_t patch_version; -} TSLanguageMetadata; -#endif - -typedef struct { - TSFieldId field_id; - uint8_t child_index; - bool inherited; -} TSFieldMapEntry; - -// Used to index the field and supertype maps. -typedef struct { - uint16_t index; - uint16_t length; -} TSMapSlice; - -typedef struct { - bool visible; - bool named; - bool supertype; -} TSSymbolMetadata; - -typedef struct TSLexer TSLexer; - -struct TSLexer { - int32_t lookahead; - TSSymbol result_symbol; - void (*advance)(TSLexer *, bool); - void (*mark_end)(TSLexer *); - uint32_t (*get_column)(TSLexer *); - bool (*is_at_included_range_start)(const TSLexer *); - bool (*eof)(const TSLexer *); - void (*log)(const TSLexer *, const char *, ...); -}; - -typedef enum { - TSParseActionTypeShift, - TSParseActionTypeReduce, - TSParseActionTypeAccept, - TSParseActionTypeRecover, -} TSParseActionType; - -typedef union { - struct { - uint8_t type; - TSStateId state; - bool extra; - bool repetition; - } shift; - struct { - uint8_t type; - uint8_t child_count; - TSSymbol symbol; - int16_t dynamic_precedence; - uint16_t production_id; - } reduce; - uint8_t type; -} TSParseAction; - -typedef struct { - uint16_t lex_state; - uint16_t external_lex_state; -} TSLexMode; - -typedef struct { - uint16_t lex_state; - uint16_t external_lex_state; - uint16_t reserved_word_set_id; -} TSLexerMode; - -typedef union { - TSParseAction action; - struct { - uint8_t count; - bool reusable; - } entry; -} TSParseActionEntry; - -typedef struct { - int32_t start; - int32_t end; -} TSCharacterRange; - -struct TSLanguage { - uint32_t abi_version; - uint32_t symbol_count; - uint32_t alias_count; - uint32_t token_count; - uint32_t external_token_count; - uint32_t state_count; - uint32_t large_state_count; - uint32_t production_id_count; - uint32_t field_count; - uint16_t max_alias_sequence_length; - const uint16_t *parse_table; - const uint16_t *small_parse_table; - const uint32_t *small_parse_table_map; - const TSParseActionEntry *parse_actions; - const char * const *symbol_names; - const char * const *field_names; - const TSMapSlice *field_map_slices; - const TSFieldMapEntry *field_map_entries; - const TSSymbolMetadata *symbol_metadata; - const TSSymbol *public_symbol_map; - const uint16_t *alias_map; - const TSSymbol *alias_sequences; - const TSLexerMode *lex_modes; - bool (*lex_fn)(TSLexer *, TSStateId); - bool (*keyword_lex_fn)(TSLexer *, TSStateId); - TSSymbol keyword_capture_token; - struct { - const bool *states; - const TSSymbol *symbol_map; - void *(*create)(void); - void (*destroy)(void *); - bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); - unsigned (*serialize)(void *, char *); - void (*deserialize)(void *, const char *, unsigned); - } external_scanner; - const TSStateId *primary_state_ids; - const char *name; - const TSSymbol *reserved_words; - uint16_t max_reserved_word_set_size; - uint32_t supertype_count; - const TSSymbol *supertype_symbols; - const TSMapSlice *supertype_map_slices; - const TSSymbol *supertype_map_entries; - TSLanguageMetadata metadata; -}; - -static inline bool set_contains(const TSCharacterRange *ranges, uint32_t len, int32_t lookahead) { - uint32_t index = 0; - uint32_t size = len - index; - while (size > 1) { - uint32_t half_size = size / 2; - uint32_t mid_index = index + half_size; - const TSCharacterRange *range = &ranges[mid_index]; - if (lookahead >= range->start && lookahead <= range->end) { - return true; - } else if (lookahead > range->end) { - index = mid_index; - } - size -= half_size; - } - const TSCharacterRange *range = &ranges[index]; - return (lookahead >= range->start && lookahead <= range->end); -} - -/* - * Lexer Macros - */ - -#ifdef _MSC_VER -#define UNUSED __pragma(warning(suppress : 4101)) -#else -#define UNUSED __attribute__((unused)) -#endif - -#define START_LEXER() \ - bool result = false; \ - bool skip = false; \ - UNUSED \ - bool eof = false; \ - int32_t lookahead; \ - goto start; \ - next_state: \ - lexer->advance(lexer, skip); \ - start: \ - skip = false; \ - lookahead = lexer->lookahead; - -#define ADVANCE(state_value) \ - { \ - state = state_value; \ - goto next_state; \ - } - -#define ADVANCE_MAP(...) \ - { \ - static const uint16_t map[] = { __VA_ARGS__ }; \ - for (uint32_t i = 0; i < sizeof(map) / sizeof(map[0]); i += 2) { \ - if (map[i] == lookahead) { \ - state = map[i + 1]; \ - goto next_state; \ - } \ - } \ - } - -#define SKIP(state_value) \ - { \ - skip = true; \ - state = state_value; \ - goto next_state; \ - } - -#define ACCEPT_TOKEN(symbol_value) \ - result = true; \ - lexer->result_symbol = symbol_value; \ - lexer->mark_end(lexer); - -#define END_STATE() return result; - -/* - * Parse Table Macros - */ - -#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT) - -#define STATE(id) id - -#define ACTIONS(id) id - -#define SHIFT(state_value) \ - {{ \ - .shift = { \ - .type = TSParseActionTypeShift, \ - .state = (state_value) \ - } \ - }} - -#define SHIFT_REPEAT(state_value) \ - {{ \ - .shift = { \ - .type = TSParseActionTypeShift, \ - .state = (state_value), \ - .repetition = true \ - } \ - }} - -#define SHIFT_EXTRA() \ - {{ \ - .shift = { \ - .type = TSParseActionTypeShift, \ - .extra = true \ - } \ - }} - -#define REDUCE(symbol_name, children, precedence, prod_id) \ - {{ \ - .reduce = { \ - .type = TSParseActionTypeReduce, \ - .symbol = symbol_name, \ - .child_count = children, \ - .dynamic_precedence = precedence, \ - .production_id = prod_id \ - }, \ - }} - -#define RECOVER() \ - {{ \ - .type = TSParseActionTypeRecover \ - }} - -#define ACCEPT_INPUT() \ - {{ \ - .type = TSParseActionTypeAccept \ - }} - -#ifdef __cplusplus -} -#endif - -#endif // TREE_SITTER_PARSER_H_ diff --git a/crates/jj-diff/src/syntax.rs b/crates/jj-diff/src/syntax.rs index 7a44bed5d..0406e7f52 100644 --- a/crates/jj-diff/src/syntax.rs +++ b/crates/jj-diff/src/syntax.rs @@ -2,8 +2,6 @@ mod bundled; #[cfg(all(feature = "syntax", not(target_family = "wasm")))] mod cache; -#[cfg(all(feature = "lang-fluent", not(target_family = "wasm")))] -mod fluent; #[cfg(feature = "lang-markdown")] mod markdown; #[cfg(target_family = "wasm")] @@ -288,7 +286,7 @@ languages! { "lang-bash": "shell" | "bash" from "bash" => tree_sitter_bash::LANGUAGE, tree_sitter_bash::HIGHLIGHT_QUERY; "lang-batch": "batch" => tree_sitter_batch::LANGUAGE, tree_sitter_batch::HIGHLIGHTS_QUERY; "lang-fish": "fish" => tree_sitter_fish::language(), tree_sitter_fish::HIGHLIGHTS_QUERY; - "lang-fluent": "fluent" => fluent::LANGUAGE, fluent::HIGHLIGHTS_QUERY; + "lang-fluent": "fluent" => tree_sitter_fluent::LANGUAGE, tree_sitter_fluent::HIGHLIGHTS_QUERY; "lang-powershell": "powershell" => tree_sitter_powershell::LANGUAGE, tree_sitter_powershell::HIGHLIGHTS_QUERY; "lang-yaml": "yaml" => tree_sitter_yaml::LANGUAGE, tree_sitter_yaml::HIGHLIGHTS_QUERY; "lang-swift": "swift" => tree_sitter_swift::LANGUAGE, tree_sitter_swift::HIGHLIGHTS_QUERY; diff --git a/crates/jj-diff/src/syntax/fluent.rs b/crates/jj-diff/src/syntax/fluent.rs deleted file mode 100644 index 491848468..000000000 --- a/crates/jj-diff/src/syntax/fluent.rs +++ /dev/null @@ -1,8 +0,0 @@ -use tree_sitter_language::LanguageFn; - -unsafe extern "C" { - fn tree_sitter_fluent() -> *const (); -} - -pub(super) const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_fluent) }; -pub(super) const HIGHLIGHTS_QUERY: &str = include_str!("../../grammars/fluent/highlights.scm"); diff --git a/dist/appimage/build.sh b/dist/appimage/build.sh index c06108a0a..9adfbdab4 100755 --- a/dist/appimage/build.sh +++ b/dist/appimage/build.sh @@ -35,7 +35,6 @@ fi for license in assets/fonts/Seti.LICENSE shell/gpui/assets/fonts/Octicons.LICENSE shell/mac/Resources/ToolbarIcons.LICENSE shell/mac/Resources/DashboardIcons.LICENSE; do install -Dm644 "$root/$license" "$appdir/usr/share/jayjay/licenses/$(basename "$license")" done -install -Dm644 "$root/crates/jj-diff/grammars/fluent/LICENSE" "$appdir/usr/share/jayjay/licenses/tree-sitter-fluent.LICENSE" for license in "$root"/crates/jj-diff/grammars/wasm/*.LICENSE; do install -Dm644 "$license" "$appdir/usr/share/jayjay/licenses/tree-sitter-$(basename "$license")" done diff --git a/dist/windows/build.ps1 b/dist/windows/build.ps1 index 2d0d80f56..72e08aa48 100644 --- a/dist/windows/build.ps1 +++ b/dist/windows/build.ps1 @@ -36,7 +36,6 @@ try { Copy-Item shell/mac/Resources/DashboardIcons.LICENSE "$payload/DASHBOARD-ICONS-LICENSE.txt" Copy-Item dist/windows/README.txt $payload New-Item -ItemType Directory -Path "$payload/grammar-licenses" | Out-Null - Copy-Item crates/jj-diff/grammars/fluent/LICENSE "$payload/grammar-licenses/tree-sitter-fluent.LICENSE" Get-ChildItem crates/jj-diff/grammars/wasm -Filter *.LICENSE | ForEach-Object { Copy-Item $_.FullName "$payload/grammar-licenses/tree-sitter-$($_.Name)" } if ($SshHelpers) { New-Item -ItemType Directory -Path "$payload/ssh-helpers" | Out-Null diff --git a/scripts/grammar-wasm.sh b/scripts/grammar-wasm.sh index 41a87616d..3753d7f7c 100644 --- a/scripts/grammar-wasm.sh +++ b/scripts/grammar-wasm.sh @@ -11,23 +11,21 @@ locked_version() { echo "$versions" } -# The version a source resolves to: a crate's locked version, a git source's commit, or a hash of an in-repository grammar. +# The version a source resolves to: a crate's locked version or a git source's commit. source_version() { case "$1" in https://*) echo "${1#*@}" ;; - ./*) find "$root/$1" -type f -print0 | sort -z | xargs -0 cat | shasum -a 256 | cut -c1-16 ;; *) locked_version "$1" ;; esac } -# Copies a crate locked in Cargo.lock, a git repository@commit, or an in-repository path to a writable directory. +# Copies a crate locked in Cargo.lock or a git repository@commit to a writable directory. fetch_source() { case "$1" in https://*) git clone --quiet "${1%@*}" "$2" git -C "$2" checkout --quiet "${1#*@}" ;; - ./*) cp -R "$root/$1" "$2" ;; *) cp -R "$(ls -d "$registry"/*/"$1-$(locked_version "$1")" | head -n 1)" "$2" ;; esac chmod -R u+w "$2" diff --git a/scripts/macos/build.sh b/scripts/macos/build.sh index 0ea574a6c..c1707fa45 100644 --- a/scripts/macos/build.sh +++ b/scripts/macos/build.sh @@ -31,7 +31,6 @@ if [[ "$configuration" == Release ]]; then "DashboardIcons $project/Resources/DashboardIcons.LICENSE" "Ondine $mermaid/ondine-LICENSE.txt" "Pele $mermaid/pele-LICENSE.txt" - "tree-sitter-fluent $root/crates/jj-diff/grammars/fluent/LICENSE" ) for license in "$root"/crates/jj-diff/grammars/wasm/*.LICENSE; do bundled+=("tree-sitter-$(basename "$license" .LICENSE) $license") diff --git a/scripts/web-grammars.sh b/scripts/web-grammars.sh index efb7e198e..bc1d1cecf 100755 --- a/scripts/web-grammars.sh +++ b/scripts/web-grammars.sh @@ -10,7 +10,7 @@ source "$root/scripts/grammar-wasm.sh" # The build steps are part of every cache key, so editing them rebuilds each grammar. steps="$(cat "$root/scripts/grammar-wasm.sh" "${BASH_SOURCE[0]}" | shasum -a 256 | cut -c1-16)" -# grammar file, crate in Cargo.lock or in-repository path, grammar directory +# grammar file, crate in Cargo.lock, grammar directory sources=( "bash tree-sitter-bash ." "batch tree-sitter-batch ." @@ -19,7 +19,7 @@ sources=( "cpp tree-sitter-cpp ." "css tree-sitter-css ." "fish tree-sitter-fish ." - "fluent ./crates/jj-diff/grammars/fluent ." + "fluent tree-sitter-fluent ." "go tree-sitter-go ." "html tree-sitter-html ." "ini tree-sitter-ini ." @@ -69,10 +69,7 @@ for file in $files; do exit 1 fi read -r _ crate dir <<< "$entry" - case "$crate" in - ./*) license="$root/$crate/LICENSE" ;; - *) license="$(ls -d "$registry"/*/"$crate-$(locked_version "$crate")" | head -n 1)/LICENSE" ;; - esac + license="$(ls -d "$registry"/*/"$crate-$(locked_version "$crate")" | head -n 1)/LICENSE" # Several crates publish no license file, so their upstream one is kept in the repository. [[ -f "$license" ]] || license="$root/crates/jj-diff/grammars/licenses/$crate.LICENSE" notice "$file" "$license" >> "$notices"