Fix up cheat sheets

This commit is contained in:
Tony Garnock-Jones 2023-10-29 22:11:43 +01:00
parent 9d1db2d71f
commit e2e81a67c3
4 changed files with 16 additions and 1 deletions

View File

@ -4,6 +4,8 @@ Value := ws (Record | Collection | Atom | Embedded | Annotated)
Collection := Sequence | Dictionary | Set
Atom := Boolean | ByteString | String | QuotedSymbol | Symbol | Number
ws := (space | tab | cr | lf | `,`)*
delimiter := ws | `<` | `>` | `[` | `]` | `{` | `}`
| `#` | `:` | `"` | `|` | `@` | `;`
Record := `<` Value+ ws `>`
Sequence := `[` Value* ws `]`

View File

@ -4,6 +4,7 @@
| *Collection* | := | *Sequence* &#124; *Dictionary* &#124; *Set* |
| *Atom* | := | *Boolean* &#124; *ByteString* &#124; *String* &#124; *QuotedSymbol* &#124; *Symbol* &#124; *Number* |
| **ws** | := | (**space** &#124; **tab** &#124; **cr** &#124; **lf** &#124;`,`)<sup></sup> |
| **delimiter** | := | **ws** &#124; `<` &#124; `>` &#124; `[` &#124; `]` &#124; `{` &#124; `}` &#124; `#` &#124; `:` &#124; `"` &#124; `|` &#124; `@` &#124; `;` |
{:.postcard-grammar.textsyntax}
| *Record* | := | `<`*Value*<sup>+</sup> **ws**`>` |

View File

@ -3,7 +3,15 @@
set -e
exec 1>&2
COMMAND=cmp
failed=
cmp_and_fail() {
if ! cmp "$1" "$2"
then
failed=failed
fi
}
COMMAND=cmp_and_fail
if [ "$1" = "--fix" ];
then
COMMAND=cp
@ -38,3 +46,5 @@ ${COMMAND} _includes/cheatsheet-text-plaintext.md implementations/rust/preserves
${COMMAND} _includes/value-grammar.md implementations/rust/preserves/doc/value-grammar.md
${COMMAND} _includes/what-is-preserves-schema.md implementations/rust/preserves-schema/doc/what-is-preserves-schema.md
[ -z "$failed" ]

View File

@ -4,6 +4,8 @@ Value := ws (Record | Collection | Atom | Embedded | Annotated)
Collection := Sequence | Dictionary | Set
Atom := Boolean | ByteString | String | QuotedSymbol | Symbol | Number
ws := (space | tab | cr | lf | `,`)*
delimiter := ws | `<` | `>` | `[` | `]` | `{` | `}`
| `#` | `:` | `"` | `|` | `@` | `;`
Record := `<` Value+ ws `>`
Sequence := `[` Value* ws `]`