mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Add Token.KeyFoo constants.
This commit is contained in:
1 parent
05a217e8a3
commit
90c5f4758e
8 files changed
+483
-358
No files matched your search
@@ -104,19 +104,19 @@ func Render(w io.Writer, m *token.IDMap, src []token.Token, comments []string) (
|
||||
if prevID != 0 && !prevIsTightRight && !t.IsTightLeft() {
|
||||
// The "(" token's tight-left-ness is context dependent. For
|
||||
// "f(x)", the "(" is tight-left. For "a * (b + c)", it is not.
|
||||
if t.ID != token.IDOpenParen || prevID.Flags()&flagsLIC == 0 {
|
||||
if t.ID.Key() != token.KeyOpenParen || prevID.Flags()&flagsLIC == 0 {
|
||||
buf = append(buf, ' ')
|
||||
}
|
||||
}
|
||||
|
||||
buf = append(buf, m.ByToken(t)...)
|
||||
|
||||
if t.ID == token.IDOpenCurly {
|
||||
if t.ID.Key() == token.KeyOpenCurly {
|
||||
if indent == maxIndent {
|
||||
return errors.New("render: too many \"{\" tokens")
|
||||
}
|
||||
indent++
|
||||
} else if t.ID == token.IDCloseCurly {
|
||||
} else if t.ID.Key() == token.KeyCloseCurly {
|
||||
if indent == 0 {
|
||||
return errors.New("render: too many \"}\" tokens")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user