ttsc 0.3.1 → 0.4.0-dev.20260425
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +93 -362
- package/cmd/ttsc/build.go +128 -0
- package/cmd/ttsc/main.go +222 -0
- package/cmd/ttsc/main_test.go +288 -0
- package/cmd/ttsc/transform.go +166 -0
- package/driver/host.go +31 -0
- package/driver/program.go +298 -0
- package/driver/rewrite.go +315 -0
- package/go.mod +48 -0
- package/go.sum +22 -0
- package/lib/api.d.ts +91 -0
- package/lib/api.js +325 -0
- package/lib/api.js.map +1 -0
- package/lib/cli.d.ts +1 -0
- package/lib/cli.js +481 -0
- package/lib/cli.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +35 -0
- package/lib/index.js.map +1 -0
- package/lib/native.d.ts +15 -0
- package/lib/native.js +34 -0
- package/lib/native.js.map +1 -0
- package/lib/platform.d.ts +66 -0
- package/lib/platform.js +170 -0
- package/lib/platform.js.map +1 -0
- package/lib/plugin.d.ts +47 -0
- package/lib/plugin.js +150 -0
- package/lib/plugin.js.map +1 -0
- package/lib/project.d.ts +32 -0
- package/lib/project.js +303 -0
- package/lib/project.js.map +1 -0
- package/lib/runner/cli.d.ts +1 -0
- package/lib/runner/cli.js +284 -0
- package/lib/runner/cli.js.map +1 -0
- package/lib/runner/register.d.ts +13 -0
- package/lib/runner/register.js +424 -0
- package/lib/runner/register.js.map +1 -0
- package/package.json +72 -63
- package/shim/ast/extra-shim.json +4 -0
- package/shim/ast/go.mod +5 -0
- package/shim/ast/shim.go +117 -0
- package/shim/bundled/extra-shim.json +1 -0
- package/shim/bundled/go.mod +5 -0
- package/shim/bundled/shim.go +19 -0
- package/shim/checker/extra-shim.json +31 -0
- package/shim/checker/go.mod +5 -0
- package/shim/checker/shim.go +146 -0
- package/shim/compiler/extra-shim.json +4 -0
- package/shim/compiler/go.mod +5 -0
- package/shim/compiler/shim.go +50 -0
- package/shim/core/extra-shim.json +4 -0
- package/shim/core/go.mod +5 -0
- package/shim/core/shim.go +11 -0
- package/shim/diagnosticwriter/go.mod +5 -0
- package/shim/diagnosticwriter/shim.go +29 -0
- package/shim/parser/extra-shim.json +4 -0
- package/shim/parser/go.mod +5 -0
- package/shim/parser/shim.go +55 -0
- package/shim/scanner/extra-shim.json +4 -0
- package/shim/scanner/go.mod +5 -0
- package/shim/scanner/shim.go +96 -0
- package/shim/tsoptions/extra-shim.json +4 -0
- package/shim/tsoptions/go.mod +5 -0
- package/shim/tsoptions/shim.go +123 -0
- package/shim/tspath/extra-shim.json +4 -0
- package/shim/tspath/go.mod +5 -0
- package/shim/tspath/shim.go +165 -0
- package/shim/vfs/cachedvfs/extra-shim.json +4 -0
- package/shim/vfs/cachedvfs/go.mod +5 -0
- package/shim/vfs/cachedvfs/shim.go +12 -0
- package/shim/vfs/extra-shim.json +4 -0
- package/shim/vfs/go.mod +5 -0
- package/shim/vfs/osvfs/extra-shim.json +4 -0
- package/shim/vfs/osvfs/go.mod +5 -0
- package/shim/vfs/osvfs/shim.go +13 -0
- package/shim/vfs/shim.go +19 -0
- package/src/api.ts +416 -0
- package/src/cli.ts +492 -0
- package/src/index.ts +19 -0
- package/src/launcher/ttsc-dev.js +42 -0
- package/src/launcher/ttsc.js +19 -0
- package/src/launcher/ttsx.js +19 -0
- package/src/native.ts +60 -0
- package/src/platform.ts +163 -0
- package/src/plugin.ts +241 -0
- package/src/project.ts +330 -0
- package/src/runner/cli.ts +286 -0
- package/src/runner/register.ts +487 -0
- package/test/native.test.ts +60 -0
- package/test/package.test.ts +131 -0
- package/test/platform.test.ts +58 -0
- package/test/project.test.ts +195 -0
- package/tools/gen_shims/go.mod +14 -0
- package/tools/gen_shims/go.sum +12 -0
- package/tools/gen_shims/main.go +446 -0
- package/CHANGELOG.md +0 -2
- package/bin/tsc +0 -2
- package/bin/tsserver +0 -2
- package/lib/PluginCreator.d.ts +0 -67
- package/lib/PluginCreator.js +0 -190
- package/lib/cancelationToken.d.ts +0 -0
- package/lib/cancelationToken.js +0 -2
- package/lib/loadTypescript.d.ts +0 -7
- package/lib/loadTypescript.js +0 -56
- package/lib/patchCreateProgram.d.ts +0 -21
- package/lib/patchCreateProgram.js +0 -190
- package/lib/tsc.d.ts +0 -1
- package/lib/tsc.js +0 -24
- package/lib/tsserver.d.ts +0 -0
- package/lib/tsserver.js +0 -2
- package/lib/tsserverlibrary.d.ts +0 -3
- package/lib/tsserverlibrary.js +0 -4
- package/lib/typescript.d.ts +0 -3
- package/lib/typescript.js +0 -4
- package/lib/typescriptServices.d.ts +0 -3
- package/lib/typescriptServices.js +0 -4
- package/lib/typingsInstaller.d.ts +0 -0
- package/lib/typingsInstaller.js +0 -2
- package/lib/watchGuard.d.ts +0 -0
- package/lib/watchGuard.js +0 -2
package/shim/ast/shim.go
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
package ast
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
innerast "github.com/microsoft/typescript-go/internal/ast"
|
|
5
|
+
_ "unsafe"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
type CallExpression = innerast.CallExpression
|
|
9
|
+
type Diagnostic = innerast.Diagnostic
|
|
10
|
+
type Identifier = innerast.Identifier
|
|
11
|
+
type IntersectionTypeNode = innerast.IntersectionTypeNode
|
|
12
|
+
type Kind = innerast.Kind
|
|
13
|
+
type LiteralTypeNode = innerast.LiteralTypeNode
|
|
14
|
+
type NoSubstitutionTemplateLiteral = innerast.NoSubstitutionTemplateLiteral
|
|
15
|
+
type Node = innerast.Node
|
|
16
|
+
type TemplateHead = innerast.TemplateHead
|
|
17
|
+
type TemplateLiteralTypeNode = innerast.TemplateLiteralTypeNode
|
|
18
|
+
type TemplateLiteralTypeSpan = innerast.TemplateLiteralTypeSpan
|
|
19
|
+
type TemplateMiddle = innerast.TemplateMiddle
|
|
20
|
+
type TemplateTail = innerast.TemplateTail
|
|
21
|
+
type PrefixUnaryExpression = innerast.PrefixUnaryExpression
|
|
22
|
+
type ComputedPropertyName = innerast.ComputedPropertyName
|
|
23
|
+
type PropertySignatureDeclaration = innerast.PropertySignatureDeclaration
|
|
24
|
+
type QualifiedName = innerast.QualifiedName
|
|
25
|
+
type TypeLiteralNode = innerast.TypeLiteralNode
|
|
26
|
+
type FunctionTypeNode = innerast.FunctionTypeNode
|
|
27
|
+
type InterfaceDeclaration = innerast.InterfaceDeclaration
|
|
28
|
+
type TypeReferenceNode = innerast.TypeReferenceNode
|
|
29
|
+
type SourceFile = innerast.SourceFile
|
|
30
|
+
type StringLiteral = innerast.StringLiteral
|
|
31
|
+
type Symbol = innerast.Symbol
|
|
32
|
+
type SymbolFlags = innerast.SymbolFlags
|
|
33
|
+
type NumericLiteral = innerast.NumericLiteral
|
|
34
|
+
type BigIntLiteral = innerast.BigIntLiteral
|
|
35
|
+
type ArrayTypeNode = innerast.ArrayTypeNode
|
|
36
|
+
type IndexSignatureDeclaration = innerast.IndexSignatureDeclaration
|
|
37
|
+
type NamedTupleMember = innerast.NamedTupleMember
|
|
38
|
+
type OptionalTypeNode = innerast.OptionalTypeNode
|
|
39
|
+
type RestTypeNode = innerast.RestTypeNode
|
|
40
|
+
type TypeAliasDeclaration = innerast.TypeAliasDeclaration
|
|
41
|
+
type TypeParameterDeclaration = innerast.TypeParameterDeclaration
|
|
42
|
+
type TupleTypeNode = innerast.TupleTypeNode
|
|
43
|
+
type UnionTypeNode = innerast.UnionTypeNode
|
|
44
|
+
type MethodSignatureDeclaration = innerast.MethodSignatureDeclaration
|
|
45
|
+
type MethodDeclaration = innerast.MethodDeclaration
|
|
46
|
+
type NodeList = innerast.NodeList
|
|
47
|
+
type ParameterDeclaration = innerast.ParameterDeclaration
|
|
48
|
+
type ParenthesizedTypeNode = innerast.ParenthesizedTypeNode
|
|
49
|
+
|
|
50
|
+
const (
|
|
51
|
+
KindCallExpression = innerast.KindCallExpression
|
|
52
|
+
KindIdentifier = innerast.KindIdentifier
|
|
53
|
+
KindPropertyAccessExpression = innerast.KindPropertyAccessExpression
|
|
54
|
+
KindPropertySignature = innerast.KindPropertySignature
|
|
55
|
+
KindComputedPropertyName = innerast.KindComputedPropertyName
|
|
56
|
+
KindMethodSignature = innerast.KindMethodSignature
|
|
57
|
+
KindMethodDeclaration = innerast.KindMethodDeclaration
|
|
58
|
+
KindIndexSignature = innerast.KindIndexSignature
|
|
59
|
+
KindParameter = innerast.KindParameter
|
|
60
|
+
KindStringKeyword = innerast.KindStringKeyword
|
|
61
|
+
KindNumberKeyword = innerast.KindNumberKeyword
|
|
62
|
+
KindBooleanKeyword = innerast.KindBooleanKeyword
|
|
63
|
+
KindBigIntKeyword = innerast.KindBigIntKeyword
|
|
64
|
+
KindAnyKeyword = innerast.KindAnyKeyword
|
|
65
|
+
KindNeverKeyword = innerast.KindNeverKeyword
|
|
66
|
+
KindUndefinedKeyword = innerast.KindUndefinedKeyword
|
|
67
|
+
KindNullKeyword = innerast.KindNullKeyword
|
|
68
|
+
KindVoidKeyword = innerast.KindVoidKeyword
|
|
69
|
+
KindTrueKeyword = innerast.KindTrueKeyword
|
|
70
|
+
KindFalseKeyword = innerast.KindFalseKeyword
|
|
71
|
+
KindStringLiteral = innerast.KindStringLiteral
|
|
72
|
+
KindNoSubstitutionTemplateLiteral = innerast.KindNoSubstitutionTemplateLiteral
|
|
73
|
+
KindTemplateHead = innerast.KindTemplateHead
|
|
74
|
+
KindTemplateMiddle = innerast.KindTemplateMiddle
|
|
75
|
+
KindTemplateTail = innerast.KindTemplateTail
|
|
76
|
+
KindNumericLiteral = innerast.KindNumericLiteral
|
|
77
|
+
KindBigIntLiteral = innerast.KindBigIntLiteral
|
|
78
|
+
KindTypeReference = innerast.KindTypeReference
|
|
79
|
+
KindFunctionType = innerast.KindFunctionType
|
|
80
|
+
KindLiteralType = innerast.KindLiteralType
|
|
81
|
+
KindArrayType = innerast.KindArrayType
|
|
82
|
+
KindTypeLiteral = innerast.KindTypeLiteral
|
|
83
|
+
KindInterfaceDeclaration = innerast.KindInterfaceDeclaration
|
|
84
|
+
KindTupleType = innerast.KindTupleType
|
|
85
|
+
KindUnionType = innerast.KindUnionType
|
|
86
|
+
KindIntersectionType = innerast.KindIntersectionType
|
|
87
|
+
KindNamedTupleMember = innerast.KindNamedTupleMember
|
|
88
|
+
KindOptionalType = innerast.KindOptionalType
|
|
89
|
+
KindParenthesizedType = innerast.KindParenthesizedType
|
|
90
|
+
KindRestType = innerast.KindRestType
|
|
91
|
+
KindTemplateLiteralType = innerast.KindTemplateLiteralType
|
|
92
|
+
KindTemplateLiteralTypeSpan = innerast.KindTemplateLiteralTypeSpan
|
|
93
|
+
KindPrefixUnaryExpression = innerast.KindPrefixUnaryExpression
|
|
94
|
+
KindQualifiedName = innerast.KindQualifiedName
|
|
95
|
+
KindTypeAliasDeclaration = innerast.KindTypeAliasDeclaration
|
|
96
|
+
KindTypeParameter = innerast.KindTypeParameter
|
|
97
|
+
KindImportSpecifier = innerast.KindImportSpecifier
|
|
98
|
+
KindImportDeclaration = innerast.KindImportDeclaration
|
|
99
|
+
KindNamedImports = innerast.KindNamedImports
|
|
100
|
+
KindNamespaceImport = innerast.KindNamespaceImport
|
|
101
|
+
KindExportSpecifier = innerast.KindExportSpecifier
|
|
102
|
+
KindModuleBlock = innerast.KindModuleBlock
|
|
103
|
+
KindModuleDeclaration = innerast.KindModuleDeclaration
|
|
104
|
+
KindFunctionDeclaration = innerast.KindFunctionDeclaration
|
|
105
|
+
KindMinusToken = innerast.KindMinusToken
|
|
106
|
+
|
|
107
|
+
SymbolFlagsOptional = innerast.SymbolFlagsOptional
|
|
108
|
+
SymbolFlagsAlias = innerast.SymbolFlagsAlias
|
|
109
|
+
SymbolFlagsType = innerast.SymbolFlagsType
|
|
110
|
+
SymbolFlagsNamespace = innerast.SymbolFlagsNamespace
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
//go:linkname GetSourceFileOfNode github.com/microsoft/typescript-go/internal/ast.GetSourceFileOfNode
|
|
114
|
+
func GetSourceFileOfNode(node *innerast.Node) *innerast.SourceFile
|
|
115
|
+
|
|
116
|
+
//go:linkname GetNodeAtPosition github.com/microsoft/typescript-go/internal/ast.GetNodeAtPosition
|
|
117
|
+
func GetNodeAtPosition(file *innerast.SourceFile, position int, includeJSDoc bool) *innerast.Node
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"ExtraMethods":{},"ExtraFields":{}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
// Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
package bundled
|
|
5
|
+
|
|
6
|
+
import "github.com/microsoft/typescript-go/internal/bundled"
|
|
7
|
+
import "github.com/microsoft/typescript-go/internal/vfs"
|
|
8
|
+
import _ "unsafe"
|
|
9
|
+
|
|
10
|
+
const Embedded = bundled.Embedded
|
|
11
|
+
//go:linkname IsBundled github.com/microsoft/typescript-go/internal/bundled.IsBundled
|
|
12
|
+
func IsBundled(path string) bool
|
|
13
|
+
var LibNames = bundled.LibNames
|
|
14
|
+
//go:linkname LibPath github.com/microsoft/typescript-go/internal/bundled.LibPath
|
|
15
|
+
func LibPath() string
|
|
16
|
+
//go:linkname TestingLibPath github.com/microsoft/typescript-go/internal/bundled.TestingLibPath
|
|
17
|
+
func TestingLibPath() string
|
|
18
|
+
//go:linkname WrapFS github.com/microsoft/typescript-go/internal/bundled.WrapFS
|
|
19
|
+
func WrapFS(fs vfs.FS) vfs.FS
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ExtraMethods": {
|
|
3
|
+
"Checker": [
|
|
4
|
+
"getApparentType",
|
|
5
|
+
"getIndexTypeOfType",
|
|
6
|
+
"getPropertiesOfType",
|
|
7
|
+
"getTypeOfSymbol",
|
|
8
|
+
"getDeclaredTypeOfSymbol",
|
|
9
|
+
"getBaseTypes",
|
|
10
|
+
"getTypeArguments",
|
|
11
|
+
"getIndexInfosOfType",
|
|
12
|
+
"isArrayType",
|
|
13
|
+
"isArrayOrTupleType",
|
|
14
|
+
"isTypeAssignableTo",
|
|
15
|
+
"isReadonlySymbol",
|
|
16
|
+
"getWidenedType",
|
|
17
|
+
"getPropertyNameForKnownSymbolName",
|
|
18
|
+
"getBaseConstraintOfType",
|
|
19
|
+
"getNullableType",
|
|
20
|
+
"getExportsOfModule"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"ExtraFields": {
|
|
24
|
+
"Type": [
|
|
25
|
+
"alias"
|
|
26
|
+
],
|
|
27
|
+
"Checker": [
|
|
28
|
+
"globalRegExpType"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
package checker
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
innerast "github.com/microsoft/typescript-go/internal/ast"
|
|
5
|
+
innerchecker "github.com/microsoft/typescript-go/internal/checker"
|
|
6
|
+
_ "unsafe"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
type Checker = innerchecker.Checker
|
|
10
|
+
type IndexInfo = innerchecker.IndexInfo
|
|
11
|
+
type Signature = innerchecker.Signature
|
|
12
|
+
type SignatureKind = innerchecker.SignatureKind
|
|
13
|
+
type Type = innerchecker.Type
|
|
14
|
+
type TypeFlags = innerchecker.TypeFlags
|
|
15
|
+
type ObjectFlags = innerchecker.ObjectFlags
|
|
16
|
+
|
|
17
|
+
const (
|
|
18
|
+
SignatureKindCall = innerchecker.SignatureKindCall
|
|
19
|
+
|
|
20
|
+
TypeFlagsAny = innerchecker.TypeFlagsAny
|
|
21
|
+
TypeFlagsUnknown = innerchecker.TypeFlagsUnknown
|
|
22
|
+
TypeFlagsUndefined = innerchecker.TypeFlagsUndefined
|
|
23
|
+
TypeFlagsNull = innerchecker.TypeFlagsNull
|
|
24
|
+
TypeFlagsVoid = innerchecker.TypeFlagsVoid
|
|
25
|
+
TypeFlagsNever = innerchecker.TypeFlagsNever
|
|
26
|
+
TypeFlagsObject = innerchecker.TypeFlagsObject
|
|
27
|
+
TypeFlagsTemplateLiteral = innerchecker.TypeFlagsTemplateLiteral
|
|
28
|
+
TypeFlagsStringMapping = innerchecker.TypeFlagsStringMapping
|
|
29
|
+
TypeFlagsUnion = innerchecker.TypeFlagsUnion
|
|
30
|
+
TypeFlagsIntersection = innerchecker.TypeFlagsIntersection
|
|
31
|
+
TypeFlagsLiteral = innerchecker.TypeFlagsLiteral
|
|
32
|
+
TypeFlagsStringLiteral = innerchecker.TypeFlagsStringLiteral
|
|
33
|
+
TypeFlagsNumberLiteral = innerchecker.TypeFlagsNumberLiteral
|
|
34
|
+
TypeFlagsBigIntLiteral = innerchecker.TypeFlagsBigIntLiteral
|
|
35
|
+
TypeFlagsBooleanLiteral = innerchecker.TypeFlagsBooleanLiteral
|
|
36
|
+
TypeFlagsStringLike = innerchecker.TypeFlagsStringLike
|
|
37
|
+
TypeFlagsNumberLike = innerchecker.TypeFlagsNumberLike
|
|
38
|
+
TypeFlagsBigIntLike = innerchecker.TypeFlagsBigIntLike
|
|
39
|
+
TypeFlagsBooleanLike = innerchecker.TypeFlagsBooleanLike
|
|
40
|
+
|
|
41
|
+
ObjectFlagsReference = innerchecker.ObjectFlagsReference
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
func IsTupleType(t *innerchecker.Type) bool {
|
|
45
|
+
return innerchecker.IsTupleType(t)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
func Checker_getIndexInfosOfType(recv *innerchecker.Checker, t *innerchecker.Type) []*innerchecker.IndexInfo {
|
|
49
|
+
return recv.GetIndexInfosOfType(t)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
func Checker_getPropertiesOfType(recv *innerchecker.Checker, t *innerchecker.Type) []*innerast.Symbol {
|
|
53
|
+
return recv.GetPropertiesOfType(t)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
func Checker_getApparentProperties(recv *innerchecker.Checker, t *innerchecker.Type) []*innerast.Symbol {
|
|
57
|
+
return recv.GetApparentProperties(t)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
func Checker_getTypeArguments(recv *innerchecker.Checker, t *innerchecker.Type) []*innerchecker.Type {
|
|
61
|
+
return recv.GetTypeArguments(t)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
func Checker_getTypeOfSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerchecker.Type {
|
|
65
|
+
return recv.GetTypeOfSymbol(symbol)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
func Checker_getTypeOfSymbolAtLocation(recv *innerchecker.Checker, symbol *innerast.Symbol, node *innerast.Node) *innerchecker.Type {
|
|
69
|
+
return recv.GetTypeOfSymbolAtLocation(symbol, node)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
func Checker_getTypeOfPropertyOfType(recv *innerchecker.Checker, t *innerchecker.Type, name string) *innerchecker.Type {
|
|
73
|
+
return recv.GetTypeOfPropertyOfType(t, name)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//go:linkname checkerGetAliasSymbolForTypeNode github.com/microsoft/typescript-go/internal/checker.(*Checker).getAliasSymbolForTypeNode
|
|
77
|
+
func checkerGetAliasSymbolForTypeNode(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol
|
|
78
|
+
|
|
79
|
+
func Checker_getAliasSymbolForTypeNode(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol {
|
|
80
|
+
return checkerGetAliasSymbolForTypeNode(recv, node)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//go:linkname checkerGetDeclarationOfAliasSymbol github.com/microsoft/typescript-go/internal/checker.(*Checker).getDeclarationOfAliasSymbol
|
|
84
|
+
func checkerGetDeclarationOfAliasSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerast.Node
|
|
85
|
+
|
|
86
|
+
func Checker_getDeclarationOfAliasSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerast.Node {
|
|
87
|
+
return checkerGetDeclarationOfAliasSymbol(recv, symbol)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//go:linkname checkerGetTargetOfImportSpecifier github.com/microsoft/typescript-go/internal/checker.(*Checker).getTargetOfImportSpecifier
|
|
91
|
+
func checkerGetTargetOfImportSpecifier(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol
|
|
92
|
+
|
|
93
|
+
func Checker_getTargetOfImportSpecifier(recv *innerchecker.Checker, node *innerast.Node) *innerast.Symbol {
|
|
94
|
+
if recv == nil || node == nil {
|
|
95
|
+
return nil
|
|
96
|
+
}
|
|
97
|
+
return checkerGetTargetOfImportSpecifier(recv, node)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
func Checker_getAliasedSymbol(recv *innerchecker.Checker, symbol *innerast.Symbol) *innerast.Symbol {
|
|
101
|
+
if recv == nil || symbol == nil {
|
|
102
|
+
return nil
|
|
103
|
+
}
|
|
104
|
+
return recv.GetAliasedSymbol(symbol)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//go:linkname checkerResolveEntityName github.com/microsoft/typescript-go/internal/checker.(*Checker).resolveEntityName
|
|
108
|
+
func checkerResolveEntityName(
|
|
109
|
+
recv *innerchecker.Checker,
|
|
110
|
+
name *innerast.Node,
|
|
111
|
+
meaning innerast.SymbolFlags,
|
|
112
|
+
ignoreErrors bool,
|
|
113
|
+
dontResolveAlias bool,
|
|
114
|
+
location *innerast.Node,
|
|
115
|
+
) *innerast.Symbol
|
|
116
|
+
|
|
117
|
+
func Checker_resolveEntityName(
|
|
118
|
+
recv *innerchecker.Checker,
|
|
119
|
+
name *innerast.Node,
|
|
120
|
+
meaning innerast.SymbolFlags,
|
|
121
|
+
ignoreErrors bool,
|
|
122
|
+
dontResolveAlias bool,
|
|
123
|
+
location *innerast.Node,
|
|
124
|
+
) *innerast.Symbol {
|
|
125
|
+
if recv == nil || name == nil {
|
|
126
|
+
return nil
|
|
127
|
+
}
|
|
128
|
+
return checkerResolveEntityName(recv, name, meaning, ignoreErrors, dontResolveAlias, location)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
//go:linkname checkerGetTypeNameSymbol github.com/microsoft/typescript-go/internal/checker.getTypeNameSymbol
|
|
132
|
+
func checkerGetTypeNameSymbol(t *innerchecker.Type) *innerast.Symbol
|
|
133
|
+
|
|
134
|
+
func Type_getTypeNameSymbol(t *innerchecker.Type) *innerast.Symbol {
|
|
135
|
+
if t == nil {
|
|
136
|
+
return nil
|
|
137
|
+
}
|
|
138
|
+
return checkerGetTypeNameSymbol(t)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//go:linkname checkerIsArrayType github.com/microsoft/typescript-go/internal/checker.(*Checker).isArrayType
|
|
142
|
+
func checkerIsArrayType(recv *innerchecker.Checker, t *innerchecker.Type) bool
|
|
143
|
+
|
|
144
|
+
func Checker_isArrayType(recv *innerchecker.Checker, t *innerchecker.Type) bool {
|
|
145
|
+
return checkerIsArrayType(recv, t)
|
|
146
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
// Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
package compiler
|
|
5
|
+
|
|
6
|
+
import "context"
|
|
7
|
+
import "github.com/microsoft/typescript-go/internal/ast"
|
|
8
|
+
import "github.com/microsoft/typescript-go/internal/compiler"
|
|
9
|
+
import "github.com/microsoft/typescript-go/internal/core"
|
|
10
|
+
import "github.com/microsoft/typescript-go/internal/diagnostics"
|
|
11
|
+
import "github.com/microsoft/typescript-go/internal/tsoptions"
|
|
12
|
+
import "github.com/microsoft/typescript-go/internal/vfs"
|
|
13
|
+
import _ "unsafe"
|
|
14
|
+
|
|
15
|
+
type CheckerPool = compiler.CheckerPool
|
|
16
|
+
//go:linkname CombineEmitResults github.com/microsoft/typescript-go/internal/compiler.CombineEmitResults
|
|
17
|
+
func CombineEmitResults(results []*compiler.EmitResult) *compiler.EmitResult
|
|
18
|
+
type CompilerHost = compiler.CompilerHost
|
|
19
|
+
type DuplicateSourceFile = compiler.DuplicateSourceFile
|
|
20
|
+
const EmitAll = compiler.EmitAll
|
|
21
|
+
type EmitHost = compiler.EmitHost
|
|
22
|
+
type EmitOnly = compiler.EmitOnly
|
|
23
|
+
const EmitOnlyDts = compiler.EmitOnlyDts
|
|
24
|
+
const EmitOnlyForcedDts = compiler.EmitOnlyForcedDts
|
|
25
|
+
const EmitOnlyJs = compiler.EmitOnlyJs
|
|
26
|
+
type EmitOptions = compiler.EmitOptions
|
|
27
|
+
type EmitResult = compiler.EmitResult
|
|
28
|
+
type FileIncludeReason = compiler.FileIncludeReason
|
|
29
|
+
//go:linkname FilterNoEmitSemanticDiagnostics github.com/microsoft/typescript-go/internal/compiler.FilterNoEmitSemanticDiagnostics
|
|
30
|
+
func FilterNoEmitSemanticDiagnostics(diagnostics []*ast.Diagnostic, options *core.CompilerOptions) []*ast.Diagnostic
|
|
31
|
+
//go:linkname GetDiagnosticsOfAnyProgram github.com/microsoft/typescript-go/internal/compiler.GetDiagnosticsOfAnyProgram
|
|
32
|
+
func GetDiagnosticsOfAnyProgram(ctx context.Context, program compiler.ProgramLike, file *ast.SourceFile, skipNoEmitCheckForDtsDiagnostics bool, getBindDiagnostics func(context.Context, *ast.SourceFile) []*ast.Diagnostic, getSemanticDiagnostics func(context.Context, *ast.SourceFile) []*ast.Diagnostic) []*ast.Diagnostic
|
|
33
|
+
//go:linkname HandleNoEmitOnError github.com/microsoft/typescript-go/internal/compiler.HandleNoEmitOnError
|
|
34
|
+
func HandleNoEmitOnError(ctx context.Context, program compiler.ProgramLike, file *ast.SourceFile) *compiler.EmitResult
|
|
35
|
+
type LibFile = compiler.LibFile
|
|
36
|
+
//go:linkname NewCachedFSCompilerHost github.com/microsoft/typescript-go/internal/compiler.NewCachedFSCompilerHost
|
|
37
|
+
func NewCachedFSCompilerHost(currentDirectory string, fs vfs.FS, defaultLibraryPath string, extendedConfigCache tsoptions.ExtendedConfigCache, trace func(msg *diagnostics.Message, args ...any)) compiler.CompilerHost
|
|
38
|
+
//go:linkname NewCompilerHost github.com/microsoft/typescript-go/internal/compiler.NewCompilerHost
|
|
39
|
+
func NewCompilerHost(currentDirectory string, fs vfs.FS, defaultLibraryPath string, extendedConfigCache tsoptions.ExtendedConfigCache, trace func(msg *diagnostics.Message, args ...any)) compiler.CompilerHost
|
|
40
|
+
//go:linkname NewProgram github.com/microsoft/typescript-go/internal/compiler.NewProgram
|
|
41
|
+
func NewProgram(opts compiler.ProgramOptions) *compiler.Program
|
|
42
|
+
type Program = compiler.Program
|
|
43
|
+
type ProgramLike = compiler.ProgramLike
|
|
44
|
+
type ProgramOptions = compiler.ProgramOptions
|
|
45
|
+
//go:linkname SortAndDeduplicateDiagnostics github.com/microsoft/typescript-go/internal/compiler.SortAndDeduplicateDiagnostics
|
|
46
|
+
func SortAndDeduplicateDiagnostics(diagnostics []*ast.Diagnostic) []*ast.Diagnostic
|
|
47
|
+
type SourceFileMayBeEmittedHost = compiler.SourceFileMayBeEmittedHost
|
|
48
|
+
type SourceMapEmitResult = compiler.SourceMapEmitResult
|
|
49
|
+
type WriteFile = compiler.WriteFile
|
|
50
|
+
type WriteFileData = compiler.WriteFileData
|
package/shim/core/go.mod
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package diagnosticwriter
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"io"
|
|
5
|
+
|
|
6
|
+
"github.com/microsoft/typescript-go/internal/ast"
|
|
7
|
+
inner "github.com/microsoft/typescript-go/internal/diagnosticwriter"
|
|
8
|
+
"github.com/microsoft/typescript-go/internal/locale"
|
|
9
|
+
"github.com/microsoft/typescript-go/internal/tspath"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
// FormatASTDiagnosticsWithColorAndContext writes TypeScript-style pretty
|
|
13
|
+
// diagnostics using the same internal formatter as typescript-go.
|
|
14
|
+
func FormatASTDiagnosticsWithColorAndContext(output io.Writer, diagnostics []*ast.Diagnostic, currentDirectory string) {
|
|
15
|
+
if len(diagnostics) == 0 {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
formatted := inner.FromASTDiagnostics(diagnostics)
|
|
19
|
+
options := &inner.FormattingOptions{
|
|
20
|
+
Locale: locale.Default,
|
|
21
|
+
ComparePathsOptions: tspath.ComparePathsOptions{
|
|
22
|
+
CurrentDirectory: currentDirectory,
|
|
23
|
+
UseCaseSensitiveFileNames: true,
|
|
24
|
+
},
|
|
25
|
+
NewLine: "\n",
|
|
26
|
+
}
|
|
27
|
+
inner.FormatDiagnosticsWithColorAndContext(output, formatted, options)
|
|
28
|
+
inner.WriteErrorSummaryText(output, formatted, options)
|
|
29
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
// Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
package parser
|
|
5
|
+
|
|
6
|
+
import "github.com/microsoft/typescript-go/internal/ast"
|
|
7
|
+
import "github.com/microsoft/typescript-go/internal/core"
|
|
8
|
+
import "github.com/microsoft/typescript-go/internal/parser"
|
|
9
|
+
import _ "unsafe"
|
|
10
|
+
|
|
11
|
+
//go:linkname GetJSDocCommentRanges github.com/microsoft/typescript-go/internal/parser.GetJSDocCommentRanges
|
|
12
|
+
func GetJSDocCommentRanges(f *ast.NodeFactory, commentRanges []ast.CommentRange, node *ast.Node, text string) []ast.CommentRange
|
|
13
|
+
type JSDocInfo = parser.JSDocInfo
|
|
14
|
+
const PCArgumentExpressions = parser.PCArgumentExpressions
|
|
15
|
+
const PCArrayBindingElements = parser.PCArrayBindingElements
|
|
16
|
+
const PCArrayLiteralMembers = parser.PCArrayLiteralMembers
|
|
17
|
+
const PCBlockStatements = parser.PCBlockStatements
|
|
18
|
+
const PCClassMembers = parser.PCClassMembers
|
|
19
|
+
const PCCount = parser.PCCount
|
|
20
|
+
const PCEnumMembers = parser.PCEnumMembers
|
|
21
|
+
const PCHeritageClauseElement = parser.PCHeritageClauseElement
|
|
22
|
+
const PCHeritageClauses = parser.PCHeritageClauses
|
|
23
|
+
const PCImportAttributes = parser.PCImportAttributes
|
|
24
|
+
const PCImportOrExportSpecifiers = parser.PCImportOrExportSpecifiers
|
|
25
|
+
const PCJSDocComment = parser.PCJSDocComment
|
|
26
|
+
const PCJSDocParameters = parser.PCJSDocParameters
|
|
27
|
+
const PCJsxAttributes = parser.PCJsxAttributes
|
|
28
|
+
const PCJsxChildren = parser.PCJsxChildren
|
|
29
|
+
const PCObjectBindingElements = parser.PCObjectBindingElements
|
|
30
|
+
const PCObjectLiteralMembers = parser.PCObjectLiteralMembers
|
|
31
|
+
const PCParameters = parser.PCParameters
|
|
32
|
+
const PCRestProperties = parser.PCRestProperties
|
|
33
|
+
const PCSourceElements = parser.PCSourceElements
|
|
34
|
+
const PCSwitchClauseStatements = parser.PCSwitchClauseStatements
|
|
35
|
+
const PCSwitchClauses = parser.PCSwitchClauses
|
|
36
|
+
const PCTupleElementTypes = parser.PCTupleElementTypes
|
|
37
|
+
const PCTypeArguments = parser.PCTypeArguments
|
|
38
|
+
const PCTypeMembers = parser.PCTypeMembers
|
|
39
|
+
const PCTypeParameters = parser.PCTypeParameters
|
|
40
|
+
const PCVariableDeclarations = parser.PCVariableDeclarations
|
|
41
|
+
type ParseFlags = parser.ParseFlags
|
|
42
|
+
const ParseFlagsAwait = parser.ParseFlagsAwait
|
|
43
|
+
const ParseFlagsIgnoreMissingOpenBrace = parser.ParseFlagsIgnoreMissingOpenBrace
|
|
44
|
+
const ParseFlagsJSDoc = parser.ParseFlagsJSDoc
|
|
45
|
+
const ParseFlagsNone = parser.ParseFlagsNone
|
|
46
|
+
const ParseFlagsType = parser.ParseFlagsType
|
|
47
|
+
const ParseFlagsYield = parser.ParseFlagsYield
|
|
48
|
+
//go:linkname ParseIsolatedEntityName github.com/microsoft/typescript-go/internal/parser.ParseIsolatedEntityName
|
|
49
|
+
func ParseIsolatedEntityName(text string) *ast.EntityName
|
|
50
|
+
//go:linkname ParseSourceFile github.com/microsoft/typescript-go/internal/parser.ParseSourceFile
|
|
51
|
+
func ParseSourceFile(opts ast.SourceFileParseOptions, sourceText string, scriptKind core.ScriptKind) *ast.SourceFile
|
|
52
|
+
type Parser = parser.Parser
|
|
53
|
+
type ParserState = parser.ParserState
|
|
54
|
+
type ParsingContext = parser.ParsingContext
|
|
55
|
+
type ParsingContexts = parser.ParsingContexts
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
// Code generated by packages/ttsc/tools/gen_shims. DO NOT EDIT.
|
|
3
|
+
|
|
4
|
+
package scanner
|
|
5
|
+
|
|
6
|
+
import "github.com/microsoft/typescript-go/internal/ast"
|
|
7
|
+
import "github.com/microsoft/typescript-go/internal/core"
|
|
8
|
+
import "github.com/microsoft/typescript-go/internal/scanner"
|
|
9
|
+
import "iter"
|
|
10
|
+
import _ "unsafe"
|
|
11
|
+
|
|
12
|
+
//go:linkname ComputeLineOfPosition github.com/microsoft/typescript-go/internal/scanner.ComputeLineOfPosition
|
|
13
|
+
func ComputeLineOfPosition(lineStarts []core.TextPos, pos int) int
|
|
14
|
+
//go:linkname ComputePositionOfLineAndByteOffset github.com/microsoft/typescript-go/internal/scanner.ComputePositionOfLineAndByteOffset
|
|
15
|
+
func ComputePositionOfLineAndByteOffset(lineStarts []core.TextPos, line int, byteOffset int) int
|
|
16
|
+
//go:linkname ComputePositionOfLineAndUTF16Character github.com/microsoft/typescript-go/internal/scanner.ComputePositionOfLineAndUTF16Character
|
|
17
|
+
func ComputePositionOfLineAndUTF16Character(lineStarts []core.TextPos, line int, character core.UTF16Offset, text string, allowEdits bool) int
|
|
18
|
+
//go:linkname DeclarationNameToString github.com/microsoft/typescript-go/internal/scanner.DeclarationNameToString
|
|
19
|
+
func DeclarationNameToString(name *ast.Node) string
|
|
20
|
+
type ErrorCallback = scanner.ErrorCallback
|
|
21
|
+
type EscapeSequenceScanningFlags = scanner.EscapeSequenceScanningFlags
|
|
22
|
+
const EscapeSequenceScanningFlagsAllowExtendedUnicodeEscape = scanner.EscapeSequenceScanningFlagsAllowExtendedUnicodeEscape
|
|
23
|
+
const EscapeSequenceScanningFlagsAnnexB = scanner.EscapeSequenceScanningFlagsAnnexB
|
|
24
|
+
const EscapeSequenceScanningFlagsAnyUnicodeMode = scanner.EscapeSequenceScanningFlagsAnyUnicodeMode
|
|
25
|
+
const EscapeSequenceScanningFlagsAtomEscape = scanner.EscapeSequenceScanningFlagsAtomEscape
|
|
26
|
+
const EscapeSequenceScanningFlagsRegularExpression = scanner.EscapeSequenceScanningFlagsRegularExpression
|
|
27
|
+
const EscapeSequenceScanningFlagsReportErrors = scanner.EscapeSequenceScanningFlagsReportErrors
|
|
28
|
+
const EscapeSequenceScanningFlagsReportInvalidEscapeErrors = scanner.EscapeSequenceScanningFlagsReportInvalidEscapeErrors
|
|
29
|
+
const EscapeSequenceScanningFlagsString = scanner.EscapeSequenceScanningFlagsString
|
|
30
|
+
//go:linkname GetECMAEndLinePosition github.com/microsoft/typescript-go/internal/scanner.GetECMAEndLinePosition
|
|
31
|
+
func GetECMAEndLinePosition(sourceFile *ast.SourceFile, line int) int
|
|
32
|
+
//go:linkname GetECMALineAndByteOffsetOfPosition github.com/microsoft/typescript-go/internal/scanner.GetECMALineAndByteOffsetOfPosition
|
|
33
|
+
func GetECMALineAndByteOffsetOfPosition(sourceFile ast.SourceFileLike, pos int) (line int, byteOffset int)
|
|
34
|
+
//go:linkname GetECMALineAndUTF16CharacterOfPosition github.com/microsoft/typescript-go/internal/scanner.GetECMALineAndUTF16CharacterOfPosition
|
|
35
|
+
func GetECMALineAndUTF16CharacterOfPosition(sourceFile ast.SourceFileLike, pos int) (line int, character core.UTF16Offset)
|
|
36
|
+
//go:linkname GetECMALineOfPosition github.com/microsoft/typescript-go/internal/scanner.GetECMALineOfPosition
|
|
37
|
+
func GetECMALineOfPosition(sourceFile ast.SourceFileLike, pos int) int
|
|
38
|
+
//go:linkname GetECMALineStarts github.com/microsoft/typescript-go/internal/scanner.GetECMALineStarts
|
|
39
|
+
func GetECMALineStarts(sourceFile ast.SourceFileLike) []core.TextPos
|
|
40
|
+
//go:linkname GetECMAPositionOfLineAndByteOffset github.com/microsoft/typescript-go/internal/scanner.GetECMAPositionOfLineAndByteOffset
|
|
41
|
+
func GetECMAPositionOfLineAndByteOffset(sourceFile ast.SourceFileLike, line int, byteOffset int) int
|
|
42
|
+
//go:linkname GetECMAPositionOfLineAndUTF16Character github.com/microsoft/typescript-go/internal/scanner.GetECMAPositionOfLineAndUTF16Character
|
|
43
|
+
func GetECMAPositionOfLineAndUTF16Character(sourceFile ast.SourceFileLike, line int, character core.UTF16Offset) int
|
|
44
|
+
//go:linkname GetErrorRangeForNode github.com/microsoft/typescript-go/internal/scanner.GetErrorRangeForNode
|
|
45
|
+
func GetErrorRangeForNode(sourceFile *ast.SourceFile, node *ast.Node) core.TextRange
|
|
46
|
+
//go:linkname GetIdentifierToken github.com/microsoft/typescript-go/internal/scanner.GetIdentifierToken
|
|
47
|
+
func GetIdentifierToken(str string) ast.Kind
|
|
48
|
+
//go:linkname GetLeadingCommentRanges github.com/microsoft/typescript-go/internal/scanner.GetLeadingCommentRanges
|
|
49
|
+
func GetLeadingCommentRanges(f *ast.NodeFactory, text string, pos int) iter.Seq[ast.CommentRange]
|
|
50
|
+
//go:linkname GetRangeOfTokenAtPosition github.com/microsoft/typescript-go/internal/scanner.GetRangeOfTokenAtPosition
|
|
51
|
+
func GetRangeOfTokenAtPosition(sourceFile *ast.SourceFile, pos int) core.TextRange
|
|
52
|
+
//go:linkname GetScannerForSourceFile github.com/microsoft/typescript-go/internal/scanner.GetScannerForSourceFile
|
|
53
|
+
func GetScannerForSourceFile(sourceFile *ast.SourceFile, pos int) *scanner.Scanner
|
|
54
|
+
//go:linkname GetShebang github.com/microsoft/typescript-go/internal/scanner.GetShebang
|
|
55
|
+
func GetShebang(text string) string
|
|
56
|
+
//go:linkname GetSourceTextOfNodeFromSourceFile github.com/microsoft/typescript-go/internal/scanner.GetSourceTextOfNodeFromSourceFile
|
|
57
|
+
func GetSourceTextOfNodeFromSourceFile(sourceFile *ast.SourceFile, node *ast.Node, includeTrivia bool) string
|
|
58
|
+
//go:linkname GetTextOfNode github.com/microsoft/typescript-go/internal/scanner.GetTextOfNode
|
|
59
|
+
func GetTextOfNode(node *ast.Node) string
|
|
60
|
+
//go:linkname GetTextOfNodeFromSourceText github.com/microsoft/typescript-go/internal/scanner.GetTextOfNodeFromSourceText
|
|
61
|
+
func GetTextOfNodeFromSourceText(sourceText string, node *ast.Node, includeTrivia bool) string
|
|
62
|
+
//go:linkname GetTokenPosOfNode github.com/microsoft/typescript-go/internal/scanner.GetTokenPosOfNode
|
|
63
|
+
func GetTokenPosOfNode(node *ast.Node, sourceFile *ast.SourceFile, includeJSDoc bool) int
|
|
64
|
+
//go:linkname GetTrailingCommentRanges github.com/microsoft/typescript-go/internal/scanner.GetTrailingCommentRanges
|
|
65
|
+
func GetTrailingCommentRanges(f *ast.NodeFactory, text string, pos int) iter.Seq[ast.CommentRange]
|
|
66
|
+
//go:linkname GetViableKeywordSuggestions github.com/microsoft/typescript-go/internal/scanner.GetViableKeywordSuggestions
|
|
67
|
+
func GetViableKeywordSuggestions() []string
|
|
68
|
+
//go:linkname IdentifierToKeywordKind github.com/microsoft/typescript-go/internal/scanner.IdentifierToKeywordKind
|
|
69
|
+
func IdentifierToKeywordKind(node *ast.Identifier) ast.Kind
|
|
70
|
+
//go:linkname IsIdentifierPart github.com/microsoft/typescript-go/internal/scanner.IsIdentifierPart
|
|
71
|
+
func IsIdentifierPart(ch rune) bool
|
|
72
|
+
//go:linkname IsIdentifierPartEx github.com/microsoft/typescript-go/internal/scanner.IsIdentifierPartEx
|
|
73
|
+
func IsIdentifierPartEx(ch rune, languageVariant core.LanguageVariant) bool
|
|
74
|
+
//go:linkname IsIdentifierStart github.com/microsoft/typescript-go/internal/scanner.IsIdentifierStart
|
|
75
|
+
func IsIdentifierStart(ch rune) bool
|
|
76
|
+
//go:linkname IsIdentifierText github.com/microsoft/typescript-go/internal/scanner.IsIdentifierText
|
|
77
|
+
func IsIdentifierText(name string, languageVariant core.LanguageVariant) bool
|
|
78
|
+
//go:linkname IsIntrinsicJsxName github.com/microsoft/typescript-go/internal/scanner.IsIntrinsicJsxName
|
|
79
|
+
func IsIntrinsicJsxName(name string) bool
|
|
80
|
+
//go:linkname IsValidIdentifier github.com/microsoft/typescript-go/internal/scanner.IsValidIdentifier
|
|
81
|
+
func IsValidIdentifier(s string) bool
|
|
82
|
+
//go:linkname NewScanner github.com/microsoft/typescript-go/internal/scanner.NewScanner
|
|
83
|
+
func NewScanner() *scanner.Scanner
|
|
84
|
+
//go:linkname ScanTokenAtPosition github.com/microsoft/typescript-go/internal/scanner.ScanTokenAtPosition
|
|
85
|
+
func ScanTokenAtPosition(sourceFile *ast.SourceFile, pos int) ast.Kind
|
|
86
|
+
type Scanner = scanner.Scanner
|
|
87
|
+
type ScannerState = scanner.ScannerState
|
|
88
|
+
//go:linkname SkipTrivia github.com/microsoft/typescript-go/internal/scanner.SkipTrivia
|
|
89
|
+
func SkipTrivia(text string, pos int) int
|
|
90
|
+
//go:linkname SkipTriviaEx github.com/microsoft/typescript-go/internal/scanner.SkipTriviaEx
|
|
91
|
+
func SkipTriviaEx(text string, pos int, options *scanner.SkipTriviaOptions) int
|
|
92
|
+
type SkipTriviaOptions = scanner.SkipTriviaOptions
|
|
93
|
+
//go:linkname StringToToken github.com/microsoft/typescript-go/internal/scanner.StringToToken
|
|
94
|
+
func StringToToken(s string) ast.Kind
|
|
95
|
+
//go:linkname TokenToString github.com/microsoft/typescript-go/internal/scanner.TokenToString
|
|
96
|
+
func TokenToString(token ast.Kind) string
|