-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dcac54
commit e0ab53d
Showing
36 changed files
with
589 additions
and
687 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
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
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 |
---|---|---|
@@ -1,37 +1,42 @@ | ||
package tree_sitter_fsharp_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
tree_sitter "github.com/smacker/go-tree-sitter" | ||
tree_sitter_fsharp "github.com/ionide/tree-sitter-fsharp" | ||
tree_sitter "github.com/tree-sitter/go-tree-sitter" | ||
tree_sitter_fsharp "github.com/tree-sitter/tree-sitter-fsharp/bindings/go" | ||
) | ||
|
||
func TestFSharpGrammar(t *testing.T) { | ||
language := tree_sitter.NewLanguage(tree_sitter_fsharp.FSharp()) | ||
language := tree_sitter.NewLanguage(tree_sitter_fsharp.LanguageFSharp()) | ||
if language == nil { | ||
t.Errorf("Error loading FSharp grammar") | ||
} | ||
|
||
sourceCode := []byte("module M = ()") | ||
parser := tree_sitter.NewParser() | ||
defer parser.Close() | ||
parser.SetLanguage(language) | ||
|
||
node, err := tree_sitter.ParseCtx(context.Background(), sourceCode, language) | ||
if err != nil || node.HasError() { | ||
tree := parser.Parse(sourceCode, nil) | ||
if tree == nil || tree.RootNode().HasError() { | ||
t.Errorf("Error parsing FSharp") | ||
} | ||
} | ||
|
||
func TestFSharpSignatureGrammar(t *testing.T) { | ||
language := tree_sitter.NewLanguage(tree_sitter_fsharp.FSharpSignature()) | ||
language := tree_sitter.NewLanguage(tree_sitter_fsharp.LanguageFSharpSignature()) | ||
if language == nil { | ||
t.Errorf("Error loading FSharpSignature grammar") | ||
} | ||
|
||
sourceCode := []byte("val x : int -> int") | ||
parser := tree_sitter.NewParser() | ||
defer parser.Close() | ||
parser.SetLanguage(language) | ||
|
||
node, err := tree_sitter.ParseCtx(context.Background(), sourceCode, language) | ||
if err != nil || node.HasError() { | ||
tree := parser.Parse(sourceCode, nil) | ||
if tree == nil || tree.RootNode().HasError() { | ||
t.Errorf("Error parsing FSharpSignature") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.