[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Error in REXML

Daniel Carrera

10/27/2003 10:23:00 PM

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

2 Answers

Daniel Carrera

10/27/2003 11:28:00 PM

0

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

Daniel Carrera

10/27/2003 11:42:00 PM

0

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
> "<!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.

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