[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Re: The %? .. ? Operator

From: Eric Hodel <drbrain@...7.net>
Date: 2006-09-29 18:52:37 UTC
List: ruby-core #8957
On Sep 29, 2006, at 9:56 AM, James Edward Gray II wrote:

> I'm needing to know the full list of characters that can (or  
> cannot) be used in the following Ruby construct:
>
>   %?special Ruby String literal?
>
> What are all the legal choices for the ?s above?
>
> I did browse parse.y a little, but couldn't find an obvious answer  
> there.

It looks like the rule is something like:

/%[QqWwxrs]?(.).*\1/

Where QqWwxrs define what type of special literal it is (string,  
array, exec (`), regex or symbol) and following that is the  
terminating character which may be any character (but ([<{ must be  
balanced).

See parse.y around line 4162, "case '%':"

-- 
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com



In This Thread