Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Parser bug?

Reply
Thread Tools

Parser bug?

 
 
Logan Capaldo
Guest
Posts: n/a
 
      10-02-2006
So I was playing around, and decided that I wanted to define a method
that ended in ?, but also happened to not have anything but an ending,
<g>.

So I did this:

def ?()
end

I got a syntax error, not very surprising. The interesting bit was
_what_ syntax error I got:

% ruby <<HERE
heredoc> def ?()
heredoc> end
heredoc> HERE
-:1: parse error, unexpected tINTEGER
def ?()
^

Obviously a ')' is not an integer token. Thoughts? Comments? Insults? Is
this really a bug?

 
Reply With Quote
 
 
 
 
Marcin Mielżyński
Guest
Posts: n/a
 
      10-02-2006


the ? operator takes an ascii symbol and returns numerical value for it
(namely integer)

lopex
 
Reply With Quote
 
 
 
 
Marcin Mielżyński
Guest
Posts: n/a
 
      10-02-2006
Marcin Mielżyński wrote:
>
>
> the ? operator takes an ascii symbol and returns numerical value for it
> (namely integer)
>


at parse time of course...

lopex
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
import parser does not import parser.py in same dir on win Joel Hedlund Python 2 11-11-2006 03:46 PM
import parser does not import parser.py in same dir on win Joel Hedlund Python 0 11-11-2006 11:34 AM
XML Parser VS HTML Parser ZOCOR Java 11 10-05-2004 01:58 PM
XMLparser: Difference between parser.setErrorHandler() vs. parser.setContentHandler() Bernd Oninger Java 0 06-09-2004 01:26 AM
XMLparser: Difference between parser.setErrorHandler() vs. parser.setContentHandler() Bernd Oninger XML 0 06-09-2004 01:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57