diff --git a/File Formats/Code/Lua.md b/File Formats/Code/Lua.md deleted file mode 100644 index cda37e6..0000000 --- a/File Formats/Code/Lua.md +++ /dev/null @@ -1,15 +0,0 @@ -# *COS 2:* Lua - -## Quick information - -| Information | | -| ----------- | ------------------------- | -| Type | Plain text file format | -| MIME | `text/lua` | -| Extensions | `.lua` | - -## Technical details - -*This format is based upon [plain text](/File%20Formats/Documents/Plain%20Text.md) and as such technical details that apply to plain text also apply to this format.* - -Lua code files should contain valid, executable Lua code. These can either be self-contained programs, APIs or Lua otherwise loaded by a program. diff --git a/File Formats/Lua/Serialised Table.md b/File Formats/Lua/Serialised Table.md new file mode 100644 index 0000000..0c8424b --- /dev/null +++ b/File Formats/Lua/Serialised Table.md @@ -0,0 +1,34 @@ +# *COS ?:* Lua Serialised Table + +## Quick information + +| Information | | +| ----------- | ------------------------- | +| Type | Serialised Table | +| MIME | `lua/table` | +| Extensions | `.tbl` | + +## Technical details + +*This format is based upon [plain text](/File%20Formats/Documents/Plain%20Text.md) and as such technical details that apply to plain text also apply to this format.* + +Lua serialised table files must contain a valid Lua table. A serialised table is valid if `textutils.unserialise` parses the *entire* contents of the file in to a table. + +It is not strictly necessary to use `textutils.serialise` when creating the file. For example, you can make another function which does the same but omits unnecessary whitespace. The only requirement is that it is *parseable*. + +### Example + +```Lua +{ + { + 1, + 2, + 3, + 4 + } + "hello", + false, + nil, + ["key"] = "value" +} +``` \ No newline at end of file