data formats: comments are specs only
This commit is contained in:
1 parent
0bd7b87d2b
commit
0452f26eef
18 files changed
+110
-224
No files matched your search
@@ -1,11 +1,7 @@
|
||||
--!strict
|
||||
-- data/toml: TOML 1.0.0 (https://toml.io/en/v1.0.0). New code. Supports: decode of the whole 1.0 grammar (tables,
|
||||
-- inline tables, arrays of tables, dotted keys, every string kind, integers in every base with the 64-bit range
|
||||
-- check, floats incl. inf / nan, booleans, offset / local datetimes, local dates and times) with the validity rules
|
||||
-- (redefinitions, UTF-8, control characters, number grammar), tested against toml-test; encode from plain tables /
|
||||
-- Types.object (key order kept) / Types.Date. Tables decode to Types.object values (key order kept), datetimes to
|
||||
-- Types.Date. Not supported: TOML 1.1 additions; the integer / float distinction is lost (Luau numbers: integral
|
||||
-- values are written as integers).
|
||||
-- data/toml: TOML 1.0.0 (https://toml.io/en/v1.0.0), new code, tested against toml-test. Supports: the whole 1.0
|
||||
-- grammar and validity rules; tables as Types.object, datetimes as Types.Date. Not supported: TOML 1.1; the integer /
|
||||
-- float distinction (integral values write as integers).
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ requires
|
||||
local Err = require("@rosetta/core/Err")
|
||||
@@ -27,8 +23,7 @@ export type DecodeOptions = Decode.Options
|
||||
export type EncodeOptions = Encode.Options
|
||||
|
||||
-- ------------------------------------------------------------------------------------------------ sniff
|
||||
-- text that starts (after comments / blank lines) with a [table] header or a key = value line; INI looks the same,
|
||||
-- so this stays low and the extension decides
|
||||
-- INI looks the same: a [table] or key = value start scores low and the extension decides
|
||||
function Toml.sniff(r: Bytes.Reader): number
|
||||
local head = r:peek(512)
|
||||
if string.find(head, "%z") then
|
||||
|
||||
Reference in new issue
Block a user