Skip to content

MoonScript 0.3.0 parser enters an inconsistent state after an unsuccessful chunk parsing #177

@shmuz

Description

@shmuz

Running the following code

to_lua = require("moonscript.base").to_lua
to_lua "{b=5}"
to_lua "{b=5}"

produces the following error:

moon: [string "moonscript.lua"]:2854: attempt to call upvalue 'pos' (a number value)
stack traceback:
[string "moonscript.lua"]:2854: in function 'build_grammar'
[string "moonscript.lua"]:2975: in function 'string'
[string "moonscript.lua"]:390: in function 'to_lua'
2.moon:3: (3) in main chunk

while I was expecting just returning nil.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions