Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crunch creates zero byte files when used standalone #17

Open
TomatoCo opened this issue Oct 29, 2017 · 2 comments
Open

crunch creates zero byte files when used standalone #17

TomatoCo opened this issue Oct 29, 2017 · 2 comments

Comments

@TomatoCo
Copy link

TomatoCo commented Oct 29, 2017

I extracted the tar on my raspberry pi (uname is Linux raspberrypi 4.9.35-v7+) and installed luarocks to install lfs.

I copied crunch.lua from ./bin to ./lib so that it could find parser.main.

I made a simple test script which consisted of a table declaration, a loop populating it with random values, and then a second loop printing it.

I then ran lua crunch.lua test.lua. The resulting test.cr.lua file had a size of zero.

However, crunch still works in game.

I just realized that, due to this folder structure, it's not including anything in crunch. I have altered the filesystem list to include the working directory (added a true to the lib.list in loadModules() in crunch.lua). I now get an error, instead:
test.lua:eof: ./parser/main.lua:1160: attempt to index local 'toke' (a nil value).

@TomatoCo
Copy link
Author

I suspect this is because I was using Lua 5.1. I switched to 5.2 (and blew away the LFS stuff, replacing it with a hardcoded list of libs because I was having a hard time with luarocks) and it works.

@mpmxyz
Copy link
Collaborator

mpmxyz commented Nov 6, 2017

Interesting... Is it really "toke" or is it "token"?
I'm quite surprised because I don't see any way the function readToken is able to get a nil argument.
Would you mind giving me the output of the --debug option? That should include a traceback.
(I'm a bit short on time this evening to switch my OS and create a Lua 5.1 test.)
PS: Nice to see somebody using it outside OpenComputers. :)

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

No branches or pull requests

2 participants