mherkender / lua.js

An ECMAscript framework to compile and run Lua code, allowing Lua to run in a browser or in Flash
http://blog.brokenfunction.com/
600 stars 73 forks source link

Conflicts encountered #19

Open ggcrunchy opened 11 years ago

ggcrunchy commented 11 years ago

Hi. I've been trying to build the new parser (the prebuilt version is now out-of-date), and I'm running into a LOT of "Resolve R/R conflict (use first production declared in grammar.) (2,21, 2,14) -> 2,14Resolve R/R conflict (use first production declared in grammar.)" sort of warnings.

These seem to be manifesting as errors along the lines of:

error during main.lua : Error: Parse error on line 26: ...s(tiles) do TILES[#TILES + 1] = love. ----------------------^ Expecting '=', ',', got '[' :

Rearranging some lines will give me similar errors with other operators.

(From https://dl.dropbox.com/u/14510154/TESTS/take_the_fork/main.lua )

I tried to tease out any parser shenanigans but found myself rather swamped. :smile:

I don't have much of an environment set up to run the makefile (I have Cygwin on some other machine...), but I ran it both through node and the web generator at http://zaach.github.com/jison/try/ with similar results.

Thanks in advance for any help or hints on this.

mherkender commented 11 years ago

I'm sorry I didn't get to this sooner, are you still experiencing these problems? I am unable to reproduce them.

ggcrunchy commented 11 years ago

No worries. I did finally install Cygwin on this machine and try the actual makefile (versus just feeding the lua.jison into something and manually hooking stuff up). The relevant error now seems to be:

cd . && node src/build_lua_parser.js

C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:109 throw new Error(str); ^ Error: Lexical error on line 656. Unrecognized text. var indentLevel -------------------^ at Object.parseError (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:109:11) at Object.parseError (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:224:28) at Object.lexer.next (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:360:25) at Object.lex (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:365:22) at lex (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:131:28) at Object.parse (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\bnf-parser.js:144:26) at Object.parse (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\bnf.js:4:54) at Jison_Generator (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison.js:75:42) at (anonymous function) (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\typal.js:23:28) at new construct.o.constructor (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison\util\typal.js:77:70) at new Jison_Generator (C:\users\steve\desktop\lua.js\node_modules\jison\lib\jison.js:1571:20) Makefile:25: recipe for target `src/lua_parser.js' failed

(Seems to be around here: https://github.com/zaach/jison/blob/master/lib/jison/util/bnf-parser.js#L360)

This is a fresh Cygwin install with just 'devel', a fresh node install, and Windows Vista. Haven't tried on anything else.

mherkender commented 11 years ago

It's crashing when trying to build lua.jison. I'm not able to reproduce this, and while there are grammar problems, they're only warnings and it should work.

I've cleaned up the Makefile a bit, could you update and run make clean_all all? This will clear out basically everything that has been downloaded or generated, and build from scratch, allowing me to better understand what's going on.

ggcrunchy commented 11 years ago

Sorry for the belated response. I've probably set this project aside until the new year, now that the contest is over.

That said, the make clean_all all gives me the same results. Some searching unfortunately seems to imply that obscure things can trigger this, e.g. this :frowning: And maybe it's some Windows arcana... (On that note, the pre-built version hasn't been updated.)

As an aside, have you seen this one (relatively new)? Maybe you have, but it wasn't in your stars.

mherkender commented 11 years ago

Odd. I'll take another look at it later. The prebuilt version has been updated, is it not working for you?

I have not heard of brozula, it's definitely interesting and reminds me of emscripten. Thanks for the link! It's good to see other people are exploring similar techniques and expanding Lua's range of influence.