mirror of https://github.com/kdl-org/kdl.git
bump version to 1.0.0 and add example with type annotations
This commit is contained in:
parent
d24d8551ca
commit
02c40c589d
16
README.md
16
README.md
|
|
@ -16,6 +16,8 @@ Language](SCHEMA-SPEC.md) loosely based on JSON Schema.
|
||||||
The language is based on [SDLang](https://sdlang.org), with a number of
|
The language is based on [SDLang](https://sdlang.org), with a number of
|
||||||
modifications and clarifications on its syntax and behavior.
|
modifications and clarifications on its syntax and behavior.
|
||||||
|
|
||||||
|
The current version of the KDL spec is `1.0.0`.
|
||||||
|
|
||||||
## Design and Discussion
|
## Design and Discussion
|
||||||
|
|
||||||
KDL is still extremely new, and discussion about the format should happen over
|
KDL is still extremely new, and discussion about the format should happen over
|
||||||
|
|
@ -181,6 +183,20 @@ mynode /-"commented" "not commented" /-key="value" /-{
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Type Annotations
|
||||||
|
|
||||||
|
KDL supports type annotations on both values and nodes. These can be
|
||||||
|
arbitrary, but can be used by individual implementations or use-cases to
|
||||||
|
constrain KDL's basic types. A number of type names are also reserved to have
|
||||||
|
specific meanings.
|
||||||
|
|
||||||
|
```kdl
|
||||||
|
numbers (u8)10 (i32)20 myfloat=(f32)1.5 {
|
||||||
|
strings (uuid)"123e4567-e89b-12d3-a456-426614174000" (date)"2021-02-03" filter=(regex)r"$\d+"
|
||||||
|
(author)person name="Alex"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### More Details
|
### More Details
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
|
|
|
||||||
4
SPEC.md
4
SPEC.md
|
|
@ -3,7 +3,7 @@
|
||||||
This is the semi-formal specification for KDL, including the intended data
|
This is the semi-formal specification for KDL, including the intended data
|
||||||
model and the grammar.
|
model and the grammar.
|
||||||
|
|
||||||
This document describes KDL version `1.0.0-pre.0`.
|
This document describes KDL version `1.0.0`.
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
|
|
@ -253,7 +253,7 @@ IEEE 754-2008 decimal floating point numbers
|
||||||
* `date-time`: ISO8601 date/time format.
|
* `date-time`: ISO8601 date/time format.
|
||||||
* `time`: "Time" section of ISO8601.
|
* `time`: "Time" section of ISO8601.
|
||||||
* `date`: "Date" section of ISO8601.
|
* `date`: "Date" section of ISO8601.
|
||||||
* `duration`: ISO8601 duration format.
|
* `duration`: ISO8601 duration format.
|
||||||
* `decimal`: IEEE 754-2008 decimal string format.
|
* `decimal`: IEEE 754-2008 decimal string format.
|
||||||
* `currency`: ISO 4217 currency code.
|
* `currency`: ISO 4217 currency code.
|
||||||
* `country-2`: ISO 3166-1 alpha-2 country code.
|
* `country-2`: ISO 3166-1 alpha-2 country code.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue