> ## Documentation Index
> Fetch the complete documentation index at: https://differens.ossl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Lua

> Semantic diffing for Lua

## Lua extractor

The Lua extractor maps tree-sitter Lua CST nodes to canonical concepts. Function names come from the standard `name` field; local variable names come from the variable list under the declaration.

### Detected concepts

| tree-sitter node type | Canonical concept |
| - | - |
| `function_declaration` | Function |
| `variable_declaration` | Variable |
| `assignment_statement` | Assignment |
| `table_constructor` | ObjectLiteral |
| `field` | KeyValuePair |
| `function_call` | CallExpression |
| `dot_index_expression` | MemberAccess |
| `method_index_expression` | MethodCall |
| `if_statement` | IfBlock |
| `for_statement` | ForLoop |
| `return_statement` | Return |
| `number` | number\_literal |

### Example

Renaming a function:

```lua theme={null}
-- old.lua
function total(n)
  return n + 1
end
```

```lua theme={null}
-- new.lua
function sum(n)
  return n + 1
end
```

Running `differens old.lua new.lua`:

```
~ renamed function `total` to `sum`
```

### Known limitations

* Lua has no int/float split; every number literal reports as `number_literal`.
* Metatable calls (`obj:method()`) report as method calls only when written as method-index syntax.
