JohnnyMorganz/StyLua

Output AST generated a syntax error

Opened this issue · 1 comments

I get this error:

[ERROR] Formatter 'stylua' error: error: could not format from stdin: failed to format from stdin: INTERNAL ERROR: Output AST generated a syntax error. Please report this at https://github.com/johnnymorganz/stylua/issues
  error occurred while creating ast: unexpected token `console`

When attempting to format this example file from the IUP gui library.

Thanks for reporting! Looks like the problematic part are the comments in this section:

console.dialog = iup.dialog
{
  iup.vbox
  {
    iup.frame
    {
      iup.hbox -- use it to inherit margins
      {
        console.prompt,
      },
      title = "Command:",
    },
    iup.frame
    {
      iup.hbox -- use it to inherit margins
      {
        console.output
      },
      title = "Output:",
    },
    margin = "5x5",
    gap = "5",
  },
  title="Lua Console",
  size="250x180", -- initial size
  icon=0, -- use the Lua icon from the executable in Windows
}