Skip to content

AST generated from local declarations does not match documentation #11

Description

@mpeterv

test.lua:

local parser = require "metalua.compiler".new()
local inspect = require "inspect"
local s = "local a"
print(inspect(parser:src_to_ast(s)))

Output(omitting lineinfo, etc):

{ { { { -- `Id "a"
         "a",
        tag = "Id"
      }
    }, {},
    tag = "Local"
  }
}

Note the extra empty table. It shouldn't be there according to the docs: Local{ {ident+} {expr+}? }
Either docs should be changed to Local{ {ident+} {expr*} } or the empty table shouldn't be added when there is no rhs.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions