# Parser bug?

**URL:** <https://www.ruby-forum.com/t/parser-bug/70793>\
**Category:** Ruby\
**Created:** [October 3, 2006, 1:16am UTC](https://www.ruby-forum.com/t/parser-bug/70793 "2006-10-03T01:16:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Logan\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e47774/32.png) [@Logan\_C](https://www.ruby-forum.com/u/Logan_C)\
**Post date:** [October 3, 2006, 1:16am UTC](https://www.ruby-forum.com/t/parser-bug/70793/1 "2006-10-03T01:16:20Z")

</div>

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

So I did this:

def ?()  
end

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

% ruby \< 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?

---

<div class="post-metadata">

**Author:** ![Logan\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e47774/32.png) [@Logan\_C](https://www.ruby-forum.com/u/Logan_C)\
**Post date:** [October 3, 2006, 1:26am UTC](https://www.ruby-forum.com/t/parser-bug/70793/2 "2006-10-03T01:26:20Z")

</div>

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

lopex

---

<div class="post-metadata">

**Author:** ![Logan\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e47774/32.png) [@Logan\_C](https://www.ruby-forum.com/u/Logan_C)\
**Post date:** [October 3, 2006, 1:30am UTC](https://www.ruby-forum.com/t/parser-bug/70793/3 "2006-10-03T01:30:21Z")

</div>

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
