Skip to content

Commit

Permalink
json: Update to latest grammar, fix binding test (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
deequez authored Oct 25, 2023
1 parent 08d457e commit 1bba711
Show file tree
Hide file tree
Showing 4 changed files with 506 additions and 409 deletions.
2 changes: 1 addition & 1 deletion _automation/grammars.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"parser.c"
],
"reference": "master",
"revision": "40a81c01a40ac48744e0c8ccabbaba1920441199"
"revision": "3fef30de8aee74600f25ec2e319b62a1a870d51e"
},
{
"language": "kotlin",
Expand Down
5 changes: 3 additions & 2 deletions json/binding_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package json
package json_test

import (
"context"
"testing"

sitter "github.com/codepen/go-tree-sitter"
"github.com/codepen/go-tree-sitter/json"
"github.com/stretchr/testify/assert"
)

Expand All @@ -31,7 +32,7 @@ func TestGrammar(t *testing.T) {
}
`

n, err := sitter.ParseCtx(context.Background(), []byte(code), GetLanguage())
n, err := sitter.ParseCtx(context.Background(), []byte(code), json.GetLanguage())
assert.NoError(err)
assert.Equal(
"(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))))",
Expand Down
Loading

0 comments on commit 1bba711

Please sign in to comment.