Error in REXML

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”.

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.

···

On Tue, Oct 28, 2003 at 07:22:39AM +0900, Daniel Carrera wrote:

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”.


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

Hi –

···

On Tue, 28 Oct 2003, Daniel Carrera wrote:

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?

The line looks OK to me; my guess is that it’s matching part of
“” or something similar that has the “]>”
sequence.

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

David


David Alan Black
home: dblack@superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

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

Thanks.

···

On Tue, Oct 28, 2003 at 08:34:52AM +0900, dblack@superlink.net wrote:

The line looks OK to me; my guess is that it’s matching part of
“” or something similar that has the “]>”
sequence.

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


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