diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-27 10:45:24 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-27 10:45:24 +0000 |
commit | 55518710865bd7258422807524403c91347519a2 (patch) | |
tree | 4146c423ab0c55ed35d9d860e64d7e3a7e2a9efb /lib/rdoc/markdown | |
parent | 2d9f20e1cfdc7532a8acef4da9b8b7a788c4e99a (diff) |
Merge rdoc-6.0.0.beta4 from upstream.
It version applied `frozen_string_literal: true`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markdown')
-rw-r--r-- | lib/rdoc/markdown/entities.rb | 2 | ||||
-rw-r--r-- | lib/rdoc/markdown/literals.rb | 25 |
2 files changed, 19 insertions, 8 deletions
diff --git a/lib/rdoc/markdown/entities.rb b/lib/rdoc/markdown/entities.rb index d32ae51053..d2cf610293 100644 --- a/lib/rdoc/markdown/entities.rb +++ b/lib/rdoc/markdown/entities.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true ## # HTML entity name map for RDoc::Markdown diff --git a/lib/rdoc/markdown/literals.rb b/lib/rdoc/markdown/literals.rb index b6bb89e0c6..cd4cb52335 100644 --- a/lib/rdoc/markdown/literals.rb +++ b/lib/rdoc/markdown/literals.rb @@ -1,5 +1,4 @@ # coding: UTF-8 -# frozen_string_literal: false # :markup: markdown ## @@ -183,14 +182,26 @@ class RDoc::Markdown::Literals return nil end - def get_byte - if @pos >= @string_size - return nil + if "".respond_to? :ord + def get_byte + if @pos >= @string_size + return nil + end + + s = @string[@pos].ord + @pos += 1 + s end + else + def get_byte + if @pos >= @string_size + return nil + end - s = @string[@pos].ord - @pos += 1 - s + s = @string[@pos] + @pos += 1 + s + end end def parse(rule=nil) |