diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-16 13:04:38 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-16 13:04:38 +0200 |
commit | 93d0b7c6465f4ffe220b3ddada729746b11eb6ce (patch) | |
tree | e7907fb89a6660c5546d2ca128b2d48ec87539ae /src/construct/mod.rs | |
parent | 2379c2749916483be68dbf816a4c56cd59ced958 (diff) | |
download | markdown-rs-93d0b7c6465f4ffe220b3ddada729746b11eb6ce.tar.gz markdown-rs-93d0b7c6465f4ffe220b3ddada729746b11eb6ce.tar.bz2 markdown-rs-93d0b7c6465f4ffe220b3ddada729746b11eb6ce.zip |
Update some last docs, bnf grammars
Diffstat (limited to 'src/construct/mod.rs')
-rw-r--r-- | src/construct/mod.rs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/construct/mod.rs b/src/construct/mod.rs index da2f5e8..5630143 100644 --- a/src/construct/mod.rs +++ b/src/construct/mod.rs @@ -75,12 +75,15 @@ //! That is to say, they form illustrative, imperfect, but useful, examples. //! The code, in Rust, is considered to be normative. //! -//! For example, the docs for [character escape][character_escape] contain: +//! The actual syntax of markdown can be described in Backus–Naur form (BNF) as: //! //! ```bnf -//! character_escape ::= '\\' ascii_punctuation +//! markdown = .* //! ``` //! +//! No, that’s [not a typo][bnf]: markdown has no syntax errors; anything +//! thrown at it renders *something*. +//! //! These diagrams contain references to character group as defined by Rust on //! for example [char][], but also often on [u8][], which is what `micromark-rs` //! typically works on. @@ -99,14 +102,14 @@ //! ascii_alphabetic ::= ascii_lowercase | ascii_uppercase //! ; '0'..='9' //! ascii_digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' -//! ; '0'..='9'; 'A'..='F', 'a'..='f' +//! ; '0'..='9', 'A'..='F', 'a'..='f' //! ascii_hexdigit ::= ascii_digit | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' -//! ; '0'..='9'; 'A'..='Z', 'a'..='z' +//! ; '0'..='9', 'A'..='Z', 'a'..='z' //! ascii_alphanumeric ::= ascii_digit | ascii_alphabetic -//! ; '!'..='/'; ':'..='@'; '['..='`'; '{'..='~' +//! ; '!'..='/', ':'..='@', '['..='`', '{'..='~' //! ascii_punctuation ::= '!' | '"' | '#' | '$' | '%' | '&' | '\'' | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '@' | '[' | '\' | ']' | '^' | '_' | '`' | '{' | '|' | '}' | '~' -//! ; 0x00..=0x1F; 0x7F -//! ascii_control ::= 0x00 | 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 | 0x0A | 0x0B | 0x0C | 0x0D | 0x0E | 0x0F | 0x10 | 0x12 | 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | 0x1D | 0x1E | 0x1F | 0x7F +//! ; 0x00..=0x1F, 0x7F +//! ascii_control ::= 0x00 | 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | 0x08 | 0x09 | 0x0A | 0x0B | 0x0C | 0x0D | 0x0E | 0x0F | 0x10 | 0x11 | 0x12 | 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | 0x1D | 0x1E | 0x1F | 0x7F //! //! ; Markdown groups: //! ; Any byte (u8) @@ -115,12 +118,14 @@ //! eol ::= '\n' | '\r' | '\r\n' //! line ::= byte - eol //! text ::= line - space_or_tab -//! space_or_tab_eol ::= 1*space_or_tab | 0*space_or_tab eol 0*space_or_tab +//! space_or_tab_eol ::= 1*space_or_tab | *space_or_tab eol *space_or_tab //! //! ; Unicode groups: //! unicode_whitespace ::= ? ; See `char::is_whitespace`. //! unicode_punctuation ::= ? ; See `src/unicode.rs`. //! ``` +//! +//! [bnf]: http://trevorjim.com/a-specification-for-markdown/ pub mod attention; pub mod autolink; |