Skip to content

Commit 97cd77e

Browse files
committed
Update main.go
1 parent a2acf15 commit 97cd77e

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

main.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,16 @@ import (
55

66
"github.com/monstermichl/typeshell/converters/bash"
77
"github.com/monstermichl/typeshell/converters/batch"
8-
"github.com/monstermichl/typeshell/lexer"
9-
"github.com/monstermichl/typeshell/parser"
108
"github.com/monstermichl/typeshell/transpiler"
119
)
1210

1311
func main() {
1412
testFile := "test.mss"
15-
data, _ := os.ReadFile(testFile)
16-
tokens, err := lexer.Tokenize(string(data))
17-
18-
if err != nil {
19-
panic(err)
20-
}
21-
p := parser.New(tokens)
22-
prog, err := p.Parse()
23-
//fmt.Println(prog)
24-
if err != nil {
25-
panic(err)
26-
}
27-
i := transpiler.New(prog)
13+
t := transpiler.New()
2814

2915
// Dump batch file.
3016
batchConv := batch.New()
31-
dump, err := i.Transpile(batchConv)
17+
dump, err := t.Transpile(testFile, batchConv)
3218

3319
if err != nil {
3420
panic(err)
@@ -37,7 +23,7 @@ func main() {
3723

3824
// Dump bash file.
3925
bashConv := bash.New()
40-
dump, err = i.Transpile(bashConv)
26+
dump, err = t.Transpile(testFile, bashConv)
4127

4228
if err != nil {
4329
panic(err)

0 commit comments

Comments
 (0)