lib/tmail/scanner_r.rb in tmail-1.2.1 vs lib/tmail/scanner_r.rb in tmail-1.2.2
- old
+ new
@@ -24,11 +24,11 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Note: Originally licensed under LGPL v2+. Using MIT license for Rails
# with permission of Minero Aoki.
#++
-
+#:stopdoc:
require 'tmail/config'
module TMail
class TMailScanner
@@ -103,11 +103,11 @@
# fix scanner mode
@received = (scantype == :RECEIVED)
@is_mime_header = MIME_HEADERS[scantype]
- atom, token, @quoted_re, @domlit_re, @comment_re = PATTERN_TABLE[$KCODE]
+ atom, token, @quoted_re, @domlit_re, @comment_re = PATTERN_TABLE[TMail.KCODE]
@word_re = (MIME_HEADERS[scantype] ? token : atom)
end
attr_accessor :debug
@@ -143,38 +143,38 @@
break if eof?
end
if s = readstr(@word_re)
if @is_mime_header
- yield :TOKEN, s
+ yield [:TOKEN, s]
else
# atom
if /\A\d+\z/ === s
- yield :DIGIT, s
+ yield [:DIGIT, s]
elsif @received
- yield RECV_TOKEN[s.downcase] || :ATOM, s
+ yield [RECV_TOKEN[s.downcase] || :ATOM, s]
else
- yield :ATOM, s
+ yield [:ATOM, s]
end
end
elsif skip(/\A"/)
- yield :QUOTED, scan_quoted_word()
+ yield [:QUOTED, scan_quoted_word()]
elsif skip(/\A\[/)
- yield :DOMLIT, scan_domain_literal()
+ yield [:DOMLIT, scan_domain_literal()]
elsif skip(/\A\(/)
@comments.push scan_comment()
else
c = readchar()
- yield c, c
+ yield [c, c]
end
end
- yield false, '$'
+ yield [false, '$']
end
def scan_quoted_word
scan_qstr(@quoted_re, /\A"/, 'quoted-word')
end
@@ -257,5 +257,6 @@
end
end
end # module TMail
+#:startdoc:
\ No newline at end of file