summaryrefslogtreecommitdiff
path: root/libgo/go/html/token.go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-25 20:56:26 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-25 20:56:26 +0000
commit422eaae5fe0038ad189b8fd28cfd6a7094d67ae1 (patch)
treec68d6b2a9f5b82a23171b0a488a4b7e5c63ad860 /libgo/go/html/token.go
parente0f3ea3ed4b9d0bce9f4c14762e4257ba62c8fba (diff)
downloadgcc-422eaae5fe0038ad189b8fd28cfd6a7094d67ae1.tar.gz
libgo: Update to weekly.2012-01-15.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/html/token.go')
-rw-r--r--libgo/go/html/token.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/libgo/go/html/token.go b/libgo/go/html/token.go
index 69af96840c2..5a385a1b5c5 100644
--- a/libgo/go/html/token.go
+++ b/libgo/go/html/token.go
@@ -52,11 +52,14 @@ func (t TokenType) String() string {
return "Invalid(" + strconv.Itoa(int(t)) + ")"
}
-// An Attribute is an attribute key-value pair. Key is alphabetic (and hence
+// An Attribute is an attribute namespace-key-value triple. Namespace is
+// non-empty for foreign attributes like xlink, Key is alphabetic (and hence
// does not contain escapable characters like '&', '<' or '>'), and Val is
// unescaped (it looks like "a<b" rather than "a&lt;b").
+//
+// Namespace is only used by the parser, not the tokenizer.
type Attribute struct {
- Key, Val string
+ Namespace, Key, Val string
}
// A Token consists of a TokenType and some Data (tag name for start and end
@@ -756,7 +759,7 @@ func (z *Tokenizer) Token() Token {
for moreAttr {
var key, val []byte
key, val, moreAttr = z.TagAttr()
- attr = append(attr, Attribute{string(key), string(val)})
+ attr = append(attr, Attribute{"", string(key), string(val)})
}
t.Data = string(name)
t.Attr = attr