Error in REXML

D

Daniel Carrera

Can anyone confirm this? :

$ ruby -v
ruby 1.8.0 (2003-08-04) [sparc-solaris2.8]
$ ruby -rrexml/document -e ""
/home3/dcarrera/lib/ruby/site_ruby/1.8/rexml/doctype.rb:178: warning:
regexp has `]' without escape


Indeed, if you look at the source, line 178 has:
-----------
begin
...
source.match(/\s*]\s*>/um, true) <--------
^^^^^^^^^
rescue ParseException
-----------

That doesn't look right to me. On the other hand, I did have rexml
working before I reinstalled Ruby, and if this were a but it would have
been noticed.

Can anyone shed any light on this? Is this line correct? (it must be).
If so, does anyone know what might be wrong with my system?

Cheers,
 
D

Daniel Carrera

I moved my ~/lib/ruby directory some place else and reinstalled ruby.
This made the problem go away.

The rexml/document.rb file that comes with Ruby is different from the one
I got from RAA. In particular, this offending line is no longer there.

Perhaps the file in RAA is an old, in which case it should be updated.

Cheers,
Daniel.


Can anyone confirm this? :

$ ruby -v
ruby 1.8.0 (2003-08-04) [sparc-solaris2.8]
$ ruby -rrexml/document -e ""
/home3/dcarrera/lib/ruby/site_ruby/1.8/rexml/doctype.rb:178: warning:
regexp has `]' without escape


Indeed, if you look at the source, line 178 has:
-----------
begin
...
source.match(/\s*]\s*>/um, true) <--------
^^^^^^^^^
rescue ParseException
-----------

That doesn't look right to me. On the other hand, I did have rexml
working before I reinstalled Ruby, and if this were a but it would have
been noticed.

Can anyone shed any light on this? Is this line correct? (it must be).
If so, does anyone know what might be wrong with my system?

Cheers,
--
Daniel Carrera | OpenPGP KeyID: 9AF77A88
PhD grad student. |
Mathematics Dept. | "To understand recursion, you must first
UMD, College Park | understand recursion".
 
D

Daniel Carrera

The line looks OK to me; my guess is that it's matching part of
"<!DOCTYPE ... [ ... ]>" or something similar that has the "]>"
sequence.

The warning (not error :) message is new in 1.8.0, so I guess anyone
who's put a literal ] in a regex should probably now escape it.

Oh. Thanks. That also explains why that regex is not there anymore in
the ruby 1.8.0 version.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top