File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
1311func 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 )
You can’t perform that action at this time.
0 commit comments