preserves/_includes/cheatsheet-text.md

3.1 KiB

{:.postcard-grammar.textsyntax} | Document | := | Value ws | | 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 | < | > | [ | ] | { | } | # | : | " | | | @ | ; |

{:.postcard-grammar.textsyntax} | Record | := | <Value+ ws> | | Sequence | := | [Value ws] | | Dictionary | := | { (Value ws:Value) ws} | | Set | := | #{Value ws} |

{:.postcard-grammar.textsyntax} | Boolean | := | #t|#f | | ByteString | := | #"binchar "|#x" (ws hex hex) ws"|#[ (ws base64char) ws] | | String | := | " (« any unicode scalar value except \ or " » | escaped |\") " | | QuotedSymbol | := | | (« any unicode scalar value except \ or | » | escaped |\|) | | | Symbol | := | (A..Z|a..z|0..9| sympunct | symuchar)+ | | Number | := | Float | Double | SignedInteger | | Float | := | flt (f|F) |#xf" (ws hex hex)4 ws" | | Double | := | flt |#xd" (ws hex hex)8 ws" | | SignedInteger | := | int |

{:.postcard-grammar.textsyntax} | Embedded | := | #!Value | | Annotated | := | Annotation Value | | Annotation | := | @Value |# ((space | tab) linecomment) (cr | lf) | | linecomment | := | « any unicode scalar value except cr or lf » |

{:.postcard-grammar.textsyntax} | escaped | := | \\|\/|\b|\f|\n|\r|\t|\uhex hex hex hex | | binescaped | := | \\|\/|\b|\f|\n|\r|\t|\xhex hex | | binchar | := | « any unicode scalar value ≥32 and ≤126, except \ or " » | binescaped |\" | | base64char | := | A..Z|a..z|0..9|+|/|-|_|= | | sympunct | := | ~|!|$|%|^|&|*|?|_|=|+|-|/|. | | symuchar | := | « any scalar value ≥128 whose Unicode category is Lu, Ll, Lt, Lm, Lo, Mn, Mc, Me, Nd, Nl, No, Pc, Pd, Po, Sc, Sm, Sk, So, or Co » |

{:.postcard-grammar.textsyntax} | flt | := | int ( frac exp | frac | exp ) | | int | := | (-|+) (0..9)+ | | frac | := | . (0..9)+ | | exp | := | (e|E) (-|+) (0..9)+ | | hex | := | A..F|a..f|0..9 |