nice: chuck outdated format description comment
This commit is contained in:
parent
6d2c08878d
commit
f381edfff3
61
src/nice.zig
61
src/nice.zig
@ -1,64 +1,3 @@
|
||||
// Heavily inspired by, but not quite compatible with, NestedText. Key differences:
|
||||
//
|
||||
// - Doesn't support multiline keys (this means map keys cannot start with
|
||||
// ' ', \t, #, {, [, |, or >, and they cannot contain :)
|
||||
// - Allows using tabs for indentation (but not mixed tabs/spaces)
|
||||
// - Indentation must be quantized consistently throughout the document. e.g.
|
||||
// every nested layer being exactly 2 spaces past its parent. Tabs may
|
||||
// only use one tab per indentation level.
|
||||
// - Allows flow-style lists, maps, and strings on the same line as map keys or
|
||||
// list items (i.e. the following are legal):
|
||||
//
|
||||
// key: {inline: map}
|
||||
// key: [inline, list]
|
||||
// key: > inline string
|
||||
// - {map: item}
|
||||
// - [list, item]
|
||||
// - > inline string
|
||||
//
|
||||
// The string case retains the possibility of having an inline map value starting
|
||||
// with {, [, or >
|
||||
// - a map keys and list item dashes must be followed by a value or an indented
|
||||
// section to reduce parser quantum state. This means that
|
||||
//
|
||||
// foo:
|
||||
// bar: baz
|
||||
//
|
||||
// or
|
||||
//
|
||||
// -
|
||||
// - qux
|
||||
//
|
||||
// are not valid. This can be represented with an inline empty string after foo:
|
||||
//
|
||||
// foo: >
|
||||
// bar: baz
|
||||
//
|
||||
// or
|
||||
//
|
||||
// - >
|
||||
// - qux
|
||||
//
|
||||
// - newlines are strictly LF, if the parser finds CR, it is an error
|
||||
// - blank lines may not contain any whitespace characters except the single LF
|
||||
// - Additional string indicator `|` for soft-wrapped strings, i.e.
|
||||
//
|
||||
// key: | this is not special
|
||||
// key:
|
||||
// | these lines are
|
||||
// | soft-wrapped
|
||||
//
|
||||
// soft-wrapped lines are joined with a ' ' instead of a newline character.
|
||||
// Like multiline strings, the final space is stripped (I guess this is a very
|
||||
// janky way to add trailing whitespace to a string).
|
||||
//
|
||||
// - terminated strings to allow trailing whitespace:
|
||||
// | this string has trailing whitespace |
|
||||
// > and so does this one |
|
||||
// - The parser is both strict and probably sloppy and may have weird edge
|
||||
// cases since I'm slinging code, not writing a spec. For example, tabs are
|
||||
// not trimmed from the values of inline lists/maps
|
||||
|
||||
const std = @import("std");
|
||||
|
||||
pub const buffers = @import("./linebuffer.zig");
|
||||
|
Loading…
x
Reference in New Issue
Block a user