-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump tree-sitter version and deal with arising issues (#297)
* Bump tree-sitter commit Problem: The commit used for tree-sitter is a bit old and it's desired to bump it up. Solution: Change the commit in the tree-sitter vendor directory to something more recent (v.19.5 release). * Remove ts_parser_halt_on_error Problem: After bumping the version up, build fails on ts_parser_halt_on_error. Solution: Remove this foreign import. * Bump submodules and deal with problems Problem: It's been a pretty long time since the previous bump, so we'd like to do it again, but this time, let's bump everything. This causes some trouble that we need to deal with, though. Solution: * Run `git submodule update --remote --merge --init` to bump submodules. * After this, running `cabal test all` has one failure. This is because the cursor size was increased from 24 to 32, so `sizeOfCursor` was updated accordingly. I took the liberty to fix a small typo in its documentation as well. * After this, I wanted to test tree-sitter. I found a demo in `tree-sitter-haskell` but noticed it was SEGFAULTing when running. I don't understand the cause, but I assume the Haskell tree-sitter grammar changed so this demo was no longer valid. I "fixed" it by checking the child at index 2 (bindings) rather than 3, since there is no index 3. I took the liberty to modernize it so warnings are gone too. * After that, I wanted to test a real-world tree-sitter contract. For that, I visited a pretty old commit of one of our Haskell projects that used tree-sitter (nowadays it doesn't use it anymore), pointed it to my local branch of `haskell-tree-sitter`, and tried to build it. * First, it failed because `nodeIsMissing` wasn't present. Curiously, I couldn't find it in the branch it was previously using either, but it may be trivially added to `Node` using the `tree-sitter` API if desired, but I didn't bother. I removed its usage from the Haskell project and continued with life. * It also complained that `tree_sitter/parser.h` was missing. Indeed, it was deleted from the tree-sitter repository, so I removed it from the Cabal file. * With those changes, the project compiled was able to successfully parse a test file for CameLIGO. * n.b.: I didn't check each tree-sitter-* directory, just the haskell one as it had a demo, so it's possible there are other failures I'm unaware. * Make grammars compile Problem: Note all tree-sitter-* dirs are compiling. Solution: Some of them had updated files or paths, so fix them accordingly in the Cabal file. Change their .hs files accordingly. * Fix some more paths Problem: I forgot some paths in Cabal for OCaml and PHP. Solution: Fix their paths to the updated ones. * Run Build & test commands locally; fix issues Problem: CI still fails. Solution: Run the Build & test commands locally, fix remaining paths...
- Loading branch information
1 parent
011482f
commit 7ee9c17
Showing
34 changed files
with
53 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-c-sharp
updated
101 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-go
updated
58 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-haskell
updated
124 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-java
updated
59 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-json
updated
45 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-nix
updated
from 791b5f to 0fdada
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ maintainer: [email protected] | |
copyright: 2020 GitHub, Anton Kochkov | ||
category: Tree-sitter, OCaml | ||
build-type: Simple | ||
data-files: vendor/tree-sitter-ocaml/src/node-types.json | ||
, vendor/tree-sitter-ocaml/corpus/*.txt | ||
data-files: vendor/tree-sitter-ocaml/grammars/ocaml/src/node-types.json | ||
, vendor/tree-sitter-ocaml/grammars/ocaml/test/corpus/*.txt | ||
extra-source-files: ChangeLog.md | ||
|
||
common common | ||
|
@@ -46,10 +46,10 @@ library | |
other-modules: Paths_tree_sitter_ocaml | ||
build-depends: base >= 4.12 && < 5 | ||
, tree-sitter ^>= 0.9.0.0 | ||
Include-dirs: vendor/tree-sitter-ocaml/src | ||
Include-dirs: vendor/tree-sitter-ocaml/grammars/ocaml/src | ||
install-includes: tree_sitter/parser.h | ||
c-sources: vendor/tree-sitter-ocaml/src/parser.c | ||
, vendor/tree-sitter-ocaml/src/scanner.cc | ||
c-sources: vendor/tree-sitter-ocaml/grammars/ocaml/src/parser.c | ||
, vendor/tree-sitter-ocaml/grammars/ocaml/src/scanner.c | ||
extra-libraries: stdc++ | ||
|
||
source-repository head | ||
|
Submodule tree-sitter-ocaml
updated
122 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ maintainer: [email protected] | |
copyright: 2019 GitHub | ||
category: Tree-sitter, PHP | ||
build-type: Simple | ||
data-files: vendor/tree-sitter-php/src/node-types.json | ||
data-files: vendor/tree-sitter-php/php/src/node-types.json | ||
extra-source-files: ChangeLog.md | ||
|
||
common common | ||
|
@@ -46,10 +46,10 @@ library | |
other-modules: Paths_tree_sitter_php | ||
build-depends: base >= 4.12 && < 5 | ||
, tree-sitter | ||
include-dirs: vendor/tree-sitter-php/src | ||
include-dirs: vendor/tree-sitter-php/php/src | ||
install-includes: tree_sitter/parser.h | ||
c-sources: vendor/tree-sitter-php/src/parser.c | ||
, vendor/tree-sitter-php/src/scanner.cc | ||
c-sources: vendor/tree-sitter-php/php/src/parser.c | ||
, vendor/tree-sitter-php/php/src/scanner.c | ||
extra-libraries: stdc++ | ||
|
||
source-repository head | ||
|
Submodule tree-sitter-php
updated
95 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-python
updated
60 files
Submodule tree-sitter-ql
updated
57 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-ruby
updated
66 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-rust
updated
73 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-typescript
updated
85 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter-typescript
updated
85 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule tree-sitter
updated
402 files