Official KDL 2.0.0 Spec Released! #447
zkat
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's finally here! KDL 2.0.0 is a major overhaul of the language. It keeps to the spirit of 1.0.0 but addresses a lot of tiny sharp corners, and adds a few exciting new features to make the language overall more ergonomic, easier to manage, and more pleasant on the eyes. It is the culmination of over 3 years of work by scores of contributors, implementers, and community members. It draws from years of experience with KDL 1.0.0 in the wild.
KDL 2.0.0 documents are unambiguous with KDL 1.0.0 documents: if a document happens to parse with either parser, the data is guaranteed to be the exact same.
For up-to-date information on what parsers support which versions of the language, please refer to the implementations table in the README.
Grammar
/
) is no longer an escaped character.U+0020
) can now be written into quoted strings with the\s
escape.
//
) can now be immediately followed by a newline.\
in a string is now discarded.U+000B
) are now considered to be newlines.in the grammar have been fixed accordingly (mostly related to escaped
characters).
,
,<
, and>
are now legal identifier characters. They were previouslyreserved for KQL but this is no longer necessary.
0x20
(except newline and whitespace code points), codepoints above
0x10FFFF
, Delete control character (0x7F
), and the unicode"direction control"
characters
are now completely banned from appearing literally in KDL documents. They
can now only be represented in regular strings, and there's no facilities to
represent them in raw strings. This should be considered a security
improvement.
r
prefix: they are now specified by using#""#
.newline (or comment).
node \<EOF>
is now a legal KDL document.#
is no longer a legal identifier character.null
,true
, andfalse
are now#null
,#true
, and#false
. Usingthe unprefixed versions of these values is a syntax error.
not valid identifier characters, even though the grammar already expressed
this.
be used as type annotations.
implementation to ignore null values altogether when deserializing". This is
no longer encouraged or desired.
Values only, including
values used in string escapes (
\u{}
). All KDL documents and string valuesshould be valid UTF-8 now, as was intended.
;
,even if the closing
}
is on the same line, so this is now a legal node:node{foo;bar;baz}
power comes great responsibility:
(foo)
annotations (so,( foo )
would be legal (( f oo )
wouldnot be, since it has two identifiers))
(blah) node (thing) 1 y= (who) 2
)=
for props (x = 1
)previously treated as generic whitespace.
"""
as delimeters. The opening delimiter must be immediately followed by a newline, and the closing delimiter must be on its own line, prefixed by optional whitespace.whitespace matching the whitespace prefix of the closing line.
.1
,+.1
etc are no longer valid identifiers, to prevent confusion andconflicts with numbers.
LF
s.#inf
,#-inf
, and#nan
have been added in order to properly supportIEEE floats for implementations that choose to represent their decimals that
way.
inf
,-inf
, andnan
are now syntaxerrors.
u128
andi128
have been added as well-known number type annotations./-
) -compatible locations adjusted to be more clear andintuitive. They can now be used in exactly three different places: before nodes,
before entire entries, or before entire child blocks.
that a slashdashed child block cannot go before an entry (including slashdashed
entries).
/- kdl-version 2
(or1
) as the first line in a document, optionally preceded by the BOM.KQL
>>
), instead of using plainspaces for that purpose.
++
instead of~
, for consistency withthe new descendant selector.
continuations with
\
.New Contributors
knuffel
to the list of implementations #256kdl-schema.kdl
well-formedness #259Full Changelog: 1.0.0...2.0.0
This discussion was created from the release 2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions