...
This commit is contained in:
parent
bb4469527a
commit
1755b296f5
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @kittenipc:api
|
||||||
|
*/
|
||||||
|
class IpcApi {
|
||||||
|
Mul(a: number, b: number): number {
|
||||||
|
return a * b;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
@ -4,6 +4,7 @@ go 1.25.1
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3 // indirect
|
github.com/go-json-experiment/json v0.0.0-20250910080747-cc2cfa0554c3 // indirect
|
||||||
|
github.com/yuin/goldmark v1.7.13 // indirect
|
||||||
golang.org/x/sync v0.17.0 // indirect
|
golang.org/x/sync v0.17.0 // indirect
|
||||||
golang.org/x/sys v0.37.0 // indirect
|
golang.org/x/sys v0.37.0 // indirect
|
||||||
golang.org/x/text v0.29.0 // indirect
|
golang.org/x/text v0.29.0 // indirect
|
||||||
|
|||||||
@ -6,6 +6,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
|||||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/microsoft/typescript-go v0.0.0-20251013215234-fd15f297d473 h1:LdsGx1nLOzsu2a1QORtbhZLaAlrQTbMKq3MlpuU3cCQ=
|
github.com/microsoft/typescript-go v0.0.0-20251013215234-fd15f297d473 h1:LdsGx1nLOzsu2a1QORtbhZLaAlrQTbMKq3MlpuU3cCQ=
|
||||||
github.com/microsoft/typescript-go v0.0.0-20251013215234-fd15f297d473/go.mod h1:/yWoZzcFKn2eQjB4E+kfEhQ/iGVrFKYswH1ZW+jWZu8=
|
github.com/microsoft/typescript-go v0.0.0-20251013215234-fd15f297d473/go.mod h1:/yWoZzcFKn2eQjB4E+kfEhQ/iGVrFKYswH1ZW+jWZu8=
|
||||||
|
github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA=
|
||||||
|
github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
|
||||||
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
||||||
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||||
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProgLang string
|
type ProgLang string
|
||||||
@ -45,16 +46,25 @@ func main() {
|
|||||||
log.Panic("source and destination must be set")
|
log.Panic("source and destination must be set")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := checkIsFile(Src); err != nil {
|
srcAbs, err := filepath.Abs(Src)
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
apiParser, err := apiParserByExt(Src)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = apiParser.Parse(Src)
|
//Dest, err = filepath.Abs(Dest)
|
||||||
|
//if err != nil {
|
||||||
|
//}
|
||||||
|
|
||||||
|
if err := checkIsFile(srcAbs); err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
apiParser, err := apiParserByExt(srcAbs)
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = apiParser.Parse(srcAbs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,27 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"efprojects.com/kitten-ipc/kitcom/internal/tsgo/ast"
|
||||||
|
"efprojects.com/kitten-ipc/kitcom/internal/tsgo/core"
|
||||||
|
"efprojects.com/kitten-ipc/kitcom/internal/tsgo/parser"
|
||||||
|
)
|
||||||
|
|
||||||
type TypescriptApiParser struct {
|
type TypescriptApiParser struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TypescriptApiParser) Parse(sourceFile string) (Api, error) {
|
func (t *TypescriptApiParser) Parse(sourceFilePath string) (Api, error) {
|
||||||
|
sourceFile := parser.ParseSourceFile(ast.SourceFileParseOptions{
|
||||||
|
FileName: sourceFilePath,
|
||||||
|
Path: "",
|
||||||
|
CompilerOptions: core.SourceFileAffectingCompilerOptions{},
|
||||||
|
ExternalModuleIndicatorOptions: ast.ExternalModuleIndicatorOptions{},
|
||||||
|
JSDocParsingMode: ast.JSDocParsingModeParseAll,
|
||||||
|
}, "", core.ScriptKindTS)
|
||||||
|
_ = sourceFile
|
||||||
|
|
||||||
|
fmt.Println("kek")
|
||||||
|
|
||||||
|
return Api{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user