[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

Re: The latest 1.8.2 cvs prints parse error when starting extension compiling

From: Johan Holmberg <holmberg@...>
Date: 2004-11-23 08:37:46 UTC
List: ruby-core #3788
On Tue, 23 Nov 2004, Johan Holmberg wrote:
>
> I get this on Solaris, with the latest 1.8 CVS:
>
> -----------------------------------------------------------------------------
> [...]
> ./ext/extmk.rb:27:in `require': ./lib/mkmf.rb:1043: can't find string "SRC" 
> anywhere before EOF (SyntaxError)
> ./lib/mkmf.rb:544: parse error
>    if try_compile(<<"SRC", opt, &b) or (/\A\w+\z/n =~ type && 
> try_compile(<<"SRC", opt, &b))
>                                                                                  ^ 
> from ./ext/extmk.rb:27
> *** Error code 1
> ----------------------------------------------------------------------------
>

I also got rid of the problem by the following code change.
I introduced two new temporary variables and avoided putting the two
<<"SRC" expressions (and a regexp) together in one single if-expression.

Does his help understanding the problem?

/Johan Holmberg


old code:
----------------------------------------------------------------------
     if try_compile(<<"SRC", opt, &b) or (/\A\w+\z/n =~ type && try_compile(<<"SRC", opt, &b))
#{COMMON_HEADERS}
#{header}
/*top*/
static #{type} t;
SRC
#{COMMON_HEADERS}
#{header}
/*top*/
static #{type} *t;
SRC
----------------------------------------------------------------------

new code:
----------------------------------------------------------------------
     src1 = <<"SRC"
#{COMMON_HEADERS}
#{header}
/*top*/
static #{type} t;
SRC
     src2 = <<"SRC"
#{COMMON_HEADERS}
#{header}
/*top*/
static #{type} *t;
SRC
     if try_compile(src1, opt, &b) or (/\A\w+\z/n =~ type && try_compile(src2, opt, &b))
----------------------------------------------------------------------



In This Thread