-
Notifications
You must be signed in to change notification settings - Fork 0
/
testlang.go
48 lines (39 loc) · 991 Bytes
/
testlang.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package errgoengine
import (
"context"
"github.com/smacker/go-tree-sitter/python"
)
var TestLanguage = &Language{
Name: "TestLang",
FilePatterns: []string{".test"},
SitterLanguage: python.GetLanguage(),
StackTracePattern: `\sin (?P<symbol>\S+) at (?P<path>\S+):(?P<position>\d+)`,
AnalyzerFactory: func(cd *ContextData) LanguageAnalyzer {
return &testAnalyzer{}
},
SymbolsToCapture: `
(expression_statement
(assignment
left: (identifier) @assignment.name
right: (identifier) @assignment.content) @assignment)
`,
}
type testAnalyzer struct {
*ContextData
}
func (an *testAnalyzer) FallbackSymbol() Symbol {
return Builtin("any")
}
func (an *testAnalyzer) FindSymbol(name string) Symbol {
return nil
}
func (an *testAnalyzer) AnalyzeNode(_ context.Context, n SyntaxNode) Symbol {
// TODO:
return Builtin("void")
}
func (an *testAnalyzer) AnalyzeImport(params ImportParams) ResolvedImport {
// TODO:
return ResolvedImport{
Path: "",
}
}