p.print(x.Lparen, token.LPAREN)
p.exprList(x.Lparen, x.Args, depth, commaSep|commaTerm, multiLine, x.Rparen)
if x.Ellipsis.IsValid() {
- if p.lastTok == token.INT {
- // w/o a blank, the previous int will become a float
- // (this could be solved more generally in the print
- // function but it appears that this is the only
- // place in the grammar where a token starting with
- // a do may legally extend the previous token)
- p.print(blank)
- }
p.print(x.Ellipsis, token.ELLIPSIS)
}
p.print(x.Rparen, token.RPAREN)
data = []byte("\xff" + string(data) + "\xff")
tok = x.Kind
case token.Token:
+ s := x.String()
+ if p.lastTok == token.INT && s[0] == '.' {
+ // separate int with blank from '.' so it doesn't become a float
+ if len(p.buffer) != 0 {
+ p.internalError("whitespace buffer not empty")
+ }
+ p.buffer = p.buffer[0:1]
+ p.buffer[0] = ' '
+ }
if p.Styler != nil {
data, tag = p.Styler.Token(x)
} else {
- data = []byte(x.String())
+ data = []byte(s)
}
tok = x
case token.Position: