summaryrefslogtreecommitdiff
path: root/lib/rexml
diff options
context:
space:
mode:
authorFUJI Goro (gfx) <gfuji@cpan.org>2019-01-05 22:34:03 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-04 11:54:44 +0900
commit982208c65069423b1bc90dafde7589872c452c21 (patch)
treeadd5786db4d361b6f202a18c7a7a003cd1a1f1b9 /lib/rexml
parent81354bbd1b2ef5f4660c9255eea1f99b26688efa (diff)
[ruby/rexml] use #inspect to print meta-characters in error messages
https://github.com/ruby/rexml/commit/a124a19b9a
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/text.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb
index 6139caecd7..5eba6e03c9 100644
--- a/lib/rexml/text.rb
+++ b/lib/rexml/text.rb
@@ -137,7 +137,7 @@ module REXML
case c.ord
when *VALID_CHAR
else
- raise "Illegal character #{c.inspect} in raw string \"#{string}\""
+ raise "Illegal character #{c.inspect} in raw string #{string.inspect}"
end
end
else
@@ -145,7 +145,7 @@ module REXML
case c.unpack('U')
when *VALID_CHAR
else
- raise "Illegal character #{c.inspect} in raw string \"#{string}\""
+ raise "Illegal character #{c.inspect} in raw string #{string.inspect}"
end
end
end
@@ -154,13 +154,13 @@ module REXML
# context sensitive
string.scan(pattern) do
if $1[-1] != ?;
- raise "Illegal character '#{$1}' in raw string \"#{string}\""
+ raise "Illegal character #{$1.inspect} in raw string #{string.inspect}"
elsif $1[0] == ?&
if $5 and $5[0] == ?#
case ($5[1] == ?x ? $5[2..-1].to_i(16) : $5[1..-1].to_i)
when *VALID_CHAR
else
- raise "Illegal character '#{$1}' in raw string \"#{string}\""
+ raise "Illegal character #{$1.inspect} in raw string #{string.inspect}"
end
# FIXME: below can't work but this needs API change.
# elsif @parent and $3 and !SUBSTITUTES.include?($1)