File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change 7
7
"errors"
8
8
"fmt"
9
9
"io"
10
- "log"
11
10
12
11
"github.com/haya14busa/go-vimlparser/ast"
13
12
)
@@ -42,19 +41,6 @@ func (p *printer) init(cfg *Config) {
42
41
p .Config = * cfg
43
42
}
44
43
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
-
58
44
func (p * printer ) writeString (s string ) {
59
45
p .output = append (p .output , s ... )
60
46
}
@@ -90,8 +76,10 @@ func (p *printer) expr(expr ast.Expr) error {
90
76
// case *ast.CurlyName:
91
77
// case *ast.CurlyNameLit:
92
78
// 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 )
95
83
// case *ast.LambdaExpr:
96
84
// case *ast.ParenExpr:
97
85
default :
You can’t perform that action at this time.
0 commit comments