aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ast/scanner.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/ast/scanner.go')
-rw-r--r--pkg/ast/scanner.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/ast/scanner.go b/pkg/ast/scanner.go
index 594b9ea8d..aaabb5bcc 100644
--- a/pkg/ast/scanner.go
+++ b/pkg/ast/scanner.go
@@ -195,7 +195,7 @@ func (s *scanner) Scan() (tok token, lit string, pos Pos) {
default:
tok = punctuation[s.ch]
if tok == tokIllegal {
- s.Error(pos, "illegal character %#U", s.ch)
+ s.Errorf(pos, "illegal character %#U", s.ch)
}
s.next()
}
@@ -212,7 +212,7 @@ func (s *scanner) scanStr(pos Pos) string {
}
for s.next(); s.ch != closing; s.next() {
if s.ch == 0 || s.ch == '\n' {
- s.Error(pos, "string literal is not terminated")
+ s.Errorf(pos, "string literal is not terminated")
return ""
}
}
@@ -222,7 +222,7 @@ func (s *scanner) scanStr(pos Pos) string {
pos1 := pos
pos1.Col += i + 1
pos1.Off += i + 1
- s.Error(pos1, "illegal character %#U in string literal", lit[i])
+ s.Errorf(pos1, "illegal character %#U in string literal", lit[i])
break
}
}
@@ -232,7 +232,7 @@ func (s *scanner) scanStr(pos Pos) string {
}
decoded, err := hex.DecodeString(lit)
if err != nil {
- s.Error(pos, "bad hex string literal: %v", err)
+ s.Errorf(pos, "bad hex string literal: %v", err)
}
return string(decoded)
}
@@ -258,7 +258,7 @@ func (s *scanner) scanInt(pos Pos) string {
return lit
}
}
- s.Error(pos, fmt.Sprintf("bad integer %q", lit))
+ s.Errorf(pos, "bad integer %q", lit)
return "0"
}
@@ -266,7 +266,7 @@ func (s *scanner) scanChar(pos Pos) string {
s.next()
s.next()
if s.ch != '\'' {
- s.Error(pos, "char literal is not terminated")
+ s.Errorf(pos, "char literal is not terminated")
return "0"
}
s.next()
@@ -288,7 +288,7 @@ func (s *scanner) scanIdent(pos Pos) (tok token, lit string) {
return
}
-func (s *scanner) Error(pos Pos, msg string, args ...interface{}) {
+func (s *scanner) Errorf(pos Pos, msg string, args ...interface{}) {
s.errors++
s.errorHandler(pos, fmt.Sprintf(msg, args...))
}
@@ -320,7 +320,7 @@ func (s *scanner) next() {
s.ch = s.data[s.off]
s.col++
if s.ch == 0 {
- s.Error(s.pos(), "illegal character \\x00")
+ s.Errorf(s.pos(), "illegal character \\x00")
}
}