lua

package
v0.7.114 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package lua reads the Lua table-literal subset that SavedVariables files use.

The file is a sequence of `Name = <value>` assignments. Values are tables, strings, numbers, booleans and nil. Nothing is executed: the text is tokenised and parsed by hand. Every Lua table becomes a Table; positional entries get the integer keys 1..n, as Lua numbers them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(v any) []any

List returns the positional entries (keys 1..n) of a table, in order.

func Parse

func Parse(text string) (map[string]any, error)

Parse reads a SavedVariables file into {variable name: value}. A variable set to nil is absent.

Types

type ParseError

type ParseError struct {
	Line int
	Msg  string
}

ParseError is malformed SavedVariables text. Its message names the 1-based line.

func (*ParseError) Error

func (e *ParseError) Error() string

type Table

type Table map[any]any

Table is a parsed Lua table. Keys are string or int64; values are Table, string, int64, float64 or bool. A nil value is simply absent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL