commit 894d34211586ef2f9aa8706fba26b6811fe9d416 Author: avitex Date: Tue Dec 18 22:37:31 2018 +1100 Initial commit diff --git a/deterministic.md b/deterministic.md new file mode 100644 index 0000000..743608d --- /dev/null +++ b/deterministic.md @@ -0,0 +1,9 @@ +# Deterministic + +- No comments +- No whitespace +- No multiline text +- No reals in form 3 +- No trailing commas +- Dict keys ordered byte wise +- Natural numbers with more than two trailing zero characters use real form 2 diff --git a/examples/basic.sehn b/examples/basic.sehn new file mode 100644 index 0000000..e2bc025 --- /dev/null +++ b/examples/basic.sehn @@ -0,0 +1,35 @@ +{ + "foo": "bar", + "pi5": 3.1415, + "flag": false, + "googol": 1e100, + "items": [ + "one", + "two" + ], + "person": { + "name": "John Doe", + "age": 42, + "social": [ + # User extended types + Github/user("johndoe") + ], + "bio": [` + "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + " Phasellus at velit ultricies, luctus dolor eu, rhoncus elit." + " Nulla pulvinar pretium enim non tincidunt. Duis nec malesuada" + " ante. Maecenas semper congue vehicula. Vestibulum in libero in" + " lacus porta tristique." + `, ` + "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + " Phasellus at velit ultricies, luctus dolor eu, rhoncus elit." + " Nulla pulvinar pretium enim non tincidunt. Duis nec malesuada" + " ante. Maecenas semper congue vehicula. Vestibulum in libero in" + " lacus porta tristique." + `] + }, + "payload": enc/b64(` + "KJLSUI876IJSO9Yslo8SILUDkuyd89SO9JDSiuh98ASO9Us09ISO" + "JK9F0LKI9ko8udsff9oih23klj9OIJH0ij099OIUOjFFFKj8D===" + `) +} \ No newline at end of file diff --git a/index.md b/index.md new file mode 100644 index 0000000..d2c315e --- /dev/null +++ b/index.md @@ -0,0 +1,72 @@ +# 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. `` +2. `e` +3. `.` + +| part | allowed value | +| ------ | --------------- | +| `int` | `-?[1-9][0-9]*` | +| `frac` | `[0-9]*` | +| `sig` | `` | +| `exp` | `` | + +### `text` + +1. `""` +2. Multiline: + ``` + ` + "" + "" + ` + ``` + +A `text` value holds low and behold, text. + +### `dict` + +1. `{"": , ...}` + +A dictionary is a structure with `text` keys mapping to any value. + +### `list` + +1. `[, ...]` + +A list is a structure with a sequence of any value. + +### `kind` + +1. `` +2. `` +2. `` + +| kind | allowed value | +| ----------------- | ------------------------------------------ | +| `` | `none\|bool\|real\|text\|dict\|list\|kind` | +| `` | `(?!())[a-z][a-z0-9/]*` | +| `` | `[A-Z][a-zA-Z0-9\]*` |