docs: add EBNF grammar for the reader syntax (doc/grammar.ebnf)
Specify the surface syntax Jolt's reader accepts as an EBNF grammar — the
syntactic half of the contract (behavioural half is test/spec/). Grounded in
src/jolt/reader.janet and verified against the running reader: whitespace
(comma included), comments, #_ discard, scalars (nil/bool/number incl 0x hex &
floats/string/char incl \uNNNN \oNNN & named/keyword incl ::auto/symbol),
collections, reader macros (quote/syntax-quote/unquote/~@/deref/metadata), and
dispatch (#{}, #(), #', #"regex", #?/#?@, tagged #inst/#uuid). Jolt-vs-Clojure
deviations noted inline (no ratios/radix/BigInt literals; PEG regex limits).
Referenced from README.
This commit is contained in:
parent
e409edf8d9
commit
a6491d025c
2 changed files with 155 additions and 0 deletions
|
|
@ -107,6 +107,11 @@ Tests are organized in three layers:
|
|||
are `["label" expected actual]`, compared with Jolt's own `=`) plus
|
||||
`expect=`/`expect-throws` for unit tests.
|
||||
|
||||
The syntactic half of the contract — the surface syntax the reader accepts — is
|
||||
specified as an EBNF grammar in [`doc/grammar.ebnf`](doc/grammar.ebnf), with
|
||||
Jolt-vs-Clojure deviations noted inline. `test/spec/reader-syntax-spec.janet`
|
||||
exercises it.
|
||||
|
||||
## License
|
||||
|
||||
[Eclipse Public License 1.0](https://opensource.org/licenses/EPL-1.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue