Skip to content

Commit 1de8ebd

Browse files
committed
Update dump tests + add more after expr overhaul in tree sitter grammar
1 parent 6cf566e commit 1de8ebd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5699
-2300
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea/
22
/test/dumps/actual/
33
/test/dumps/cases/sandbox.dump
4+
.DS_Store
45

56
### Generated gitignore below ###
67

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module github.com/amterp/rts
33
go 1.23.4
44

55
require (
6-
github.com/amterp/tree-sitter-rsl v0.0.24
6+
github.com/amterp/tree-sitter-rsl v0.0.25
77
github.com/fatih/color v1.18.0
8-
github.com/tree-sitter/go-tree-sitter v0.24.0
8+
github.com/tree-sitter/go-tree-sitter v0.25.0
99
)
1010

1111
require (

go.sum

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/amterp/tree-sitter-rsl v0.0.24 h1:AwVoocmD4CHBxLHb5Ny30Ffk9H4tITmvxT4ZQV9RL/8=
2-
github.com/amterp/tree-sitter-rsl v0.0.24/go.mod h1:mI2TUxkQL+7CCjrMdU5TA5xy6W1LB6mpCmyy7sDUFCY=
1+
github.com/amterp/tree-sitter-rsl v0.0.25 h1:M1W4Z8Vrb8Pt5tuyr7Tf2ofOmt9jRndRZNrN/czTrY4=
2+
github.com/amterp/tree-sitter-rsl v0.0.25/go.mod h1:mI2TUxkQL+7CCjrMdU5TA5xy6W1LB6mpCmyy7sDUFCY=
33
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
@@ -13,34 +13,34 @@ github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o
1313
github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc=
1414
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1515
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
16-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
17-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
18-
github.com/tree-sitter/go-tree-sitter v0.24.0 h1:kRZb6aBNfcI/u0Qh8XEt3zjNVnmxTisDBN+kXK0xRYQ=
19-
github.com/tree-sitter/go-tree-sitter v0.24.0/go.mod h1:x681iFVoLMEwOSIHA1chaLkXlroXEN7WY+VHGFaoDbk=
20-
github.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb h1:A8425heRM8mylnv4H58FPUiH+aYivyitre0PzxrfmWs=
21-
github.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb/go.mod h1:dOF6gtQiF9UwNh995T5OphYmtIypkjsp3ap7r9AN/iA=
22-
github.com/tree-sitter/tree-sitter-cpp v0.22.4-0.20240818224355-b1a4e2b25148 h1:AfFPZwtwGN01BW1jDdqBVqscTwetvMpydqYZz57RSlc=
23-
github.com/tree-sitter/tree-sitter-cpp v0.22.4-0.20240818224355-b1a4e2b25148/go.mod h1:Bh6U3viD57rFXRYIQ+kmiYtr+1Bx0AceypDLJJSyi9s=
24-
github.com/tree-sitter/tree-sitter-embedded-template v0.21.1-0.20240819044651-ffbf64942c33 h1:TwqSV3qLp3tKSqirGLRHnjFk9Tc2oy57LIl+FQ4GjI4=
25-
github.com/tree-sitter/tree-sitter-embedded-template v0.21.1-0.20240819044651-ffbf64942c33/go.mod h1:CvCKCt3v04Ufos1zZnNCelBDeCGRpPucaN8QczoUsN4=
26-
github.com/tree-sitter/tree-sitter-go v0.21.3-0.20240818010209-8c0f0e7a6012 h1:Xvxck3tE5FW7F7bTS97iNM2ADMyCMJztVqn5HYKdJGo=
27-
github.com/tree-sitter/tree-sitter-go v0.21.3-0.20240818010209-8c0f0e7a6012/go.mod h1:T40D0O1cPvUU/+AmiXVXy1cncYQT6wem4Z0g4SfAYvY=
28-
github.com/tree-sitter/tree-sitter-html v0.20.5-0.20240818004741-d11201a263d0 h1:c46K6uh5Dz00zJeU9BfjXdb8I+E4RkUdfnWJpQADXFo=
29-
github.com/tree-sitter/tree-sitter-html v0.20.5-0.20240818004741-d11201a263d0/go.mod h1:hcNt/kOJHcIcuMvouE7LJcYdeFUFbVpBJ6d4wmOA+tU=
30-
github.com/tree-sitter/tree-sitter-java v0.21.1-0.20240824015150-576d8097e495 h1:jrt4qbJVEFs4H93/ITxygHc6u0TGqAkkate7TQ4wFSA=
31-
github.com/tree-sitter/tree-sitter-java v0.21.1-0.20240824015150-576d8097e495/go.mod h1:oyaR7fLnRV0hT9z6qwE9GkaeTom/hTDwK3H2idcOJFc=
32-
github.com/tree-sitter/tree-sitter-javascript v0.21.5-0.20240818005344-15887341e5b5 h1:om4X9AVg3asL8gxNJDcz4e/Wp+VpQj1PY3uJXKr6EOg=
33-
github.com/tree-sitter/tree-sitter-javascript v0.21.5-0.20240818005344-15887341e5b5/go.mod h1:nNqgPoV/h9uYWk6kYEFdEAhNVOacpfpRW5SFmdaP4tU=
34-
github.com/tree-sitter/tree-sitter-json v0.21.1-0.20240818005659-bdd69eb8c8a5 h1:pfV3G3k7NCKqKk8THBmyuh2zA33lgYHS3GVrzRR8ry4=
35-
github.com/tree-sitter/tree-sitter-json v0.21.1-0.20240818005659-bdd69eb8c8a5/go.mod h1:GbMKRjLfk0H+PI7nLi1Sx5lHf5wCpLz9al8tQYSxpEk=
36-
github.com/tree-sitter/tree-sitter-php v0.22.9-0.20240819002312-a552625b56c1 h1:ZXZMDwE+IhUtGug4Brv6NjJWUU3rfkZBKpemf6RY8/g=
37-
github.com/tree-sitter/tree-sitter-php v0.22.9-0.20240819002312-a552625b56c1/go.mod h1:UKCLuYnJ312Mei+3cyTmGOHzn0YAnaPRECgJmHtzrqs=
38-
github.com/tree-sitter/tree-sitter-python v0.21.1-0.20240818005537-55a9b8a4fbfb h1:EXEM82lFM7JjJb6qiKZXkpIDaCcbV2obNn82ghwj9lw=
39-
github.com/tree-sitter/tree-sitter-python v0.21.1-0.20240818005537-55a9b8a4fbfb/go.mod h1:lXCF1nGG5Dr4J3BTS0ObN4xJCCICiSu/b+Xe/VqMV7g=
40-
github.com/tree-sitter/tree-sitter-ruby v0.21.1-0.20240818211811-7dbc1e2d0e2d h1:fcYCvoXdcP1uRQYXqJHRy6Hec+uKScQdKVtMwK9JeCI=
41-
github.com/tree-sitter/tree-sitter-ruby v0.21.1-0.20240818211811-7dbc1e2d0e2d/go.mod h1:T1nShQ4v5AJtozZ8YyAS4uzUtDAJj/iv4YfwXSbUHzg=
42-
github.com/tree-sitter/tree-sitter-rust v0.21.3-0.20240818005432-2b43eafe6447 h1:o9alBu1J/WjrcTKEthYtXmdkDc5OVXD+PqlvnEZ0Lzc=
43-
github.com/tree-sitter/tree-sitter-rust v0.21.3-0.20240818005432-2b43eafe6447/go.mod h1:1Oh95COkkTn6Ezp0vcMbvfhRP5gLeqqljR0BYnBzWvc=
16+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
17+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
18+
github.com/tree-sitter/go-tree-sitter v0.25.0 h1:sx6kcg8raRFCvc9BnXglke6axya12krCJF5xJ2sftRU=
19+
github.com/tree-sitter/go-tree-sitter v0.25.0/go.mod h1:r77ig7BikoZhHrrsjAnv8RqGti5rtSyvDHPzgTPsUuU=
20+
github.com/tree-sitter/tree-sitter-c v0.23.4 h1:nBPH3FV07DzAD7p0GfNvXM+Y7pNIoPenQWBpvM++t4c=
21+
github.com/tree-sitter/tree-sitter-c v0.23.4/go.mod h1:MkI5dOiIpeN94LNjeCp8ljXN/953JCwAby4bClMr6bw=
22+
github.com/tree-sitter/tree-sitter-cpp v0.23.4 h1:LaWZsiqQKvR65yHgKmnaqA+uz6tlDJTJFCyFIeZU/8w=
23+
github.com/tree-sitter/tree-sitter-cpp v0.23.4/go.mod h1:doqNW64BriC7WBCQ1klf0KmJpdEvfxyXtoEybnBo6v8=
24+
github.com/tree-sitter/tree-sitter-embedded-template v0.23.2 h1:nFkkH6Sbe56EXLmZBqHHcamTpmz3TId97I16EnGy4rg=
25+
github.com/tree-sitter/tree-sitter-embedded-template v0.23.2/go.mod h1:HNPOhN0qF3hWluYLdxWs5WbzP/iE4aaRVPMsdxuzIaQ=
26+
github.com/tree-sitter/tree-sitter-go v0.23.4 h1:yt5KMGnTHS+86pJmLIAZMWxukr8W7Ae1STPvQUuNROA=
27+
github.com/tree-sitter/tree-sitter-go v0.23.4/go.mod h1:Jrx8QqYN0v7npv1fJRH1AznddllYiCMUChtVjxPK040=
28+
github.com/tree-sitter/tree-sitter-html v0.23.2 h1:1UYDV+Yd05GGRhVnTcbP58GkKLSHHZwVaN+lBZV11Lc=
29+
github.com/tree-sitter/tree-sitter-html v0.23.2/go.mod h1:gpUv/dG3Xl/eebqgeYeFMt+JLOY9cgFinb/Nw08a9og=
30+
github.com/tree-sitter/tree-sitter-java v0.23.5 h1:J9YeMGMwXYlKSP3K4Us8CitC6hjtMjqpeOf2GGo6tig=
31+
github.com/tree-sitter/tree-sitter-java v0.23.5/go.mod h1:NRKlI8+EznxA7t1Yt3xtraPk1Wzqh3GAIC46wxvc320=
32+
github.com/tree-sitter/tree-sitter-javascript v0.23.1 h1:1fWupaRC0ArlHJ/QJzsfQ3Ibyopw7ZfQK4xXc40Zveo=
33+
github.com/tree-sitter/tree-sitter-javascript v0.23.1/go.mod h1:lmGD1EJdCA+v0S1u2fFgepMg/opzSg/4pgFym2FPGAs=
34+
github.com/tree-sitter/tree-sitter-json v0.24.8 h1:tV5rMkihgtiOe14a9LHfDY5kzTl5GNUYe6carZBn0fQ=
35+
github.com/tree-sitter/tree-sitter-json v0.24.8/go.mod h1:F351KK0KGvCaYbZ5zxwx/gWWvZhIDl0eMtn+1r+gQbo=
36+
github.com/tree-sitter/tree-sitter-php v0.23.11 h1:iHewsLNDmznh8kgGyfWfujsZxIz1YGbSd2ZTEM0ZiP8=
37+
github.com/tree-sitter/tree-sitter-php v0.23.11/go.mod h1:T/kbfi+UcCywQfUNAJnGTN/fMSUjnwPXA8k4yoIks74=
38+
github.com/tree-sitter/tree-sitter-python v0.23.6 h1:qHnWFR5WhtMQpxBZRwiaU5Hk/29vGju6CVtmvu5Haas=
39+
github.com/tree-sitter/tree-sitter-python v0.23.6/go.mod h1:cpdthSy/Yoa28aJFBscFHlGiU+cnSiSh1kuDVtI8YeM=
40+
github.com/tree-sitter/tree-sitter-ruby v0.23.1 h1:T/NKHUA+iVbHM440hFx+lzVOzS4dV6z8Qw8ai+72bYo=
41+
github.com/tree-sitter/tree-sitter-ruby v0.23.1/go.mod h1:kUS4kCCQloFcdX6sdpr8p6r2rogbM6ZjTox5ZOQy8cA=
42+
github.com/tree-sitter/tree-sitter-rust v0.23.2 h1:6AtoooCW5GqNrRpfnvl0iUhxTAZEovEmLKDbyHlfw90=
43+
github.com/tree-sitter/tree-sitter-rust v0.23.2/go.mod h1:hfeGWic9BAfgTrc7Xf6FaOAguCFJRo3RBbs7QJ6D7MI=
4444
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4545
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4646
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=

test/dumps/cases/args_constraints.dump

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ B: [179, 180] PS: [8, 0], PE: [8, 1] left: var_path
7777
B: [179, 180] PS: [8, 0], PE: [8, 1] root: identifier `a`
7878
B: [181, 182] PS: [8, 2], PE: [8, 3] = `=`
7979
B: [183, 184] PS: [8, 4], PE: [8, 5] right: expr
80-
B: [183, 184] PS: [8, 4], PE: [8, 5] base: primary_expr
81-
B: [183, 184] PS: [8, 4], PE: [8, 5] literal
82-
B: [183, 184] PS: [8, 4], PE: [8, 5] int `2`
80+
B: [183, 184] PS: [8, 4], PE: [8, 5] ternary_expr
81+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: or_expr
82+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: and_expr
83+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: compare_expr
84+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: add_expr
85+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: mult_expr
86+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: unary_expr
87+
B: [183, 184] PS: [8, 4], PE: [8, 5] delegate: indexed_expr
88+
B: [183, 184] PS: [8, 4], PE: [8, 5] root: primary_expr
89+
B: [183, 184] PS: [8, 4], PE: [8, 5] literal
90+
B: [183, 184] PS: [8, 4], PE: [8, 5] int `2`

test/dumps/cases/args_decl.dump

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ B: [49, 50] PS: [3, 0], PE: [3, 1] left: var_path
2525
B: [49, 50] PS: [3, 0], PE: [3, 1] root: identifier `a`
2626
B: [51, 52] PS: [3, 2], PE: [3, 3] = `=`
2727
B: [53, 54] PS: [3, 4], PE: [3, 5] right: expr
28-
B: [53, 54] PS: [3, 4], PE: [3, 5] base: primary_expr
29-
B: [53, 54] PS: [3, 4], PE: [3, 5] literal
30-
B: [53, 54] PS: [3, 4], PE: [3, 5] int `2`
28+
B: [53, 54] PS: [3, 4], PE: [3, 5] ternary_expr
29+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: or_expr
30+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: and_expr
31+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: compare_expr
32+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: add_expr
33+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: mult_expr
34+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: unary_expr
35+
B: [53, 54] PS: [3, 4], PE: [3, 5] delegate: indexed_expr
36+
B: [53, 54] PS: [3, 4], PE: [3, 5] root: primary_expr
37+
B: [53, 54] PS: [3, 4], PE: [3, 5] literal
38+
B: [53, 54] PS: [3, 4], PE: [3, 5] int `2`

test/dumps/cases/args_decl_complete.dump

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ B: [130, 131] PS: [5, 0], PE: [5, 1] left: var_path
5959
B: [130, 131] PS: [5, 0], PE: [5, 1] root: identifier `a`
6060
B: [132, 133] PS: [5, 2], PE: [5, 3] = `=`
6161
B: [134, 135] PS: [5, 4], PE: [5, 5] right: expr
62-
B: [134, 135] PS: [5, 4], PE: [5, 5] base: primary_expr
63-
B: [134, 135] PS: [5, 4], PE: [5, 5] literal
64-
B: [134, 135] PS: [5, 4], PE: [5, 5] int `2`
62+
B: [134, 135] PS: [5, 4], PE: [5, 5] ternary_expr
63+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: or_expr
64+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: and_expr
65+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: compare_expr
66+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: add_expr
67+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: mult_expr
68+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: unary_expr
69+
B: [134, 135] PS: [5, 4], PE: [5, 5] delegate: indexed_expr
70+
B: [134, 135] PS: [5, 4], PE: [5, 5] root: primary_expr
71+
B: [134, 135] PS: [5, 4], PE: [5, 5] literal
72+
B: [134, 135] PS: [5, 4], PE: [5, 5] int `2`

0 commit comments

Comments
 (0)