diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-26 23:57:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-26 23:57:58 +0000 |
commit | d8f412571f8768df2d3239e72392dfeabbad1559 (patch) | |
tree | 19d182df05ead7ff8ba7ee00a7d57555e1383fdf /libgo/go/mime/grammar.go | |
parent | e0c39d66d4f0607177b1cf8995dda56a667e07b3 (diff) | |
download | gcc-d8f412571f8768df2d3239e72392dfeabbad1559.zip gcc-d8f412571f8768df2d3239e72392dfeabbad1559.tar.gz gcc-d8f412571f8768df2d3239e72392dfeabbad1559.tar.bz2 |
Update Go library to last weekly.
From-SVN: r180552
Diffstat (limited to 'libgo/go/mime/grammar.go')
-rw-r--r-- | libgo/go/mime/grammar.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libgo/go/mime/grammar.go b/libgo/go/mime/grammar.go index 6e319ff..70a94cd 100644 --- a/libgo/go/mime/grammar.go +++ b/libgo/go/mime/grammar.go @@ -22,6 +22,15 @@ func IsTokenChar(rune int) bool { return rune > 0x20 && rune < 0x7f && !isTSpecial(rune) } +// IsToken returns true if s is a 'token' as as defined by RFC 1521 +// and RFC 2045. +func IsToken(s string) bool { + if s == "" { + return false + } + return strings.IndexFunc(s, isNotTokenChar) < 0 +} + // IsQText returns true if rune is in 'qtext' as defined by RFC 822. func IsQText(rune int) bool { // CHAR = <any ASCII character> ; ( 0-177, 0.-127.) |