Skip to content

Commit

Permalink
fix: success message closes #58
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoene committed Sep 13, 2024
1 parent df740c0 commit 8c08c54
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions transpile.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"log"
"os"

Expand Down Expand Up @@ -41,9 +42,8 @@ func (v *vapour) transpile(conf cli.CLI) bool {
w := walker.New()
w.Walk(prog)

w.Errors().Print()

if w.HasError() {
w.Errors().Print()
return false
}

Expand All @@ -55,6 +55,7 @@ func (v *vapour) transpile(conf cli.CLI) bool {
trans := transpiler.New()
trans.Transpile(prog)
code := trans.GetCode()
successfulTranspile()

if *conf.Run {
run(code)
Expand Down Expand Up @@ -131,8 +132,8 @@ func (v *vapour) transpileFile(conf cli.CLI) bool {
// walk tree
w := walker.New()
w.Walk(prog)
w.Errors().Print()
if w.HasError() {
w.Errors().Print()
return false
}

Expand All @@ -145,6 +146,8 @@ func (v *vapour) transpileFile(conf cli.CLI) bool {
trans.Transpile(prog)
code := trans.GetCode()

successfulTranspile()

if *conf.Run {
run(code)
return false
Expand All @@ -169,3 +172,7 @@ func (v *vapour) transpileFile(conf cli.CLI) bool {

return true
}

func successfulTranspile() {
fmt.Println("✓ Files transpiled!")
}

0 comments on commit 8c08c54

Please sign in to comment.