From 7f9f6a0a6e5a8ee3758160d6653f63e94912b947 Mon Sep 17 00:00:00 2001 From: Mikhail Kornilovich Date: Sat, 11 Apr 2026 14:37:43 +0300 Subject: [PATCH] feat: pattern support args and multiple variants; add zed extension for highlight --- cmd/cli/main.go | 6 +- dsl/ast.go | 2 + dsl/include_test.go | 210 + dsl/merge.go | 81 + dsl/parser.go | 143 +- editor/zed/.gitignore | 17 + editor/zed/extension.toml | 23 + editor/zed/languages/jdg/brackets.scm | 2 + editor/zed/languages/jdg/config.toml | 12 + editor/zed/languages/jdg/highlights.scm | 100 + editor/zed/languages/jdg/indents.scm | 11 + editor/zed/languages/jdg/injections.scm | 7 + editor/zed/languages/jdg/outline.scm | 23 + editor/zed/tree-sitter-jdg/.editorconfig | 39 + editor/zed/tree-sitter-jdg/.gitattributes | 11 + editor/zed/tree-sitter-jdg/.gitignore | 38 + editor/zed/tree-sitter-jdg/grammar.js | 342 + editor/zed/tree-sitter-jdg/package.json | 54 + editor/zed/tree-sitter-jdg/src/grammar.json | 1732 +++++ .../zed/tree-sitter-jdg/src/node-types.json | 1570 +++++ editor/zed/tree-sitter-jdg/src/parser.c | 5922 +++++++++++++++++ .../tree-sitter-jdg/src/tree_sitter/alloc.h | 54 + .../tree-sitter-jdg/src/tree_sitter/array.h | 290 + .../tree-sitter-jdg/src/tree_sitter/parser.h | 265 + example/showcase/05-pattern-expansion.jdg | 82 +- example/showcase/07-include.jdg | 41 + example/showcase/common.jdg | 22 + runner/expander.go | 184 +- runner/expander_test.go | 240 + 29 files changed, 11429 insertions(+), 94 deletions(-) create mode 100644 dsl/include_test.go create mode 100644 dsl/merge.go create mode 100644 editor/zed/.gitignore create mode 100644 editor/zed/extension.toml create mode 100644 editor/zed/languages/jdg/brackets.scm create mode 100644 editor/zed/languages/jdg/config.toml create mode 100644 editor/zed/languages/jdg/highlights.scm create mode 100644 editor/zed/languages/jdg/indents.scm create mode 100644 editor/zed/languages/jdg/injections.scm create mode 100644 editor/zed/languages/jdg/outline.scm create mode 100644 editor/zed/tree-sitter-jdg/.editorconfig create mode 100644 editor/zed/tree-sitter-jdg/.gitattributes create mode 100644 editor/zed/tree-sitter-jdg/.gitignore create mode 100644 editor/zed/tree-sitter-jdg/grammar.js create mode 100644 editor/zed/tree-sitter-jdg/package.json create mode 100644 editor/zed/tree-sitter-jdg/src/grammar.json create mode 100644 editor/zed/tree-sitter-jdg/src/node-types.json create mode 100644 editor/zed/tree-sitter-jdg/src/parser.c create mode 100644 editor/zed/tree-sitter-jdg/src/tree_sitter/alloc.h create mode 100644 editor/zed/tree-sitter-jdg/src/tree_sitter/array.h create mode 100644 editor/zed/tree-sitter-jdg/src/tree_sitter/parser.h create mode 100644 example/showcase/07-include.jdg create mode 100644 example/showcase/common.jdg create mode 100644 runner/expander_test.go diff --git a/cmd/cli/main.go b/cmd/cli/main.go index 3e73253..2c07148 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -99,11 +99,7 @@ func main() { } func parseSuite(path string) *dsl.File { - src, err := os.ReadFile(path) - if err != nil { - fatalf("cannot read %q: %v", path, err) - } - f, warns, err := dsl.Parse(string(src)) + f, warns, err := dsl.ParseFile(path) if err != nil { fatalf("parse error in %q:\n %v", path, err) } diff --git a/dsl/ast.go b/dsl/ast.go index b9b5b70..0daf82f 100644 --- a/dsl/ast.go +++ b/dsl/ast.go @@ -50,6 +50,8 @@ type Pattern struct { DirsGlob string InputFile string OutputFile string + + Args []string } func (p *Pattern) IsDirMode() bool { diff --git a/dsl/include_test.go b/dsl/include_test.go new file mode 100644 index 0000000..5fde436 --- /dev/null +++ b/dsl/include_test.go @@ -0,0 +1,210 @@ +package dsl + +import ( + "os" + "path/filepath" + "strings" + "testing" +) + +func writeTempJdg(t *testing.T, dir, name, content string) string { + t.Helper() + path := filepath.Join(dir, name) + if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(path, []byte(content), 0644); err != nil { + t.Fatal(err) + } + return path +} + +func TestIncludeBasicMerge(t *testing.T) { + dir := t.TempDir() + + writeTempJdg(t, dir, "common.jdg", ` +toolchains { + gcc { platforms = "linux" } +} + +build_defaults { + language = "c" + standard = "c11" + sources = "*.c" + output = "solution" + warnings = strict +} +`) + + mainPath := writeTempJdg(t, dir, "main.jdg", ` +include "common.jdg" + +build "release" { profile = release } + +group("g") { + weight = 1.0 + test("t") { stdout = "ok\n" } +} +`) + + f, _, err := ParseFile(mainPath) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if len(f.Toolchains) != 1 || f.Toolchains[0].Name != "gcc" { + t.Errorf("toolchains not merged: %+v", f.Toolchains) + } + if f.BuildDefaults == nil || f.BuildDefaults.Language != "c" { + t.Errorf("build_defaults not merged: %+v", f.BuildDefaults) + } + if len(f.Builds) != 1 || f.Builds[0].Name != "release" { + t.Errorf("local build lost: %+v", f.Builds) + } +} + +func TestIncludeLocalOverridesIncluded(t *testing.T) { + dir := t.TempDir() + + writeTempJdg(t, dir, "common.jdg", ` +build_defaults { + language = "c" + standard = "c11" + warnings = strict +} +`) + + mainPath := writeTempJdg(t, dir, "main.jdg", ` +include "common.jdg" + +build_defaults { + standard = "c17" +} + +group("g") { weight = 1.0 test("t") { stdout = "ok\n" } } +`) + + f, _, err := ParseFile(mainPath) + if err != nil { + t.Fatalf("parse: %v", err) + } + if f.BuildDefaults.Standard != "c17" { + t.Errorf("local should override included standard: got %q", f.BuildDefaults.Standard) + } + if f.BuildDefaults.Language != "c" { + t.Errorf("language should survive from include: got %q", f.BuildDefaults.Language) + } + if f.BuildDefaults.Warnings != WarningsStrict { + t.Errorf("warnings should survive from include: got %v", f.BuildDefaults.Warnings) + } +} + +func TestIncludeRelativePathResolution(t *testing.T) { + dir := t.TempDir() + + writeTempJdg(t, dir, "shared/tools.jdg", ` +toolchains { + gcc { platforms = "linux" } +} +`) + + mainPath := writeTempJdg(t, dir, "suite/main.jdg", ` +include "../shared/tools.jdg" + +build "release" { + language = "c" + sources = "solution.c" + output = "solution" + profile = release +} + +group("g") { weight = 1.0 test("t") { stdout = "ok\n" } } +`) + + f, _, err := ParseFile(mainPath) + if err != nil { + t.Fatalf("parse: %v", err) + } + if len(f.Toolchains) != 1 { + t.Errorf("relative include failed to resolve: %+v", f.Toolchains) + } +} + +func TestIncludeDuplicateToolchainErrors(t *testing.T) { + dir := t.TempDir() + + writeTempJdg(t, dir, "common.jdg", ` +toolchains { + gcc { platforms = "linux" } +} +`) + + mainPath := writeTempJdg(t, dir, "main.jdg", ` +include "common.jdg" + +toolchains { + gcc { platforms = "linux" } +} + +group("g") { weight = 1.0 test("t") { stdout = "ok\n" } } +`) + + _, _, err := ParseFile(mainPath) + if err == nil { + t.Fatal("expected duplicate toolchain error") + } + if !strings.Contains(err.Error(), "duplicate toolchain") { + t.Errorf("error %q does not mention duplicate toolchain", err.Error()) + } +} + +func TestIncludeCircularDetection(t *testing.T) { + dir := t.TempDir() + + aPath := writeTempJdg(t, dir, "a.jdg", ` +include "b.jdg" +group("ga") { weight = 1.0 test("t") { stdout = "ok\n" } } +`) + writeTempJdg(t, dir, "b.jdg", ` +include "a.jdg" +`) + + _, _, err := ParseFile(aPath) + if err == nil { + t.Fatal("expected circular include error") + } + if !strings.Contains(err.Error(), "circular include") { + t.Errorf("error %q does not mention circular include", err.Error()) + } +} + +func TestIncludeMissingFileErrors(t *testing.T) { + dir := t.TempDir() + + mainPath := writeTempJdg(t, dir, "main.jdg", ` +include "nonexistent.jdg" +group("g") { weight = 1.0 test("t") { stdout = "ok\n" } } +`) + + _, _, err := ParseFile(mainPath) + if err == nil { + t.Fatal("expected missing include error") + } + if !strings.Contains(err.Error(), "nonexistent.jdg") { + t.Errorf("error %q does not reference the missing path", err.Error()) + } +} + +func TestParseRejectsIncludeWithoutFileContext(t *testing.T) { + src := ` +include "common.jdg" +group("g") { weight = 1.0 test("t") { stdout = "ok\n" } } +` + _, _, err := Parse(src) + if err == nil { + t.Fatal("expected error: include without file context") + } + if !strings.Contains(err.Error(), "file context") { + t.Errorf("error %q does not mention file context", err.Error()) + } +} diff --git a/dsl/merge.go b/dsl/merge.go new file mode 100644 index 0000000..7e14ab1 --- /dev/null +++ b/dsl/merge.go @@ -0,0 +1,81 @@ +package dsl + +import "fmt" + +func mergeFiles(dst, src *File) error { + if src.Build != "" { + dst.Build = src.Build + } + if src.BuildLinux != "" { + dst.BuildLinux = src.BuildLinux + } + if src.BuildWindows != "" { + dst.BuildWindows = src.BuildWindows + } + if src.BuildDarwin != "" { + dst.BuildDarwin = src.BuildDarwin + } + + if src.BuildDefaults != nil { + if dst.BuildDefaults == nil { + dst.BuildDefaults = &BuildConfig{} + } + dst.BuildDefaults.MergeFrom(src.BuildDefaults) + } + + seenTC := map[string]bool{} + for _, t := range dst.Toolchains { + seenTC[t.Name] = true + } + for _, t := range src.Toolchains { + if seenTC[t.Name] { + return fmt.Errorf("duplicate toolchain %q", t.Name) + } + seenTC[t.Name] = true + dst.Toolchains = append(dst.Toolchains, t) + } + + seenB := map[string]bool{} + for _, b := range dst.Builds { + seenB[b.Name] = true + } + for _, b := range src.Builds { + if seenB[b.Name] { + return fmt.Errorf("duplicate build %q", b.Name) + } + seenB[b.Name] = true + dst.Builds = append(dst.Builds, b) + } + + seenG := map[string]bool{} + for _, g := range dst.Groups { + seenG[g.Name] = true + } + for _, g := range src.Groups { + if seenG[g.Name] { + return fmt.Errorf("duplicate group %q", g.Name) + } + seenG[g.Name] = true + dst.Groups = append(dst.Groups, g) + } + + if src.Timeout != 0 { + dst.Timeout = src.Timeout + } + if src.MemoryLimit != 0 { + dst.MemoryLimit = src.MemoryLimit + } + if src.Binary != "" { + dst.Binary = src.Binary + } + if src.Sources != "" { + dst.Sources = src.Sources + } + if src.NormalizeCRLF { + dst.NormalizeCRLF = true + } + if src.TrimTrailingWS { + dst.TrimTrailingWS = true + } + return nil +} diff --git a/dsl/parser.go b/dsl/parser.go index e93e9f4..413f758 100644 --- a/dsl/parser.go +++ b/dsl/parser.go @@ -3,14 +3,18 @@ package dsl import ( "fmt" "math" + "os" + "path/filepath" "strconv" "time" ) type Parser struct { - tokens []Token - pos int - warns []string + tokens []Token + pos int + warns []string + includeBaseDir string + visited map[string]bool } func NewParser(tokens []Token) *Parser { @@ -72,9 +76,67 @@ func Parse(src string) (*File, []string, error) { if err != nil { return nil, parser.Warnings(), err } + if err := parser.finalize(file); err != nil { + return nil, parser.Warnings(), err + } return file, parser.Warnings(), nil } +func ParseFile(path string) (*File, []string, error) { + abs, err := filepath.Abs(path) + if err != nil { + return nil, nil, fmt.Errorf("resolve %q: %w", path, err) + } + visited := map[string]bool{} + parser, file, err := parseFileOnDisk(abs, visited) + if err != nil { + var warns []string + if parser != nil { + warns = parser.Warnings() + } + return nil, warns, err + } + if err := parser.finalize(file); err != nil { + return nil, parser.Warnings(), err + } + return file, parser.Warnings(), nil +} + +func parseFileOnDisk(absPath string, visited map[string]bool) (*Parser, *File, error) { + if visited[absPath] { + return nil, nil, fmt.Errorf("circular include: %s", absPath) + } + visited[absPath] = true + + src, err := os.ReadFile(absPath) + if err != nil { + return nil, nil, fmt.Errorf("read %s: %w", absPath, err) + } + tokens, err := NewLexer(string(src)).Tokenize() + if err != nil { + return nil, nil, fmt.Errorf("%s: %w", absPath, err) + } + p := NewParser(tokens) + p.includeBaseDir = filepath.Dir(absPath) + p.visited = visited + + file, err := p.parseFile() + if err != nil { + return p, nil, fmt.Errorf("%s: %w", absPath, err) + } + return p, file, nil +} + +func (p *Parser) finalize(f *File) error { + if err := p.validateWeights(f); err != nil { + return err + } + if err := validateBuilds(f); err != nil { + return err + } + return nil +} + func (p *Parser) parseFile() (*File, error) { f := &File{} @@ -107,7 +169,10 @@ func (p *Parser) parseFile() (*File, error) { if err != nil { return nil, err } - f.BuildDefaults = bc + if f.BuildDefaults == nil { + f.BuildDefaults = &BuildConfig{} + } + f.BuildDefaults.MergeFrom(bc) case "toolchains": p.advance() @@ -115,7 +180,45 @@ func (p *Parser) parseFile() (*File, error) { if err != nil { return nil, err } - f.Toolchains = specs + existing := map[string]bool{} + for _, tc := range f.Toolchains { + existing[tc.Name] = true + } + for _, tc := range specs { + if existing[tc.Name] { + return nil, fmt.Errorf("duplicate toolchain %q", tc.Name) + } + existing[tc.Name] = true + f.Toolchains = append(f.Toolchains, tc) + } + + case "include": + p.advance() + s, err := p.expect(TOKEN_STRING) + if err != nil { + return nil, err + } + if p.includeBaseDir == "" { + return nil, fmt.Errorf("%d:%d: `include` requires file context (use ParseFile, not Parse)", s.Line, s.Col) + } + target := s.Value + if !filepath.IsAbs(target) { + target = filepath.Join(p.includeBaseDir, target) + } + abs, err := filepath.Abs(target) + if err != nil { + return nil, fmt.Errorf("%d:%d: resolve include %q: %w", s.Line, s.Col, s.Value, err) + } + childParser, child, err := parseFileOnDisk(abs, p.visited) + if err != nil { + return nil, fmt.Errorf("%d:%d: include %q: %w", s.Line, s.Col, s.Value, err) + } + for _, w := range childParser.Warnings() { + p.warn(w) + } + if err := mergeFiles(f, child); err != nil { + return nil, fmt.Errorf("%d:%d: include %q: %w", s.Line, s.Col, s.Value, err) + } case "build_linux": p.advance() @@ -216,13 +319,6 @@ func (p *Parser) parseFile() (*File, error) { } } - if err := p.validateWeights(f); err != nil { - return nil, err - } - if err := validateBuilds(f); err != nil { - return nil, err - } - return f, nil } @@ -683,25 +779,40 @@ func (p *Parser) parsePattern() (*Pattern, error) { if _, err := p.expect(TOKEN_ASSIGN); err != nil { return nil, err } - val, err := p.expect(TOKEN_STRING) - if err != nil { - return nil, err - } + switch t.Value { case "input": + val, err := p.expect(TOKEN_STRING) + if err != nil { + return nil, err + } if pat.DirsGlob != "" { pat.InputFile = val.Value } else { pat.InputGlob = val.Value } case "output": + val, err := p.expect(TOKEN_STRING) + if err != nil { + return nil, err + } if pat.DirsGlob != "" { pat.OutputFile = val.Value } else { pat.OutputGlob = val.Value } case "dirs": + val, err := p.expect(TOKEN_STRING) + if err != nil { + return nil, err + } pat.DirsGlob = val.Value + case "args": + xs, err := p.parseStringList() + if err != nil { + return nil, err + } + pat.Args = xs default: return nil, fmt.Errorf("%d:%d: unknown pattern field %q", t.Line, t.Col, t.Value) } diff --git a/editor/zed/.gitignore b/editor/zed/.gitignore new file mode 100644 index 0000000..0a79b7d --- /dev/null +++ b/editor/zed/.gitignore @@ -0,0 +1,17 @@ +grammars/*.wasm + +tree-sitter-jdg/tree-sitter-jdg.wasm +tree-sitter-jdg/node_modules/ +tree-sitter-jdg/bindings/ +tree-sitter-jdg/binding.gyp +tree-sitter-jdg/Cargo.toml +tree-sitter-jdg/Cargo.lock +tree-sitter-jdg/Makefile +tree-sitter-jdg/Package.swift +tree-sitter-jdg/pyproject.toml +tree-sitter-jdg/setup.py +tree-sitter-jdg/go.mod +tree-sitter-jdg/go.sum +tree-sitter-jdg/bindings.gyp +tree-sitter-jdg/prebuilds/ +tree-sitter-jdg/target/ diff --git a/editor/zed/extension.toml b/editor/zed/extension.toml new file mode 100644 index 0000000..8dbe931 --- /dev/null +++ b/editor/zed/extension.toml @@ -0,0 +1,23 @@ +id = "jdg" +name = "JDG" +version = "0.1.0" +schema_version = 1 +description = "Syntax highlighting for the judge DSL (.jdg)" +repository = "https://github.com/Mond1c/judge" +authors = ["judge contributors"] +themes = [] +icon_themes = [] +languages = ["languages/jdg"] +capabilities = [] + +[lib] + +[grammars.jdg] +repository = "https://github.com/Mond1c/judge" +rev = "main" + +[language_servers] + +[context_servers] + +[slash_commands] diff --git a/editor/zed/languages/jdg/brackets.scm b/editor/zed/languages/jdg/brackets.scm new file mode 100644 index 0000000..6f924c6 --- /dev/null +++ b/editor/zed/languages/jdg/brackets.scm @@ -0,0 +1,2 @@ +("{" @open "}" @close) +("(" @open ")" @close) diff --git a/editor/zed/languages/jdg/config.toml b/editor/zed/languages/jdg/config.toml new file mode 100644 index 0000000..8636dfd --- /dev/null +++ b/editor/zed/languages/jdg/config.toml @@ -0,0 +1,12 @@ +name = "JDG" +grammar = "jdg" +path_suffixes = ["jdg"] +line_comments = ["// "] +autoclose_before = ";:.,=}])>" +brackets = [ + { start = "{", end = "}", close = true, newline = true }, + { start = "(", end = ")", close = true, newline = false }, + { start = "\"", end = "\"", close = true, newline = false, not_in = ["string", "comment"] }, +] +word_characters = ["_"] +tab_size = 4 diff --git a/editor/zed/languages/jdg/highlights.scm b/editor/zed/languages/jdg/highlights.scm new file mode 100644 index 0000000..b2d9590 --- /dev/null +++ b/editor/zed/languages/jdg/highlights.scm @@ -0,0 +1,100 @@ +(comment) @comment + +[ + "include" + "build" + "build_defaults" + "build_linux" + "build_windows" + "build_darwin" + "toolchains" + "binary" + "sources" + "timeout" + "memory_limit" + "group" + "test" + "pattern" +] @keyword + +[ + "normalize_crlf" + "trim_trailing_ws" +] @keyword + +(build_scalar_field name: _ @property) +(build_list_field name: _ @property) +(bool_decl name: _ @property) +(legacy_build_platform keyword: _ @keyword) + +[ + "profile" + "warnings" + "define" + "platforms" + "binary" + "class" + "weight" + "scoring" + "wrapper" + "env" + "stdin" + "stdout" + "stderr" + "args" + "exitCode" + "file" + "outFile" + "input" + "output" + "dirs" +] @property + +[ + "linux" + "windows" + "darwin" +] @type.builtin + +(profile_value) @constant.builtin +(warnings_value) @constant.builtin +(scoring_value) @constant.builtin +(class_value) @constant.builtin +(bool) @constant.builtin + +"of" @keyword.operator + +[ + "contains" + "matches" + "anyOrder" +] @function.builtin + +[ + "=" + "~" +] @operator + +[ + "{" + "}" + "(" + ")" +] @punctuation.bracket + +(simple_string) @string +(heredoc_string) @string +(regex_string) @string.regex + +(structured_build name: (string) @string.special) +(legacy_build command: (string) @string.special) +(toolchain_entry name: (string) @type) +(toolchain_entry name: (identifier) @type) +(group name: (string) @string.special) +(test name: (string) @string.special) +(include path: (string) @string.special.path) + +(define_field key: (string) @constant.macro) +(env_decl key: (string) @constant.macro) +(file_decl key: (string) @string.special.path) +(out_file_decl key: (string) @string.special.path) diff --git a/editor/zed/languages/jdg/indents.scm b/editor/zed/languages/jdg/indents.scm new file mode 100644 index 0000000..9ca394f --- /dev/null +++ b/editor/zed/languages/jdg/indents.scm @@ -0,0 +1,11 @@ +[ + (build_block) + (toolchains) + (toolchain_entry) + (group) + (test) + (pattern) + (any_order_matcher) +] @indent + +"}" @end diff --git a/editor/zed/languages/jdg/injections.scm b/editor/zed/languages/jdg/injections.scm new file mode 100644 index 0000000..3908579 --- /dev/null +++ b/editor/zed/languages/jdg/injections.scm @@ -0,0 +1,7 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((regex_matcher + pattern: (regex_string) @injection.content) + (#set! injection.language "regex") + (#set! injection.include-children)) diff --git a/editor/zed/languages/jdg/outline.scm b/editor/zed/languages/jdg/outline.scm new file mode 100644 index 0000000..5309e5d --- /dev/null +++ b/editor/zed/languages/jdg/outline.scm @@ -0,0 +1,23 @@ +(structured_build + "build" @context + name: (string) @name) @item + +(build_defaults + "build_defaults" @context) @item + +(toolchains + "toolchains" @context) @item + +(toolchain_entry + name: (_) @name) @item + +(group + "group" @context + name: (string) @name) @item + +(test + "test" @context + name: (string) @name) @item + +(pattern + "pattern" @context) @item diff --git a/editor/zed/tree-sitter-jdg/.editorconfig b/editor/zed/tree-sitter-jdg/.editorconfig new file mode 100644 index 0000000..d3a8b5b --- /dev/null +++ b/editor/zed/tree-sitter-jdg/.editorconfig @@ -0,0 +1,39 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,toml,yml,gyp}] +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.rs] +indent_style = space +indent_size = 4 + +[*.{c,cc,h}] +indent_style = space +indent_size = 4 + +[*.{py,pyi}] +indent_style = space +indent_size = 4 + +[*.swift] +indent_style = space +indent_size = 4 + +[*.go] +indent_style = tab +indent_size = 8 + +[Makefile] +indent_style = tab +indent_size = 8 diff --git a/editor/zed/tree-sitter-jdg/.gitattributes b/editor/zed/tree-sitter-jdg/.gitattributes new file mode 100644 index 0000000..ffb52ab --- /dev/null +++ b/editor/zed/tree-sitter-jdg/.gitattributes @@ -0,0 +1,11 @@ +* text eol=lf + +src/*.json linguist-generated +src/parser.c linguist-generated +src/tree_sitter/* linguist-generated + +bindings/** linguist-generated +binding.gyp linguist-generated +setup.py linguist-generated +Makefile linguist-generated +Package.swift linguist-generated diff --git a/editor/zed/tree-sitter-jdg/.gitignore b/editor/zed/tree-sitter-jdg/.gitignore new file mode 100644 index 0000000..27fc43f --- /dev/null +++ b/editor/zed/tree-sitter-jdg/.gitignore @@ -0,0 +1,38 @@ +# Rust artifacts +Cargo.lock +target/ + +# Node artifacts +build/ +prebuilds/ +node_modules/ +*.tgz + +# Swift artifacts +.build/ + +# Go artifacts +go.sum +_obj/ + +# Python artifacts +.venv/ +dist/ +*.egg-info +*.whl + +# C artifacts +*.a +*.so +*.so.* +*.dylib +*.dll +*.pc + +# Example dirs +/examples/*/ + +# Grammar volatiles +*.wasm +*.obj +*.o diff --git a/editor/zed/tree-sitter-jdg/grammar.js b/editor/zed/tree-sitter-jdg/grammar.js new file mode 100644 index 0000000..6177956 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/grammar.js @@ -0,0 +1,342 @@ +module.exports = grammar({ + name: 'jdg', + + extras: $ => [/\s+/, $.comment], + + word: $ => $.identifier, + + conflicts: $ => [], + + rules: { + source_file: $ => repeat($._top_statement), + + comment: $ => token(seq('//', /[^\n]*/)), + + _top_statement: $ => choice( + $.include, + $.toolchains, + $.build_defaults, + $.structured_build, + $.legacy_build_platform, + $.legacy_build, + $.binary_decl, + $.sources_decl, + $.bool_decl, + $.timeout_decl, + $.memory_limit_decl, + $.group, + ), + + include: $ => seq( + 'include', + field('path', $.string) + ), + + legacy_build: $ => prec(1, seq( + 'build', + field('command', $.string) + )), + + legacy_build_platform: $ => seq( + field('keyword', choice('build_linux', 'build_windows', 'build_darwin')), + field('command', $.string) + ), + + structured_build: $ => prec(2, seq( + 'build', + field('name', $.string), + field('body', $.build_block) + )), + + build_defaults: $ => seq( + 'build_defaults', + field('body', $.build_block) + ), + + build_block: $ => seq( + '{', + repeat($._build_field), + '}' + ), + + _build_field: $ => choice( + $.build_scalar_field, + $.build_list_field, + $.build_profile_field, + $.build_warnings_field, + $.define_field, + $.os_override, + ), + + build_scalar_field: $ => seq( + field('name', choice('language', 'standard', 'output', 'wrapper')), + '=', + field('value', $.string) + ), + + build_list_field: $ => seq( + field('name', choice('sources', 'includes', 'sanitize', 'link', 'extra', 'platforms', 'compilers')), + '=', + field('value', repeat1($.string)) + ), + + build_profile_field: $ => seq( + 'profile', + '=', + field('value', $.profile_value) + ), + profile_value: $ => choice('release', 'debug', 'sanitized'), + + build_warnings_field: $ => seq( + 'warnings', + '=', + field('value', $.warnings_value) + ), + warnings_value: $ => choice('default', 'strict', 'pedantic'), + + define_field: $ => seq( + 'define', + '(', + field('key', $.string), + ')', + '=', + field('value', $.string) + ), + + os_override: $ => seq( + field('os', $.os_name), + field('body', $.build_block) + ), + os_name: $ => choice('linux', 'windows', 'darwin'), + + toolchains: $ => seq( + 'toolchains', + '{', + repeat($.toolchain_entry), + '}' + ), + + toolchain_entry: $ => seq( + field('name', choice($.identifier, $.string)), + '{', + repeat($._toolchain_field), + '}' + ), + + _toolchain_field: $ => choice( + $.toolchain_platforms_field, + $.toolchain_binary_field, + $.toolchain_class_field, + ), + + toolchain_platforms_field: $ => seq( + 'platforms', + '=', + field('value', repeat1($.string)) + ), + toolchain_binary_field: $ => seq( + 'binary', + '=', + field('value', $.string) + ), + toolchain_class_field: $ => seq( + 'class', + '=', + field('value', $.class_value) + ), + class_value: $ => choice('gnu', 'msvc'), + + binary_decl: $ => seq( + 'binary', + '=', + field('value', $.string) + ), + + sources_decl: $ => seq( + 'sources', + '=', + field('value', $.string) + ), + + bool_decl: $ => seq( + field('name', choice('normalize_crlf', 'trim_trailing_ws')), + '=', + field('value', $.bool) + ), + + timeout_decl: $ => seq( + 'timeout', + field('value', $.duration) + ), + + memory_limit_decl: $ => seq( + 'memory_limit', + '=', + field('value', $.size) + ), + + group: $ => seq( + 'group', + '(', + field('name', $.string), + ')', + '{', + repeat($._group_field), + '}' + ), + + _group_field: $ => choice( + $.group_weight_field, + $.group_timeout_field, + $.group_memory_field, + $.group_scoring_field, + $.group_wrapper_field, + $.env_decl, + $.test, + $.pattern, + ), + + group_weight_field: $ => seq('weight', '=', field('value', $.number)), + group_timeout_field: $ => seq('timeout', '=', field('value', $.duration)), + group_memory_field: $ => seq('memory_limit', '=', field('value', $.size)), + group_scoring_field: $ => seq('scoring', '=', field('value', $.scoring_value)), + scoring_value: $ => choice('partial', 'all_or_none'), + group_wrapper_field: $ => seq('wrapper', '=', field('value', $.string)), + + env_decl: $ => seq( + 'env', + '(', + field('key', $.string), + ')', + '=', + field('value', $.string) + ), + + test: $ => seq( + 'test', + '(', + field('name', $.string), + ')', + '{', + repeat($._test_field), + '}' + ), + + _test_field: $ => choice( + $.test_stdin_field, + $.test_stdout_field, + $.test_stderr_field, + $.test_args_field, + $.test_exit_code_field, + $.test_timeout_field, + $.test_memory_field, + $.test_wrapper_field, + $.env_decl, + $.file_decl, + $.out_file_decl, + ), + + test_stdin_field: $ => seq('stdin', '=', field('value', $.string)), + test_stdout_field: $ => seq('stdout', $._matcher), + test_stderr_field: $ => seq('stderr', $._matcher), + test_args_field: $ => seq('args', '=', field('value', repeat1($.string))), + test_exit_code_field: $ => seq('exitCode', '=', field('value', $.integer)), + test_timeout_field: $ => seq('timeout', '=', field('value', $.duration)), + test_memory_field: $ => seq('memory_limit', '=', field('value', $.size)), + test_wrapper_field: $ => seq('wrapper', '=', field('value', $.string)), + + file_decl: $ => seq( + 'file', + '(', + field('key', $.string), + ')', + '=', + field('value', $.string) + ), + + out_file_decl: $ => seq( + 'outFile', + '(', + field('key', $.string), + ')', + '=', + field('value', $.string) + ), + + _matcher: $ => choice( + $.exact_matcher, + $.numeric_matcher, + $.contains_matcher, + $.regex_matcher, + $.any_order_matcher, + ), + + exact_matcher: $ => seq('=', field('value', $.string)), + numeric_matcher: $ => seq( + '~', + field('epsilon', $.number), + 'of', + field('value', $.string) + ), + contains_matcher: $ => seq('contains', field('value', $.string)), + regex_matcher: $ => seq('matches', field('pattern', $.regex_string)), + any_order_matcher: $ => seq( + 'anyOrder', + '{', + repeat1($.string), + '}' + ), + + pattern: $ => seq( + 'pattern', + '{', + repeat($._pattern_field), + '}' + ), + + _pattern_field: $ => choice( + $.pattern_input_field, + $.pattern_output_field, + $.pattern_dirs_field, + $.pattern_args_field, + ), + + pattern_input_field: $ => seq('input', '=', field('value', $.string)), + pattern_output_field: $ => seq('output', '=', field('value', $.string)), + pattern_dirs_field: $ => seq('dirs', '=', field('value', $.string)), + pattern_args_field: $ => seq('args', '=', field('value', repeat1($.string))), + + bool: $ => choice('true', 'false'), + + number: $ => choice($.integer, $.float), + + string: $ => choice( + $.heredoc_string, + $.simple_string, + ), + + simple_string: $ => token(seq( + '"', + repeat(choice( + /[^"\\\n]/, + seq('\\', /./) + )), + '"' + )), + + heredoc_string: $ => token(seq( + '"""', + /([^"]|"[^"]|""[^"])*/, + '"""' + )), + + regex_string: $ => $.simple_string, + + identifier: $ => /[a-zA-Z_][a-zA-Z0-9_]*/, + + integer: $ => token(/-?\d+/), + float: $ => token(/-?\d+\.\d+/), + duration: $ => token(/\d+(ms|s|m)/), + size: $ => token(/\d+(KiB|MiB|GiB|KB|MB|GB|B|K|M|G)/), + } +}); diff --git a/editor/zed/tree-sitter-jdg/package.json b/editor/zed/tree-sitter-jdg/package.json new file mode 100644 index 0000000..068e749 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/package.json @@ -0,0 +1,54 @@ +{ + "name": "tree-sitter-jdg", + "version": "0.1.0", + "description": "Tree-sitter grammar for the judge DSL (.jdg)", + "main": "bindings/node", + "types": "bindings/node", + "keywords": [ + "tree-sitter", + "parser", + "jdg", + "judge" + ], + "files": [ + "grammar.js", + "binding.gyp", + "prebuilds/**", + "bindings/node/*", + "queries/*", + "src/**" + ], + "license": "MIT", + "dependencies": { + "node-addon-api": "^7.1.0", + "node-gyp-build": "^4.8.0" + }, + "peerDependencies": { + "tree-sitter": "^0.21.0" + }, + "peerDependenciesMeta": { + "tree_sitter": { + "optional": true + } + }, + "devDependencies": { + "tree-sitter-cli": "^0.22.0", + "prebuildify": "^6.0.0" + }, + "scripts": { + "build": "tree-sitter generate", + "test": "tree-sitter test", + "install": "node-gyp-build", + "prebuildify": "prebuildify --napi --strip" + }, + "tree-sitter": [ + { + "scope": "source.jdg", + "file-types": [ + "jdg" + ], + "highlights": "queries/highlights.scm", + "injections": "queries/injections.scm" + } + ] +} diff --git a/editor/zed/tree-sitter-jdg/src/grammar.json b/editor/zed/tree-sitter-jdg/src/grammar.json new file mode 100644 index 0000000..eac24a0 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/src/grammar.json @@ -0,0 +1,1732 @@ +{ + "name": "jdg", + "word": "identifier", + "rules": { + "source_file": { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_top_statement" + } + }, + "comment": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "//" + }, + { + "type": "PATTERN", + "value": "[^\\n]*" + } + ] + } + }, + "_top_statement": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "include" + }, + { + "type": "SYMBOL", + "name": "toolchains" + }, + { + "type": "SYMBOL", + "name": "build_defaults" + }, + { + "type": "SYMBOL", + "name": "structured_build" + }, + { + "type": "SYMBOL", + "name": "legacy_build_platform" + }, + { + "type": "SYMBOL", + "name": "legacy_build" + }, + { + "type": "SYMBOL", + "name": "binary_decl" + }, + { + "type": "SYMBOL", + "name": "sources_decl" + }, + { + "type": "SYMBOL", + "name": "bool_decl" + }, + { + "type": "SYMBOL", + "name": "timeout_decl" + }, + { + "type": "SYMBOL", + "name": "memory_limit_decl" + }, + { + "type": "SYMBOL", + "name": "group" + } + ] + }, + "include": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "include" + }, + { + "type": "FIELD", + "name": "path", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "legacy_build": { + "type": "PREC", + "value": 1, + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "build" + }, + { + "type": "FIELD", + "name": "command", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + } + }, + "legacy_build_platform": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "keyword", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "build_linux" + }, + { + "type": "STRING", + "value": "build_windows" + }, + { + "type": "STRING", + "value": "build_darwin" + } + ] + } + }, + { + "type": "FIELD", + "name": "command", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "structured_build": { + "type": "PREC", + "value": 2, + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "build" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "build_block" + } + } + ] + } + }, + "build_defaults": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "build_defaults" + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "build_block" + } + } + ] + }, + "build_block": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_build_field" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "_build_field": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "build_scalar_field" + }, + { + "type": "SYMBOL", + "name": "build_list_field" + }, + { + "type": "SYMBOL", + "name": "build_profile_field" + }, + { + "type": "SYMBOL", + "name": "build_warnings_field" + }, + { + "type": "SYMBOL", + "name": "define_field" + }, + { + "type": "SYMBOL", + "name": "os_override" + } + ] + }, + "build_scalar_field": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "language" + }, + { + "type": "STRING", + "value": "standard" + }, + { + "type": "STRING", + "value": "output" + }, + { + "type": "STRING", + "value": "wrapper" + } + ] + } + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "build_list_field": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "sources" + }, + { + "type": "STRING", + "value": "includes" + }, + { + "type": "STRING", + "value": "sanitize" + }, + { + "type": "STRING", + "value": "link" + }, + { + "type": "STRING", + "value": "extra" + }, + { + "type": "STRING", + "value": "platforms" + }, + { + "type": "STRING", + "value": "compilers" + } + ] + } + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "REPEAT1", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + } + ] + }, + "build_profile_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "profile" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "profile_value" + } + } + ] + }, + "profile_value": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "release" + }, + { + "type": "STRING", + "value": "debug" + }, + { + "type": "STRING", + "value": "sanitized" + } + ] + }, + "build_warnings_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "warnings" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "warnings_value" + } + } + ] + }, + "warnings_value": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "default" + }, + { + "type": "STRING", + "value": "strict" + }, + { + "type": "STRING", + "value": "pedantic" + } + ] + }, + "define_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "define" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "key", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "os_override": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "os", + "content": { + "type": "SYMBOL", + "name": "os_name" + } + }, + { + "type": "FIELD", + "name": "body", + "content": { + "type": "SYMBOL", + "name": "build_block" + } + } + ] + }, + "os_name": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "linux" + }, + { + "type": "STRING", + "value": "windows" + }, + { + "type": "STRING", + "value": "darwin" + } + ] + }, + "toolchains": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "toolchains" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "toolchain_entry" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "toolchain_entry": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "identifier" + }, + { + "type": "SYMBOL", + "name": "string" + } + ] + } + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_toolchain_field" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "_toolchain_field": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "toolchain_platforms_field" + }, + { + "type": "SYMBOL", + "name": "toolchain_binary_field" + }, + { + "type": "SYMBOL", + "name": "toolchain_class_field" + } + ] + }, + "toolchain_platforms_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "platforms" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "REPEAT1", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + } + ] + }, + "toolchain_binary_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "binary" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "toolchain_class_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "class" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "class_value" + } + } + ] + }, + "class_value": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "gnu" + }, + { + "type": "STRING", + "value": "msvc" + } + ] + }, + "binary_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "binary" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "sources_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "sources" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "bool_decl": { + "type": "SEQ", + "members": [ + { + "type": "FIELD", + "name": "name", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "normalize_crlf" + }, + { + "type": "STRING", + "value": "trim_trailing_ws" + } + ] + } + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "bool" + } + } + ] + }, + "timeout_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "timeout" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "duration" + } + } + ] + }, + "memory_limit_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "memory_limit" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "size" + } + } + ] + }, + "group": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "group" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_group_field" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "_group_field": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "group_weight_field" + }, + { + "type": "SYMBOL", + "name": "group_timeout_field" + }, + { + "type": "SYMBOL", + "name": "group_memory_field" + }, + { + "type": "SYMBOL", + "name": "group_scoring_field" + }, + { + "type": "SYMBOL", + "name": "group_wrapper_field" + }, + { + "type": "SYMBOL", + "name": "env_decl" + }, + { + "type": "SYMBOL", + "name": "test" + }, + { + "type": "SYMBOL", + "name": "pattern" + } + ] + }, + "group_weight_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "weight" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "number" + } + } + ] + }, + "group_timeout_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "timeout" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "duration" + } + } + ] + }, + "group_memory_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "memory_limit" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "size" + } + } + ] + }, + "group_scoring_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "scoring" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "scoring_value" + } + } + ] + }, + "scoring_value": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "partial" + }, + { + "type": "STRING", + "value": "all_or_none" + } + ] + }, + "group_wrapper_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "wrapper" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "env_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "env" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "key", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "test": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "test" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "name", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_test_field" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "_test_field": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "test_stdin_field" + }, + { + "type": "SYMBOL", + "name": "test_stdout_field" + }, + { + "type": "SYMBOL", + "name": "test_stderr_field" + }, + { + "type": "SYMBOL", + "name": "test_args_field" + }, + { + "type": "SYMBOL", + "name": "test_exit_code_field" + }, + { + "type": "SYMBOL", + "name": "test_timeout_field" + }, + { + "type": "SYMBOL", + "name": "test_memory_field" + }, + { + "type": "SYMBOL", + "name": "test_wrapper_field" + }, + { + "type": "SYMBOL", + "name": "env_decl" + }, + { + "type": "SYMBOL", + "name": "file_decl" + }, + { + "type": "SYMBOL", + "name": "out_file_decl" + } + ] + }, + "test_stdin_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "stdin" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "test_stdout_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "stdout" + }, + { + "type": "SYMBOL", + "name": "_matcher" + } + ] + }, + "test_stderr_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "stderr" + }, + { + "type": "SYMBOL", + "name": "_matcher" + } + ] + }, + "test_args_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "args" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "REPEAT1", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + } + ] + }, + "test_exit_code_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "exitCode" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "integer" + } + } + ] + }, + "test_timeout_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "timeout" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "duration" + } + } + ] + }, + "test_memory_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "memory_limit" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "size" + } + } + ] + }, + "test_wrapper_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "wrapper" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "file_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "file" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "key", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "out_file_decl": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "outFile" + }, + { + "type": "STRING", + "value": "(" + }, + { + "type": "FIELD", + "name": "key", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": ")" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "_matcher": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "exact_matcher" + }, + { + "type": "SYMBOL", + "name": "numeric_matcher" + }, + { + "type": "SYMBOL", + "name": "contains_matcher" + }, + { + "type": "SYMBOL", + "name": "regex_matcher" + }, + { + "type": "SYMBOL", + "name": "any_order_matcher" + } + ] + }, + "exact_matcher": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "numeric_matcher": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "~" + }, + { + "type": "FIELD", + "name": "epsilon", + "content": { + "type": "SYMBOL", + "name": "number" + } + }, + { + "type": "STRING", + "value": "of" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "contains_matcher": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "contains" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "regex_matcher": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "matches" + }, + { + "type": "FIELD", + "name": "pattern", + "content": { + "type": "SYMBOL", + "name": "regex_string" + } + } + ] + }, + "any_order_matcher": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "anyOrder" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT1", + "content": { + "type": "SYMBOL", + "name": "string" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "pattern": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "pattern" + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_pattern_field" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "_pattern_field": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "pattern_input_field" + }, + { + "type": "SYMBOL", + "name": "pattern_output_field" + }, + { + "type": "SYMBOL", + "name": "pattern_dirs_field" + }, + { + "type": "SYMBOL", + "name": "pattern_args_field" + } + ] + }, + "pattern_input_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "input" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "pattern_output_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "output" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "pattern_dirs_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "dirs" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + ] + }, + "pattern_args_field": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "args" + }, + { + "type": "STRING", + "value": "=" + }, + { + "type": "FIELD", + "name": "value", + "content": { + "type": "REPEAT1", + "content": { + "type": "SYMBOL", + "name": "string" + } + } + } + ] + }, + "bool": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "true" + }, + { + "type": "STRING", + "value": "false" + } + ] + }, + "number": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "integer" + }, + { + "type": "SYMBOL", + "name": "float" + } + ] + }, + "string": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "heredoc_string" + }, + { + "type": "SYMBOL", + "name": "simple_string" + } + ] + }, + "simple_string": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\"" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "[^\"\\\\\\n]" + }, + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\\" + }, + { + "type": "PATTERN", + "value": "." + } + ] + } + ] + } + }, + { + "type": "STRING", + "value": "\"" + } + ] + } + }, + "heredoc_string": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\"\"\"" + }, + { + "type": "PATTERN", + "value": "([^\"]|\"[^\"]|\"\"[^\"])*" + }, + { + "type": "STRING", + "value": "\"\"\"" + } + ] + } + }, + "regex_string": { + "type": "SYMBOL", + "name": "simple_string" + }, + "identifier": { + "type": "PATTERN", + "value": "[a-zA-Z_][a-zA-Z0-9_]*" + }, + "integer": { + "type": "TOKEN", + "content": { + "type": "PATTERN", + "value": "-?\\d+" + } + }, + "float": { + "type": "TOKEN", + "content": { + "type": "PATTERN", + "value": "-?\\d+\\.\\d+" + } + }, + "duration": { + "type": "TOKEN", + "content": { + "type": "PATTERN", + "value": "\\d+(ms|s|m)" + } + }, + "size": { + "type": "TOKEN", + "content": { + "type": "PATTERN", + "value": "\\d+(KiB|MiB|GiB|KB|MB|GB|B|K|M|G)" + } + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "\\s+" + }, + { + "type": "SYMBOL", + "name": "comment" + } + ], + "conflicts": [], + "precedences": [], + "externals": [], + "inline": [], + "supertypes": [] +} diff --git a/editor/zed/tree-sitter-jdg/src/node-types.json b/editor/zed/tree-sitter-jdg/src/node-types.json new file mode 100644 index 0000000..876dc79 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/src/node-types.json @@ -0,0 +1,1570 @@ +[ + { + "type": "any_order_matcher", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + }, + { + "type": "binary_decl", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "bool", + "named": true, + "fields": {} + }, + { + "type": "bool_decl", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "normalize_crlf", + "named": false + }, + { + "type": "trim_trailing_ws", + "named": false + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bool", + "named": true + } + ] + } + } + }, + { + "type": "build_block", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "build_list_field", + "named": true + }, + { + "type": "build_profile_field", + "named": true + }, + { + "type": "build_scalar_field", + "named": true + }, + { + "type": "build_warnings_field", + "named": true + }, + { + "type": "define_field", + "named": true + }, + { + "type": "os_override", + "named": true + } + ] + } + }, + { + "type": "build_defaults", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "build_block", + "named": true + } + ] + } + } + }, + { + "type": "build_list_field", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "compilers", + "named": false + }, + { + "type": "extra", + "named": false + }, + { + "type": "includes", + "named": false + }, + { + "type": "link", + "named": false + }, + { + "type": "platforms", + "named": false + }, + { + "type": "sanitize", + "named": false + }, + { + "type": "sources", + "named": false + } + ] + }, + "value": { + "multiple": true, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "build_profile_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "profile_value", + "named": true + } + ] + } + } + }, + { + "type": "build_scalar_field", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "language", + "named": false + }, + { + "type": "output", + "named": false + }, + { + "type": "standard", + "named": false + }, + { + "type": "wrapper", + "named": false + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "build_warnings_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "warnings_value", + "named": true + } + ] + } + } + }, + { + "type": "class_value", + "named": true, + "fields": {} + }, + { + "type": "contains_matcher", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "define_field", + "named": true, + "fields": { + "key": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "env_decl", + "named": true, + "fields": { + "key": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "exact_matcher", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "file_decl", + "named": true, + "fields": { + "key": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "group", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "env_decl", + "named": true + }, + { + "type": "group_memory_field", + "named": true + }, + { + "type": "group_scoring_field", + "named": true + }, + { + "type": "group_timeout_field", + "named": true + }, + { + "type": "group_weight_field", + "named": true + }, + { + "type": "group_wrapper_field", + "named": true + }, + { + "type": "pattern", + "named": true + }, + { + "type": "test", + "named": true + } + ] + } + }, + { + "type": "group_memory_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "size", + "named": true + } + ] + } + } + }, + { + "type": "group_scoring_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "scoring_value", + "named": true + } + ] + } + } + }, + { + "type": "group_timeout_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "duration", + "named": true + } + ] + } + } + }, + { + "type": "group_weight_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "number", + "named": true + } + ] + } + } + }, + { + "type": "group_wrapper_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "include", + "named": true, + "fields": { + "path": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "legacy_build", + "named": true, + "fields": { + "command": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "legacy_build_platform", + "named": true, + "fields": { + "command": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + }, + "keyword": { + "multiple": false, + "required": true, + "types": [ + { + "type": "build_darwin", + "named": false + }, + { + "type": "build_linux", + "named": false + }, + { + "type": "build_windows", + "named": false + } + ] + } + } + }, + { + "type": "memory_limit_decl", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "size", + "named": true + } + ] + } + } + }, + { + "type": "number", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "float", + "named": true + }, + { + "type": "integer", + "named": true + } + ] + } + }, + { + "type": "numeric_matcher", + "named": true, + "fields": { + "epsilon": { + "multiple": false, + "required": true, + "types": [ + { + "type": "number", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "os_name", + "named": true, + "fields": {} + }, + { + "type": "os_override", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "build_block", + "named": true + } + ] + }, + "os": { + "multiple": false, + "required": true, + "types": [ + { + "type": "os_name", + "named": true + } + ] + } + } + }, + { + "type": "out_file_decl", + "named": true, + "fields": { + "key": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "pattern", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "pattern_args_field", + "named": true + }, + { + "type": "pattern_dirs_field", + "named": true + }, + { + "type": "pattern_input_field", + "named": true + }, + { + "type": "pattern_output_field", + "named": true + } + ] + } + }, + { + "type": "pattern_args_field", + "named": true, + "fields": { + "value": { + "multiple": true, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "pattern_dirs_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "pattern_input_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "pattern_output_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "profile_value", + "named": true, + "fields": {} + }, + { + "type": "regex_matcher", + "named": true, + "fields": { + "pattern": { + "multiple": false, + "required": true, + "types": [ + { + "type": "regex_string", + "named": true + } + ] + } + } + }, + { + "type": "regex_string", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "simple_string", + "named": true + } + ] + } + }, + { + "type": "scoring_value", + "named": true, + "fields": {} + }, + { + "type": "source_file", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "binary_decl", + "named": true + }, + { + "type": "bool_decl", + "named": true + }, + { + "type": "build_defaults", + "named": true + }, + { + "type": "group", + "named": true + }, + { + "type": "include", + "named": true + }, + { + "type": "legacy_build", + "named": true + }, + { + "type": "legacy_build_platform", + "named": true + }, + { + "type": "memory_limit_decl", + "named": true + }, + { + "type": "sources_decl", + "named": true + }, + { + "type": "structured_build", + "named": true + }, + { + "type": "timeout_decl", + "named": true + }, + { + "type": "toolchains", + "named": true + } + ] + } + }, + { + "type": "sources_decl", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "string", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "heredoc_string", + "named": true + }, + { + "type": "simple_string", + "named": true + } + ] + } + }, + { + "type": "structured_build", + "named": true, + "fields": { + "body": { + "multiple": false, + "required": true, + "types": [ + { + "type": "build_block", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "test", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "env_decl", + "named": true + }, + { + "type": "file_decl", + "named": true + }, + { + "type": "out_file_decl", + "named": true + }, + { + "type": "test_args_field", + "named": true + }, + { + "type": "test_exit_code_field", + "named": true + }, + { + "type": "test_memory_field", + "named": true + }, + { + "type": "test_stderr_field", + "named": true + }, + { + "type": "test_stdin_field", + "named": true + }, + { + "type": "test_stdout_field", + "named": true + }, + { + "type": "test_timeout_field", + "named": true + }, + { + "type": "test_wrapper_field", + "named": true + } + ] + } + }, + { + "type": "test_args_field", + "named": true, + "fields": { + "value": { + "multiple": true, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "test_exit_code_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "integer", + "named": true + } + ] + } + } + }, + { + "type": "test_memory_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "size", + "named": true + } + ] + } + } + }, + { + "type": "test_stderr_field", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "any_order_matcher", + "named": true + }, + { + "type": "contains_matcher", + "named": true + }, + { + "type": "exact_matcher", + "named": true + }, + { + "type": "numeric_matcher", + "named": true + }, + { + "type": "regex_matcher", + "named": true + } + ] + } + }, + { + "type": "test_stdin_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "test_stdout_field", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "any_order_matcher", + "named": true + }, + { + "type": "contains_matcher", + "named": true + }, + { + "type": "exact_matcher", + "named": true + }, + { + "type": "numeric_matcher", + "named": true + }, + { + "type": "regex_matcher", + "named": true + } + ] + } + }, + { + "type": "test_timeout_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "duration", + "named": true + } + ] + } + } + }, + { + "type": "test_wrapper_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "timeout_decl", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "duration", + "named": true + } + ] + } + } + }, + { + "type": "toolchain_binary_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "toolchain_class_field", + "named": true, + "fields": { + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "class_value", + "named": true + } + ] + } + } + }, + { + "type": "toolchain_entry", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + }, + { + "type": "string", + "named": true + } + ] + } + }, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "toolchain_binary_field", + "named": true + }, + { + "type": "toolchain_class_field", + "named": true + }, + { + "type": "toolchain_platforms_field", + "named": true + } + ] + } + }, + { + "type": "toolchain_platforms_field", + "named": true, + "fields": { + "value": { + "multiple": true, + "required": true, + "types": [ + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "toolchains", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "toolchain_entry", + "named": true + } + ] + } + }, + { + "type": "warnings_value", + "named": true, + "fields": {} + }, + { + "type": "(", + "named": false + }, + { + "type": ")", + "named": false + }, + { + "type": "=", + "named": false + }, + { + "type": "all_or_none", + "named": false + }, + { + "type": "anyOrder", + "named": false + }, + { + "type": "args", + "named": false + }, + { + "type": "binary", + "named": false + }, + { + "type": "build", + "named": false + }, + { + "type": "build_darwin", + "named": false + }, + { + "type": "build_defaults", + "named": false + }, + { + "type": "build_linux", + "named": false + }, + { + "type": "build_windows", + "named": false + }, + { + "type": "class", + "named": false + }, + { + "type": "comment", + "named": true + }, + { + "type": "compilers", + "named": false + }, + { + "type": "contains", + "named": false + }, + { + "type": "darwin", + "named": false + }, + { + "type": "debug", + "named": false + }, + { + "type": "default", + "named": false + }, + { + "type": "define", + "named": false + }, + { + "type": "dirs", + "named": false + }, + { + "type": "duration", + "named": true + }, + { + "type": "env", + "named": false + }, + { + "type": "exitCode", + "named": false + }, + { + "type": "extra", + "named": false + }, + { + "type": "false", + "named": false + }, + { + "type": "file", + "named": false + }, + { + "type": "float", + "named": true + }, + { + "type": "gnu", + "named": false + }, + { + "type": "group", + "named": false + }, + { + "type": "heredoc_string", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "include", + "named": false + }, + { + "type": "includes", + "named": false + }, + { + "type": "input", + "named": false + }, + { + "type": "integer", + "named": true + }, + { + "type": "language", + "named": false + }, + { + "type": "link", + "named": false + }, + { + "type": "linux", + "named": false + }, + { + "type": "matches", + "named": false + }, + { + "type": "memory_limit", + "named": false + }, + { + "type": "msvc", + "named": false + }, + { + "type": "normalize_crlf", + "named": false + }, + { + "type": "of", + "named": false + }, + { + "type": "outFile", + "named": false + }, + { + "type": "output", + "named": false + }, + { + "type": "partial", + "named": false + }, + { + "type": "pattern", + "named": false + }, + { + "type": "pedantic", + "named": false + }, + { + "type": "platforms", + "named": false + }, + { + "type": "profile", + "named": false + }, + { + "type": "release", + "named": false + }, + { + "type": "sanitize", + "named": false + }, + { + "type": "sanitized", + "named": false + }, + { + "type": "scoring", + "named": false + }, + { + "type": "simple_string", + "named": true + }, + { + "type": "size", + "named": true + }, + { + "type": "sources", + "named": false + }, + { + "type": "standard", + "named": false + }, + { + "type": "stderr", + "named": false + }, + { + "type": "stdin", + "named": false + }, + { + "type": "stdout", + "named": false + }, + { + "type": "strict", + "named": false + }, + { + "type": "test", + "named": false + }, + { + "type": "timeout", + "named": false + }, + { + "type": "toolchains", + "named": false + }, + { + "type": "trim_trailing_ws", + "named": false + }, + { + "type": "true", + "named": false + }, + { + "type": "warnings", + "named": false + }, + { + "type": "weight", + "named": false + }, + { + "type": "windows", + "named": false + }, + { + "type": "wrapper", + "named": false + }, + { + "type": "{", + "named": false + }, + { + "type": "}", + "named": false + }, + { + "type": "~", + "named": false + } +] \ No newline at end of file diff --git a/editor/zed/tree-sitter-jdg/src/parser.c b/editor/zed/tree-sitter-jdg/src/parser.c new file mode 100644 index 0000000..50942b5 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/src/parser.c @@ -0,0 +1,5922 @@ +#include "tree_sitter/parser.h" + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +#define LANGUAGE_VERSION 14 +#define STATE_COUNT 189 +#define LARGE_STATE_COUNT 2 +#define SYMBOL_COUNT 151 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 76 +#define EXTERNAL_TOKEN_COUNT 0 +#define FIELD_COUNT 10 +#define MAX_ALIAS_SEQUENCE_LENGTH 7 +#define PRODUCTION_ID_COUNT 15 + +enum ts_symbol_identifiers { + sym_identifier = 1, + sym_comment = 2, + anon_sym_include = 3, + anon_sym_build = 4, + anon_sym_build_linux = 5, + anon_sym_build_windows = 6, + anon_sym_build_darwin = 7, + anon_sym_build_defaults = 8, + anon_sym_LBRACE = 9, + anon_sym_RBRACE = 10, + anon_sym_language = 11, + anon_sym_standard = 12, + anon_sym_output = 13, + anon_sym_wrapper = 14, + anon_sym_EQ = 15, + anon_sym_sources = 16, + anon_sym_includes = 17, + anon_sym_sanitize = 18, + anon_sym_link = 19, + anon_sym_extra = 20, + anon_sym_platforms = 21, + anon_sym_compilers = 22, + anon_sym_profile = 23, + anon_sym_release = 24, + anon_sym_debug = 25, + anon_sym_sanitized = 26, + anon_sym_warnings = 27, + anon_sym_default = 28, + anon_sym_strict = 29, + anon_sym_pedantic = 30, + anon_sym_define = 31, + anon_sym_LPAREN = 32, + anon_sym_RPAREN = 33, + anon_sym_linux = 34, + anon_sym_windows = 35, + anon_sym_darwin = 36, + anon_sym_toolchains = 37, + anon_sym_binary = 38, + anon_sym_class = 39, + anon_sym_gnu = 40, + anon_sym_msvc = 41, + anon_sym_normalize_crlf = 42, + anon_sym_trim_trailing_ws = 43, + anon_sym_timeout = 44, + anon_sym_memory_limit = 45, + anon_sym_group = 46, + anon_sym_weight = 47, + anon_sym_scoring = 48, + anon_sym_partial = 49, + anon_sym_all_or_none = 50, + anon_sym_env = 51, + anon_sym_test = 52, + anon_sym_stdin = 53, + anon_sym_stdout = 54, + anon_sym_stderr = 55, + anon_sym_args = 56, + anon_sym_exitCode = 57, + anon_sym_file = 58, + anon_sym_outFile = 59, + anon_sym_TILDE = 60, + anon_sym_of = 61, + anon_sym_contains = 62, + anon_sym_matches = 63, + anon_sym_anyOrder = 64, + anon_sym_pattern = 65, + anon_sym_input = 66, + anon_sym_dirs = 67, + anon_sym_true = 68, + anon_sym_false = 69, + sym_simple_string = 70, + sym_heredoc_string = 71, + sym_integer = 72, + sym_float = 73, + sym_duration = 74, + sym_size = 75, + sym_source_file = 76, + sym__top_statement = 77, + sym_include = 78, + sym_legacy_build = 79, + sym_legacy_build_platform = 80, + sym_structured_build = 81, + sym_build_defaults = 82, + sym_build_block = 83, + sym__build_field = 84, + sym_build_scalar_field = 85, + sym_build_list_field = 86, + sym_build_profile_field = 87, + sym_profile_value = 88, + sym_build_warnings_field = 89, + sym_warnings_value = 90, + sym_define_field = 91, + sym_os_override = 92, + sym_os_name = 93, + sym_toolchains = 94, + sym_toolchain_entry = 95, + sym__toolchain_field = 96, + sym_toolchain_platforms_field = 97, + sym_toolchain_binary_field = 98, + sym_toolchain_class_field = 99, + sym_class_value = 100, + sym_binary_decl = 101, + sym_sources_decl = 102, + sym_bool_decl = 103, + sym_timeout_decl = 104, + sym_memory_limit_decl = 105, + sym_group = 106, + sym__group_field = 107, + sym_group_weight_field = 108, + sym_group_timeout_field = 109, + sym_group_memory_field = 110, + sym_group_scoring_field = 111, + sym_scoring_value = 112, + sym_group_wrapper_field = 113, + sym_env_decl = 114, + sym_test = 115, + sym__test_field = 116, + sym_test_stdin_field = 117, + sym_test_stdout_field = 118, + sym_test_stderr_field = 119, + sym_test_args_field = 120, + sym_test_exit_code_field = 121, + sym_test_timeout_field = 122, + sym_test_memory_field = 123, + sym_test_wrapper_field = 124, + sym_file_decl = 125, + sym_out_file_decl = 126, + sym__matcher = 127, + sym_exact_matcher = 128, + sym_numeric_matcher = 129, + sym_contains_matcher = 130, + sym_regex_matcher = 131, + sym_any_order_matcher = 132, + sym_pattern = 133, + sym__pattern_field = 134, + sym_pattern_input_field = 135, + sym_pattern_output_field = 136, + sym_pattern_dirs_field = 137, + sym_pattern_args_field = 138, + sym_bool = 139, + sym_number = 140, + sym_string = 141, + sym_regex_string = 142, + aux_sym_source_file_repeat1 = 143, + aux_sym_build_block_repeat1 = 144, + aux_sym_build_list_field_repeat1 = 145, + aux_sym_toolchains_repeat1 = 146, + aux_sym_toolchain_entry_repeat1 = 147, + aux_sym_group_repeat1 = 148, + aux_sym_test_repeat1 = 149, + aux_sym_pattern_repeat1 = 150, +}; + +static const char * const ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [sym_identifier] = "identifier", + [sym_comment] = "comment", + [anon_sym_include] = "include", + [anon_sym_build] = "build", + [anon_sym_build_linux] = "build_linux", + [anon_sym_build_windows] = "build_windows", + [anon_sym_build_darwin] = "build_darwin", + [anon_sym_build_defaults] = "build_defaults", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_language] = "language", + [anon_sym_standard] = "standard", + [anon_sym_output] = "output", + [anon_sym_wrapper] = "wrapper", + [anon_sym_EQ] = "=", + [anon_sym_sources] = "sources", + [anon_sym_includes] = "includes", + [anon_sym_sanitize] = "sanitize", + [anon_sym_link] = "link", + [anon_sym_extra] = "extra", + [anon_sym_platforms] = "platforms", + [anon_sym_compilers] = "compilers", + [anon_sym_profile] = "profile", + [anon_sym_release] = "release", + [anon_sym_debug] = "debug", + [anon_sym_sanitized] = "sanitized", + [anon_sym_warnings] = "warnings", + [anon_sym_default] = "default", + [anon_sym_strict] = "strict", + [anon_sym_pedantic] = "pedantic", + [anon_sym_define] = "define", + [anon_sym_LPAREN] = "(", + [anon_sym_RPAREN] = ")", + [anon_sym_linux] = "linux", + [anon_sym_windows] = "windows", + [anon_sym_darwin] = "darwin", + [anon_sym_toolchains] = "toolchains", + [anon_sym_binary] = "binary", + [anon_sym_class] = "class", + [anon_sym_gnu] = "gnu", + [anon_sym_msvc] = "msvc", + [anon_sym_normalize_crlf] = "normalize_crlf", + [anon_sym_trim_trailing_ws] = "trim_trailing_ws", + [anon_sym_timeout] = "timeout", + [anon_sym_memory_limit] = "memory_limit", + [anon_sym_group] = "group", + [anon_sym_weight] = "weight", + [anon_sym_scoring] = "scoring", + [anon_sym_partial] = "partial", + [anon_sym_all_or_none] = "all_or_none", + [anon_sym_env] = "env", + [anon_sym_test] = "test", + [anon_sym_stdin] = "stdin", + [anon_sym_stdout] = "stdout", + [anon_sym_stderr] = "stderr", + [anon_sym_args] = "args", + [anon_sym_exitCode] = "exitCode", + [anon_sym_file] = "file", + [anon_sym_outFile] = "outFile", + [anon_sym_TILDE] = "~", + [anon_sym_of] = "of", + [anon_sym_contains] = "contains", + [anon_sym_matches] = "matches", + [anon_sym_anyOrder] = "anyOrder", + [anon_sym_pattern] = "pattern", + [anon_sym_input] = "input", + [anon_sym_dirs] = "dirs", + [anon_sym_true] = "true", + [anon_sym_false] = "false", + [sym_simple_string] = "simple_string", + [sym_heredoc_string] = "heredoc_string", + [sym_integer] = "integer", + [sym_float] = "float", + [sym_duration] = "duration", + [sym_size] = "size", + [sym_source_file] = "source_file", + [sym__top_statement] = "_top_statement", + [sym_include] = "include", + [sym_legacy_build] = "legacy_build", + [sym_legacy_build_platform] = "legacy_build_platform", + [sym_structured_build] = "structured_build", + [sym_build_defaults] = "build_defaults", + [sym_build_block] = "build_block", + [sym__build_field] = "_build_field", + [sym_build_scalar_field] = "build_scalar_field", + [sym_build_list_field] = "build_list_field", + [sym_build_profile_field] = "build_profile_field", + [sym_profile_value] = "profile_value", + [sym_build_warnings_field] = "build_warnings_field", + [sym_warnings_value] = "warnings_value", + [sym_define_field] = "define_field", + [sym_os_override] = "os_override", + [sym_os_name] = "os_name", + [sym_toolchains] = "toolchains", + [sym_toolchain_entry] = "toolchain_entry", + [sym__toolchain_field] = "_toolchain_field", + [sym_toolchain_platforms_field] = "toolchain_platforms_field", + [sym_toolchain_binary_field] = "toolchain_binary_field", + [sym_toolchain_class_field] = "toolchain_class_field", + [sym_class_value] = "class_value", + [sym_binary_decl] = "binary_decl", + [sym_sources_decl] = "sources_decl", + [sym_bool_decl] = "bool_decl", + [sym_timeout_decl] = "timeout_decl", + [sym_memory_limit_decl] = "memory_limit_decl", + [sym_group] = "group", + [sym__group_field] = "_group_field", + [sym_group_weight_field] = "group_weight_field", + [sym_group_timeout_field] = "group_timeout_field", + [sym_group_memory_field] = "group_memory_field", + [sym_group_scoring_field] = "group_scoring_field", + [sym_scoring_value] = "scoring_value", + [sym_group_wrapper_field] = "group_wrapper_field", + [sym_env_decl] = "env_decl", + [sym_test] = "test", + [sym__test_field] = "_test_field", + [sym_test_stdin_field] = "test_stdin_field", + [sym_test_stdout_field] = "test_stdout_field", + [sym_test_stderr_field] = "test_stderr_field", + [sym_test_args_field] = "test_args_field", + [sym_test_exit_code_field] = "test_exit_code_field", + [sym_test_timeout_field] = "test_timeout_field", + [sym_test_memory_field] = "test_memory_field", + [sym_test_wrapper_field] = "test_wrapper_field", + [sym_file_decl] = "file_decl", + [sym_out_file_decl] = "out_file_decl", + [sym__matcher] = "_matcher", + [sym_exact_matcher] = "exact_matcher", + [sym_numeric_matcher] = "numeric_matcher", + [sym_contains_matcher] = "contains_matcher", + [sym_regex_matcher] = "regex_matcher", + [sym_any_order_matcher] = "any_order_matcher", + [sym_pattern] = "pattern", + [sym__pattern_field] = "_pattern_field", + [sym_pattern_input_field] = "pattern_input_field", + [sym_pattern_output_field] = "pattern_output_field", + [sym_pattern_dirs_field] = "pattern_dirs_field", + [sym_pattern_args_field] = "pattern_args_field", + [sym_bool] = "bool", + [sym_number] = "number", + [sym_string] = "string", + [sym_regex_string] = "regex_string", + [aux_sym_source_file_repeat1] = "source_file_repeat1", + [aux_sym_build_block_repeat1] = "build_block_repeat1", + [aux_sym_build_list_field_repeat1] = "build_list_field_repeat1", + [aux_sym_toolchains_repeat1] = "toolchains_repeat1", + [aux_sym_toolchain_entry_repeat1] = "toolchain_entry_repeat1", + [aux_sym_group_repeat1] = "group_repeat1", + [aux_sym_test_repeat1] = "test_repeat1", + [aux_sym_pattern_repeat1] = "pattern_repeat1", +}; + +static const TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [sym_identifier] = sym_identifier, + [sym_comment] = sym_comment, + [anon_sym_include] = anon_sym_include, + [anon_sym_build] = anon_sym_build, + [anon_sym_build_linux] = anon_sym_build_linux, + [anon_sym_build_windows] = anon_sym_build_windows, + [anon_sym_build_darwin] = anon_sym_build_darwin, + [anon_sym_build_defaults] = anon_sym_build_defaults, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_language] = anon_sym_language, + [anon_sym_standard] = anon_sym_standard, + [anon_sym_output] = anon_sym_output, + [anon_sym_wrapper] = anon_sym_wrapper, + [anon_sym_EQ] = anon_sym_EQ, + [anon_sym_sources] = anon_sym_sources, + [anon_sym_includes] = anon_sym_includes, + [anon_sym_sanitize] = anon_sym_sanitize, + [anon_sym_link] = anon_sym_link, + [anon_sym_extra] = anon_sym_extra, + [anon_sym_platforms] = anon_sym_platforms, + [anon_sym_compilers] = anon_sym_compilers, + [anon_sym_profile] = anon_sym_profile, + [anon_sym_release] = anon_sym_release, + [anon_sym_debug] = anon_sym_debug, + [anon_sym_sanitized] = anon_sym_sanitized, + [anon_sym_warnings] = anon_sym_warnings, + [anon_sym_default] = anon_sym_default, + [anon_sym_strict] = anon_sym_strict, + [anon_sym_pedantic] = anon_sym_pedantic, + [anon_sym_define] = anon_sym_define, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_RPAREN] = anon_sym_RPAREN, + [anon_sym_linux] = anon_sym_linux, + [anon_sym_windows] = anon_sym_windows, + [anon_sym_darwin] = anon_sym_darwin, + [anon_sym_toolchains] = anon_sym_toolchains, + [anon_sym_binary] = anon_sym_binary, + [anon_sym_class] = anon_sym_class, + [anon_sym_gnu] = anon_sym_gnu, + [anon_sym_msvc] = anon_sym_msvc, + [anon_sym_normalize_crlf] = anon_sym_normalize_crlf, + [anon_sym_trim_trailing_ws] = anon_sym_trim_trailing_ws, + [anon_sym_timeout] = anon_sym_timeout, + [anon_sym_memory_limit] = anon_sym_memory_limit, + [anon_sym_group] = anon_sym_group, + [anon_sym_weight] = anon_sym_weight, + [anon_sym_scoring] = anon_sym_scoring, + [anon_sym_partial] = anon_sym_partial, + [anon_sym_all_or_none] = anon_sym_all_or_none, + [anon_sym_env] = anon_sym_env, + [anon_sym_test] = anon_sym_test, + [anon_sym_stdin] = anon_sym_stdin, + [anon_sym_stdout] = anon_sym_stdout, + [anon_sym_stderr] = anon_sym_stderr, + [anon_sym_args] = anon_sym_args, + [anon_sym_exitCode] = anon_sym_exitCode, + [anon_sym_file] = anon_sym_file, + [anon_sym_outFile] = anon_sym_outFile, + [anon_sym_TILDE] = anon_sym_TILDE, + [anon_sym_of] = anon_sym_of, + [anon_sym_contains] = anon_sym_contains, + [anon_sym_matches] = anon_sym_matches, + [anon_sym_anyOrder] = anon_sym_anyOrder, + [anon_sym_pattern] = anon_sym_pattern, + [anon_sym_input] = anon_sym_input, + [anon_sym_dirs] = anon_sym_dirs, + [anon_sym_true] = anon_sym_true, + [anon_sym_false] = anon_sym_false, + [sym_simple_string] = sym_simple_string, + [sym_heredoc_string] = sym_heredoc_string, + [sym_integer] = sym_integer, + [sym_float] = sym_float, + [sym_duration] = sym_duration, + [sym_size] = sym_size, + [sym_source_file] = sym_source_file, + [sym__top_statement] = sym__top_statement, + [sym_include] = sym_include, + [sym_legacy_build] = sym_legacy_build, + [sym_legacy_build_platform] = sym_legacy_build_platform, + [sym_structured_build] = sym_structured_build, + [sym_build_defaults] = sym_build_defaults, + [sym_build_block] = sym_build_block, + [sym__build_field] = sym__build_field, + [sym_build_scalar_field] = sym_build_scalar_field, + [sym_build_list_field] = sym_build_list_field, + [sym_build_profile_field] = sym_build_profile_field, + [sym_profile_value] = sym_profile_value, + [sym_build_warnings_field] = sym_build_warnings_field, + [sym_warnings_value] = sym_warnings_value, + [sym_define_field] = sym_define_field, + [sym_os_override] = sym_os_override, + [sym_os_name] = sym_os_name, + [sym_toolchains] = sym_toolchains, + [sym_toolchain_entry] = sym_toolchain_entry, + [sym__toolchain_field] = sym__toolchain_field, + [sym_toolchain_platforms_field] = sym_toolchain_platforms_field, + [sym_toolchain_binary_field] = sym_toolchain_binary_field, + [sym_toolchain_class_field] = sym_toolchain_class_field, + [sym_class_value] = sym_class_value, + [sym_binary_decl] = sym_binary_decl, + [sym_sources_decl] = sym_sources_decl, + [sym_bool_decl] = sym_bool_decl, + [sym_timeout_decl] = sym_timeout_decl, + [sym_memory_limit_decl] = sym_memory_limit_decl, + [sym_group] = sym_group, + [sym__group_field] = sym__group_field, + [sym_group_weight_field] = sym_group_weight_field, + [sym_group_timeout_field] = sym_group_timeout_field, + [sym_group_memory_field] = sym_group_memory_field, + [sym_group_scoring_field] = sym_group_scoring_field, + [sym_scoring_value] = sym_scoring_value, + [sym_group_wrapper_field] = sym_group_wrapper_field, + [sym_env_decl] = sym_env_decl, + [sym_test] = sym_test, + [sym__test_field] = sym__test_field, + [sym_test_stdin_field] = sym_test_stdin_field, + [sym_test_stdout_field] = sym_test_stdout_field, + [sym_test_stderr_field] = sym_test_stderr_field, + [sym_test_args_field] = sym_test_args_field, + [sym_test_exit_code_field] = sym_test_exit_code_field, + [sym_test_timeout_field] = sym_test_timeout_field, + [sym_test_memory_field] = sym_test_memory_field, + [sym_test_wrapper_field] = sym_test_wrapper_field, + [sym_file_decl] = sym_file_decl, + [sym_out_file_decl] = sym_out_file_decl, + [sym__matcher] = sym__matcher, + [sym_exact_matcher] = sym_exact_matcher, + [sym_numeric_matcher] = sym_numeric_matcher, + [sym_contains_matcher] = sym_contains_matcher, + [sym_regex_matcher] = sym_regex_matcher, + [sym_any_order_matcher] = sym_any_order_matcher, + [sym_pattern] = sym_pattern, + [sym__pattern_field] = sym__pattern_field, + [sym_pattern_input_field] = sym_pattern_input_field, + [sym_pattern_output_field] = sym_pattern_output_field, + [sym_pattern_dirs_field] = sym_pattern_dirs_field, + [sym_pattern_args_field] = sym_pattern_args_field, + [sym_bool] = sym_bool, + [sym_number] = sym_number, + [sym_string] = sym_string, + [sym_regex_string] = sym_regex_string, + [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1, + [aux_sym_build_block_repeat1] = aux_sym_build_block_repeat1, + [aux_sym_build_list_field_repeat1] = aux_sym_build_list_field_repeat1, + [aux_sym_toolchains_repeat1] = aux_sym_toolchains_repeat1, + [aux_sym_toolchain_entry_repeat1] = aux_sym_toolchain_entry_repeat1, + [aux_sym_group_repeat1] = aux_sym_group_repeat1, + [aux_sym_test_repeat1] = aux_sym_test_repeat1, + [aux_sym_pattern_repeat1] = aux_sym_pattern_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [sym_identifier] = { + .visible = true, + .named = true, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, + [anon_sym_include] = { + .visible = true, + .named = false, + }, + [anon_sym_build] = { + .visible = true, + .named = false, + }, + [anon_sym_build_linux] = { + .visible = true, + .named = false, + }, + [anon_sym_build_windows] = { + .visible = true, + .named = false, + }, + [anon_sym_build_darwin] = { + .visible = true, + .named = false, + }, + [anon_sym_build_defaults] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_language] = { + .visible = true, + .named = false, + }, + [anon_sym_standard] = { + .visible = true, + .named = false, + }, + [anon_sym_output] = { + .visible = true, + .named = false, + }, + [anon_sym_wrapper] = { + .visible = true, + .named = false, + }, + [anon_sym_EQ] = { + .visible = true, + .named = false, + }, + [anon_sym_sources] = { + .visible = true, + .named = false, + }, + [anon_sym_includes] = { + .visible = true, + .named = false, + }, + [anon_sym_sanitize] = { + .visible = true, + .named = false, + }, + [anon_sym_link] = { + .visible = true, + .named = false, + }, + [anon_sym_extra] = { + .visible = true, + .named = false, + }, + [anon_sym_platforms] = { + .visible = true, + .named = false, + }, + [anon_sym_compilers] = { + .visible = true, + .named = false, + }, + [anon_sym_profile] = { + .visible = true, + .named = false, + }, + [anon_sym_release] = { + .visible = true, + .named = false, + }, + [anon_sym_debug] = { + .visible = true, + .named = false, + }, + [anon_sym_sanitized] = { + .visible = true, + .named = false, + }, + [anon_sym_warnings] = { + .visible = true, + .named = false, + }, + [anon_sym_default] = { + .visible = true, + .named = false, + }, + [anon_sym_strict] = { + .visible = true, + .named = false, + }, + [anon_sym_pedantic] = { + .visible = true, + .named = false, + }, + [anon_sym_define] = { + .visible = true, + .named = false, + }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_linux] = { + .visible = true, + .named = false, + }, + [anon_sym_windows] = { + .visible = true, + .named = false, + }, + [anon_sym_darwin] = { + .visible = true, + .named = false, + }, + [anon_sym_toolchains] = { + .visible = true, + .named = false, + }, + [anon_sym_binary] = { + .visible = true, + .named = false, + }, + [anon_sym_class] = { + .visible = true, + .named = false, + }, + [anon_sym_gnu] = { + .visible = true, + .named = false, + }, + [anon_sym_msvc] = { + .visible = true, + .named = false, + }, + [anon_sym_normalize_crlf] = { + .visible = true, + .named = false, + }, + [anon_sym_trim_trailing_ws] = { + .visible = true, + .named = false, + }, + [anon_sym_timeout] = { + .visible = true, + .named = false, + }, + [anon_sym_memory_limit] = { + .visible = true, + .named = false, + }, + [anon_sym_group] = { + .visible = true, + .named = false, + }, + [anon_sym_weight] = { + .visible = true, + .named = false, + }, + [anon_sym_scoring] = { + .visible = true, + .named = false, + }, + [anon_sym_partial] = { + .visible = true, + .named = false, + }, + [anon_sym_all_or_none] = { + .visible = true, + .named = false, + }, + [anon_sym_env] = { + .visible = true, + .named = false, + }, + [anon_sym_test] = { + .visible = true, + .named = false, + }, + [anon_sym_stdin] = { + .visible = true, + .named = false, + }, + [anon_sym_stdout] = { + .visible = true, + .named = false, + }, + [anon_sym_stderr] = { + .visible = true, + .named = false, + }, + [anon_sym_args] = { + .visible = true, + .named = false, + }, + [anon_sym_exitCode] = { + .visible = true, + .named = false, + }, + [anon_sym_file] = { + .visible = true, + .named = false, + }, + [anon_sym_outFile] = { + .visible = true, + .named = false, + }, + [anon_sym_TILDE] = { + .visible = true, + .named = false, + }, + [anon_sym_of] = { + .visible = true, + .named = false, + }, + [anon_sym_contains] = { + .visible = true, + .named = false, + }, + [anon_sym_matches] = { + .visible = true, + .named = false, + }, + [anon_sym_anyOrder] = { + .visible = true, + .named = false, + }, + [anon_sym_pattern] = { + .visible = true, + .named = false, + }, + [anon_sym_input] = { + .visible = true, + .named = false, + }, + [anon_sym_dirs] = { + .visible = true, + .named = false, + }, + [anon_sym_true] = { + .visible = true, + .named = false, + }, + [anon_sym_false] = { + .visible = true, + .named = false, + }, + [sym_simple_string] = { + .visible = true, + .named = true, + }, + [sym_heredoc_string] = { + .visible = true, + .named = true, + }, + [sym_integer] = { + .visible = true, + .named = true, + }, + [sym_float] = { + .visible = true, + .named = true, + }, + [sym_duration] = { + .visible = true, + .named = true, + }, + [sym_size] = { + .visible = true, + .named = true, + }, + [sym_source_file] = { + .visible = true, + .named = true, + }, + [sym__top_statement] = { + .visible = false, + .named = true, + }, + [sym_include] = { + .visible = true, + .named = true, + }, + [sym_legacy_build] = { + .visible = true, + .named = true, + }, + [sym_legacy_build_platform] = { + .visible = true, + .named = true, + }, + [sym_structured_build] = { + .visible = true, + .named = true, + }, + [sym_build_defaults] = { + .visible = true, + .named = true, + }, + [sym_build_block] = { + .visible = true, + .named = true, + }, + [sym__build_field] = { + .visible = false, + .named = true, + }, + [sym_build_scalar_field] = { + .visible = true, + .named = true, + }, + [sym_build_list_field] = { + .visible = true, + .named = true, + }, + [sym_build_profile_field] = { + .visible = true, + .named = true, + }, + [sym_profile_value] = { + .visible = true, + .named = true, + }, + [sym_build_warnings_field] = { + .visible = true, + .named = true, + }, + [sym_warnings_value] = { + .visible = true, + .named = true, + }, + [sym_define_field] = { + .visible = true, + .named = true, + }, + [sym_os_override] = { + .visible = true, + .named = true, + }, + [sym_os_name] = { + .visible = true, + .named = true, + }, + [sym_toolchains] = { + .visible = true, + .named = true, + }, + [sym_toolchain_entry] = { + .visible = true, + .named = true, + }, + [sym__toolchain_field] = { + .visible = false, + .named = true, + }, + [sym_toolchain_platforms_field] = { + .visible = true, + .named = true, + }, + [sym_toolchain_binary_field] = { + .visible = true, + .named = true, + }, + [sym_toolchain_class_field] = { + .visible = true, + .named = true, + }, + [sym_class_value] = { + .visible = true, + .named = true, + }, + [sym_binary_decl] = { + .visible = true, + .named = true, + }, + [sym_sources_decl] = { + .visible = true, + .named = true, + }, + [sym_bool_decl] = { + .visible = true, + .named = true, + }, + [sym_timeout_decl] = { + .visible = true, + .named = true, + }, + [sym_memory_limit_decl] = { + .visible = true, + .named = true, + }, + [sym_group] = { + .visible = true, + .named = true, + }, + [sym__group_field] = { + .visible = false, + .named = true, + }, + [sym_group_weight_field] = { + .visible = true, + .named = true, + }, + [sym_group_timeout_field] = { + .visible = true, + .named = true, + }, + [sym_group_memory_field] = { + .visible = true, + .named = true, + }, + [sym_group_scoring_field] = { + .visible = true, + .named = true, + }, + [sym_scoring_value] = { + .visible = true, + .named = true, + }, + [sym_group_wrapper_field] = { + .visible = true, + .named = true, + }, + [sym_env_decl] = { + .visible = true, + .named = true, + }, + [sym_test] = { + .visible = true, + .named = true, + }, + [sym__test_field] = { + .visible = false, + .named = true, + }, + [sym_test_stdin_field] = { + .visible = true, + .named = true, + }, + [sym_test_stdout_field] = { + .visible = true, + .named = true, + }, + [sym_test_stderr_field] = { + .visible = true, + .named = true, + }, + [sym_test_args_field] = { + .visible = true, + .named = true, + }, + [sym_test_exit_code_field] = { + .visible = true, + .named = true, + }, + [sym_test_timeout_field] = { + .visible = true, + .named = true, + }, + [sym_test_memory_field] = { + .visible = true, + .named = true, + }, + [sym_test_wrapper_field] = { + .visible = true, + .named = true, + }, + [sym_file_decl] = { + .visible = true, + .named = true, + }, + [sym_out_file_decl] = { + .visible = true, + .named = true, + }, + [sym__matcher] = { + .visible = false, + .named = true, + }, + [sym_exact_matcher] = { + .visible = true, + .named = true, + }, + [sym_numeric_matcher] = { + .visible = true, + .named = true, + }, + [sym_contains_matcher] = { + .visible = true, + .named = true, + }, + [sym_regex_matcher] = { + .visible = true, + .named = true, + }, + [sym_any_order_matcher] = { + .visible = true, + .named = true, + }, + [sym_pattern] = { + .visible = true, + .named = true, + }, + [sym__pattern_field] = { + .visible = false, + .named = true, + }, + [sym_pattern_input_field] = { + .visible = true, + .named = true, + }, + [sym_pattern_output_field] = { + .visible = true, + .named = true, + }, + [sym_pattern_dirs_field] = { + .visible = true, + .named = true, + }, + [sym_pattern_args_field] = { + .visible = true, + .named = true, + }, + [sym_bool] = { + .visible = true, + .named = true, + }, + [sym_number] = { + .visible = true, + .named = true, + }, + [sym_string] = { + .visible = true, + .named = true, + }, + [sym_regex_string] = { + .visible = true, + .named = true, + }, + [aux_sym_source_file_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_build_block_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_build_list_field_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_toolchains_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_toolchain_entry_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_group_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_test_repeat1] = { + .visible = false, + .named = false, + }, + [aux_sym_pattern_repeat1] = { + .visible = false, + .named = false, + }, +}; + +enum ts_field_identifiers { + field_body = 1, + field_command = 2, + field_epsilon = 3, + field_key = 4, + field_keyword = 5, + field_name = 6, + field_os = 7, + field_path = 8, + field_pattern = 9, + field_value = 10, +}; + +static const char * const ts_field_names[] = { + [0] = NULL, + [field_body] = "body", + [field_command] = "command", + [field_epsilon] = "epsilon", + [field_key] = "key", + [field_keyword] = "keyword", + [field_name] = "name", + [field_os] = "os", + [field_path] = "path", + [field_pattern] = "pattern", + [field_value] = "value", +}; + +static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { + [1] = {.index = 0, .length = 1}, + [2] = {.index = 1, .length = 1}, + [3] = {.index = 2, .length = 2}, + [4] = {.index = 4, .length = 1}, + [5] = {.index = 5, .length = 1}, + [6] = {.index = 6, .length = 2}, + [7] = {.index = 8, .length = 1}, + [8] = {.index = 9, .length = 2}, + [9] = {.index = 11, .length = 2}, + [10] = {.index = 13, .length = 1}, + [11] = {.index = 14, .length = 1}, + [12] = {.index = 15, .length = 2}, + [13] = {.index = 17, .length = 1}, + [14] = {.index = 18, .length = 2}, +}; + +static const TSFieldMapEntry ts_field_map_entries[] = { + [0] = + {field_path, 1}, + [1] = + {field_command, 1}, + [2] = + {field_command, 1}, + {field_keyword, 0}, + [4] = + {field_body, 1}, + [5] = + {field_value, 1}, + [6] = + {field_body, 2}, + {field_name, 1}, + [8] = + {field_value, 2}, + [9] = + {field_name, 0}, + {field_value, 2}, + [11] = + {field_body, 1}, + {field_os, 0}, + [13] = + {field_name, 0}, + [14] = + {field_name, 2}, + [15] = + {field_key, 2}, + {field_value, 5}, + [17] = + {field_pattern, 1}, + [18] = + {field_epsilon, 1}, + {field_value, 3}, +}; + +static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { + [0] = {0}, +}; + +static const uint16_t ts_non_terminal_alias_map[] = { + 0, +}; + +static const TSStateId ts_primary_state_ids[STATE_COUNT] = { + [0] = 0, + [1] = 1, + [2] = 2, + [3] = 3, + [4] = 4, + [5] = 5, + [6] = 6, + [7] = 7, + [8] = 8, + [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] = 38, + [39] = 39, + [40] = 40, + [41] = 41, + [42] = 42, + [43] = 43, + [44] = 44, + [45] = 45, + [46] = 46, + [47] = 47, + [48] = 48, + [49] = 49, + [50] = 50, + [51] = 51, + [52] = 52, + [53] = 53, + [54] = 54, + [55] = 55, + [56] = 56, + [57] = 57, + [58] = 58, + [59] = 59, + [60] = 60, + [61] = 61, + [62] = 62, + [63] = 63, + [64] = 64, + [65] = 65, + [66] = 66, + [67] = 67, + [68] = 68, + [69] = 69, + [70] = 70, + [71] = 71, + [72] = 72, + [73] = 73, + [74] = 74, + [75] = 75, + [76] = 76, + [77] = 77, + [78] = 78, + [79] = 79, + [80] = 80, + [81] = 81, + [82] = 82, + [83] = 83, + [84] = 84, + [85] = 85, + [86] = 86, + [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] = 107, + [108] = 108, + [109] = 109, + [110] = 110, + [111] = 111, + [112] = 112, + [113] = 113, + [114] = 114, + [115] = 115, + [116] = 116, + [117] = 117, + [118] = 118, + [119] = 119, + [120] = 120, + [121] = 121, + [122] = 122, + [123] = 123, + [124] = 124, + [125] = 125, + [126] = 126, + [127] = 127, + [128] = 128, + [129] = 129, + [130] = 130, + [131] = 131, + [132] = 132, + [133] = 133, + [134] = 134, + [135] = 135, + [136] = 136, + [137] = 137, + [138] = 138, + [139] = 139, + [140] = 140, + [141] = 141, + [142] = 142, + [143] = 143, + [144] = 144, + [145] = 145, + [146] = 146, + [147] = 147, + [148] = 148, + [149] = 149, + [150] = 150, + [151] = 151, + [152] = 152, + [153] = 153, + [154] = 154, + [155] = 155, + [156] = 156, + [157] = 157, + [158] = 158, + [159] = 159, + [160] = 160, + [161] = 161, + [162] = 162, + [163] = 163, + [164] = 164, + [165] = 165, + [166] = 166, + [167] = 167, + [168] = 168, + [169] = 169, + [170] = 170, + [171] = 171, + [172] = 172, + [173] = 173, + [174] = 174, + [175] = 175, + [176] = 176, + [177] = 177, + [178] = 178, + [179] = 179, + [180] = 180, + [181] = 181, + [182] = 182, + [183] = 183, + [184] = 184, + [185] = 185, + [186] = 186, + [187] = 187, + [188] = 188, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(14); + ADVANCE_MAP( + '"', 1, + '(', 19, + ')', 20, + '-', 11, + '/', 8, + '=', 18, + '{', 16, + '}', 17, + '~', 21, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(0); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(26); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(25); + END_STATE(); + case 1: + if (lookahead == '"') ADVANCE(23); + if (lookahead == '\\') ADVANCE(13); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(2); + END_STATE(); + case 2: + if (lookahead == '"') ADVANCE(22); + if (lookahead == '\\') ADVANCE(13); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(2); + END_STATE(); + case 3: + if (lookahead == '"') ADVANCE(24); + if (lookahead != 0) ADVANCE(6); + END_STATE(); + case 4: + if (lookahead == '"') ADVANCE(2); + if (lookahead == '-') ADVANCE(11); + if (lookahead == '/') ADVANCE(8); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(4); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); + END_STATE(); + case 5: + if (lookahead == '"') ADVANCE(3); + if (lookahead != 0) ADVANCE(6); + END_STATE(); + case 6: + if (lookahead == '"') ADVANCE(5); + if (lookahead != 0) ADVANCE(6); + END_STATE(); + case 7: + if (lookahead == '/') ADVANCE(8); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(7); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(10); + END_STATE(); + case 8: + if (lookahead == '/') ADVANCE(15); + END_STATE(); + case 9: + if (lookahead == 'B') ADVANCE(31); + END_STATE(); + case 10: + if (lookahead == 'B') ADVANCE(31); + if (lookahead == 'G') ADVANCE(32); + if (lookahead == 'K') ADVANCE(32); + if (lookahead == 'M') ADVANCE(32); + if (lookahead == 'm') ADVANCE(30); + if (lookahead == 's') ADVANCE(29); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(10); + END_STATE(); + case 11: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); + END_STATE(); + case 12: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); + END_STATE(); + case 13: + if (lookahead != 0 && + lookahead != '\n') ADVANCE(2); + END_STATE(); + case 14: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 15: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(15); + END_STATE(); + case 16: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 17: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 18: + ACCEPT_TOKEN(anon_sym_EQ); + END_STATE(); + case 19: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 20: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 21: + ACCEPT_TOKEN(anon_sym_TILDE); + END_STATE(); + case 22: + ACCEPT_TOKEN(sym_simple_string); + END_STATE(); + case 23: + ACCEPT_TOKEN(sym_simple_string); + if (lookahead == '"') ADVANCE(6); + END_STATE(); + case 24: + ACCEPT_TOKEN(sym_heredoc_string); + END_STATE(); + case 25: + ACCEPT_TOKEN(sym_identifier); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(25); + END_STATE(); + case 26: + ACCEPT_TOKEN(sym_integer); + if (lookahead == '.') ADVANCE(12); + if (lookahead == 'B') ADVANCE(31); + if (lookahead == 'G') ADVANCE(32); + if (lookahead == 'K') ADVANCE(32); + if (lookahead == 'M') ADVANCE(32); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(26); + END_STATE(); + case 27: + ACCEPT_TOKEN(sym_integer); + if (lookahead == '.') ADVANCE(12); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); + END_STATE(); + case 28: + ACCEPT_TOKEN(sym_float); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); + END_STATE(); + case 29: + ACCEPT_TOKEN(sym_duration); + END_STATE(); + case 30: + ACCEPT_TOKEN(sym_duration); + if (lookahead == 's') ADVANCE(29); + END_STATE(); + case 31: + ACCEPT_TOKEN(sym_size); + END_STATE(); + case 32: + ACCEPT_TOKEN(sym_size); + if (lookahead == 'B') ADVANCE(31); + if (lookahead == 'i') ADVANCE(9); + END_STATE(); + default: + return false; + } +} + +static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + ADVANCE_MAP( + 'a', 1, + 'b', 2, + 'c', 3, + 'd', 4, + 'e', 5, + 'f', 6, + 'g', 7, + 'i', 8, + 'l', 9, + 'm', 10, + 'n', 11, + 'o', 12, + 'p', 13, + 'r', 14, + 's', 15, + 't', 16, + 'w', 17, + ); + if (('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(0); + END_STATE(); + case 1: + if (lookahead == 'l') ADVANCE(18); + if (lookahead == 'n') ADVANCE(19); + if (lookahead == 'r') ADVANCE(20); + END_STATE(); + case 2: + if (lookahead == 'i') ADVANCE(21); + if (lookahead == 'u') ADVANCE(22); + END_STATE(); + case 3: + if (lookahead == 'l') ADVANCE(23); + if (lookahead == 'o') ADVANCE(24); + END_STATE(); + case 4: + if (lookahead == 'a') ADVANCE(25); + if (lookahead == 'e') ADVANCE(26); + if (lookahead == 'i') ADVANCE(27); + END_STATE(); + case 5: + if (lookahead == 'n') ADVANCE(28); + if (lookahead == 'x') ADVANCE(29); + END_STATE(); + case 6: + if (lookahead == 'a') ADVANCE(30); + if (lookahead == 'i') ADVANCE(31); + END_STATE(); + case 7: + if (lookahead == 'n') ADVANCE(32); + if (lookahead == 'r') ADVANCE(33); + END_STATE(); + case 8: + if (lookahead == 'n') ADVANCE(34); + END_STATE(); + case 9: + if (lookahead == 'a') ADVANCE(35); + if (lookahead == 'i') ADVANCE(36); + END_STATE(); + case 10: + if (lookahead == 'a') ADVANCE(37); + if (lookahead == 'e') ADVANCE(38); + if (lookahead == 's') ADVANCE(39); + END_STATE(); + case 11: + if (lookahead == 'o') ADVANCE(40); + END_STATE(); + case 12: + if (lookahead == 'f') ADVANCE(41); + if (lookahead == 'u') ADVANCE(42); + END_STATE(); + case 13: + if (lookahead == 'a') ADVANCE(43); + if (lookahead == 'e') ADVANCE(44); + if (lookahead == 'l') ADVANCE(45); + if (lookahead == 'r') ADVANCE(46); + END_STATE(); + case 14: + if (lookahead == 'e') ADVANCE(47); + END_STATE(); + case 15: + if (lookahead == 'a') ADVANCE(48); + if (lookahead == 'c') ADVANCE(49); + if (lookahead == 'o') ADVANCE(50); + if (lookahead == 't') ADVANCE(51); + END_STATE(); + case 16: + if (lookahead == 'e') ADVANCE(52); + if (lookahead == 'i') ADVANCE(53); + if (lookahead == 'o') ADVANCE(54); + if (lookahead == 'r') ADVANCE(55); + END_STATE(); + case 17: + if (lookahead == 'a') ADVANCE(56); + if (lookahead == 'e') ADVANCE(57); + if (lookahead == 'i') ADVANCE(58); + if (lookahead == 'r') ADVANCE(59); + END_STATE(); + case 18: + if (lookahead == 'l') ADVANCE(60); + END_STATE(); + case 19: + if (lookahead == 'y') ADVANCE(61); + END_STATE(); + case 20: + if (lookahead == 'g') ADVANCE(62); + END_STATE(); + case 21: + if (lookahead == 'n') ADVANCE(63); + END_STATE(); + case 22: + if (lookahead == 'i') ADVANCE(64); + END_STATE(); + case 23: + if (lookahead == 'a') ADVANCE(65); + END_STATE(); + case 24: + if (lookahead == 'm') ADVANCE(66); + if (lookahead == 'n') ADVANCE(67); + END_STATE(); + case 25: + if (lookahead == 'r') ADVANCE(68); + END_STATE(); + case 26: + if (lookahead == 'b') ADVANCE(69); + if (lookahead == 'f') ADVANCE(70); + END_STATE(); + case 27: + if (lookahead == 'r') ADVANCE(71); + END_STATE(); + case 28: + if (lookahead == 'v') ADVANCE(72); + END_STATE(); + case 29: + if (lookahead == 'i') ADVANCE(73); + if (lookahead == 't') ADVANCE(74); + END_STATE(); + case 30: + if (lookahead == 'l') ADVANCE(75); + END_STATE(); + case 31: + if (lookahead == 'l') ADVANCE(76); + END_STATE(); + case 32: + if (lookahead == 'u') ADVANCE(77); + END_STATE(); + case 33: + if (lookahead == 'o') ADVANCE(78); + END_STATE(); + case 34: + if (lookahead == 'c') ADVANCE(79); + if (lookahead == 'p') ADVANCE(80); + END_STATE(); + case 35: + if (lookahead == 'n') ADVANCE(81); + END_STATE(); + case 36: + if (lookahead == 'n') ADVANCE(82); + END_STATE(); + case 37: + if (lookahead == 't') ADVANCE(83); + END_STATE(); + case 38: + if (lookahead == 'm') ADVANCE(84); + END_STATE(); + case 39: + if (lookahead == 'v') ADVANCE(85); + END_STATE(); + case 40: + if (lookahead == 'r') ADVANCE(86); + END_STATE(); + case 41: + ACCEPT_TOKEN(anon_sym_of); + END_STATE(); + case 42: + if (lookahead == 't') ADVANCE(87); + END_STATE(); + case 43: + if (lookahead == 'r') ADVANCE(88); + if (lookahead == 't') ADVANCE(89); + END_STATE(); + case 44: + if (lookahead == 'd') ADVANCE(90); + END_STATE(); + case 45: + if (lookahead == 'a') ADVANCE(91); + END_STATE(); + case 46: + if (lookahead == 'o') ADVANCE(92); + END_STATE(); + case 47: + if (lookahead == 'l') ADVANCE(93); + END_STATE(); + case 48: + if (lookahead == 'n') ADVANCE(94); + END_STATE(); + case 49: + if (lookahead == 'o') ADVANCE(95); + END_STATE(); + case 50: + if (lookahead == 'u') ADVANCE(96); + END_STATE(); + case 51: + if (lookahead == 'a') ADVANCE(97); + if (lookahead == 'd') ADVANCE(98); + if (lookahead == 'r') ADVANCE(99); + END_STATE(); + case 52: + if (lookahead == 's') ADVANCE(100); + END_STATE(); + case 53: + if (lookahead == 'm') ADVANCE(101); + END_STATE(); + case 54: + if (lookahead == 'o') ADVANCE(102); + END_STATE(); + case 55: + if (lookahead == 'i') ADVANCE(103); + if (lookahead == 'u') ADVANCE(104); + END_STATE(); + case 56: + if (lookahead == 'r') ADVANCE(105); + END_STATE(); + case 57: + if (lookahead == 'i') ADVANCE(106); + END_STATE(); + case 58: + if (lookahead == 'n') ADVANCE(107); + END_STATE(); + case 59: + if (lookahead == 'a') ADVANCE(108); + END_STATE(); + case 60: + if (lookahead == '_') ADVANCE(109); + END_STATE(); + case 61: + if (lookahead == 'O') ADVANCE(110); + END_STATE(); + case 62: + if (lookahead == 's') ADVANCE(111); + END_STATE(); + case 63: + if (lookahead == 'a') ADVANCE(112); + END_STATE(); + case 64: + if (lookahead == 'l') ADVANCE(113); + END_STATE(); + case 65: + if (lookahead == 's') ADVANCE(114); + END_STATE(); + case 66: + if (lookahead == 'p') ADVANCE(115); + END_STATE(); + case 67: + if (lookahead == 't') ADVANCE(116); + END_STATE(); + case 68: + if (lookahead == 'w') ADVANCE(117); + END_STATE(); + case 69: + if (lookahead == 'u') ADVANCE(118); + END_STATE(); + case 70: + if (lookahead == 'a') ADVANCE(119); + if (lookahead == 'i') ADVANCE(120); + END_STATE(); + case 71: + if (lookahead == 's') ADVANCE(121); + END_STATE(); + case 72: + ACCEPT_TOKEN(anon_sym_env); + END_STATE(); + case 73: + if (lookahead == 't') ADVANCE(122); + END_STATE(); + case 74: + if (lookahead == 'r') ADVANCE(123); + END_STATE(); + case 75: + if (lookahead == 's') ADVANCE(124); + END_STATE(); + case 76: + if (lookahead == 'e') ADVANCE(125); + END_STATE(); + case 77: + ACCEPT_TOKEN(anon_sym_gnu); + END_STATE(); + case 78: + if (lookahead == 'u') ADVANCE(126); + END_STATE(); + case 79: + if (lookahead == 'l') ADVANCE(127); + END_STATE(); + case 80: + if (lookahead == 'u') ADVANCE(128); + END_STATE(); + case 81: + if (lookahead == 'g') ADVANCE(129); + END_STATE(); + case 82: + if (lookahead == 'k') ADVANCE(130); + if (lookahead == 'u') ADVANCE(131); + END_STATE(); + case 83: + if (lookahead == 'c') ADVANCE(132); + END_STATE(); + case 84: + if (lookahead == 'o') ADVANCE(133); + END_STATE(); + case 85: + if (lookahead == 'c') ADVANCE(134); + END_STATE(); + case 86: + if (lookahead == 'm') ADVANCE(135); + END_STATE(); + case 87: + if (lookahead == 'F') ADVANCE(136); + if (lookahead == 'p') ADVANCE(137); + END_STATE(); + case 88: + if (lookahead == 't') ADVANCE(138); + END_STATE(); + case 89: + if (lookahead == 't') ADVANCE(139); + END_STATE(); + case 90: + if (lookahead == 'a') ADVANCE(140); + END_STATE(); + case 91: + if (lookahead == 't') ADVANCE(141); + END_STATE(); + case 92: + if (lookahead == 'f') ADVANCE(142); + END_STATE(); + case 93: + if (lookahead == 'e') ADVANCE(143); + END_STATE(); + case 94: + if (lookahead == 'i') ADVANCE(144); + END_STATE(); + case 95: + if (lookahead == 'r') ADVANCE(145); + END_STATE(); + case 96: + if (lookahead == 'r') ADVANCE(146); + END_STATE(); + case 97: + if (lookahead == 'n') ADVANCE(147); + END_STATE(); + case 98: + if (lookahead == 'e') ADVANCE(148); + if (lookahead == 'i') ADVANCE(149); + if (lookahead == 'o') ADVANCE(150); + END_STATE(); + case 99: + if (lookahead == 'i') ADVANCE(151); + END_STATE(); + case 100: + if (lookahead == 't') ADVANCE(152); + END_STATE(); + case 101: + if (lookahead == 'e') ADVANCE(153); + END_STATE(); + case 102: + if (lookahead == 'l') ADVANCE(154); + END_STATE(); + case 103: + if (lookahead == 'm') ADVANCE(155); + END_STATE(); + case 104: + if (lookahead == 'e') ADVANCE(156); + END_STATE(); + case 105: + if (lookahead == 'n') ADVANCE(157); + END_STATE(); + case 106: + if (lookahead == 'g') ADVANCE(158); + END_STATE(); + case 107: + if (lookahead == 'd') ADVANCE(159); + END_STATE(); + case 108: + if (lookahead == 'p') ADVANCE(160); + END_STATE(); + case 109: + if (lookahead == 'o') ADVANCE(161); + END_STATE(); + case 110: + if (lookahead == 'r') ADVANCE(162); + END_STATE(); + case 111: + ACCEPT_TOKEN(anon_sym_args); + END_STATE(); + case 112: + if (lookahead == 'r') ADVANCE(163); + END_STATE(); + case 113: + if (lookahead == 'd') ADVANCE(164); + END_STATE(); + case 114: + if (lookahead == 's') ADVANCE(165); + END_STATE(); + case 115: + if (lookahead == 'i') ADVANCE(166); + END_STATE(); + case 116: + if (lookahead == 'a') ADVANCE(167); + END_STATE(); + case 117: + if (lookahead == 'i') ADVANCE(168); + END_STATE(); + case 118: + if (lookahead == 'g') ADVANCE(169); + END_STATE(); + case 119: + if (lookahead == 'u') ADVANCE(170); + END_STATE(); + case 120: + if (lookahead == 'n') ADVANCE(171); + END_STATE(); + case 121: + ACCEPT_TOKEN(anon_sym_dirs); + END_STATE(); + case 122: + if (lookahead == 'C') ADVANCE(172); + END_STATE(); + case 123: + if (lookahead == 'a') ADVANCE(173); + END_STATE(); + case 124: + if (lookahead == 'e') ADVANCE(174); + END_STATE(); + case 125: + ACCEPT_TOKEN(anon_sym_file); + END_STATE(); + case 126: + if (lookahead == 'p') ADVANCE(175); + END_STATE(); + case 127: + if (lookahead == 'u') ADVANCE(176); + END_STATE(); + case 128: + if (lookahead == 't') ADVANCE(177); + END_STATE(); + case 129: + if (lookahead == 'u') ADVANCE(178); + END_STATE(); + case 130: + ACCEPT_TOKEN(anon_sym_link); + END_STATE(); + case 131: + if (lookahead == 'x') ADVANCE(179); + END_STATE(); + case 132: + if (lookahead == 'h') ADVANCE(180); + END_STATE(); + case 133: + if (lookahead == 'r') ADVANCE(181); + END_STATE(); + case 134: + ACCEPT_TOKEN(anon_sym_msvc); + END_STATE(); + case 135: + if (lookahead == 'a') ADVANCE(182); + END_STATE(); + case 136: + if (lookahead == 'i') ADVANCE(183); + END_STATE(); + case 137: + if (lookahead == 'u') ADVANCE(184); + END_STATE(); + case 138: + if (lookahead == 'i') ADVANCE(185); + END_STATE(); + case 139: + if (lookahead == 'e') ADVANCE(186); + END_STATE(); + case 140: + if (lookahead == 'n') ADVANCE(187); + END_STATE(); + case 141: + if (lookahead == 'f') ADVANCE(188); + END_STATE(); + case 142: + if (lookahead == 'i') ADVANCE(189); + END_STATE(); + case 143: + if (lookahead == 'a') ADVANCE(190); + END_STATE(); + case 144: + if (lookahead == 't') ADVANCE(191); + END_STATE(); + case 145: + if (lookahead == 'i') ADVANCE(192); + END_STATE(); + case 146: + if (lookahead == 'c') ADVANCE(193); + END_STATE(); + case 147: + if (lookahead == 'd') ADVANCE(194); + END_STATE(); + case 148: + if (lookahead == 'r') ADVANCE(195); + END_STATE(); + case 149: + if (lookahead == 'n') ADVANCE(196); + END_STATE(); + case 150: + if (lookahead == 'u') ADVANCE(197); + END_STATE(); + case 151: + if (lookahead == 'c') ADVANCE(198); + END_STATE(); + case 152: + ACCEPT_TOKEN(anon_sym_test); + END_STATE(); + case 153: + if (lookahead == 'o') ADVANCE(199); + END_STATE(); + case 154: + if (lookahead == 'c') ADVANCE(200); + END_STATE(); + case 155: + if (lookahead == '_') ADVANCE(201); + END_STATE(); + case 156: + ACCEPT_TOKEN(anon_sym_true); + END_STATE(); + case 157: + if (lookahead == 'i') ADVANCE(202); + END_STATE(); + case 158: + if (lookahead == 'h') ADVANCE(203); + END_STATE(); + case 159: + if (lookahead == 'o') ADVANCE(204); + END_STATE(); + case 160: + if (lookahead == 'p') ADVANCE(205); + END_STATE(); + case 161: + if (lookahead == 'r') ADVANCE(206); + END_STATE(); + case 162: + if (lookahead == 'd') ADVANCE(207); + END_STATE(); + case 163: + if (lookahead == 'y') ADVANCE(208); + END_STATE(); + case 164: + ACCEPT_TOKEN(anon_sym_build); + if (lookahead == '_') ADVANCE(209); + END_STATE(); + case 165: + ACCEPT_TOKEN(anon_sym_class); + END_STATE(); + case 166: + if (lookahead == 'l') ADVANCE(210); + END_STATE(); + case 167: + if (lookahead == 'i') ADVANCE(211); + END_STATE(); + case 168: + if (lookahead == 'n') ADVANCE(212); + END_STATE(); + case 169: + ACCEPT_TOKEN(anon_sym_debug); + END_STATE(); + case 170: + if (lookahead == 'l') ADVANCE(213); + END_STATE(); + case 171: + if (lookahead == 'e') ADVANCE(214); + END_STATE(); + case 172: + if (lookahead == 'o') ADVANCE(215); + END_STATE(); + case 173: + ACCEPT_TOKEN(anon_sym_extra); + END_STATE(); + case 174: + ACCEPT_TOKEN(anon_sym_false); + END_STATE(); + case 175: + ACCEPT_TOKEN(anon_sym_group); + END_STATE(); + case 176: + if (lookahead == 'd') ADVANCE(216); + END_STATE(); + case 177: + ACCEPT_TOKEN(anon_sym_input); + END_STATE(); + case 178: + if (lookahead == 'a') ADVANCE(217); + END_STATE(); + case 179: + ACCEPT_TOKEN(anon_sym_linux); + END_STATE(); + case 180: + if (lookahead == 'e') ADVANCE(218); + END_STATE(); + case 181: + if (lookahead == 'y') ADVANCE(219); + END_STATE(); + case 182: + if (lookahead == 'l') ADVANCE(220); + END_STATE(); + case 183: + if (lookahead == 'l') ADVANCE(221); + END_STATE(); + case 184: + if (lookahead == 't') ADVANCE(222); + END_STATE(); + case 185: + if (lookahead == 'a') ADVANCE(223); + END_STATE(); + case 186: + if (lookahead == 'r') ADVANCE(224); + END_STATE(); + case 187: + if (lookahead == 't') ADVANCE(225); + END_STATE(); + case 188: + if (lookahead == 'o') ADVANCE(226); + END_STATE(); + case 189: + if (lookahead == 'l') ADVANCE(227); + END_STATE(); + case 190: + if (lookahead == 's') ADVANCE(228); + END_STATE(); + case 191: + if (lookahead == 'i') ADVANCE(229); + END_STATE(); + case 192: + if (lookahead == 'n') ADVANCE(230); + END_STATE(); + case 193: + if (lookahead == 'e') ADVANCE(231); + END_STATE(); + case 194: + if (lookahead == 'a') ADVANCE(232); + END_STATE(); + case 195: + if (lookahead == 'r') ADVANCE(233); + END_STATE(); + case 196: + ACCEPT_TOKEN(anon_sym_stdin); + END_STATE(); + case 197: + if (lookahead == 't') ADVANCE(234); + END_STATE(); + case 198: + if (lookahead == 't') ADVANCE(235); + END_STATE(); + case 199: + if (lookahead == 'u') ADVANCE(236); + END_STATE(); + case 200: + if (lookahead == 'h') ADVANCE(237); + END_STATE(); + case 201: + if (lookahead == 't') ADVANCE(238); + END_STATE(); + case 202: + if (lookahead == 'n') ADVANCE(239); + END_STATE(); + case 203: + if (lookahead == 't') ADVANCE(240); + END_STATE(); + case 204: + if (lookahead == 'w') ADVANCE(241); + END_STATE(); + case 205: + if (lookahead == 'e') ADVANCE(242); + END_STATE(); + case 206: + if (lookahead == '_') ADVANCE(243); + END_STATE(); + case 207: + if (lookahead == 'e') ADVANCE(244); + END_STATE(); + case 208: + ACCEPT_TOKEN(anon_sym_binary); + END_STATE(); + case 209: + if (lookahead == 'd') ADVANCE(245); + if (lookahead == 'l') ADVANCE(246); + if (lookahead == 'w') ADVANCE(247); + END_STATE(); + case 210: + if (lookahead == 'e') ADVANCE(248); + END_STATE(); + case 211: + if (lookahead == 'n') ADVANCE(249); + END_STATE(); + case 212: + ACCEPT_TOKEN(anon_sym_darwin); + END_STATE(); + case 213: + if (lookahead == 't') ADVANCE(250); + END_STATE(); + case 214: + ACCEPT_TOKEN(anon_sym_define); + END_STATE(); + case 215: + if (lookahead == 'd') ADVANCE(251); + END_STATE(); + case 216: + if (lookahead == 'e') ADVANCE(252); + END_STATE(); + case 217: + if (lookahead == 'g') ADVANCE(253); + END_STATE(); + case 218: + if (lookahead == 's') ADVANCE(254); + END_STATE(); + case 219: + if (lookahead == '_') ADVANCE(255); + END_STATE(); + case 220: + if (lookahead == 'i') ADVANCE(256); + END_STATE(); + case 221: + if (lookahead == 'e') ADVANCE(257); + END_STATE(); + case 222: + ACCEPT_TOKEN(anon_sym_output); + END_STATE(); + case 223: + if (lookahead == 'l') ADVANCE(258); + END_STATE(); + case 224: + if (lookahead == 'n') ADVANCE(259); + END_STATE(); + case 225: + if (lookahead == 'i') ADVANCE(260); + END_STATE(); + case 226: + if (lookahead == 'r') ADVANCE(261); + END_STATE(); + case 227: + if (lookahead == 'e') ADVANCE(262); + END_STATE(); + case 228: + if (lookahead == 'e') ADVANCE(263); + END_STATE(); + case 229: + if (lookahead == 'z') ADVANCE(264); + END_STATE(); + case 230: + if (lookahead == 'g') ADVANCE(265); + END_STATE(); + case 231: + if (lookahead == 's') ADVANCE(266); + END_STATE(); + case 232: + if (lookahead == 'r') ADVANCE(267); + END_STATE(); + case 233: + ACCEPT_TOKEN(anon_sym_stderr); + END_STATE(); + case 234: + ACCEPT_TOKEN(anon_sym_stdout); + END_STATE(); + case 235: + ACCEPT_TOKEN(anon_sym_strict); + END_STATE(); + case 236: + if (lookahead == 't') ADVANCE(268); + END_STATE(); + case 237: + if (lookahead == 'a') ADVANCE(269); + END_STATE(); + case 238: + if (lookahead == 'r') ADVANCE(270); + END_STATE(); + case 239: + if (lookahead == 'g') ADVANCE(271); + END_STATE(); + case 240: + ACCEPT_TOKEN(anon_sym_weight); + END_STATE(); + case 241: + if (lookahead == 's') ADVANCE(272); + END_STATE(); + case 242: + if (lookahead == 'r') ADVANCE(273); + END_STATE(); + case 243: + if (lookahead == 'n') ADVANCE(274); + END_STATE(); + case 244: + if (lookahead == 'r') ADVANCE(275); + END_STATE(); + case 245: + if (lookahead == 'a') ADVANCE(276); + if (lookahead == 'e') ADVANCE(277); + END_STATE(); + case 246: + if (lookahead == 'i') ADVANCE(278); + END_STATE(); + case 247: + if (lookahead == 'i') ADVANCE(279); + END_STATE(); + case 248: + if (lookahead == 'r') ADVANCE(280); + END_STATE(); + case 249: + if (lookahead == 's') ADVANCE(281); + END_STATE(); + case 250: + ACCEPT_TOKEN(anon_sym_default); + END_STATE(); + case 251: + if (lookahead == 'e') ADVANCE(282); + END_STATE(); + case 252: + ACCEPT_TOKEN(anon_sym_include); + if (lookahead == 's') ADVANCE(283); + END_STATE(); + case 253: + if (lookahead == 'e') ADVANCE(284); + END_STATE(); + case 254: + ACCEPT_TOKEN(anon_sym_matches); + END_STATE(); + case 255: + if (lookahead == 'l') ADVANCE(285); + END_STATE(); + case 256: + if (lookahead == 'z') ADVANCE(286); + END_STATE(); + case 257: + ACCEPT_TOKEN(anon_sym_outFile); + END_STATE(); + case 258: + ACCEPT_TOKEN(anon_sym_partial); + END_STATE(); + case 259: + ACCEPT_TOKEN(anon_sym_pattern); + END_STATE(); + case 260: + if (lookahead == 'c') ADVANCE(287); + END_STATE(); + case 261: + if (lookahead == 'm') ADVANCE(288); + END_STATE(); + case 262: + ACCEPT_TOKEN(anon_sym_profile); + END_STATE(); + case 263: + ACCEPT_TOKEN(anon_sym_release); + END_STATE(); + case 264: + if (lookahead == 'e') ADVANCE(289); + END_STATE(); + case 265: + ACCEPT_TOKEN(anon_sym_scoring); + END_STATE(); + case 266: + ACCEPT_TOKEN(anon_sym_sources); + END_STATE(); + case 267: + if (lookahead == 'd') ADVANCE(290); + END_STATE(); + case 268: + ACCEPT_TOKEN(anon_sym_timeout); + END_STATE(); + case 269: + if (lookahead == 'i') ADVANCE(291); + END_STATE(); + case 270: + if (lookahead == 'a') ADVANCE(292); + END_STATE(); + case 271: + if (lookahead == 's') ADVANCE(293); + END_STATE(); + case 272: + ACCEPT_TOKEN(anon_sym_windows); + END_STATE(); + case 273: + ACCEPT_TOKEN(anon_sym_wrapper); + END_STATE(); + case 274: + if (lookahead == 'o') ADVANCE(294); + END_STATE(); + case 275: + ACCEPT_TOKEN(anon_sym_anyOrder); + END_STATE(); + case 276: + if (lookahead == 'r') ADVANCE(295); + END_STATE(); + case 277: + if (lookahead == 'f') ADVANCE(296); + END_STATE(); + case 278: + if (lookahead == 'n') ADVANCE(297); + END_STATE(); + case 279: + if (lookahead == 'n') ADVANCE(298); + END_STATE(); + case 280: + if (lookahead == 's') ADVANCE(299); + END_STATE(); + case 281: + ACCEPT_TOKEN(anon_sym_contains); + END_STATE(); + case 282: + ACCEPT_TOKEN(anon_sym_exitCode); + END_STATE(); + case 283: + ACCEPT_TOKEN(anon_sym_includes); + END_STATE(); + case 284: + ACCEPT_TOKEN(anon_sym_language); + END_STATE(); + case 285: + if (lookahead == 'i') ADVANCE(300); + END_STATE(); + case 286: + if (lookahead == 'e') ADVANCE(301); + END_STATE(); + case 287: + ACCEPT_TOKEN(anon_sym_pedantic); + END_STATE(); + case 288: + if (lookahead == 's') ADVANCE(302); + END_STATE(); + case 289: + ACCEPT_TOKEN(anon_sym_sanitize); + if (lookahead == 'd') ADVANCE(303); + END_STATE(); + case 290: + ACCEPT_TOKEN(anon_sym_standard); + END_STATE(); + case 291: + if (lookahead == 'n') ADVANCE(304); + END_STATE(); + case 292: + if (lookahead == 'i') ADVANCE(305); + END_STATE(); + case 293: + ACCEPT_TOKEN(anon_sym_warnings); + END_STATE(); + case 294: + if (lookahead == 'n') ADVANCE(306); + END_STATE(); + case 295: + if (lookahead == 'w') ADVANCE(307); + END_STATE(); + case 296: + if (lookahead == 'a') ADVANCE(308); + END_STATE(); + case 297: + if (lookahead == 'u') ADVANCE(309); + END_STATE(); + case 298: + if (lookahead == 'd') ADVANCE(310); + END_STATE(); + case 299: + ACCEPT_TOKEN(anon_sym_compilers); + END_STATE(); + case 300: + if (lookahead == 'm') ADVANCE(311); + END_STATE(); + case 301: + if (lookahead == '_') ADVANCE(312); + END_STATE(); + case 302: + ACCEPT_TOKEN(anon_sym_platforms); + END_STATE(); + case 303: + ACCEPT_TOKEN(anon_sym_sanitized); + END_STATE(); + case 304: + if (lookahead == 's') ADVANCE(313); + END_STATE(); + case 305: + if (lookahead == 'l') ADVANCE(314); + END_STATE(); + case 306: + if (lookahead == 'e') ADVANCE(315); + END_STATE(); + case 307: + if (lookahead == 'i') ADVANCE(316); + END_STATE(); + case 308: + if (lookahead == 'u') ADVANCE(317); + END_STATE(); + case 309: + if (lookahead == 'x') ADVANCE(318); + END_STATE(); + case 310: + if (lookahead == 'o') ADVANCE(319); + END_STATE(); + case 311: + if (lookahead == 'i') ADVANCE(320); + END_STATE(); + case 312: + if (lookahead == 'c') ADVANCE(321); + END_STATE(); + case 313: + ACCEPT_TOKEN(anon_sym_toolchains); + END_STATE(); + case 314: + if (lookahead == 'i') ADVANCE(322); + END_STATE(); + case 315: + ACCEPT_TOKEN(anon_sym_all_or_none); + END_STATE(); + case 316: + if (lookahead == 'n') ADVANCE(323); + END_STATE(); + case 317: + if (lookahead == 'l') ADVANCE(324); + END_STATE(); + case 318: + ACCEPT_TOKEN(anon_sym_build_linux); + END_STATE(); + case 319: + if (lookahead == 'w') ADVANCE(325); + END_STATE(); + case 320: + if (lookahead == 't') ADVANCE(326); + END_STATE(); + case 321: + if (lookahead == 'r') ADVANCE(327); + END_STATE(); + case 322: + if (lookahead == 'n') ADVANCE(328); + END_STATE(); + case 323: + ACCEPT_TOKEN(anon_sym_build_darwin); + END_STATE(); + case 324: + if (lookahead == 't') ADVANCE(329); + END_STATE(); + case 325: + if (lookahead == 's') ADVANCE(330); + END_STATE(); + case 326: + ACCEPT_TOKEN(anon_sym_memory_limit); + END_STATE(); + case 327: + if (lookahead == 'l') ADVANCE(331); + END_STATE(); + case 328: + if (lookahead == 'g') ADVANCE(332); + END_STATE(); + case 329: + if (lookahead == 's') ADVANCE(333); + END_STATE(); + case 330: + ACCEPT_TOKEN(anon_sym_build_windows); + END_STATE(); + case 331: + if (lookahead == 'f') ADVANCE(334); + END_STATE(); + case 332: + if (lookahead == '_') ADVANCE(335); + END_STATE(); + case 333: + ACCEPT_TOKEN(anon_sym_build_defaults); + END_STATE(); + case 334: + ACCEPT_TOKEN(anon_sym_normalize_crlf); + END_STATE(); + case 335: + if (lookahead == 'w') ADVANCE(336); + END_STATE(); + case 336: + if (lookahead == 's') ADVANCE(337); + END_STATE(); + case 337: + ACCEPT_TOKEN(anon_sym_trim_trailing_ws); + END_STATE(); + default: + return false; + } +} + +static const TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0}, + [1] = {.lex_state = 0}, + [2] = {.lex_state = 0}, + [3] = {.lex_state = 0}, + [4] = {.lex_state = 0}, + [5] = {.lex_state = 0}, + [6] = {.lex_state = 0}, + [7] = {.lex_state = 0}, + [8] = {.lex_state = 0}, + [9] = {.lex_state = 0}, + [10] = {.lex_state = 0}, + [11] = {.lex_state = 0}, + [12] = {.lex_state = 0}, + [13] = {.lex_state = 0}, + [14] = {.lex_state = 0}, + [15] = {.lex_state = 0}, + [16] = {.lex_state = 0}, + [17] = {.lex_state = 0}, + [18] = {.lex_state = 0}, + [19] = {.lex_state = 0}, + [20] = {.lex_state = 0}, + [21] = {.lex_state = 0}, + [22] = {.lex_state = 0}, + [23] = {.lex_state = 0}, + [24] = {.lex_state = 0}, + [25] = {.lex_state = 0}, + [26] = {.lex_state = 0}, + [27] = {.lex_state = 0}, + [28] = {.lex_state = 0}, + [29] = {.lex_state = 0}, + [30] = {.lex_state = 0}, + [31] = {.lex_state = 0}, + [32] = {.lex_state = 0}, + [33] = {.lex_state = 0}, + [34] = {.lex_state = 0}, + [35] = {.lex_state = 0}, + [36] = {.lex_state = 0}, + [37] = {.lex_state = 0}, + [38] = {.lex_state = 0}, + [39] = {.lex_state = 0}, + [40] = {.lex_state = 0}, + [41] = {.lex_state = 0}, + [42] = {.lex_state = 0}, + [43] = {.lex_state = 0}, + [44] = {.lex_state = 0}, + [45] = {.lex_state = 0}, + [46] = {.lex_state = 0}, + [47] = {.lex_state = 0}, + [48] = {.lex_state = 0}, + [49] = {.lex_state = 0}, + [50] = {.lex_state = 0}, + [51] = {.lex_state = 0}, + [52] = {.lex_state = 0}, + [53] = {.lex_state = 0}, + [54] = {.lex_state = 0}, + [55] = {.lex_state = 0}, + [56] = {.lex_state = 0}, + [57] = {.lex_state = 0}, + [58] = {.lex_state = 0}, + [59] = {.lex_state = 0}, + [60] = {.lex_state = 0}, + [61] = {.lex_state = 0}, + [62] = {.lex_state = 0}, + [63] = {.lex_state = 0}, + [64] = {.lex_state = 0}, + [65] = {.lex_state = 0}, + [66] = {.lex_state = 0}, + [67] = {.lex_state = 0}, + [68] = {.lex_state = 0}, + [69] = {.lex_state = 0}, + [70] = {.lex_state = 0}, + [71] = {.lex_state = 0}, + [72] = {.lex_state = 0}, + [73] = {.lex_state = 0}, + [74] = {.lex_state = 0}, + [75] = {.lex_state = 0}, + [76] = {.lex_state = 0}, + [77] = {.lex_state = 0}, + [78] = {.lex_state = 0}, + [79] = {.lex_state = 0}, + [80] = {.lex_state = 0}, + [81] = {.lex_state = 0}, + [82] = {.lex_state = 0}, + [83] = {.lex_state = 0}, + [84] = {.lex_state = 0}, + [85] = {.lex_state = 0}, + [86] = {.lex_state = 0}, + [87] = {.lex_state = 0}, + [88] = {.lex_state = 0}, + [89] = {.lex_state = 0}, + [90] = {.lex_state = 0}, + [91] = {.lex_state = 0}, + [92] = {.lex_state = 0}, + [93] = {.lex_state = 0}, + [94] = {.lex_state = 0}, + [95] = {.lex_state = 0}, + [96] = {.lex_state = 0}, + [97] = {.lex_state = 0}, + [98] = {.lex_state = 0}, + [99] = {.lex_state = 0}, + [100] = {.lex_state = 0}, + [101] = {.lex_state = 0}, + [102] = {.lex_state = 0}, + [103] = {.lex_state = 0}, + [104] = {.lex_state = 0}, + [105] = {.lex_state = 0}, + [106] = {.lex_state = 0}, + [107] = {.lex_state = 0}, + [108] = {.lex_state = 0}, + [109] = {.lex_state = 0}, + [110] = {.lex_state = 0}, + [111] = {.lex_state = 0}, + [112] = {.lex_state = 0}, + [113] = {.lex_state = 4}, + [114] = {.lex_state = 0}, + [115] = {.lex_state = 0}, + [116] = {.lex_state = 0}, + [117] = {.lex_state = 4}, + [118] = {.lex_state = 0}, + [119] = {.lex_state = 0}, + [120] = {.lex_state = 0}, + [121] = {.lex_state = 0}, + [122] = {.lex_state = 0}, + [123] = {.lex_state = 0}, + [124] = {.lex_state = 0}, + [125] = {.lex_state = 0}, + [126] = {.lex_state = 0}, + [127] = {.lex_state = 0}, + [128] = {.lex_state = 0}, + [129] = {.lex_state = 0}, + [130] = {.lex_state = 4}, + [131] = {.lex_state = 0}, + [132] = {.lex_state = 4}, + [133] = {.lex_state = 0}, + [134] = {.lex_state = 0}, + [135] = {.lex_state = 0}, + [136] = {.lex_state = 0}, + [137] = {.lex_state = 0}, + [138] = {.lex_state = 0}, + [139] = {.lex_state = 0}, + [140] = {.lex_state = 0}, + [141] = {.lex_state = 0}, + [142] = {.lex_state = 0}, + [143] = {.lex_state = 0}, + [144] = {.lex_state = 0}, + [145] = {.lex_state = 0}, + [146] = {.lex_state = 0}, + [147] = {.lex_state = 0}, + [148] = {.lex_state = 0}, + [149] = {.lex_state = 7}, + [150] = {.lex_state = 7}, + [151] = {.lex_state = 0}, + [152] = {.lex_state = 0}, + [153] = {.lex_state = 0}, + [154] = {.lex_state = 0}, + [155] = {.lex_state = 0}, + [156] = {.lex_state = 0}, + [157] = {.lex_state = 0}, + [158] = {.lex_state = 0}, + [159] = {.lex_state = 0}, + [160] = {.lex_state = 0}, + [161] = {.lex_state = 0}, + [162] = {.lex_state = 0}, + [163] = {.lex_state = 0}, + [164] = {.lex_state = 0}, + [165] = {.lex_state = 7}, + [166] = {.lex_state = 0}, + [167] = {.lex_state = 0}, + [168] = {.lex_state = 0}, + [169] = {.lex_state = 0}, + [170] = {.lex_state = 0}, + [171] = {.lex_state = 0}, + [172] = {.lex_state = 0}, + [173] = {.lex_state = 7}, + [174] = {.lex_state = 0}, + [175] = {.lex_state = 0}, + [176] = {.lex_state = 0}, + [177] = {.lex_state = 0}, + [178] = {.lex_state = 0}, + [179] = {.lex_state = 7}, + [180] = {.lex_state = 0}, + [181] = {.lex_state = 0}, + [182] = {.lex_state = 0}, + [183] = {.lex_state = 0}, + [184] = {.lex_state = 7}, + [185] = {.lex_state = 0}, + [186] = {.lex_state = 0}, + [187] = {.lex_state = 0}, + [188] = {.lex_state = 0}, +}; + +static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [sym_identifier] = ACTIONS(1), + [sym_comment] = ACTIONS(3), + [anon_sym_include] = ACTIONS(1), + [anon_sym_build] = ACTIONS(1), + [anon_sym_build_linux] = ACTIONS(1), + [anon_sym_build_windows] = ACTIONS(1), + [anon_sym_build_darwin] = ACTIONS(1), + [anon_sym_build_defaults] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_language] = ACTIONS(1), + [anon_sym_standard] = ACTIONS(1), + [anon_sym_output] = ACTIONS(1), + [anon_sym_wrapper] = ACTIONS(1), + [anon_sym_EQ] = ACTIONS(1), + [anon_sym_sources] = ACTIONS(1), + [anon_sym_includes] = ACTIONS(1), + [anon_sym_sanitize] = ACTIONS(1), + [anon_sym_link] = ACTIONS(1), + [anon_sym_extra] = ACTIONS(1), + [anon_sym_platforms] = ACTIONS(1), + [anon_sym_compilers] = ACTIONS(1), + [anon_sym_profile] = ACTIONS(1), + [anon_sym_release] = ACTIONS(1), + [anon_sym_debug] = ACTIONS(1), + [anon_sym_sanitized] = ACTIONS(1), + [anon_sym_warnings] = ACTIONS(1), + [anon_sym_default] = ACTIONS(1), + [anon_sym_strict] = ACTIONS(1), + [anon_sym_pedantic] = ACTIONS(1), + [anon_sym_define] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_linux] = ACTIONS(1), + [anon_sym_windows] = ACTIONS(1), + [anon_sym_darwin] = ACTIONS(1), + [anon_sym_toolchains] = ACTIONS(1), + [anon_sym_binary] = ACTIONS(1), + [anon_sym_class] = ACTIONS(1), + [anon_sym_gnu] = ACTIONS(1), + [anon_sym_msvc] = ACTIONS(1), + [anon_sym_normalize_crlf] = ACTIONS(1), + [anon_sym_trim_trailing_ws] = ACTIONS(1), + [anon_sym_timeout] = ACTIONS(1), + [anon_sym_memory_limit] = ACTIONS(1), + [anon_sym_group] = ACTIONS(1), + [anon_sym_weight] = ACTIONS(1), + [anon_sym_scoring] = ACTIONS(1), + [anon_sym_partial] = ACTIONS(1), + [anon_sym_all_or_none] = ACTIONS(1), + [anon_sym_env] = ACTIONS(1), + [anon_sym_test] = ACTIONS(1), + [anon_sym_stdin] = ACTIONS(1), + [anon_sym_stdout] = ACTIONS(1), + [anon_sym_stderr] = ACTIONS(1), + [anon_sym_args] = ACTIONS(1), + [anon_sym_exitCode] = ACTIONS(1), + [anon_sym_file] = ACTIONS(1), + [anon_sym_outFile] = ACTIONS(1), + [anon_sym_TILDE] = ACTIONS(1), + [anon_sym_of] = ACTIONS(1), + [anon_sym_contains] = ACTIONS(1), + [anon_sym_matches] = ACTIONS(1), + [anon_sym_anyOrder] = ACTIONS(1), + [anon_sym_pattern] = ACTIONS(1), + [anon_sym_input] = ACTIONS(1), + [anon_sym_dirs] = ACTIONS(1), + [anon_sym_true] = ACTIONS(1), + [anon_sym_false] = ACTIONS(1), + [sym_simple_string] = ACTIONS(1), + [sym_heredoc_string] = ACTIONS(1), + [sym_integer] = ACTIONS(1), + [sym_float] = ACTIONS(1), + [sym_size] = ACTIONS(1), + }, + [1] = { + [sym_source_file] = STATE(169), + [sym__top_statement] = STATE(7), + [sym_include] = STATE(7), + [sym_legacy_build] = STATE(7), + [sym_legacy_build_platform] = STATE(7), + [sym_structured_build] = STATE(7), + [sym_build_defaults] = STATE(7), + [sym_toolchains] = STATE(7), + [sym_binary_decl] = STATE(7), + [sym_sources_decl] = STATE(7), + [sym_bool_decl] = STATE(7), + [sym_timeout_decl] = STATE(7), + [sym_memory_limit_decl] = STATE(7), + [sym_group] = STATE(7), + [aux_sym_source_file_repeat1] = STATE(7), + [ts_builtin_sym_end] = ACTIONS(5), + [sym_comment] = ACTIONS(3), + [anon_sym_include] = ACTIONS(7), + [anon_sym_build] = ACTIONS(9), + [anon_sym_build_linux] = ACTIONS(11), + [anon_sym_build_windows] = ACTIONS(11), + [anon_sym_build_darwin] = ACTIONS(11), + [anon_sym_build_defaults] = ACTIONS(13), + [anon_sym_sources] = ACTIONS(15), + [anon_sym_toolchains] = ACTIONS(17), + [anon_sym_binary] = ACTIONS(19), + [anon_sym_normalize_crlf] = ACTIONS(21), + [anon_sym_trim_trailing_ws] = ACTIONS(21), + [anon_sym_timeout] = ACTIONS(23), + [anon_sym_memory_limit] = ACTIONS(25), + [anon_sym_group] = ACTIONS(27), + }, +}; + +static const uint16_t ts_small_parse_table[] = { + [0] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(31), 3, + anon_sym_include, + anon_sym_build, + sym_simple_string, + ACTIONS(29), 48, + ts_builtin_sym_end, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_LBRACE, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_RPAREN, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_class, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + anon_sym_pattern, + anon_sym_input, + anon_sym_dirs, + sym_heredoc_string, + [59] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(35), 1, + sym_simple_string, + ACTIONS(38), 1, + sym_heredoc_string, + STATE(3), 2, + sym_string, + aux_sym_build_list_field_repeat1, + ACTIONS(33), 32, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + anon_sym_binary, + anon_sym_class, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + anon_sym_input, + anon_sym_dirs, + [107] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(43), 2, + anon_sym_include, + anon_sym_build, + ACTIONS(41), 30, + ts_builtin_sym_end, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [147] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(47), 2, + anon_sym_include, + anon_sym_build, + ACTIONS(45), 30, + ts_builtin_sym_end, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [187] = 14, + ACTIONS(3), 1, + sym_comment, + ACTIONS(49), 1, + ts_builtin_sym_end, + ACTIONS(51), 1, + anon_sym_include, + ACTIONS(54), 1, + anon_sym_build, + ACTIONS(60), 1, + anon_sym_build_defaults, + ACTIONS(63), 1, + anon_sym_sources, + ACTIONS(66), 1, + anon_sym_toolchains, + ACTIONS(69), 1, + anon_sym_binary, + ACTIONS(75), 1, + anon_sym_timeout, + ACTIONS(78), 1, + anon_sym_memory_limit, + ACTIONS(81), 1, + anon_sym_group, + ACTIONS(72), 2, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + ACTIONS(57), 3, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + STATE(6), 14, + sym__top_statement, + sym_include, + sym_legacy_build, + sym_legacy_build_platform, + sym_structured_build, + sym_build_defaults, + sym_toolchains, + sym_binary_decl, + sym_sources_decl, + sym_bool_decl, + sym_timeout_decl, + sym_memory_limit_decl, + sym_group, + aux_sym_source_file_repeat1, + [246] = 14, + ACTIONS(3), 1, + sym_comment, + ACTIONS(7), 1, + anon_sym_include, + ACTIONS(9), 1, + anon_sym_build, + ACTIONS(13), 1, + anon_sym_build_defaults, + ACTIONS(15), 1, + anon_sym_sources, + ACTIONS(17), 1, + anon_sym_toolchains, + ACTIONS(19), 1, + anon_sym_binary, + ACTIONS(23), 1, + anon_sym_timeout, + ACTIONS(25), 1, + anon_sym_memory_limit, + ACTIONS(27), 1, + anon_sym_group, + ACTIONS(84), 1, + ts_builtin_sym_end, + ACTIONS(21), 2, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + ACTIONS(11), 3, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + STATE(6), 14, + sym__top_statement, + sym_include, + sym_legacy_build, + sym_legacy_build_platform, + sym_structured_build, + sym_build_defaults, + sym_toolchains, + sym_binary_decl, + sym_sources_decl, + sym_bool_decl, + sym_timeout_decl, + sym_memory_limit_decl, + sym_group, + aux_sym_source_file_repeat1, + [305] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(86), 1, + anon_sym_RBRACE, + ACTIONS(92), 1, + anon_sym_profile, + ACTIONS(94), 1, + anon_sym_warnings, + ACTIONS(96), 1, + anon_sym_define, + STATE(128), 1, + sym_os_name, + ACTIONS(98), 3, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + ACTIONS(88), 4, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + ACTIONS(90), 7, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + STATE(9), 8, + sym__build_field, + sym_build_scalar_field, + sym_build_list_field, + sym_build_profile_field, + sym_build_warnings_field, + sym_define_field, + sym_os_override, + aux_sym_build_block_repeat1, + [354] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(100), 1, + anon_sym_RBRACE, + ACTIONS(108), 1, + anon_sym_profile, + ACTIONS(111), 1, + anon_sym_warnings, + ACTIONS(114), 1, + anon_sym_define, + STATE(128), 1, + sym_os_name, + ACTIONS(117), 3, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + ACTIONS(102), 4, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + ACTIONS(105), 7, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + STATE(9), 8, + sym__build_field, + sym_build_scalar_field, + sym_build_list_field, + sym_build_profile_field, + sym_build_warnings_field, + sym_define_field, + sym_os_override, + aux_sym_build_block_repeat1, + [403] = 10, + ACTIONS(3), 1, + sym_comment, + ACTIONS(92), 1, + anon_sym_profile, + ACTIONS(94), 1, + anon_sym_warnings, + ACTIONS(96), 1, + anon_sym_define, + ACTIONS(120), 1, + anon_sym_RBRACE, + STATE(128), 1, + sym_os_name, + ACTIONS(98), 3, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + ACTIONS(88), 4, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + ACTIONS(90), 7, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + STATE(8), 8, + sym__build_field, + sym_build_scalar_field, + sym_build_list_field, + sym_build_profile_field, + sym_build_warnings_field, + sym_define_field, + sym_os_override, + aux_sym_build_block_repeat1, + [452] = 14, + ACTIONS(3), 1, + sym_comment, + ACTIONS(122), 1, + anon_sym_RBRACE, + ACTIONS(124), 1, + anon_sym_wrapper, + ACTIONS(126), 1, + anon_sym_timeout, + ACTIONS(128), 1, + anon_sym_memory_limit, + ACTIONS(130), 1, + anon_sym_env, + ACTIONS(132), 1, + anon_sym_stdin, + ACTIONS(134), 1, + anon_sym_stdout, + ACTIONS(136), 1, + anon_sym_stderr, + ACTIONS(138), 1, + anon_sym_args, + ACTIONS(140), 1, + anon_sym_exitCode, + ACTIONS(142), 1, + anon_sym_file, + ACTIONS(144), 1, + anon_sym_outFile, + STATE(12), 13, + sym_env_decl, + sym__test_field, + sym_test_stdin_field, + sym_test_stdout_field, + sym_test_stderr_field, + sym_test_args_field, + sym_test_exit_code_field, + sym_test_timeout_field, + sym_test_memory_field, + sym_test_wrapper_field, + sym_file_decl, + sym_out_file_decl, + aux_sym_test_repeat1, + [507] = 14, + ACTIONS(3), 1, + sym_comment, + ACTIONS(124), 1, + anon_sym_wrapper, + ACTIONS(126), 1, + anon_sym_timeout, + ACTIONS(128), 1, + anon_sym_memory_limit, + ACTIONS(130), 1, + anon_sym_env, + ACTIONS(132), 1, + anon_sym_stdin, + ACTIONS(134), 1, + anon_sym_stdout, + ACTIONS(136), 1, + anon_sym_stderr, + ACTIONS(138), 1, + anon_sym_args, + ACTIONS(140), 1, + anon_sym_exitCode, + ACTIONS(142), 1, + anon_sym_file, + ACTIONS(144), 1, + anon_sym_outFile, + ACTIONS(146), 1, + anon_sym_RBRACE, + STATE(13), 13, + sym_env_decl, + sym__test_field, + sym_test_stdin_field, + sym_test_stdout_field, + sym_test_stderr_field, + sym_test_args_field, + sym_test_exit_code_field, + sym_test_timeout_field, + sym_test_memory_field, + sym_test_wrapper_field, + sym_file_decl, + sym_out_file_decl, + aux_sym_test_repeat1, + [562] = 14, + ACTIONS(3), 1, + sym_comment, + ACTIONS(148), 1, + anon_sym_RBRACE, + ACTIONS(150), 1, + anon_sym_wrapper, + ACTIONS(153), 1, + anon_sym_timeout, + ACTIONS(156), 1, + anon_sym_memory_limit, + ACTIONS(159), 1, + anon_sym_env, + ACTIONS(162), 1, + anon_sym_stdin, + ACTIONS(165), 1, + anon_sym_stdout, + ACTIONS(168), 1, + anon_sym_stderr, + ACTIONS(171), 1, + anon_sym_args, + ACTIONS(174), 1, + anon_sym_exitCode, + ACTIONS(177), 1, + anon_sym_file, + ACTIONS(180), 1, + anon_sym_outFile, + STATE(13), 13, + sym_env_decl, + sym__test_field, + sym_test_stdin_field, + sym_test_stdout_field, + sym_test_stderr_field, + sym_test_args_field, + sym_test_exit_code_field, + sym_test_timeout_field, + sym_test_memory_field, + sym_test_wrapper_field, + sym_file_decl, + sym_out_file_decl, + aux_sym_test_repeat1, + [617] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(3), 2, + sym_string, + aux_sym_build_list_field_repeat1, + ACTIONS(183), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [651] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(130), 1, + anon_sym_env, + ACTIONS(189), 1, + anon_sym_RBRACE, + ACTIONS(191), 1, + anon_sym_wrapper, + ACTIONS(193), 1, + anon_sym_timeout, + ACTIONS(195), 1, + anon_sym_memory_limit, + ACTIONS(197), 1, + anon_sym_weight, + ACTIONS(199), 1, + anon_sym_scoring, + ACTIONS(201), 1, + anon_sym_test, + ACTIONS(203), 1, + anon_sym_pattern, + STATE(17), 10, + sym__group_field, + sym_group_weight_field, + sym_group_timeout_field, + sym_group_memory_field, + sym_group_scoring_field, + sym_group_wrapper_field, + sym_env_decl, + sym_test, + sym_pattern, + aux_sym_group_repeat1, + [694] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(205), 1, + anon_sym_RBRACE, + ACTIONS(207), 1, + anon_sym_wrapper, + ACTIONS(210), 1, + anon_sym_timeout, + ACTIONS(213), 1, + anon_sym_memory_limit, + ACTIONS(216), 1, + anon_sym_weight, + ACTIONS(219), 1, + anon_sym_scoring, + ACTIONS(222), 1, + anon_sym_env, + ACTIONS(225), 1, + anon_sym_test, + ACTIONS(228), 1, + anon_sym_pattern, + STATE(16), 10, + sym__group_field, + sym_group_weight_field, + sym_group_timeout_field, + sym_group_memory_field, + sym_group_scoring_field, + sym_group_wrapper_field, + sym_env_decl, + sym_test, + sym_pattern, + aux_sym_group_repeat1, + [737] = 11, + ACTIONS(3), 1, + sym_comment, + ACTIONS(130), 1, + anon_sym_env, + ACTIONS(191), 1, + anon_sym_wrapper, + ACTIONS(193), 1, + anon_sym_timeout, + ACTIONS(195), 1, + anon_sym_memory_limit, + ACTIONS(197), 1, + anon_sym_weight, + ACTIONS(199), 1, + anon_sym_scoring, + ACTIONS(201), 1, + anon_sym_test, + ACTIONS(203), 1, + anon_sym_pattern, + ACTIONS(231), 1, + anon_sym_RBRACE, + STATE(16), 10, + sym__group_field, + sym_group_weight_field, + sym_group_timeout_field, + sym_group_memory_field, + sym_group_scoring_field, + sym_group_wrapper_field, + sym_env_decl, + sym_test, + sym_pattern, + aux_sym_group_repeat1, + [780] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(233), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [804] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(235), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [828] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(237), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [852] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(239), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [876] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(241), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [900] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(243), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [924] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(245), 18, + anon_sym_RBRACE, + anon_sym_language, + anon_sym_standard, + anon_sym_output, + anon_sym_wrapper, + anon_sym_sources, + anon_sym_includes, + anon_sym_sanitize, + anon_sym_link, + anon_sym_extra, + anon_sym_platforms, + anon_sym_compilers, + anon_sym_profile, + anon_sym_warnings, + anon_sym_define, + anon_sym_linux, + anon_sym_windows, + anon_sym_darwin, + [948] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(249), 1, + anon_sym_build, + ACTIONS(251), 1, + anon_sym_LBRACE, + STATE(29), 1, + sym_build_block, + ACTIONS(247), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [977] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(253), 16, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + anon_sym_pattern, + [999] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(3), 2, + sym_string, + aux_sym_build_list_field_repeat1, + ACTIONS(255), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1027] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(259), 1, + anon_sym_build, + ACTIONS(257), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1050] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(263), 1, + anon_sym_build, + ACTIONS(261), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1073] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(267), 1, + anon_sym_build, + ACTIONS(265), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1096] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(271), 1, + anon_sym_build, + ACTIONS(269), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1119] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(275), 1, + anon_sym_build, + ACTIONS(273), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1142] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(279), 1, + anon_sym_build, + ACTIONS(277), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1165] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(283), 1, + anon_sym_build, + ACTIONS(281), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1188] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(287), 1, + anon_sym_build, + ACTIONS(285), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1211] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_build, + ACTIONS(289), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1234] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(295), 1, + anon_sym_build, + ACTIONS(293), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1257] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(299), 1, + anon_sym_build, + ACTIONS(297), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1280] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(303), 1, + anon_sym_build, + ACTIONS(301), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1303] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(307), 1, + anon_sym_build, + ACTIONS(305), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1326] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(311), 1, + anon_sym_build, + ACTIONS(309), 14, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_build_linux, + anon_sym_build_windows, + anon_sym_build_darwin, + anon_sym_build_defaults, + anon_sym_sources, + anon_sym_toolchains, + anon_sym_binary, + anon_sym_normalize_crlf, + anon_sym_trim_trailing_ws, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_group, + [1349] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(313), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1367] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(315), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1385] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(317), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1403] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(319), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1421] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(321), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1439] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(323), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1457] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(325), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1475] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(327), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1493] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(329), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1511] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(331), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1529] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(333), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1547] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(335), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1565] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(337), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1583] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(339), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1601] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(341), 12, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_env, + anon_sym_stdin, + anon_sym_stdout, + anon_sym_stderr, + anon_sym_args, + anon_sym_exitCode, + anon_sym_file, + anon_sym_outFile, + [1619] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(343), 1, + anon_sym_EQ, + ACTIONS(345), 1, + anon_sym_TILDE, + ACTIONS(347), 1, + anon_sym_contains, + ACTIONS(349), 1, + anon_sym_matches, + ACTIONS(351), 1, + anon_sym_anyOrder, + STATE(55), 6, + sym__matcher, + sym_exact_matcher, + sym_numeric_matcher, + sym_contains_matcher, + sym_regex_matcher, + sym_any_order_matcher, + [1646] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(353), 1, + anon_sym_RBRACE, + ACTIONS(355), 1, + anon_sym_output, + ACTIONS(357), 1, + anon_sym_args, + ACTIONS(359), 1, + anon_sym_input, + ACTIONS(361), 1, + anon_sym_dirs, + STATE(60), 6, + sym__pattern_field, + sym_pattern_input_field, + sym_pattern_output_field, + sym_pattern_dirs_field, + sym_pattern_args_field, + aux_sym_pattern_repeat1, + [1673] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(343), 1, + anon_sym_EQ, + ACTIONS(345), 1, + anon_sym_TILDE, + ACTIONS(347), 1, + anon_sym_contains, + ACTIONS(349), 1, + anon_sym_matches, + ACTIONS(351), 1, + anon_sym_anyOrder, + STATE(54), 6, + sym__matcher, + sym_exact_matcher, + sym_numeric_matcher, + sym_contains_matcher, + sym_regex_matcher, + sym_any_order_matcher, + [1700] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(355), 1, + anon_sym_output, + ACTIONS(357), 1, + anon_sym_args, + ACTIONS(359), 1, + anon_sym_input, + ACTIONS(361), 1, + anon_sym_dirs, + ACTIONS(363), 1, + anon_sym_RBRACE, + STATE(61), 6, + sym__pattern_field, + sym_pattern_input_field, + sym_pattern_output_field, + sym_pattern_dirs_field, + sym_pattern_args_field, + aux_sym_pattern_repeat1, + [1727] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(365), 1, + anon_sym_RBRACE, + ACTIONS(367), 1, + anon_sym_output, + ACTIONS(370), 1, + anon_sym_args, + ACTIONS(373), 1, + anon_sym_input, + ACTIONS(376), 1, + anon_sym_dirs, + STATE(61), 6, + sym__pattern_field, + sym_pattern_input_field, + sym_pattern_output_field, + sym_pattern_dirs_field, + sym_pattern_args_field, + aux_sym_pattern_repeat1, + [1754] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(379), 10, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_of, + anon_sym_pattern, + [1770] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(381), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1785] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(383), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1800] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(385), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1815] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(387), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1830] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(389), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1845] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(391), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1860] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(393), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1875] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(395), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1890] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(397), 1, + anon_sym_RBRACE, + ACTIONS(399), 1, + anon_sym_platforms, + ACTIONS(401), 1, + anon_sym_binary, + ACTIONS(403), 1, + anon_sym_class, + STATE(73), 5, + sym__toolchain_field, + sym_toolchain_platforms_field, + sym_toolchain_binary_field, + sym_toolchain_class_field, + aux_sym_toolchain_entry_repeat1, + [1913] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(405), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1928] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(407), 1, + anon_sym_RBRACE, + ACTIONS(409), 1, + anon_sym_platforms, + ACTIONS(412), 1, + anon_sym_binary, + ACTIONS(415), 1, + anon_sym_class, + STATE(73), 5, + sym__toolchain_field, + sym_toolchain_platforms_field, + sym_toolchain_binary_field, + sym_toolchain_class_field, + aux_sym_toolchain_entry_repeat1, + [1951] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(3), 2, + sym_string, + aux_sym_build_list_field_repeat1, + ACTIONS(418), 5, + anon_sym_RBRACE, + anon_sym_output, + anon_sym_args, + anon_sym_input, + anon_sym_dirs, + [1972] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(420), 9, + anon_sym_RBRACE, + anon_sym_wrapper, + anon_sym_timeout, + anon_sym_memory_limit, + anon_sym_weight, + anon_sym_scoring, + anon_sym_env, + anon_sym_test, + anon_sym_pattern, + [1987] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(399), 1, + anon_sym_platforms, + ACTIONS(401), 1, + anon_sym_binary, + ACTIONS(403), 1, + anon_sym_class, + ACTIONS(422), 1, + anon_sym_RBRACE, + STATE(71), 5, + sym__toolchain_field, + sym_toolchain_platforms_field, + sym_toolchain_binary_field, + sym_toolchain_class_field, + aux_sym_toolchain_entry_repeat1, + [2010] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(3), 2, + sym_string, + aux_sym_build_list_field_repeat1, + ACTIONS(424), 4, + anon_sym_RBRACE, + anon_sym_platforms, + anon_sym_binary, + anon_sym_class, + [2030] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + ACTIONS(426), 1, + sym_identifier, + ACTIONS(428), 1, + anon_sym_RBRACE, + STATE(136), 1, + sym_string, + STATE(80), 2, + sym_toolchain_entry, + aux_sym_toolchains_repeat1, + [2053] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(430), 1, + sym_identifier, + ACTIONS(433), 1, + anon_sym_RBRACE, + ACTIONS(435), 1, + sym_simple_string, + ACTIONS(438), 1, + sym_heredoc_string, + STATE(136), 1, + sym_string, + STATE(79), 2, + sym_toolchain_entry, + aux_sym_toolchains_repeat1, + [2076] = 7, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + ACTIONS(426), 1, + sym_identifier, + ACTIONS(441), 1, + anon_sym_RBRACE, + STATE(136), 1, + sym_string, + STATE(79), 2, + sym_toolchain_entry, + aux_sym_toolchains_repeat1, + [2099] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(443), 5, + anon_sym_RBRACE, + anon_sym_output, + anon_sym_args, + anon_sym_input, + anon_sym_dirs, + [2110] = 5, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + ACTIONS(445), 1, + anon_sym_RBRACE, + STATE(3), 2, + sym_string, + aux_sym_build_list_field_repeat1, + [2127] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(447), 5, + anon_sym_RBRACE, + anon_sym_output, + anon_sym_args, + anon_sym_input, + anon_sym_dirs, + [2138] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(449), 5, + anon_sym_RBRACE, + anon_sym_output, + anon_sym_args, + anon_sym_input, + anon_sym_dirs, + [2149] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(451), 4, + anon_sym_RBRACE, + anon_sym_platforms, + anon_sym_binary, + anon_sym_class, + [2159] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(77), 2, + sym_string, + aux_sym_build_list_field_repeat1, + [2173] = 3, + ACTIONS(3), 1, + sym_comment, + STATE(24), 1, + sym_warnings_value, + ACTIONS(453), 3, + anon_sym_default, + anon_sym_strict, + anon_sym_pedantic, + [2185] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(74), 2, + sym_string, + aux_sym_build_list_field_repeat1, + [2199] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(14), 2, + sym_string, + aux_sym_build_list_field_repeat1, + [2213] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(457), 1, + sym_simple_string, + ACTIONS(455), 3, + anon_sym_RBRACE, + sym_heredoc_string, + sym_identifier, + [2225] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(27), 2, + sym_string, + aux_sym_build_list_field_repeat1, + [2239] = 3, + ACTIONS(3), 1, + sym_comment, + STATE(18), 1, + sym_profile_value, + ACTIONS(459), 3, + anon_sym_release, + anon_sym_debug, + anon_sym_sanitized, + [2251] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(461), 4, + anon_sym_RBRACE, + anon_sym_platforms, + anon_sym_binary, + anon_sym_class, + [2261] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(463), 4, + anon_sym_RBRACE, + anon_sym_platforms, + anon_sym_binary, + anon_sym_class, + [2271] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(467), 1, + sym_simple_string, + ACTIONS(465), 3, + anon_sym_RBRACE, + sym_heredoc_string, + sym_identifier, + [2283] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(82), 2, + sym_string, + aux_sym_build_list_field_repeat1, + [2297] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(53), 1, + sym_string, + [2310] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(21), 1, + sym_string, + [2323] = 3, + ACTIONS(3), 1, + sym_comment, + STATE(68), 1, + sym_scoring_value, + ACTIONS(469), 2, + anon_sym_partial, + anon_sym_all_or_none, + [2334] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(161), 1, + sym_string, + [2347] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(159), 1, + sym_string, + [2360] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(30), 1, + sym_string, + [2373] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(39), 1, + sym_string, + [2386] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(28), 1, + sym_string, + [2399] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(63), 1, + sym_string, + [2412] = 3, + ACTIONS(3), 1, + sym_comment, + STATE(85), 1, + sym_class_value, + ACTIONS(471), 2, + anon_sym_gnu, + anon_sym_msvc, + [2423] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(44), 1, + sym_string, + [2436] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(22), 1, + sym_string, + [2449] = 3, + ACTIONS(3), 1, + sym_comment, + STATE(36), 1, + sym_bool, + ACTIONS(473), 2, + anon_sym_true, + anon_sym_false, + [2460] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(135), 1, + sym_string, + [2473] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(178), 1, + sym_string, + [2486] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(177), 1, + sym_string, + [2499] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(475), 1, + sym_integer, + ACTIONS(477), 1, + sym_float, + STATE(70), 1, + sym_number, + [2512] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(25), 1, + sym_string, + [2525] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(93), 1, + sym_string, + [2538] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(50), 1, + sym_string, + [2551] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(475), 1, + sym_integer, + ACTIONS(477), 1, + sym_float, + STATE(170), 1, + sym_number, + [2564] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(51), 1, + sym_string, + [2577] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(52), 1, + sym_string, + [2590] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(56), 1, + sym_string, + [2603] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(46), 1, + sym_string, + [2616] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(26), 1, + sym_string, + [2629] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(81), 1, + sym_string, + [2642] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(37), 1, + sym_string, + [2655] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(83), 1, + sym_string, + [2668] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(84), 1, + sym_string, + [2681] = 4, + ACTIONS(3), 1, + sym_comment, + ACTIONS(185), 1, + sym_simple_string, + ACTIONS(187), 1, + sym_heredoc_string, + STATE(151), 1, + sym_string, + [2694] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(251), 1, + anon_sym_LBRACE, + STATE(19), 1, + sym_build_block, + [2704] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(251), 1, + anon_sym_LBRACE, + STATE(33), 1, + sym_build_block, + [2714] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(479), 1, + sym_simple_string, + STATE(48), 1, + sym_regex_string, + [2724] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(481), 1, + anon_sym_EQ, + [2731] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(483), 1, + sym_integer, + [2738] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(485), 1, + anon_sym_LBRACE, + [2745] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(487), 1, + anon_sym_LBRACE, + [2752] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(489), 1, + anon_sym_RPAREN, + [2759] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(491), 1, + anon_sym_LBRACE, + [2766] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(493), 1, + anon_sym_EQ, + [2773] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(495), 1, + anon_sym_EQ, + [2780] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(497), 1, + anon_sym_EQ, + [2787] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(499), 1, + anon_sym_EQ, + [2794] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(501), 1, + anon_sym_LBRACE, + [2801] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(503), 1, + anon_sym_LPAREN, + [2808] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(505), 1, + anon_sym_EQ, + [2815] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(507), 1, + anon_sym_EQ, + [2822] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(509), 1, + anon_sym_LPAREN, + [2829] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(511), 1, + anon_sym_LPAREN, + [2836] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(513), 1, + anon_sym_EQ, + [2843] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(515), 1, + anon_sym_EQ, + [2850] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(517), 1, + sym_duration, + [2857] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(519), 1, + sym_size, + [2864] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(521), 1, + anon_sym_RPAREN, + [2871] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(523), 1, + anon_sym_EQ, + [2878] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(525), 1, + anon_sym_EQ, + [2885] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(527), 1, + anon_sym_EQ, + [2892] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(529), 1, + anon_sym_EQ, + [2899] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(531), 1, + anon_sym_LBRACE, + [2906] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(533), 1, + anon_sym_EQ, + [2913] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(535), 1, + anon_sym_EQ, + [2920] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(537), 1, + anon_sym_RPAREN, + [2927] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(539), 1, + anon_sym_EQ, + [2934] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(541), 1, + anon_sym_RPAREN, + [2941] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(543), 1, + anon_sym_EQ, + [2948] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(545), 1, + anon_sym_EQ, + [2955] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(547), 1, + anon_sym_EQ, + [2962] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(549), 1, + sym_size, + [2969] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(551), 1, + anon_sym_EQ, + [2976] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(553), 1, + anon_sym_EQ, + [2983] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(555), 1, + anon_sym_EQ, + [2990] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(557), 1, + ts_builtin_sym_end, + [2997] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(559), 1, + anon_sym_of, + [3004] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(561), 1, + anon_sym_LPAREN, + [3011] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(563), 1, + anon_sym_EQ, + [3018] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(565), 1, + sym_duration, + [3025] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(567), 1, + anon_sym_EQ, + [3032] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(569), 1, + anon_sym_EQ, + [3039] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(571), 1, + anon_sym_EQ, + [3046] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(573), 1, + anon_sym_RPAREN, + [3053] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(575), 1, + anon_sym_RPAREN, + [3060] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(577), 1, + sym_size, + [3067] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(579), 1, + anon_sym_LBRACE, + [3074] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(581), 1, + anon_sym_EQ, + [3081] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(583), 1, + anon_sym_EQ, + [3088] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(585), 1, + anon_sym_EQ, + [3095] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(587), 1, + sym_duration, + [3102] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(589), 1, + anon_sym_LBRACE, + [3109] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(591), 1, + anon_sym_LPAREN, + [3116] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(593), 1, + anon_sym_LPAREN, + [3123] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(595), 1, + anon_sym_EQ, +}; + +static const uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(2)] = 0, + [SMALL_STATE(3)] = 59, + [SMALL_STATE(4)] = 107, + [SMALL_STATE(5)] = 147, + [SMALL_STATE(6)] = 187, + [SMALL_STATE(7)] = 246, + [SMALL_STATE(8)] = 305, + [SMALL_STATE(9)] = 354, + [SMALL_STATE(10)] = 403, + [SMALL_STATE(11)] = 452, + [SMALL_STATE(12)] = 507, + [SMALL_STATE(13)] = 562, + [SMALL_STATE(14)] = 617, + [SMALL_STATE(15)] = 651, + [SMALL_STATE(16)] = 694, + [SMALL_STATE(17)] = 737, + [SMALL_STATE(18)] = 780, + [SMALL_STATE(19)] = 804, + [SMALL_STATE(20)] = 828, + [SMALL_STATE(21)] = 852, + [SMALL_STATE(22)] = 876, + [SMALL_STATE(23)] = 900, + [SMALL_STATE(24)] = 924, + [SMALL_STATE(25)] = 948, + [SMALL_STATE(26)] = 977, + [SMALL_STATE(27)] = 999, + [SMALL_STATE(28)] = 1027, + [SMALL_STATE(29)] = 1050, + [SMALL_STATE(30)] = 1073, + [SMALL_STATE(31)] = 1096, + [SMALL_STATE(32)] = 1119, + [SMALL_STATE(33)] = 1142, + [SMALL_STATE(34)] = 1165, + [SMALL_STATE(35)] = 1188, + [SMALL_STATE(36)] = 1211, + [SMALL_STATE(37)] = 1234, + [SMALL_STATE(38)] = 1257, + [SMALL_STATE(39)] = 1280, + [SMALL_STATE(40)] = 1303, + [SMALL_STATE(41)] = 1326, + [SMALL_STATE(42)] = 1349, + [SMALL_STATE(43)] = 1367, + [SMALL_STATE(44)] = 1385, + [SMALL_STATE(45)] = 1403, + [SMALL_STATE(46)] = 1421, + [SMALL_STATE(47)] = 1439, + [SMALL_STATE(48)] = 1457, + [SMALL_STATE(49)] = 1475, + [SMALL_STATE(50)] = 1493, + [SMALL_STATE(51)] = 1511, + [SMALL_STATE(52)] = 1529, + [SMALL_STATE(53)] = 1547, + [SMALL_STATE(54)] = 1565, + [SMALL_STATE(55)] = 1583, + [SMALL_STATE(56)] = 1601, + [SMALL_STATE(57)] = 1619, + [SMALL_STATE(58)] = 1646, + [SMALL_STATE(59)] = 1673, + [SMALL_STATE(60)] = 1700, + [SMALL_STATE(61)] = 1727, + [SMALL_STATE(62)] = 1754, + [SMALL_STATE(63)] = 1770, + [SMALL_STATE(64)] = 1785, + [SMALL_STATE(65)] = 1800, + [SMALL_STATE(66)] = 1815, + [SMALL_STATE(67)] = 1830, + [SMALL_STATE(68)] = 1845, + [SMALL_STATE(69)] = 1860, + [SMALL_STATE(70)] = 1875, + [SMALL_STATE(71)] = 1890, + [SMALL_STATE(72)] = 1913, + [SMALL_STATE(73)] = 1928, + [SMALL_STATE(74)] = 1951, + [SMALL_STATE(75)] = 1972, + [SMALL_STATE(76)] = 1987, + [SMALL_STATE(77)] = 2010, + [SMALL_STATE(78)] = 2030, + [SMALL_STATE(79)] = 2053, + [SMALL_STATE(80)] = 2076, + [SMALL_STATE(81)] = 2099, + [SMALL_STATE(82)] = 2110, + [SMALL_STATE(83)] = 2127, + [SMALL_STATE(84)] = 2138, + [SMALL_STATE(85)] = 2149, + [SMALL_STATE(86)] = 2159, + [SMALL_STATE(87)] = 2173, + [SMALL_STATE(88)] = 2185, + [SMALL_STATE(89)] = 2199, + [SMALL_STATE(90)] = 2213, + [SMALL_STATE(91)] = 2225, + [SMALL_STATE(92)] = 2239, + [SMALL_STATE(93)] = 2251, + [SMALL_STATE(94)] = 2261, + [SMALL_STATE(95)] = 2271, + [SMALL_STATE(96)] = 2283, + [SMALL_STATE(97)] = 2297, + [SMALL_STATE(98)] = 2310, + [SMALL_STATE(99)] = 2323, + [SMALL_STATE(100)] = 2334, + [SMALL_STATE(101)] = 2347, + [SMALL_STATE(102)] = 2360, + [SMALL_STATE(103)] = 2373, + [SMALL_STATE(104)] = 2386, + [SMALL_STATE(105)] = 2399, + [SMALL_STATE(106)] = 2412, + [SMALL_STATE(107)] = 2423, + [SMALL_STATE(108)] = 2436, + [SMALL_STATE(109)] = 2449, + [SMALL_STATE(110)] = 2460, + [SMALL_STATE(111)] = 2473, + [SMALL_STATE(112)] = 2486, + [SMALL_STATE(113)] = 2499, + [SMALL_STATE(114)] = 2512, + [SMALL_STATE(115)] = 2525, + [SMALL_STATE(116)] = 2538, + [SMALL_STATE(117)] = 2551, + [SMALL_STATE(118)] = 2564, + [SMALL_STATE(119)] = 2577, + [SMALL_STATE(120)] = 2590, + [SMALL_STATE(121)] = 2603, + [SMALL_STATE(122)] = 2616, + [SMALL_STATE(123)] = 2629, + [SMALL_STATE(124)] = 2642, + [SMALL_STATE(125)] = 2655, + [SMALL_STATE(126)] = 2668, + [SMALL_STATE(127)] = 2681, + [SMALL_STATE(128)] = 2694, + [SMALL_STATE(129)] = 2704, + [SMALL_STATE(130)] = 2714, + [SMALL_STATE(131)] = 2724, + [SMALL_STATE(132)] = 2731, + [SMALL_STATE(133)] = 2738, + [SMALL_STATE(134)] = 2745, + [SMALL_STATE(135)] = 2752, + [SMALL_STATE(136)] = 2759, + [SMALL_STATE(137)] = 2766, + [SMALL_STATE(138)] = 2773, + [SMALL_STATE(139)] = 2780, + [SMALL_STATE(140)] = 2787, + [SMALL_STATE(141)] = 2794, + [SMALL_STATE(142)] = 2801, + [SMALL_STATE(143)] = 2808, + [SMALL_STATE(144)] = 2815, + [SMALL_STATE(145)] = 2822, + [SMALL_STATE(146)] = 2829, + [SMALL_STATE(147)] = 2836, + [SMALL_STATE(148)] = 2843, + [SMALL_STATE(149)] = 2850, + [SMALL_STATE(150)] = 2857, + [SMALL_STATE(151)] = 2864, + [SMALL_STATE(152)] = 2871, + [SMALL_STATE(153)] = 2878, + [SMALL_STATE(154)] = 2885, + [SMALL_STATE(155)] = 2892, + [SMALL_STATE(156)] = 2899, + [SMALL_STATE(157)] = 2906, + [SMALL_STATE(158)] = 2913, + [SMALL_STATE(159)] = 2920, + [SMALL_STATE(160)] = 2927, + [SMALL_STATE(161)] = 2934, + [SMALL_STATE(162)] = 2941, + [SMALL_STATE(163)] = 2948, + [SMALL_STATE(164)] = 2955, + [SMALL_STATE(165)] = 2962, + [SMALL_STATE(166)] = 2969, + [SMALL_STATE(167)] = 2976, + [SMALL_STATE(168)] = 2983, + [SMALL_STATE(169)] = 2990, + [SMALL_STATE(170)] = 2997, + [SMALL_STATE(171)] = 3004, + [SMALL_STATE(172)] = 3011, + [SMALL_STATE(173)] = 3018, + [SMALL_STATE(174)] = 3025, + [SMALL_STATE(175)] = 3032, + [SMALL_STATE(176)] = 3039, + [SMALL_STATE(177)] = 3046, + [SMALL_STATE(178)] = 3053, + [SMALL_STATE(179)] = 3060, + [SMALL_STATE(180)] = 3067, + [SMALL_STATE(181)] = 3074, + [SMALL_STATE(182)] = 3081, + [SMALL_STATE(183)] = 3088, + [SMALL_STATE(184)] = 3095, + [SMALL_STATE(185)] = 3102, + [SMALL_STATE(186)] = 3109, + [SMALL_STATE(187)] = 3116, + [SMALL_STATE(188)] = 3123, +}; + +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}}, SHIFT_EXTRA(), + [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(102), + [9] = {.entry = {.count = 1, .reusable = false}}, SHIFT(114), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(124), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(129), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(183), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(180), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(176), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(175), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(173), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(172), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(171), + [29] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 1, 0, 0), + [31] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_string, 1, 0, 0), + [33] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_build_list_field_repeat1, 2, 0, 0), + [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_build_list_field_repeat1, 2, 0, 0), SHIFT_REPEAT(2), + [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_list_field_repeat1, 2, 0, 0), SHIFT_REPEAT(2), + [41] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_block, 3, 0, 0), + [43] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_build_block, 3, 0, 0), + [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_block, 2, 0, 0), + [47] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_build_block, 2, 0, 0), + [49] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(102), + [54] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(114), + [57] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(124), + [60] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(129), + [63] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(183), + [66] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(180), + [69] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(176), + [72] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(175), + [75] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(173), + [78] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(172), + [81] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(171), + [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), + [86] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [88] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), + [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(158), + [92] = {.entry = {.count = 1, .reusable = true}}, SHIFT(157), + [94] = {.entry = {.count = 1, .reusable = true}}, SHIFT(147), + [96] = {.entry = {.count = 1, .reusable = true}}, SHIFT(142), + [98] = {.entry = {.count = 1, .reusable = true}}, SHIFT(141), + [100] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), + [102] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), SHIFT_REPEAT(163), + [105] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), SHIFT_REPEAT(158), + [108] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), SHIFT_REPEAT(157), + [111] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), SHIFT_REPEAT(147), + [114] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), SHIFT_REPEAT(142), + [117] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_build_block_repeat1, 2, 0, 0), SHIFT_REPEAT(141), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [122] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(137), + [126] = {.entry = {.count = 1, .reusable = true}}, SHIFT(138), + [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), + [130] = {.entry = {.count = 1, .reusable = true}}, SHIFT(187), + [132] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), + [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), + [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [138] = {.entry = {.count = 1, .reusable = true}}, SHIFT(143), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(144), + [142] = {.entry = {.count = 1, .reusable = true}}, SHIFT(145), + [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(146), + [146] = {.entry = {.count = 1, .reusable = true}}, SHIFT(72), + [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), + [150] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(137), + [153] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(138), + [156] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(139), + [159] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(187), + [162] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(140), + [165] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(59), + [168] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(57), + [171] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(143), + [174] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(144), + [177] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(145), + [180] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_test_repeat1, 2, 0, 0), SHIFT_REPEAT(146), + [183] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_list_field, 3, 0, 8), + [185] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), + [187] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [189] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [191] = {.entry = {.count = 1, .reusable = true}}, SHIFT(168), + [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(174), + [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), + [197] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), + [199] = {.entry = {.count = 1, .reusable = true}}, SHIFT(188), + [201] = {.entry = {.count = 1, .reusable = true}}, SHIFT(186), + [203] = {.entry = {.count = 1, .reusable = true}}, SHIFT(185), + [205] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), + [207] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(168), + [210] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(174), + [213] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(164), + [216] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(148), + [219] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(188), + [222] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(187), + [225] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(186), + [228] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_group_repeat1, 2, 0, 0), SHIFT_REPEAT(185), + [231] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [233] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_profile_field, 3, 0, 7), + [235] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_os_override, 2, 0, 9), + [237] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_profile_value, 1, 0, 0), + [239] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_scalar_field, 3, 0, 8), + [241] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_define_field, 6, 0, 12), + [243] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_warnings_value, 1, 0, 0), + [245] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_warnings_field, 3, 0, 7), + [247] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_legacy_build, 2, 0, 2), + [249] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_legacy_build, 2, 0, 2), + [251] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [253] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_env_decl, 6, 0, 12), + [255] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_args_field, 3, 0, 7), + [257] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_binary_decl, 3, 0, 7), + [259] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_binary_decl, 3, 0, 7), + [261] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_structured_build, 3, 0, 6), + [263] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_structured_build, 3, 0, 6), + [265] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_include, 2, 0, 1), + [267] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_include, 2, 0, 1), + [269] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_timeout_decl, 2, 0, 5), + [271] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_timeout_decl, 2, 0, 5), + [273] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchains, 4, 0, 0), + [275] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_toolchains, 4, 0, 0), + [277] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_build_defaults, 2, 0, 4), + [279] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_build_defaults, 2, 0, 4), + [281] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group, 6, 0, 11), + [283] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_group, 6, 0, 11), + [285] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_memory_limit_decl, 3, 0, 7), + [287] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_memory_limit_decl, 3, 0, 7), + [289] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bool_decl, 3, 0, 8), + [291] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bool_decl, 3, 0, 8), + [293] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_legacy_build_platform, 2, 0, 3), + [295] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_legacy_build_platform, 2, 0, 3), + [297] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group, 7, 0, 11), + [299] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_group, 7, 0, 11), + [301] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sources_decl, 3, 0, 7), + [303] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sources_decl, 3, 0, 7), + [305] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchains, 3, 0, 0), + [307] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_toolchains, 3, 0, 0), + [309] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_bool, 1, 0, 0), + [311] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_bool, 1, 0, 0), + [313] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_memory_field, 3, 0, 7), + [315] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_timeout_field, 3, 0, 7), + [317] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_file_decl, 6, 0, 12), + [319] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_any_order_matcher, 4, 0, 0), + [321] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_numeric_matcher, 4, 0, 14), + [323] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_exit_code_field, 3, 0, 7), + [325] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_regex_matcher, 2, 0, 13), + [327] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_regex_string, 1, 0, 0), + [329] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_contains_matcher, 2, 0, 5), + [331] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_exact_matcher, 2, 0, 5), + [333] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_stdin_field, 3, 0, 7), + [335] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_out_file_decl, 6, 0, 12), + [337] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_stdout_field, 2, 0, 0), + [339] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_stderr_field, 2, 0, 0), + [341] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test_wrapper_field, 3, 0, 7), + [343] = {.entry = {.count = 1, .reusable = true}}, SHIFT(118), + [345] = {.entry = {.count = 1, .reusable = true}}, SHIFT(117), + [347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), + [349] = {.entry = {.count = 1, .reusable = true}}, SHIFT(130), + [351] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), + [353] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), + [355] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), + [357] = {.entry = {.count = 1, .reusable = true}}, SHIFT(154), + [359] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), + [361] = {.entry = {.count = 1, .reusable = true}}, SHIFT(152), + [363] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), + [365] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), + [367] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(155), + [370] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(154), + [373] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(153), + [376] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2, 0, 0), SHIFT_REPEAT(152), + [379] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_number, 1, 0, 0), + [381] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group_wrapper_field, 3, 0, 7), + [383] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group_memory_field, 3, 0, 7), + [385] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test, 6, 0, 11), + [387] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 4, 0, 0), + [389] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 3, 0, 0), + [391] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group_scoring_field, 3, 0, 7), + [393] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_scoring_value, 1, 0, 0), + [395] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group_weight_field, 3, 0, 7), + [397] = {.entry = {.count = 1, .reusable = true}}, SHIFT(95), + [399] = {.entry = {.count = 1, .reusable = true}}, SHIFT(162), + [401] = {.entry = {.count = 1, .reusable = true}}, SHIFT(131), + [403] = {.entry = {.count = 1, .reusable = true}}, SHIFT(166), + [405] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_test, 7, 0, 11), + [407] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_toolchain_entry_repeat1, 2, 0, 0), + [409] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_toolchain_entry_repeat1, 2, 0, 0), SHIFT_REPEAT(162), + [412] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_toolchain_entry_repeat1, 2, 0, 0), SHIFT_REPEAT(131), + [415] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_toolchain_entry_repeat1, 2, 0, 0), SHIFT_REPEAT(166), + [418] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_args_field, 3, 0, 7), + [420] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_group_timeout_field, 3, 0, 7), + [422] = {.entry = {.count = 1, .reusable = true}}, SHIFT(90), + [424] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchain_platforms_field, 3, 0, 7), + [426] = {.entry = {.count = 1, .reusable = true}}, SHIFT(136), + [428] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), + [430] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_toolchains_repeat1, 2, 0, 0), SHIFT_REPEAT(136), + [433] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_toolchains_repeat1, 2, 0, 0), + [435] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_toolchains_repeat1, 2, 0, 0), SHIFT_REPEAT(2), + [438] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_toolchains_repeat1, 2, 0, 0), SHIFT_REPEAT(2), + [441] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [443] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_output_field, 3, 0, 7), + [445] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45), + [447] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_input_field, 3, 0, 7), + [449] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_dirs_field, 3, 0, 7), + [451] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchain_class_field, 3, 0, 7), + [453] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [455] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchain_entry, 3, 0, 10), + [457] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_toolchain_entry, 3, 0, 10), + [459] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [461] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchain_binary_field, 3, 0, 7), + [463] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_class_value, 1, 0, 0), + [465] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_toolchain_entry, 4, 0, 10), + [467] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_toolchain_entry, 4, 0, 10), + [469] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [471] = {.entry = {.count = 1, .reusable = true}}, SHIFT(94), + [473] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [475] = {.entry = {.count = 1, .reusable = false}}, SHIFT(62), + [477] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [479] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [481] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), + [483] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), + [485] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [487] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [489] = {.entry = {.count = 1, .reusable = true}}, SHIFT(134), + [491] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), + [493] = {.entry = {.count = 1, .reusable = true}}, SHIFT(120), + [495] = {.entry = {.count = 1, .reusable = true}}, SHIFT(149), + [497] = {.entry = {.count = 1, .reusable = true}}, SHIFT(150), + [499] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), + [501] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_os_name, 1, 0, 0), + [503] = {.entry = {.count = 1, .reusable = true}}, SHIFT(127), + [505] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), + [507] = {.entry = {.count = 1, .reusable = true}}, SHIFT(132), + [509] = {.entry = {.count = 1, .reusable = true}}, SHIFT(112), + [511] = {.entry = {.count = 1, .reusable = true}}, SHIFT(111), + [513] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), + [515] = {.entry = {.count = 1, .reusable = true}}, SHIFT(113), + [517] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), + [519] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), + [521] = {.entry = {.count = 1, .reusable = true}}, SHIFT(167), + [523] = {.entry = {.count = 1, .reusable = true}}, SHIFT(126), + [525] = {.entry = {.count = 1, .reusable = true}}, SHIFT(125), + [527] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), + [529] = {.entry = {.count = 1, .reusable = true}}, SHIFT(123), + [531] = {.entry = {.count = 1, .reusable = true}}, SHIFT(96), + [533] = {.entry = {.count = 1, .reusable = true}}, SHIFT(92), + [535] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), + [537] = {.entry = {.count = 1, .reusable = true}}, SHIFT(133), + [539] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122), + [541] = {.entry = {.count = 1, .reusable = true}}, SHIFT(160), + [543] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), + [545] = {.entry = {.count = 1, .reusable = true}}, SHIFT(98), + [547] = {.entry = {.count = 1, .reusable = true}}, SHIFT(179), + [549] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [551] = {.entry = {.count = 1, .reusable = true}}, SHIFT(106), + [553] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), + [555] = {.entry = {.count = 1, .reusable = true}}, SHIFT(105), + [557] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [559] = {.entry = {.count = 1, .reusable = true}}, SHIFT(121), + [561] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), + [563] = {.entry = {.count = 1, .reusable = true}}, SHIFT(165), + [565] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [567] = {.entry = {.count = 1, .reusable = true}}, SHIFT(184), + [569] = {.entry = {.count = 1, .reusable = true}}, SHIFT(109), + [571] = {.entry = {.count = 1, .reusable = true}}, SHIFT(104), + [573] = {.entry = {.count = 1, .reusable = true}}, SHIFT(181), + [575] = {.entry = {.count = 1, .reusable = true}}, SHIFT(182), + [577] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [579] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [581] = {.entry = {.count = 1, .reusable = true}}, SHIFT(107), + [583] = {.entry = {.count = 1, .reusable = true}}, SHIFT(97), + [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(103), + [587] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), + [589] = {.entry = {.count = 1, .reusable = true}}, SHIFT(58), + [591] = {.entry = {.count = 1, .reusable = true}}, SHIFT(101), + [593] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [595] = {.entry = {.count = 1, .reusable = true}}, SHIFT(99), +}; + +#ifdef __cplusplus +extern "C" { +#endif +#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_jdg(void) { + static const TSLanguage language = { + .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, + .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 = ts_lex_modes, + .lex_fn = ts_lex, + .keyword_lex_fn = ts_lex_keywords, + .keyword_capture_token = sym_identifier, + .primary_state_ids = ts_primary_state_ids, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/editor/zed/tree-sitter-jdg/src/tree_sitter/alloc.h b/editor/zed/tree-sitter-jdg/src/tree_sitter/alloc.h new file mode 100644 index 0000000..1f4466d --- /dev/null +++ b/editor/zed/tree-sitter-jdg/src/tree_sitter/alloc.h @@ -0,0 +1,54 @@ +#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); +extern void *(*ts_current_calloc)(size_t, size_t); +extern void *(*ts_current_realloc)(void *, size_t); +extern void (*ts_current_free)(void *); + +#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/editor/zed/tree-sitter-jdg/src/tree_sitter/array.h b/editor/zed/tree-sitter-jdg/src/tree_sitter/array.h new file mode 100644 index 0000000..15a3b23 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/src/tree_sitter/array.h @@ -0,0 +1,290 @@ +#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(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) \ + _array__reserve((Array *)(self), 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) _array__delete((Array *)(self)) + +/// Push a new `element` onto the end of the array. +#define array_push(self, element) \ + (_array__grow((Array *)(self), 1, array_elem_size(self)), \ + (self)->contents[(self)->size++] = (element)) + +/// Increase the array's size by `count` elements. +/// New elements are zero-initialized. +#define array_grow_by(self, count) \ + do { \ + if ((count) == 0) break; \ + _array__grow((Array *)(self), 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, contents) \ + _array__splice( \ + (Array *)(self), array_elem_size(self), (self)->size, \ + 0, count, 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) \ + _array__splice( \ + (Array *)(self), 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) \ + _array__splice((Array *)(self), 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((Array *)(self), 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) \ + _array__assign((Array *)(self), (const Array *)(other), array_elem_size(self)) + +/// Swap one array with another +#define array_swap(self, other) \ + _array__swap((Array *)(self), (Array *)(other)) + +/// 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 + +typedef Array(void) Array; + +/// This is not what you're looking for, see `array_delete`. +static inline void _array__delete(Array *self) { + if (self->contents) { + ts_free(self->contents); + self->contents = NULL; + self->size = 0; + self->capacity = 0; + } +} + +/// This is not what you're looking for, see `array_erase`. +static inline void _array__erase(Array *self, size_t element_size, + uint32_t index) { + assert(index < self->size); + char *contents = (char *)self->contents; + memmove(contents + index * element_size, contents + (index + 1) * element_size, + (self->size - index - 1) * element_size); + self->size--; +} + +/// This is not what you're looking for, see `array_reserve`. +static inline void _array__reserve(Array *self, size_t element_size, uint32_t new_capacity) { + if (new_capacity > self->capacity) { + if (self->contents) { + self->contents = ts_realloc(self->contents, new_capacity * element_size); + } else { + self->contents = ts_malloc(new_capacity * element_size); + } + self->capacity = new_capacity; + } +} + +/// This is not what you're looking for, see `array_assign`. +static inline void _array__assign(Array *self, const Array *other, size_t element_size) { + _array__reserve(self, element_size, other->size); + self->size = other->size; + memcpy(self->contents, other->contents, self->size * element_size); +} + +/// This is not what you're looking for, see `array_swap`. +static inline void _array__swap(Array *self, Array *other) { + Array swap = *other; + *other = *self; + *self = swap; +} + +/// This is not what you're looking for, see `array_push` or `array_grow_by`. +static inline void _array__grow(Array *self, uint32_t count, size_t element_size) { + uint32_t new_size = self->size + count; + if (new_size > self->capacity) { + uint32_t new_capacity = self->capacity * 2; + if (new_capacity < 8) new_capacity = 8; + if (new_capacity < new_size) new_capacity = new_size; + _array__reserve(self, element_size, new_capacity); + } +} + +/// This is not what you're looking for, see `array_splice`. +static inline void _array__splice(Array *self, size_t element_size, + uint32_t index, uint32_t old_count, + uint32_t new_count, const void *elements) { + uint32_t new_size = self->size + new_count - old_count; + uint32_t old_end = index + old_count; + uint32_t new_end = index + new_count; + assert(old_end <= self->size); + + _array__reserve(self, element_size, new_size); + + char *contents = (char *)self->contents; + if (self->size > old_end) { + memmove( + contents + new_end * element_size, + contents + old_end * element_size, + (self->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 + ); + } + } + self->size += new_count - old_count; +} + +/// 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(default : 4101) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_ARRAY_H_ diff --git a/editor/zed/tree-sitter-jdg/src/tree_sitter/parser.h b/editor/zed/tree-sitter-jdg/src/tree_sitter/parser.h new file mode 100644 index 0000000..17f0e94 --- /dev/null +++ b/editor/zed/tree-sitter-jdg/src/tree_sitter/parser.h @@ -0,0 +1,265 @@ +#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; +#endif + +typedef struct { + TSFieldId field_id; + uint8_t child_index; + bool inherited; +} TSFieldMapEntry; + +typedef struct { + uint16_t index; + uint16_t length; +} TSFieldMapSlice; + +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 *); +}; + +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 union { + TSParseAction action; + struct { + uint8_t count; + bool reusable; + } entry; +} TSParseActionEntry; + +typedef struct { + int32_t start; + int32_t end; +} TSCharacterRange; + +struct TSLanguage { + uint32_t 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 TSFieldMapSlice *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 TSLexMode *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; +}; + +static inline bool set_contains(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; + 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; + } + 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/example/showcase/05-pattern-expansion.jdg b/example/showcase/05-pattern-expansion.jdg index 6d14e48..faabaa8 100644 --- a/example/showcase/05-pattern-expansion.jdg +++ b/example/showcase/05-pattern-expansion.jdg @@ -1,11 +1,20 @@ -// Автогенерация тестов из папки с файлами. Удобно когда тестов много и -// вручную выписывать каждый через test("...") { stdin = ... stdout = ... } -// будет слишком громоздко. +// Автогенерация тестов из файлов/папок. Покрывает четыре типовых сценария: // -// Два режима: -// 1) file-glob — пары .in/.ans файлов -// 2) dir-mode — каждый тест лежит в своей подпапке с фиксированными -// именами input/output файлов +// 1. Stdio-режим с парой globs — классика: stdin из .in, stdout = .ans +// 2. Shared expected — N входов, один общий ожидаемый файл +// 3. File-mode по args — программа читает файл по аргументу +// 4. Dir-mode с input+output файлами — программа читает И пишет файлы +// +// Плейсхолдеры в `args` pattern'а: +// {input_path} — путь к input-файлу текущего теста (для glob — разный, +// для литерала — один и тот же во всех тестах) +// {output_path} — аналогично для output +// {name} — wildcard-часть имени (glob) или basename директории (dir) +// {dir} — dir-mode: полный путь к директории теста +// +// Правило режима: наличие `{input_path}` в args → input кладётся как InFile, +// а не в stdin. Наличие `{output_path}` → expected сравнивается как OutFile, +// а не stdout. toolchains { gcc { platforms = "linux" } @@ -19,11 +28,10 @@ build "release" { profile = release } -// Режим 1: глобы на input и output файлы. -// Тестом становится каждая пара (tests/*.in, tests/*.ans) с совпадающим -// базовым именем. Имя теста — имя файла без расширения. -group("from-files") { - weight = 0.5 +// 1) Классика: каждая пара (*.in, *.ans) → один тест. +// Stdin ← .in, Stdout сравнивается с .ans. +group("stdio-pair") { + weight = 0.25 pattern { input = "tests/*.in" @@ -31,22 +39,42 @@ group("from-files") { } } -// Режим 2: каждый тест — подкаталог с фиксированным layout'ом. -// Ожидается структура: -// cases/ -// 01-basic/ -// input.txt -// expected.txt -// 02-edge/ -// input.txt -// expected.txt -// Имя теста — имя подкаталога. -group("from-dirs") { - weight = 0.5 +// 2) Один общий expected для всех входов. +// Удобно для задач где «для любого корректного входа ответ одинаковый» +// (edge-case fuzzing) или наоборот «все некорректные входы → error» +// (смотрим на один и тот же файл с сообщением об ошибке). +group("shared-output") { + weight = 0.25 pattern { - dirs = "cases/*" - input = "input.txt" - output = "expected.txt" + input = "edge/*.in" + output = "edge/expected.ans" // литерал без * + } +} + +// 3) Программа читает файл по аргументу командной строки, а не из stdin. +// Expander создаёт InFiles[01.in]=..., запускает `./solution 01.in`, +// сравнивает stdout программы с содержимым соответствующего .ans. +group("file-input") { + weight = 0.25 + + pattern { + input = "file-tests/*.in" + output = "file-tests/*.ans" + args = "{input_path}" + } +} + +// 4) Программа и читает, и пишет через файлы — никакого stdin/stdout. +// Expander кладёт input в InFiles, expected в OutFiles, запускает +// `./solution in.txt out.txt` и сравнивает созданный out.txt с expected. +group("file-io") { + weight = 0.25 + + pattern { + dirs = "cases/*" // каждая подпапка — отдельный тест + input = "in.txt" + output = "out.txt" + args = "{input_path}" "{output_path}" } } diff --git a/example/showcase/07-include.jdg b/example/showcase/07-include.jdg new file mode 100644 index 0000000..08cf125 --- /dev/null +++ b/example/showcase/07-include.jdg @@ -0,0 +1,41 @@ +// Наследование общей конфигурации через `include`. Подключает соседний +// common.jdg (тулчейны + build_defaults + глобальные настройки), а затем +// задаёт только специфичные для этой задачи build-варианты и тесты. +// +// Пути в include относительны самому этому файлу (не CWD, не корню репо). +// Абсолютные пути тоже работают. Циклические включения детектятся парсером. +// +// Локальные директивы поверх include могут переопределять: +// - скаляры в build_defaults (через последующий build_defaults-блок) +// - timeout / memory_limit / binary / sources / normalize_crlf / trim_trailing_ws +// Но не могут переопределять: +// - toolchains с тем же именем (ошибка «duplicate toolchain») +// - build с тем же именем +// - group с тем же именем + +include "common.jdg" + +build "release" { + profile = release +} + +build "debug" { + profile = debug + warnings = pedantic +} + +build "sanitized" { + profile = sanitized + sanitize = "address" "undefined" + platforms = "linux" + compilers = "gcc" "clang" +} + +group("basic") { + weight = 1.0 + + test("smoke") { + stdin = "1\n42\n" + stdout = "42\n" + } +} diff --git a/example/showcase/common.jdg b/example/showcase/common.jdg new file mode 100644 index 0000000..e80fabc --- /dev/null +++ b/example/showcase/common.jdg @@ -0,0 +1,22 @@ +// Общая инфраструктура для всех задач курса: тулчейны и базовые настройки +// билда. Подключается через `include "common.jdg"` из конкретных .jdg +// файлов задач. Локальные build-блоки наследуют эти дефолты через +// встроенный merge в build_defaults. + +toolchains { + gcc { platforms = "linux" } + clang { platforms = "linux" "windows" } + msvc { platforms = "windows" } +} + +build_defaults { + language = "c" + standard = "c11" + sources = "solution.c" + output = "solution" + warnings = strict +} + +timeout 5s +normalize_crlf = true +trim_trailing_ws = true diff --git a/runner/expander.go b/runner/expander.go index 528ab32..0974cbc 100644 --- a/runner/expander.go +++ b/runner/expander.go @@ -16,47 +16,85 @@ func expandPattern(pattern *dsl.Pattern) ([]*dsl.Test, error) { return expandGlobPattern(pattern) } +type patternCase struct { + name string + inputPath string + outputPath string + dir string +} + func expandGlobPattern(pattern *dsl.Pattern) ([]*dsl.Test, error) { - inputFiles, err := filepath.Glob(pattern.InputGlob) - if err != nil { - return nil, fmt.Errorf("invalid input glob %q: %w", pattern.InputGlob, err) + inputIsGlob := strings.Contains(pattern.InputGlob, "*") + outputIsGlob := strings.Contains(pattern.OutputGlob, "*") + + if pattern.InputGlob == "" && pattern.OutputGlob == "" { + return nil, fmt.Errorf("pattern needs at least one of input/output/dirs") } - if len(inputFiles) == 0 { - return nil, fmt.Errorf("no files matched input glob %q", pattern.InputGlob) + if !inputIsGlob && !outputIsGlob { + return nil, fmt.Errorf("pattern needs at least one glob field (input or output must contain *)") } - inputPrefix, inputSuffix := splitGlob(pattern.InputGlob) - outputPrefix, outputSuffix := splitGlob(pattern.OutputGlob) + var cases []patternCase - var tests []*dsl.Test - for _, inputPath := range inputFiles { - wildcard := extractWildcard(inputPath, inputPrefix, inputSuffix) - outputPath := outputPrefix + wildcard + outputSuffix - - inputContent, err := os.ReadFile(inputPath) + switch { + case inputIsGlob && outputIsGlob: + inputFiles, err := filepath.Glob(pattern.InputGlob) if err != nil { - return nil, fmt.Errorf("read input %q: %w", inputPath, err) + return nil, fmt.Errorf("invalid input glob %q: %w", pattern.InputGlob, err) } - outputContent, err := os.ReadFile(outputPath) - if err != nil { - return nil, fmt.Errorf("read output %q: %w", outputPath, err) + if len(inputFiles) == 0 { + return nil, fmt.Errorf("no files matched input glob %q", pattern.InputGlob) + } + inputPrefix, inputSuffix := splitGlob(pattern.InputGlob) + outputPrefix, outputSuffix := splitGlob(pattern.OutputGlob) + for _, inputPath := range inputFiles { + wildcard := extractWildcard(inputPath, inputPrefix, inputSuffix) + outputPath := outputPrefix + wildcard + outputSuffix + cases = append(cases, patternCase{ + name: wildcard, + inputPath: inputPath, + outputPath: outputPath, + }) } - name := fmt.Sprintf("pattern:%s", wildcard) - stdin := string(inputContent) - expected := string(outputContent) + case inputIsGlob && !outputIsGlob: + inputFiles, err := filepath.Glob(pattern.InputGlob) + if err != nil { + return nil, fmt.Errorf("invalid input glob %q: %w", pattern.InputGlob, err) + } + if len(inputFiles) == 0 { + return nil, fmt.Errorf("no files matched input glob %q", pattern.InputGlob) + } + inputPrefix, inputSuffix := splitGlob(pattern.InputGlob) + for _, inputPath := range inputFiles { + wildcard := extractWildcard(inputPath, inputPrefix, inputSuffix) + cases = append(cases, patternCase{ + name: wildcard, + inputPath: inputPath, + outputPath: pattern.OutputGlob, + }) + } - tests = append(tests, &dsl.Test{ - Name: name, - Stdin: &stdin, - Env: map[string]string{}, - InFiles: map[string]string{}, - OutFiles: map[string]string{}, - Stdout: dsl.ExactMatcher{Value: expected}, - Stderr: dsl.NoMatcher{}, - }) + case !inputIsGlob && outputIsGlob: + outputFiles, err := filepath.Glob(pattern.OutputGlob) + if err != nil { + return nil, fmt.Errorf("invalid output glob %q: %w", pattern.OutputGlob, err) + } + if len(outputFiles) == 0 { + return nil, fmt.Errorf("no files matched output glob %q", pattern.OutputGlob) + } + outputPrefix, outputSuffix := splitGlob(pattern.OutputGlob) + for _, outputPath := range outputFiles { + wildcard := extractWildcard(outputPath, outputPrefix, outputSuffix) + cases = append(cases, patternCase{ + name: wildcard, + inputPath: pattern.InputGlob, + outputPath: outputPath, + }) + } } - return tests, nil + + return buildTests(cases, pattern.Args) } func expandDirPattern(pattern *dsl.Pattern) ([]*dsl.Test, error) { @@ -68,42 +106,96 @@ func expandDirPattern(pattern *dsl.Pattern) ([]*dsl.Test, error) { return nil, fmt.Errorf("no directories matched %q", pattern.DirsGlob) } - var tests []*dsl.Test + var cases []patternCase for _, dir := range dirs { info, err := os.Stat(dir) if err != nil || !info.IsDir() { continue } + cases = append(cases, patternCase{ + name: filepath.Base(dir), + inputPath: filepath.Join(dir, pattern.InputFile), + outputPath: filepath.Join(dir, pattern.OutputFile), + dir: dir, + }) + } + return buildTests(cases, pattern.Args) +} - inputPath := filepath.Join(dir, pattern.InputFile) - outputPath := filepath.Join(dir, pattern.OutputFile) +func buildTests(cases []patternCase, argTemplate []string) ([]*dsl.Test, error) { + useInputAsFile := argsContain(argTemplate, "{input_path}") + useOutputAsFile := argsContain(argTemplate, "{output_path}") - inputContent, err := os.ReadFile(inputPath) + var tests []*dsl.Test + for _, c := range cases { + inputContent, err := os.ReadFile(c.inputPath) if err != nil { - return nil, fmt.Errorf("read %q: %w", inputPath, err) + return nil, fmt.Errorf("read input %q: %w", c.inputPath, err) } - outputContent, err := os.ReadFile(outputPath) + outputContent, err := os.ReadFile(c.outputPath) if err != nil { - return nil, fmt.Errorf("read %q: %w", outputPath, err) + return nil, fmt.Errorf("read output %q: %w", c.outputPath, err) } - name := fmt.Sprintf("pattern:%s", filepath.Base(dir)) - stdin := string(inputContent) - expected := string(outputContent) - - tests = append(tests, &dsl.Test{ - Name: name, - Stdin: &stdin, + t := &dsl.Test{ + Name: fmt.Sprintf("pattern:%s", c.name), Env: map[string]string{}, InFiles: map[string]string{}, OutFiles: map[string]string{}, - Stdout: dsl.ExactMatcher{Value: expected}, Stderr: dsl.NoMatcher{}, - }) + } + + inputName := filepath.Base(c.inputPath) + outputName := filepath.Base(c.outputPath) + + if useInputAsFile { + t.InFiles[inputName] = string(inputContent) + } else { + s := string(inputContent) + t.Stdin = &s + } + + if useOutputAsFile { + t.OutFiles[outputName] = string(outputContent) + t.Stdout = dsl.NoMatcher{} + } else { + t.Stdout = dsl.ExactMatcher{Value: string(outputContent)} + } + + if len(argTemplate) > 0 { + t.Args = substituteArgs(argTemplate, map[string]string{ + "{input_path}": inputName, + "{output_path}": outputName, + "{name}": c.name, + "{dir}": c.dir, + }) + } + + tests = append(tests, t) } return tests, nil } +func argsContain(args []string, placeholder string) bool { + for _, a := range args { + if strings.Contains(a, placeholder) { + return true + } + } + return false +} + +func substituteArgs(template []string, vars map[string]string) []string { + out := make([]string, len(template)) + for i, a := range template { + for k, v := range vars { + a = strings.ReplaceAll(a, k, v) + } + out[i] = a + } + return out +} + func splitGlob(pattern string) (prefix, suffix string) { before, after, found := strings.Cut(pattern, "*") if !found { diff --git a/runner/expander_test.go b/runner/expander_test.go new file mode 100644 index 0000000..170ffba --- /dev/null +++ b/runner/expander_test.go @@ -0,0 +1,240 @@ +package runner + +import ( + "os" + "path/filepath" + "strings" + "testing" + + "github.com/Mond1c/judge/dsl" +) + +func writeFile(t *testing.T, dir, name, content string) { + t.Helper() + path := filepath.Join(dir, name) + if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(path, []byte(content), 0644); err != nil { + t.Fatal(err) + } +} + +func TestExpandGlobPairedStdioMode(t *testing.T) { + dir := t.TempDir() + writeFile(t, dir, "tests/01.in", "1 2 3\n") + writeFile(t, dir, "tests/01.ans", "6\n") + writeFile(t, dir, "tests/02.in", "10 20\n") + writeFile(t, dir, "tests/02.ans", "30\n") + + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + tests, err := expandPattern(&dsl.Pattern{ + InputGlob: "tests/*.in", + OutputGlob: "tests/*.ans", + }) + if err != nil { + t.Fatal(err) + } + if len(tests) != 2 { + t.Fatalf("expected 2 tests, got %d", len(tests)) + } + for _, tc := range tests { + if tc.Stdin == nil { + t.Errorf("%s: stdin should be set in stdio mode", tc.Name) + } + if len(tc.Args) != 0 { + t.Errorf("%s: args should be empty without template", tc.Name) + } + if _, ok := tc.Stdout.(dsl.ExactMatcher); !ok { + t.Errorf("%s: stdout should be ExactMatcher, got %T", tc.Name, tc.Stdout) + } + } +} + +func TestExpandGlobWithSharedOutput(t *testing.T) { + dir := t.TempDir() + writeFile(t, dir, "tests/01.in", "1\n") + writeFile(t, dir, "tests/02.in", "2\n") + writeFile(t, dir, "tests/03.in", "3\n") + writeFile(t, dir, "expected.ans", "ok\n") + + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + tests, err := expandPattern(&dsl.Pattern{ + InputGlob: "tests/*.in", + OutputGlob: "expected.ans", + }) + if err != nil { + t.Fatalf("expand: %v", err) + } + if len(tests) != 3 { + t.Fatalf("expected 3 tests, got %d", len(tests)) + } + for _, tc := range tests { + m, ok := tc.Stdout.(dsl.ExactMatcher) + if !ok { + t.Fatalf("%s: stdout should be ExactMatcher, got %T", tc.Name, tc.Stdout) + } + if m.Value != "ok\n" { + t.Errorf("%s: shared output = %q, want %q", tc.Name, m.Value, "ok\n") + } + } +} + +func TestExpandGlobFileModeInputOnly(t *testing.T) { + dir := t.TempDir() + writeFile(t, dir, "tests/01.in", "hello\n") + writeFile(t, dir, "tests/01.ans", "HELLO\n") + + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + tests, err := expandPattern(&dsl.Pattern{ + InputGlob: "tests/*.in", + OutputGlob: "tests/*.ans", + Args: []string{"{input_path}"}, + }) + if err != nil { + t.Fatal(err) + } + if len(tests) != 1 { + t.Fatalf("expected 1 test, got %d", len(tests)) + } + tc := tests[0] + if tc.Stdin != nil { + t.Errorf("stdin should be nil in file mode for input") + } + if content, ok := tc.InFiles["01.in"]; !ok || content != "hello\n" { + t.Errorf("InFiles[01.in] = %q, want %q", content, "hello\n") + } + if _, ok := tc.Stdout.(dsl.ExactMatcher); !ok { + t.Errorf("stdout should still be ExactMatcher when output not in file mode, got %T", tc.Stdout) + } + if len(tc.Args) != 1 || tc.Args[0] != "01.in" { + t.Errorf("args = %v, want [01.in]", tc.Args) + } +} + +func TestExpandGlobFileModeBoth(t *testing.T) { + dir := t.TempDir() + writeFile(t, dir, "tests/01.in", "1 2 3\n") + writeFile(t, dir, "tests/01.ans", "6\n") + + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + tests, err := expandPattern(&dsl.Pattern{ + InputGlob: "tests/*.in", + OutputGlob: "tests/*.ans", + Args: []string{"{input_path}", "{output_path}"}, + }) + if err != nil { + t.Fatal(err) + } + tc := tests[0] + if tc.Stdin != nil { + t.Error("stdin should be nil") + } + if _, ok := tc.Stdout.(dsl.NoMatcher); !ok { + t.Errorf("stdout should be NoMatcher when output is file, got %T", tc.Stdout) + } + if content := tc.OutFiles["01.ans"]; content != "6\n" { + t.Errorf("OutFiles[01.ans] = %q, want %q", content, "6\n") + } + if len(tc.Args) != 2 || tc.Args[0] != "01.in" || tc.Args[1] != "01.ans" { + t.Errorf("args = %v, want [01.in 01.ans]", tc.Args) + } +} + +func TestExpandGlobArgsWithStaticAndPlaceholders(t *testing.T) { + dir := t.TempDir() + writeFile(t, dir, "tests/01.in", "x\n") + writeFile(t, dir, "tests/01.ans", "x\n") + + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + tests, err := expandPattern(&dsl.Pattern{ + InputGlob: "tests/*.in", + OutputGlob: "tests/*.ans", + Args: []string{"--mode", "strict", "{input_path}"}, + }) + if err != nil { + t.Fatal(err) + } + if len(tests[0].Args) != 3 || tests[0].Args[0] != "--mode" || tests[0].Args[2] != "01.in" { + t.Errorf("args = %v", tests[0].Args) + } +} + +func TestExpandDirModeWithArgs(t *testing.T) { + dir := t.TempDir() + writeFile(t, dir, "cases/a/input.txt", "one\n") + writeFile(t, dir, "cases/a/expected.txt", "ONE\n") + writeFile(t, dir, "cases/b/input.txt", "two\n") + writeFile(t, dir, "cases/b/expected.txt", "TWO\n") + + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + tests, err := expandPattern(&dsl.Pattern{ + DirsGlob: "cases/*", + InputFile: "input.txt", + OutputFile: "expected.txt", + Args: []string{"{input_path}", "{output_path}"}, + }) + if err != nil { + t.Fatal(err) + } + if len(tests) != 2 { + t.Fatalf("expected 2 tests, got %d", len(tests)) + } + for _, tc := range tests { + if _, ok := tc.InFiles["input.txt"]; !ok { + t.Errorf("%s: missing InFiles[input.txt]", tc.Name) + } + if _, ok := tc.OutFiles["expected.txt"]; !ok { + t.Errorf("%s: missing OutFiles[expected.txt]", tc.Name) + } + if len(tc.Args) != 2 { + t.Errorf("%s: args = %v", tc.Name, tc.Args) + } + } +} + +func TestExpandPatternRejectsAllLiterals(t *testing.T) { + _, err := expandPattern(&dsl.Pattern{ + InputGlob: "tests/a.in", + OutputGlob: "tests/a.ans", + }) + if err == nil { + t.Fatal("expected error when no glob fields") + } + if !strings.Contains(err.Error(), "glob") { + t.Errorf("error %q does not mention glob", err.Error()) + } +} + +func TestExpandPatternNoMatches(t *testing.T) { + dir := t.TempDir() + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(dir) + + _, err := expandPattern(&dsl.Pattern{ + InputGlob: "missing/*.in", + OutputGlob: "missing/*.ans", + }) + if err == nil { + t.Fatal("expected error on zero matches") + } +}