Skip to content

Language record

Lua

Lua is read as the table-shaped language it is: functions, the methods hanging off a table, and the locals a chunk declares all get identities, and `require`, `setmetatable` and constructor calls become edges you can walk — with the module surface named only where the chunk actually names it.

.lua · 1 registry id · 10 of 14 relationship types

The registry row this page is generated from

Read at render time from the same family row the register reads, so nothing in this block can disagree with it.

Extensions
.lua
Registry names
lua
Recorded symbols
functions · methods · variables

Relationship types this analyzer constructs

10 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.

Relationship typeConstructed
callsconstructed by this analyzer
extendsconstructed by this analyzer
implementsruled absent
usesconstructed by this analyzer
importsconstructed by this analyzer
exportsconstructed by this analyzer
containsconstructed by this analyzer
referencesconstructed by this analyzer
overridesconstructed by this analyzer
instantiatesconstructed by this analyzer
decoratesconstructed by this analyzer
rendersruled absent
mixes_inruled absent
part_ofruled absent

10 constructed, 4 not constructed. All 4 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.

What this analyzer does not resolve

  • No module symbol is published for the file, so a file-scope declaration's containment edge is sourced from the literal string global. Ownership otherwise stops at the head of the receiver path: function Buffer.meta.index() files the method under Buffer, because Buffer.meta is not a name any file publishes, and the full path is kept in metadata instead.
  • A metatable is a name match, and the payload does not grade it differently. setmetatable(M, base) publishes an extends edge to whatever base names, while every Lua relationship ships confidence 1.0 — so in the stored row a syntactic fact and a name-only inference are indistinguishable, which is a real cost of the flat confidence model rather than a claim that both are equally certain.
  • A surface the chunk cannot name is disclosed rather than invented. A table returned from setmetatable's first argument, the result of a call, a value literal and an anonymous function each land in metadata.unpublishedSurface with a stated reason — "a value is not a name", "an anonymous function has no name" — so what is missing is on the record rather than implied by an absence.

Every line above was written against Lua’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.

Where you meet it in a repository

Recognised by extension — .lua. Everything below is about where those files actually sit in a working repository.

  • The idiomatic module shape is a table built in a chunk and returned from it — local M = {} … return M — so require "socket.http" is an import edge and the methods belong to the table that holds them.
  • require is recorded as an import but the loader's own search path is not evaluated, so a module found through package.path at run time connects to nothing the index can see.
  • Game and plugin trees mix Lua with vendored C headers, and framework detection deliberately refuses to fire on a bare identifier — a claimed framework has to come from a qualified head or from a required module name, because an earlier rule named three frameworks for a file that contained neither.

Questions this index answers

Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.

  1. Which functions does this module define, and which modules does it require?
  2. Which table do these functions belong to?
  3. Which surface does this chunk return that the index could not name?
  4. Which object does this one inherit from through a metatable?

What the analyzer sees in code like this

A module table, a method on it, and a metatable that extends it
local M = {}                          -- bb records: variable M

function M.read(path)                    -- bb records: method read, owned by M
  local handle = io.open(path, "r")      -- bb records: a call edge -> open (receiver io in metadata)
  return handle:read("*a")
end

setmetatable(M, { __index = base })      -- bb records: an extends edge -> base
return M                                 -- what require() gets from this module

Symbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.

Languages that turn up in the same repository

Scripting & shell — the count beside each name is how many relationship types that family’s analyzer constructs.

The extensions, registry names, recorded symbols and relationship types above are the parser registry row for Lua, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.