73 lines
1.5 KiB
Markdown
73 lines
1.5 KiB
Markdown
|
# Simple Extensible Human Notation (.sehn)
|
||
|
|
||
|
## Base Kinds
|
||
|
|
||
|
| name | description |
|
||
|
| ------ | -------------------------- |
|
||
|
| `none` | Represents nothing |
|
||
|
| `bool` | Represents a boolean value |
|
||
|
| `real` | Represents a real number |
|
||
|
| `text` | Represents text |
|
||
|
| `dict` | A key-value structure |
|
||
|
| `list` | A collection structure |
|
||
|
| `kind` | A reflective kind |
|
||
|
|
||
|
### `none`
|
||
|
|
||
|
A `none` represents the absence of any value.
|
||
|
|
||
|
### `bool`
|
||
|
|
||
|
1. `true`
|
||
|
2. `false`
|
||
|
|
||
|
### `real`
|
||
|
|
||
|
1. `<int>`
|
||
|
2. `<sig>e<exp>`
|
||
|
3. `<int>.<frac>`
|
||
|
|
||
|
| part | allowed value |
|
||
|
| ------ | --------------- |
|
||
|
| `int` | `-?[1-9][0-9]*` |
|
||
|
| `frac` | `[0-9]*` |
|
||
|
| `sig` | `<int>` |
|
||
|
| `exp` | `<int>` |
|
||
|
|
||
|
### `text`
|
||
|
|
||
|
1. `"<text>"`
|
||
|
2. Multiline:
|
||
|
```
|
||
|
`
|
||
|
"<text>"
|
||
|
"<text>"
|
||
|
`
|
||
|
```
|
||
|
|
||
|
A `text` value holds low and behold, text.
|
||
|
|
||
|
### `dict`
|
||
|
|
||
|
1. `{"<text>": <any>, ...}`
|
||
|
|
||
|
A dictionary is a structure with `text` keys mapping to any value.
|
||
|
|
||
|
### `list`
|
||
|
|
||
|
1. `[<any>, ...]`
|
||
|
|
||
|
A list is a structure with a sequence of any value.
|
||
|
|
||
|
### `kind`
|
||
|
|
||
|
1. `<base-kind>`
|
||
|
2. `<standard-kind>`
|
||
|
2. `<app-kind>`
|
||
|
|
||
|
| kind | allowed value |
|
||
|
| ----------------- | ------------------------------------------ |
|
||
|
| `<base-kind>` | `none\|bool\|real\|text\|dict\|list\|kind` |
|
||
|
| `<standard-kind>` | `(?!(<base-kind>))[a-z][a-z0-9/]*` |
|
||
|
| `<app-kind>` | `[A-Z][a-zA-Z0-9\]*` |
|