diff --git a/Development.md b/Development.md index fb0518d8..11338fed 100644 --- a/Development.md +++ b/Development.md @@ -37,9 +37,9 @@ For the Haskell bindings, see `bindings/haskell/README.md`. You can also run the same script in a pre-configured Docker environment, - by running `./dev/proto-generate-in-docker.sh` - this command will - build the environment and run ./dev/proto-generate.sh script. The only - dependency you need is Docker. + by running `./dev/generate-all-in-docker.sh` - this command will + build the environment and generate both the proto bindings, and the reprolang + parser generation. The only dependency you need is Docker. 2. Regenerating snapshots after making changes to the CLI. ``` diff --git a/Dockerfile.bindings b/Dockerfile.bindings index 477d5c7c..5fbc3d4d 100644 --- a/Dockerfile.bindings +++ b/Dockerfile.bindings @@ -40,6 +40,6 @@ RUN asdf install && \ WORKDIR /src -ENTRYPOINT ["./dev/proto-generate.sh"] +CMD ["bash", "-c", "./dev/proto-generate.sh && ./cmd/scip/tests/reprolang/generate-tree-sitter-parser.sh"] diff --git a/cmd/scip/tests/reprolang/src/parser.c b/cmd/scip/tests/reprolang/src/parser.c index e69f026c..9935f8ff 100644 --- a/cmd/scip/tests/reprolang/src/parser.c +++ b/cmd/scip/tests/reprolang/src/parser.c @@ -5,7 +5,7 @@ #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif -#define LANGUAGE_VERSION 13 +#define LANGUAGE_VERSION 14 #define STATE_COUNT 41 #define LARGE_STATE_COUNT 2 #define SYMBOL_COUNT 33 @@ -327,6 +327,50 @@ 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, +}; + static bool ts_lex(TSLexer *lexer, TSStateId state) { START_LEXER(); eof = lexer->eof(lexer); @@ -1616,6 +1660,7 @@ extern const TSLanguage *tree_sitter_reprolang(void) { .lex_fn = ts_lex, .keyword_lex_fn = ts_lex_keywords, .keyword_capture_token = sym_workspace_identifier, + .primary_state_ids = ts_primary_state_ids, }; return &language; } diff --git a/dev/proto-generate-in-docker.sh b/dev/build-docker-environment.sh similarity index 61% rename from dev/proto-generate-in-docker.sh rename to dev/build-docker-environment.sh index f6615803..c85d9d0e 100755 --- a/dev/proto-generate-in-docker.sh +++ b/dev/build-docker-environment.sh @@ -6,5 +6,4 @@ cd "$(dirname "${BASH_SOURCE[0]}")/.." # cd to repo root dir IMAGE_NAME="sourcegraph/scip-bindings-env" -docker build . -t $IMAGE_NAME -f Dockerfile.bindings -docker run -v $(pwd):/src $IMAGE_NAME +docker build . -t $IMAGE_NAME -f Dockerfile.bindings && echo $IMAGE_NAME diff --git a/dev/generate-all-in-docker.sh b/dev/generate-all-in-docker.sh new file mode 100755 index 00000000..c0cfb2ed --- /dev/null +++ b/dev/generate-all-in-docker.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -xeuo pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")/.." # cd to repo root dir + +IMAGE_NAME=$(./dev/build-docker-environment.sh) + +docker run -it -v $(pwd):/src $IMAGE_NAME + diff --git a/yarn.lock b/yarn.lock index 62cbfefd..093aa2a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27,10 +27,10 @@ protoc-gen-ts@0.8.6: resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.8.6.tgz#e789a6fc3fbe09bdc119acecc349b9554ec5940e" integrity sha512-66oeorGy4QBvYjQGd/gaeOYyFqKyRmRgTpofmnw8buMG0P7A0jQjoKSvKJz5h5tNUaVkIzvGBUTRVGakrhhwpA== -tree-sitter-cli@^0.20.4: - version "0.20.6" - resolved "https://registry.yarnpkg.com/tree-sitter-cli/-/tree-sitter-cli-0.20.6.tgz#2a7202190d7bd64e112b451f94573dbe40a04f04" - integrity sha512-tjbAeuGSMhco/EnsThjWkQbDIYMDmdkWsTPsa/NJAW7bjaki9P7oM9TkLxfdlnm4LXd1wR5wVSM2/RTLtZbm6A== +tree-sitter-cli@^0.20.8: + version "0.20.8" + resolved "https://registry.yarnpkg.com/tree-sitter-cli/-/tree-sitter-cli-0.20.8.tgz#06a81cea8d6d82f93d67eed7d28b6bc04a4a8916" + integrity sha512-XjTcS3wdTy/2cc/ptMLc/WRyOLECRYcMTrSWyhZnj1oGSOWbHLTklgsgRICU3cPfb0vy+oZCC33M43u6R1HSCA== typescript@^4.9.0: version "4.9.5"