Skip to content

crunch creates zero byte files when used standalone #17

Open

Description

@TomatoCo

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).

Activity

  1. TomatoCo commented on Oct 29, 2017

    @TomatoCo
    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.

  2. mpmxyz commented on Nov 6, 2017

    @mpmxyz
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions