Skip to content

Commit 9cca38a

Browse files
committed
printer: remove printer.print() for now
1 parent 9372e18 commit 9cca38a

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

printer/printer.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"errors"
88
"fmt"
99
"io"
10-
"log"
1110

1211
"github.com/haya14busa/go-vimlparser/ast"
1312
)
@@ -42,19 +41,6 @@ func (p *printer) init(cfg *Config) {
4241
p.Config = *cfg
4342
}
4443

45-
func (p *printer) print(args ...interface{}) {
46-
for _, arg := range args {
47-
switch arg := arg.(type) {
48-
case *ast.BasicLit:
49-
p.writeString(arg.Value)
50-
case *ast.Ident:
51-
p.writeString(arg.Name)
52-
default:
53-
log.Fatal(fmt.Errorf("print: unsupported type %T", arg))
54-
}
55-
}
56-
}
57-
5844
func (p *printer) writeString(s string) {
5945
p.output = append(p.output, s...)
6046
}
@@ -90,8 +76,10 @@ func (p *printer) expr(expr ast.Expr) error {
9076
// case *ast.CurlyName:
9177
// case *ast.CurlyNameLit:
9278
// case *ast.CurlyNameExpr:
93-
case *ast.BasicLit, *ast.Ident:
94-
p.print(n)
79+
case *ast.BasicLit:
80+
p.writeString(n.Value)
81+
case *ast.Ident:
82+
p.writeString(n.Name)
9583
// case *ast.LambdaExpr:
9684
// case *ast.ParenExpr:
9785
default:

0 commit comments

Comments
 (0)