mirror of https://github.com/kdl-org/kdl.git
fixes from review
This commit is contained in:
parent
54df7f0cab
commit
817a7dc0ab
|
|
@ -249,7 +249,7 @@ specific meanings.
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
numbers (u8)10 (i32)20 myfloat=(f32)1.5 {
|
numbers (u8)10 (i32)20 myfloat=(f32)1.5 {
|
||||||
strings (uuid)123e4567-e89b-12d3-a456-426614174000 (date)"2021-02-03" filter=(regex)#"$\d+"#
|
strings (uuid)"123e4567-e89b-12d3-a456-426614174000" (date)"2021-02-03" filter=(regex)#"$\d+"#
|
||||||
(author)person name=Alex
|
(author)person name=Alex
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
24
SPEC.md
24
SPEC.md
|
|
@ -94,10 +94,9 @@ foo 1 key="val" 3 {
|
||||||
### Identifier
|
### Identifier
|
||||||
|
|
||||||
An Identifier is either a [Bare Identifier](#bare-identifier), which is an
|
An Identifier is either a [Bare Identifier](#bare-identifier), which is an
|
||||||
unquoted string like `node` or `item`, a [String](#string), or a [Raw
|
unquoted string like `node` or `item`, a [String](#string), or a [Raw String](#raw-string).
|
||||||
String](#raw-string). There's no semantic difference between the kinds of
|
There's no semantic difference between the kinds of identifier; this simply allows
|
||||||
identifier; this simply allows for the use of quotes to have unusual
|
for the use of quotes to have unusual identifiers that are inexpressible as bare identifiers.
|
||||||
identifiers that are inexpressible as bare identifiers.
|
|
||||||
|
|
||||||
### Bare Identifier
|
### Bare Identifier
|
||||||
|
|
||||||
|
|
@ -335,7 +334,7 @@ specified with their corresponding `\u{}` escape.
|
||||||
Strings may span multiple lines with literal Newlines, in which case the
|
Strings may span multiple lines with literal Newlines, in which case the
|
||||||
resulting String is "dedented" according to the line with the fewest number of
|
resulting String is "dedented" according to the line with the fewest number of
|
||||||
Whitespace characters preceding the first non-Whitespace character. That is,
|
Whitespace characters preceding the first non-Whitespace character. That is,
|
||||||
the number of Whitespace characters in the least-indented line in the String
|
the number of literal Whitespace characters in the least-indented line in the String
|
||||||
body is subtracted from the Whitespace of all other lines.
|
body is subtracted from the Whitespace of all other lines.
|
||||||
|
|
||||||
Multi-line strings _MUST_ have a single [Newline](#newline) immediately
|
Multi-line strings _MUST_ have a single [Newline](#newline) immediately
|
||||||
|
|
@ -393,8 +392,8 @@ and all of that whitespace are discarded. For example, `"Hello World"` and
|
||||||
`"Hello \ World"` are semantically identical. See [whitespace](#whitespace)
|
`"Hello \ World"` are semantically identical. See [whitespace](#whitespace)
|
||||||
and [newlines](#newlines) for how whitespace is defined.
|
and [newlines](#newlines) for how whitespace is defined.
|
||||||
|
|
||||||
Note that only literal whitespace is escaped; *escaped* whitespace is retained.
|
Note that only literal whitespace is escaped; whitespace escapes (`\n` and
|
||||||
For example, these strings are all semantically identical:
|
such) are retained. For example, these strings are all semantically identical:
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
"Hello\ \nWorld"
|
"Hello\ \nWorld"
|
||||||
|
|
@ -437,8 +436,17 @@ unrepresentable when using Raw Strings.
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
just-escapes #"\n will be literal"#
|
just-escapes #"\n will be literal"#
|
||||||
quotes-and-escapes ##"hello\n\r\asd"#world"##
|
```
|
||||||
|
|
||||||
|
The string contains the literal characters `\n will be literal`.
|
||||||
|
|
||||||
|
```kdl
|
||||||
|
quotes-and-escapes ##"hello\n\r\asd"#world"##
|
||||||
|
```
|
||||||
|
|
||||||
|
The string contains the literal characters `hello\n\r\asd"#world`
|
||||||
|
|
||||||
|
```kdl
|
||||||
multi-line #"
|
multi-line #"
|
||||||
foo
|
foo
|
||||||
This is the base indentation
|
This is the base indentation
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue