mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Hoist some methods from token.ID to token.Token.
This commit is contained in:
1 parent
a48bbf6d2e
commit
5c934e5599
3 files changed
+19
-15
No files matched your search
+1
-6
@@ -61,11 +61,6 @@ func (m *IDMap) ByKey(k Key) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type Token struct {
|
||||
ID ID
|
||||
Line uint32
|
||||
}
|
||||
|
||||
func alpha(c byte) bool {
|
||||
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || (c == '_')
|
||||
}
|
||||
@@ -102,7 +97,7 @@ loop:
|
||||
|
||||
if c <= ' ' {
|
||||
if c == '\n' {
|
||||
if len(tokens) > 0 && tokens[len(tokens)-1].ID.IsImplicitSemicolon() {
|
||||
if len(tokens) > 0 && tokens[len(tokens)-1].IsImplicitSemicolon() {
|
||||
tokens = append(tokens, Token{IDSemicolon, line})
|
||||
}
|
||||
if line == 1<<32-1 {
|
||||
|
||||
Reference in new issue
Block a user