src/yaml.y.rb:210: warning: ambiguous first argument; make sure 
Author Message
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

any one get this error when running with '-w'?

took a peek in the file - but there are some bizarre goings on in there:

module_eval <<'.,.,', 'src/yaml.y.rb', 81
  def _reduce_27( val, _values, result )
    result = new_node( 'seq', val[1] )
    result
  end
.,.,

looks like some heredocs and...  what?  can anyone explain this syntax - looks
like C preprocessor stuff?

-a
--
  ====================================
  | Ara Howard
  | NOAA Forecast Systems Laboratory
  | Information and Technology Services
  | Data Systems Group
  | R/FST 325 Broadway
  | Boulder, CO 80305-3328

  | Phone:  303-497-7238
  | Fax:    303-497-7259
  | ~ > ruby -e 'p(%.\x2d\x29..intern)'
  ====================================



Tue, 29 Nov 2005 03:05:35 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

Quote:
> any one get this error when running with '-w'?

> took a peek in the file - but there are some bizarre goings on in there:

> module_eval <<'.,.,', 'src/yaml.y.rb', 81

You are looking at code generated by Racc.  I would upgrade to a newer version
of YAML.rb.  YAML.rb previous to 0.60 is being deprecated.

Quote:
> looks like some heredocs and...  what?  can anyone explain this syntax -
> looks like C preprocessor stuff?

Very similiar.  These statements alter __FILE__ and __LINE__.  If you look in
the YAML.rb distribution, you'll find src/yaml.y.rb and src/emitter.rb.  
These two files are cobbled into yaml.rb when you install.

_why



Tue, 29 Nov 2005 03:43:49 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

Quote:

> any one get this error when running with '-w'?

> took a peek in the file - but there are some bizarre goings on in there:

> module_eval <<'.,.,', 'src/yaml.y.rb', 81
>   def _reduce_27( val, _values, result )
>     result = new_node( 'seq', val[1] )
>     result
>   end
> ..,.,

> looks like some heredocs and...  what?  can anyone explain this syntax - looks
> like C preprocessor stuff?

As it happens, I was just looking at something like that in a
racc-generated parser class. The

   'src/yaml.y.rb', 81

are extra information about the file and line from which racc generated
this bit of code. It's used in error reporting.

The '.,.,' is just a creative version of 'END', AFAICT. But it looks
like your file has an extra '.' at the beginning of the last line. Did
racc put that there?



Tue, 29 Nov 2005 03:45:46 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

Quote:

> As it happens, I was just looking at something like that in a
> racc-generated parser class. The

>    'src/yaml.y.rb', 81

> are extra information about the file and line from which racc generated
> this bit of code. It's used in error reporting.

i guessed as much.

i didn't realize you could:

  method <<hdoc, arg1, arg2
    string
    stuff
  hdoc

that's cool.

Quote:
> The '.,.,' is just a creative version of 'END', AFAICT. But it looks
> like your file has an extra '.' at the beginning of the last line. Did
> racc put that there?

no.  vim did somehow.  ;-)

-a
--
  ====================================
  | Ara Howard
  | NOAA Forecast Systems Laboratory
  | Information and Technology Services
  | Data Systems Group
  | R/FST 325 Broadway
  | Boulder, CO 80305-3328

  | Phone:  303-497-7238
  | Fax:    303-497-7259
  | ~ > ruby -e 'p(%.\x2d\x29..intern)'
  ====================================



Tue, 29 Nov 2005 04:08:05 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

Quote:
> You are looking at code generated by Racc.  I would upgrade to a newer version
> of YAML.rb.  YAML.rb previous to 0.60 is being deprecated.

will do.  how strongly deprecated - will the file formats be compatible?

Quote:
> Very similiar.  These statements alter __FILE__ and __LINE__.  If you look
> in the YAML.rb distribution, you'll find src/yaml.y.rb and src/emitter.rb.
> These two files are cobbled into yaml.rb when you install.

neat - didn't know you could do that.  what's odd though, is that the line
number (210) does not appear in the source?

-a
--
  ====================================
  | Ara Howard
  | NOAA Forecast Systems Laboratory
  | Information and Technology Services
  | Data Systems Group
  | R/FST 325 Broadway
  | Boulder, CO 80305-3328

  | Phone:  303-497-7238
  | Fax:    303-497-7259
  | ~ > ruby -e 'p(%.\x2d\x29..intern)'
  ====================================



Tue, 29 Nov 2005 04:11:04 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

Quote:
> will do.  how strongly deprecated - will the file formats be compatible?

Absolutely.  I'll just be halting work on the Ruby parser, since the C parser
is packaged with Ruby.

You should have no trouble loading your current YAML documents with the new
parser.  If you do have trouble, please contact me straightway.

Quote:
> neat - didn't know you could do that.  what's odd though, is that the line
> number (210) does not appear in the source?

Line 210 in yaml.y.rb (from version 0.49.2) is:

    add_end_indent -1
 -> close_tokens

I suppose the lack of parens on the first line is causing the commotion.

_why



Tue, 29 Nov 2005 05:00:45 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure
Quote:
----- Original Message -----

Newsgroups: comp.lang.ruby

Sent: Thursday, June 12, 2003 3:24 PM
Subject: Re: src/yaml.y.rb:210: warning: ambiguous first argument; make sure


> i didn't realize you could:

>   method <<hdoc, arg1, arg2
>     string
>     stuff
>   hdoc

> that's cool.

It is cool. And you can even do an arbitrary number
of them:

    mymeth a, <<doc1, b, <<doc2, c, <<doc3, d
      stuff
    doc1
      more
      stuff
    doc2
      still
      more
      stuff
    doc3

Though eventually it's a bit much, I guess.

> > The '.,.,' is just a creative version of 'END', AFAICT. But it looks
> > like your file has an extra '.' at the beginning of the last line. Did
> > racc put that there?

> no.  vim did somehow.  ;-)

As for the .,., -- I thought a here-doc marker
had to be an identifier??

Hal



Tue, 29 Nov 2005 06:15:45 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure

Quote:

> It is cool. And you can even do an arbitrary number
> of them:

>     mymeth a, <<doc1, b, <<doc2, c, <<doc3, d
>       stuff
>     doc1
>       more
>       stuff
>     doc2
>       still
>       more
>       stuff
>     doc3

> Though eventually it's a bit much, I guess.

now, i personally like to know these sorts of things - they do make a language
more interesting and even more fun to write/read.  obfusication is not *all*
bad - maybe the guy who prefers perl is onto something... ;-)

-a
--
  ====================================
  | Ara Howard
  | NOAA Forecast Systems Laboratory
  | Information and Technology Services
  | Data Systems Group
  | R/FST 325 Broadway
  | Boulder, CO 80305-3328

  | Phone:  303-497-7238
  | Fax:    303-497-7259
  | ~ > ruby -e 'p(%.\x2d\x29..intern)'
  ====================================



Tue, 29 Nov 2005 07:00:28 GMT  
 src/yaml.y.rb:210: warning: ambiguous first argument; make sure
Quote:
----- Original Message -----

Newsgroups: comp.lang.ruby

Sent: Thursday, June 12, 2003 6:26 PM
Subject: Re: src/yaml.y.rb:210: warning: ambiguous first argument; make sure

> now, i personally like to know these sorts of things - they do make a
language
> more interesting and even more fun to write/read.  obfusication is not
*all*
> bad - maybe the guy who prefers perl is onto something... ;-)

:) Funny you mention obfuscation -- I once tried
to do some sneaky stuff where depending on a flag
or something, a here-doc was treated either as a
here-doc or as code. Now that's obfuscation of a
sort!

But I never got it to work. I think the Ruby parser
was too smart for that, and this was an occasion
where there was some distinction between "compile
time" and "runtime."

Hal



Tue, 29 Nov 2005 07:35:44 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Norton AV report on ActiveState build 210 src?

2. Cryptic -w warning: ambiguous first argument; make sure ...

3. src/emitter.rb warning

4. Warning error in YAML

5. Syck 0.25 + YAML.rb -- Objects in plain-text

6. Syck 0.15 -- the road to YAML.rb 1.0

7. Syck 0.08 -- Next-generation of YAML.rb

8. YAML.rb 0.49.1 -- Perfecting the parser, new merge indicator, base60

9. YAML.rb 0.47 -- stairsteppin to 0.50

10. YAML.rb 0.44 (no longer requires racc)

11. YAML.rb 0.44 (no longer requires racc)

12. YAML.rb 0.40 -- Circular references, Emitter enhancements

 

 
Powered by phpBB® Forum Software