Skip to content

Commit 1bba711

Browse files
authored
json: Update to latest grammar, fix binding test (#23)
1 parent 08d457e commit 1bba711

File tree

4 files changed

+506
-409
lines changed

4 files changed

+506
-409
lines changed

_automation/grammars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"parser.c"
154154
],
155155
"reference": "master",
156-
"revision": "40a81c01a40ac48744e0c8ccabbaba1920441199"
156+
"revision": "3fef30de8aee74600f25ec2e319b62a1a870d51e"
157157
},
158158
{
159159
"language": "kotlin",

json/binding_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package json
1+
package json_test
22

33
import (
44
"context"
55
"testing"
66

77
sitter "github.com/codepen/go-tree-sitter"
8+
"github.com/codepen/go-tree-sitter/json"
89
"github.com/stretchr/testify/assert"
910
)
1011

@@ -31,7 +32,7 @@ func TestGrammar(t *testing.T) {
3132
}
3233
`
3334

34-
n, err := sitter.ParseCtx(context.Background(), []byte(code), GetLanguage())
35+
n, err := sitter.ParseCtx(context.Background(), []byte(code), json.GetLanguage())
3536
assert.NoError(err)
3637
assert.Equal(
3738
"(document (object (pair key: (string (string_content)) value: (string (string_content))) (pair key: (string (string_content)) value: (string (string_content))) (pair key: (string (string_content)) value: (object (pair key: (string (string_content)) value: (string (string_content))))) (pair key: (string (string_content)) value: (string (string_content))) (pair key: (string (string_content)) value: (string (string_content))) (pair key: (string (string_content)) value: (object (pair key: (string (string_content)) value: (string (string_content))))) (pair key: (string (string_content)) value: (object (pair key: (string (string_content)) value: (string (string_content))) (pair key: (string (string_content)) value: (string (string_content))))) (pair key: (string (string_content)) value: (true))))",

0 commit comments

Comments
 (0)