Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

Parser bug - command args #373

Closed
johnnyt opened this issue Mar 13, 2015 · 12 comments · Fixed by #391
Closed

Parser bug - command args #373

johnnyt opened this issue Mar 13, 2015 · 12 comments · Fixed by #391
Assignees
Labels

Comments

@johnnyt
Copy link
Member

johnnyt commented Mar 13, 2015

Running puts foo:1 or puts({foo:1}) work just fine, but if the parens are used without curly braces: puts(foo:1), a RubyParseError is thrown:

~ ruby -e 'puts foo:1'
{:foo=>1}

➜ ~ ruby -e 'puts(foo:1)'
-e:3, syntax error, unexpected tINTEGER
ERROR 2702 , a RubyParseError occurred (error 2702), -e:3: syntax error, unexpected tINTEGER
unexpected EOF at line 6 (RubyParseError)
topaz 1> exit
@johnnyt
Copy link
Member Author

johnnyt commented Mar 13, 2015

I think issues #185 and #186 are related (possibly the same issue)

@Monty Monty added the Parser label Mar 13, 2015
@zenspider
Copy link
Contributor

Looking at structural differences in the maglev parser vs 1.8, 1.9, 2.0 and 2.1.

10003 % diff -du maglev.txt yacc18.txt  | wc -l
     123
10004 % diff -du maglev.txt yacc19.txt  | wc -l
     641
10005 % diff -du maglev.txt yacc20.txt  | wc -l
     781
10006 % diff -du maglev.txt yacc21.txt  | wc -l
     812

So, there are plenty of differences against the 1.8 parser still. Getting that up to date should be mostly algebraic (I'll double check that).

@johnnyt: For getting up on 1.9? Do you want to split the parser and have it moded, or do we just want to jump into it and leave 1.8 behind? I still think getting the current parser up to date against 1.8 will help us speed up the transition to 1.9, but it's your call.

@zenspider
Copy link
Contributor

OK. I'm totally confused by this setup. master will check out and bootstrap just fine. @AllenOtis' libmagparser branch will not. Neither update.sh nor install.sh work at all.

@AllenOtis and/or @johnnyt I need instructions on how to use this branch properly.

@AllenOtis
Copy link
Contributor

Read issue #352 .
As of when I last committed to libmagparser branch there was
still work to be done to integrate the building of the parser shared
library into the master. You need to decide whether the libmagparse
is going to be built from source on every download, or whether someone
is going to build and test the shared library and then put it somewhere
where it can be downloaded along with the other components.
It is up to the community to decide how this should be integrated and
to do the integration work.

Allen

On Fri, Mar 13, 2015 at 3:51 PM, Ryan Davis notifications@github.com
wrote:

OK. I'm totally confused by this setup. master will check out and
bootstrap just fine. @AllenOtis https://github.com/AllenOtis'
libmagparser branch will not. Neither update.sh nor install.sh work at
all.

@AllenOtis https://github.com/AllenOtis and/or @johnnyt
https://github.com/johnnyt I need instructions on how to use this
branch properly.


Reply to this email directly or view it on GitHub
#373 (comment).

@johnnyt
Copy link
Member Author

johnnyt commented Mar 16, 2015

@zenspider - I'm working on getting this working on my machine again right now. As soon as I have it running, I'll get it documented and ping you right away.

@zenspider
Copy link
Contributor

@johnnyt I need you to answer my previous questions to proceed.

@johnnyt
Copy link
Member Author

johnnyt commented Mar 18, 2015

@zenspider:

  1. let's get the current parser up to date against 1.8 first

  2. this branch should now work (using update.sh)

@zenspider
Copy link
Contributor

update.sh looks an awful lot like yacc.sh and both look an awful lot like a makefile. Is there a reason for the code duplication? Is there a reason for not having a Makefile?

Since I'm not paid to be futzing with getting a linux setup working, I am basically working blind until there's an OSX server available. I'm stalled until then because I'm at a checkpoint with my 1.8 work w/o testing it out.

@johnnyt
Copy link
Member Author

johnnyt commented Mar 18, 2015

I just added a Vagrantfile which will create an Ubuntu 12.04 vm with allen/libmagparse checked out and built - I don't know if that'll be helpful or not.

Also - a Makefile would be great - no reason for the duplication

@AllenOtis
Copy link
Contributor

My experience with debugging C code on OSX is not good.
I would not want to rely on OSX gdb for any serious
debugging. Here at Gemtalk we debug and test all C
changes on either Linux or Solaris, before we run new C
code on AIX or OSX .
Allen

On Wed, Mar 18, 2015 at 3:17 PM, Ryan Davis notifications@github.com
wrote:

update.sh looks an awful lot like yacc.sh and both look an awful lot like
a makefile. Is there a reason for the code duplication? Is there a reason
for not having a Makefile?

Since I'm not paid to be futzing with getting a linux setup working, I am
basically working blind until there's an OSX server available. I'm stalled
until then because I'm at a checkpoint with my 1.8 work w/o testing it out.


Reply to this email directly or view it on GitHub
#373 (comment).

@zenspider
Copy link
Contributor

This isn't an issue for me. I rarely, if ever, use gdb. Horrible tool. I usually debug with tests.

@zenspider zenspider mentioned this issue Apr 29, 2015
@zenspider
Copy link
Contributor

Voila!

966 % cd maglev
967 % ../rebuild.sh

cd ~/maglev
+ cd /home/ryan/maglev

# if [ -n "$1" ]; then
#    rsync -avP greed.local:Work/git/maglev/src/kernel/parser/grammar.y src/kernel/parser
# fi

(cd src/kernel/parser && ./parser.sh)
+ cd src/kernel/parser
+ ./parser.sh
  byacc ok
Compiling rubyast.o
Linking libmagparse.so
Copying libmagparse.so to /home/ryan/maglev/gemstone/lib/
# ./bin/maglev-ruby -e 'nil'
# ./bin/maglev-ruby -e 'p nil'
# ./bin/maglev-ruby -e 'p 2 + 3'
# ./bin/maglev-ruby -e 'puts foo:1'
./bin/maglev-ruby -e 'puts(foo:1)'
+ ./bin/maglev-ruby -e 'puts(foo:1)'
{:foo=>1}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants