gmarcais / Jellyfish

A fast multi-threaded k-mer counter
Other
471 stars 136 forks source link

yaggo error: info_main_cmdline.yaggo:6: syntax error #26

Closed sjackman closed 9 years ago

sjackman commented 9 years ago

I get the following yaggo syntax error when building Jellyfish head. I tried both Yaggo 1.5.4 and Yaggo head.

❯❯❯ yaggo --version
yaggo 1.5.4
❯❯❯ ruby --version
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
❯❯❯ yaggo info_main_cmdline.yaggo
info_main_cmdline.yaggo:6: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
file was created. Without any argument, it displays the command line
                                                   ^
info_main_cmdline.yaggo:7: syntax error, unexpected keyword_when, expecting '='
used, when and where it was run.
          ^
carze commented 9 years ago

Can also confirm that I get the same error when trying to build Jellyfish 2.1.4 using Yaggo 1.5.4 on a RHEL7 machine.

gmarcais commented 9 years ago

Weird. This yaggo file had not changed in over a year. I installed ruby 2.0.0p353 and yaggo works fine on Linux Debian.

Can you try this patch, which changes the here-doc with double quotes https://gist.github.com/gmarcais/f656cf738e4959d1ef40

carze commented 9 years ago

That fixes the previous error, but leads to a new one:

$ make
  YAGGO  sub_commands/count_main_cmdline.hpp
  YAGGO  sub_commands/info_main_cmdline.hpp
  YAGGO  sub_commands/dump_main_cmdline.hpp
  YAGGO  sub_commands/histo_main_cmdline.hpp
  YAGGO  sub_commands/stats_main_cmdline.hpp
  YAGGO  sub_commands/merge_main_cmdline.hpp
  YAGGO  sub_commands/bc_main_cmdline.hpp
  YAGGO  sub_commands/query_main_cmdline.hpp
  YAGGO  sub_commands/cite_main_cmdline.hpp
  YAGGO  sub_commands/mem_main_cmdline.hpp
sub_commands/mem_main_cmdline.yaggo:6: syntax error, unexpected keyword_when, expecting end-of-input
Jellyfish when counting mers. If one replace 'count' by 'mem' in the
              ^
make: *** [sub_commands/mem_main_cmdline.hpp] Error 1

Seems like the the description block in the mem_main_cmdline.yaggo is causing issues. Swapping out the <<EOS to just using quotes seems to fix the issue and leads to a successful compilation..

gmarcais commented 9 years ago

This is crazy. Ruby does not allow any keyword in an here-doc string? That looks like a bug in the Ruby parser.

Anyway, I'll remove the here-doc in favor of plain old string. Thank you both for the bug report. It'll be fixed in master shortly.

sjackman commented 9 years ago

I'm guessing this is a bug in an old version of the Ruby interpreter. It would have been interesting to also test <<'EOS' to disable variable expansion in the heredoc.

gmarcais commented 9 years ago

On Fri, Jan 16, 2015 at 6:58 PM, Shaun Jackman notifications@github.com wrote:

I'm guessing this is a bug in an old version of the Ruby interpreter. It would have been interesting to also test <<'EOS' to disable variable expansion in the heredoc.

I don't know about "old". I could not reproduce the bug on my machine with ruby 1.9.3p484 and 2.0.0p353, which are both older than the version you reported.

Guillaume.

— Reply to this email directly or view it on GitHub https://github.com/gmarcais/Jellyfish/issues/26#issuecomment-70342049.