From 57de6ff16bba05491733bb457acbf95bba0ebbd1 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 30 Jun 2022 10:57:36 +0200 Subject: Refactor to reorder token types --- src/tokenizer.rs | 636 +++++++++++++++++++++++++++---------------------------- 1 file changed, 318 insertions(+), 318 deletions(-) (limited to 'src') diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 950c935..17cf392 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -211,7 +211,7 @@ pub enum TokenType { /// ^ ^ ^ /// ``` CharacterReferenceMarker, - /// Character reference numeric marker. + /// Character reference hexadecimal numeric marker. /// /// ## Info /// @@ -226,10 +226,10 @@ pub enum TokenType { /// /// ```markdown /// > | a & b ≠ c 𝌆 d - /// ^ ^ + /// ^ /// ``` - CharacterReferenceMarkerNumeric, - /// Character reference hexadecimal numeric marker. + CharacterReferenceMarkerHexadecimal, + /// Character reference numeric marker. /// /// ## Info /// @@ -244,9 +244,9 @@ pub enum TokenType { /// /// ```markdown /// > | a & b ≠ c 𝌆 d - /// ^ + /// ^ ^ /// ``` - CharacterReferenceMarkerHexadecimal, + CharacterReferenceMarkerNumeric, /// Character reference closing marker. /// /// ## Info @@ -332,14 +332,14 @@ pub enum TokenType { /// ^^^ /// ```` CodeFencedFence, - /// A code (fenced) fence sequence. + /// A code (fenced) fence info word. /// /// ## Info /// /// * **Context**: - /// [`CodeFencedFenceSequence`][TokenType::CodeFencedFenceSequence] + /// [`CodeFencedFence`][TokenType::CodeFencedFence] /// * **Content model**: - /// void + /// [string content][crate::content::string] /// * **Construct**: /// [`code_fenced`][crate::construct::code_fenced] /// @@ -347,13 +347,12 @@ pub enum TokenType { /// /// ````markdown /// > | ```js - /// ^^^ + /// ^^ /// | console.log(1) - /// > | ``` - /// ^^^ + /// | ``` /// ```` - CodeFencedFenceSequence, - /// A code (fenced) fence info word. + CodeFencedFenceInfo, + /// A code (fenced) fence meta string. /// /// ## Info /// @@ -367,32 +366,33 @@ pub enum TokenType { /// ## Example /// /// ````markdown - /// > | ```js - /// ^^ + /// > | ```js highlight="1" + /// ^^^^^^^^^^^^^ /// | console.log(1) /// | ``` /// ```` - CodeFencedFenceInfo, - /// A code (fenced) fence meta string. + CodeFencedFenceMeta, + /// A code (fenced) fence sequence. /// /// ## Info /// /// * **Context**: - /// [`CodeFencedFence`][TokenType::CodeFencedFence] + /// [`CodeFencedFenceSequence`][TokenType::CodeFencedFenceSequence] /// * **Content model**: - /// [string content][crate::content::string] + /// void /// * **Construct**: /// [`code_fenced`][crate::construct::code_fenced] /// /// ## Example /// /// ````markdown - /// > | ```js highlight="1" - /// ^^^^^^^^^^^^^ + /// > | ```js + /// ^^^ /// | console.log(1) - /// | ``` + /// > | ``` + /// ^^^ /// ```` - CodeFencedFenceMeta, + CodeFencedFenceSequence, /// A code (fenced, indented) chunk. /// /// ## Info @@ -478,7 +478,7 @@ pub enum TokenType { /// ^ /// ``` CodeTextData, - /// Code (text) sequence. + /// Line ending in code (text). /// /// ## Info /// @@ -492,11 +492,12 @@ pub enum TokenType { /// ## Example /// /// ```markdown - /// > | a `b` c - /// ^ ^ + /// > | a `b␊ + /// ^ + /// | c` d /// ``` - CodeTextSequence, - /// Line ending in code (text). + CodeTextLineEnding, + /// Code (text) sequence. /// /// ## Info /// @@ -510,11 +511,10 @@ pub enum TokenType { /// ## Example /// /// ```markdown - /// > | a `b␊ - /// ^ - /// | c` d + /// > | a `b` c + /// ^ ^ /// ``` - CodeTextLineEnding, + CodeTextSequence, /// Data. /// /// ## Info @@ -557,90 +557,91 @@ pub enum TokenType { /// ^^^^^^^^^^ /// ``` Definition, - /// Whole definition label. + /// Whole definition destination. /// /// ## Info /// /// * **Context**: /// [`Definition`][TokenType::Definition] /// * **Content model**: - /// [`DefinitionLabelMarker`][TokenType::DefinitionLabelMarker], - /// [`DefinitionLabelString`][TokenType::DefinitionLabelString], - /// [`LineEnding`][TokenType::LineEnding], - /// [`SpaceOrTab`][TokenType::SpaceOrTab] + /// [`DefinitionDestinationLiteral`][TokenType::DefinitionDestinationLiteral], + /// [`DefinitionDestinationRaw`][TokenType::DefinitionDestinationRaw] /// * **Construct**: - /// [`label`][crate::construct::partial_label] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown /// > | [a]: b "c" - /// ^^^ + /// ^ + /// > | [a]: "c" + /// ^^^ /// ``` - DefinitionLabel, - /// Definition label marker. + DefinitionDestination, + /// Definition destination literal. /// /// ## Info /// /// * **Context**: - /// [`DefinitionLabel`][TokenType::DefinitionLabel] + /// [`DefinitionDestination`][TokenType::DefinitionDestination] /// * **Content model**: - /// void + /// [`DefinitionDestinationLiteralMarker`][TokenType::DefinitionDestinationLiteralMarker], + /// [`DefinitionDestinationString`][TokenType::DefinitionDestinationString] /// * **Construct**: - /// [`label`][crate::construct::partial_label] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | [a]: b "c" - /// ^ ^ + /// > | [a]: "c" + /// ^^^ /// ``` - DefinitionLabelMarker, - /// Definition label data. + DefinitionDestinationLiteral, + /// Definition destination literal marker. /// /// ## Info /// /// * **Context**: - /// [`DefinitionLabel`][TokenType::DefinitionLabel] + /// [`DefinitionDestinationLiteral`][TokenType::DefinitionDestinationLiteral] /// * **Content model**: - /// [string content][crate::content::string] + /// void /// * **Construct**: - /// [`label`][crate::construct::partial_label] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | [a]: b "c" - /// ^ + /// > | [a]: "c" + /// ^ ^ /// ``` - DefinitionLabelString, - /// Definition marker. + DefinitionDestinationLiteralMarker, + /// Definition destination raw. /// /// ## Info /// /// * **Context**: - /// [`Definition`][TokenType::Definition] + /// [`DefinitionDestination`][TokenType::DefinitionDestination] /// * **Content model**: - /// void + /// [`DefinitionDestinationString`][TokenType::DefinitionDestinationString] /// * **Construct**: - /// [`definition`][crate::construct::definition] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown /// > | [a]: b "c" - /// ^ + /// ^ /// ``` - DefinitionMarker, - /// Whole definition destination. + DefinitionDestinationRaw, + /// Definition destination data. /// /// ## Info /// /// * **Context**: - /// [`Definition`][TokenType::Definition] - /// * **Content model**: /// [`DefinitionDestinationLiteral`][TokenType::DefinitionDestinationLiteral], /// [`DefinitionDestinationRaw`][TokenType::DefinitionDestinationRaw] + /// * **Content model**: + /// [string content][crate::content::string] /// * **Construct**: /// [`destination`][crate::construct::partial_destination] /// @@ -650,85 +651,84 @@ pub enum TokenType { /// > | [a]: b "c" /// ^ /// > | [a]: "c" - /// ^^^ + /// ^ /// ``` - DefinitionDestination, - /// Definition destination literal. + DefinitionDestinationString, + /// Whole definition label. /// /// ## Info /// /// * **Context**: - /// [`DefinitionDestination`][TokenType::DefinitionDestination] + /// [`Definition`][TokenType::Definition] /// * **Content model**: - /// [`DefinitionDestinationLiteralMarker`][TokenType::DefinitionDestinationLiteralMarker], - /// [`DefinitionDestinationString`][TokenType::DefinitionDestinationString] + /// [`DefinitionLabelMarker`][TokenType::DefinitionLabelMarker], + /// [`DefinitionLabelString`][TokenType::DefinitionLabelString], + /// [`LineEnding`][TokenType::LineEnding], + /// [`SpaceOrTab`][TokenType::SpaceOrTab] /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`label`][crate::construct::partial_label] /// /// ## Example /// /// ```markdown - /// > | [a]: "c" - /// ^^^ + /// > | [a]: b "c" + /// ^^^ /// ``` - DefinitionDestinationLiteral, - /// Definition destination literal marker. + DefinitionLabel, + /// Definition label marker. /// /// ## Info /// /// * **Context**: - /// [`DefinitionDestinationLiteral`][TokenType::DefinitionDestinationLiteral] + /// [`DefinitionLabel`][TokenType::DefinitionLabel] /// * **Content model**: /// void /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`label`][crate::construct::partial_label] /// /// ## Example /// /// ```markdown - /// > | [a]: "c" - /// ^ ^ + /// > | [a]: b "c" + /// ^ ^ /// ``` - DefinitionDestinationLiteralMarker, - /// Definition destination raw. + DefinitionLabelMarker, + /// Definition label data. /// /// ## Info /// /// * **Context**: - /// [`DefinitionDestination`][TokenType::DefinitionDestination] + /// [`DefinitionLabel`][TokenType::DefinitionLabel] /// * **Content model**: - /// [`DefinitionDestinationString`][TokenType::DefinitionDestinationString] + /// [string content][crate::content::string] /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`label`][crate::construct::partial_label] /// /// ## Example /// /// ```markdown /// > | [a]: b "c" - /// ^ + /// ^ /// ``` - DefinitionDestinationRaw, - /// Definition destination data. + DefinitionLabelString, + /// Definition marker. /// /// ## Info /// /// * **Context**: - /// [`DefinitionDestinationLiteral`][TokenType::DefinitionDestinationLiteral], - /// [`DefinitionDestinationRaw`][TokenType::DefinitionDestinationRaw] + /// [`Definition`][TokenType::Definition] /// * **Content model**: - /// [string content][crate::content::string] + /// void /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`definition`][crate::construct::definition] /// /// ## Example /// /// ```markdown /// > | [a]: b "c" - /// ^ - /// > | [a]: "c" - /// ^ + /// ^ /// ``` - DefinitionDestinationString, + DefinitionMarker, /// Whole definition title. /// /// ## Info @@ -1055,44 +1055,57 @@ pub enum TokenType { /// ^^^ /// ``` HtmlTextData, - /// Label start (image). + /// Image. /// /// ## Info /// /// * **Context**: - /// [`Label`][TokenType::Label] + /// [text content][crate::content::text] /// * **Content model**: - /// [`LabelImageMarker`][TokenType::LabelImageMarker], - /// [`LabelMarker`][TokenType::LabelMarker] + /// [`Label`][TokenType::Label], + /// [`Resource`][TokenType::Resource], + /// [`Reference`][TokenType::Reference] /// * **Construct**: - /// [`label_start_image`][crate::construct::label_start_image] + /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown + /// > | a ![b] c + /// ^^^^ + /// > | a ![b][c] d + /// ^^^^^^^ /// > | a ![b](c) d - /// ^^ + /// ^^^^^^^ /// ``` - LabelImage, - /// Label start (image) marker. + Image, + /// Label. /// /// ## Info /// /// * **Context**: - /// [`LabelImage`][TokenType::LabelImage] + /// [`Image`][TokenType::Image], + /// [`Link`][TokenType::Link] /// * **Content model**: - /// void + /// [`LabelImage`][TokenType::LabelImage], + /// [`LabelLink`][TokenType::LabelLink], + /// [`LabelEnd`][TokenType::LabelEnd], + /// [`LabelText`][TokenType::LabelText] /// * **Construct**: - /// [`label_start_image`][crate::construct::label_start_image] + /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown - /// > | a ![b](c) d - /// ^ + /// > | a [b] c + /// ^^^ + /// > | a ![b][c] d + /// ^^^^ + /// > | a [b](c) d + /// ^^^ /// ``` - LabelImageMarker, - /// Label start (link). + Label, + /// Label end. /// /// ## Info /// @@ -1101,40 +1114,55 @@ pub enum TokenType { /// * **Content model**: /// [`LabelMarker`][TokenType::LabelMarker] /// * **Construct**: - /// [`label_start_link`][crate::construct::label_start_link] + /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown + /// > | a ![b](c) d + /// ^ /// > | a [b](c) d - /// ^ + /// ^ /// ``` - LabelLink, - /// Label marker. + LabelEnd, + /// Label start (image). /// /// ## Info /// /// * **Context**: - /// [`LabelImage`][TokenType::LabelImage], - /// [`LabelLink`][TokenType::LabelLink], - /// [`LabelEnd`][TokenType::LabelEnd] + /// [`Label`][TokenType::Label] /// * **Content model**: - /// void + /// [`LabelImageMarker`][TokenType::LabelImageMarker], + /// [`LabelMarker`][TokenType::LabelMarker] /// * **Construct**: - /// [`label_start_image`][crate::construct::label_start_image], - /// [`label_start_link`][crate::construct::label_start_link], - /// [`label_end`][crate::construct::label_end] + /// [`label_start_image`][crate::construct::label_start_image] /// /// ## Example /// /// ```markdown /// > | a ![b](c) d - /// ^ ^ - /// > | a [b](c) d - /// ^ ^ + /// ^^ /// ``` - LabelMarker, - /// Label end. + LabelImage, + /// Label start (image) marker. + /// + /// ## Info + /// + /// * **Context**: + /// [`LabelImage`][TokenType::LabelImage] + /// * **Content model**: + /// void + /// * **Construct**: + /// [`label_start_image`][crate::construct::label_start_image] + /// + /// ## Example + /// + /// ```markdown + /// > | a ![b](c) d + /// ^ + /// ``` + LabelImageMarker, + /// Label start (link). /// /// ## Info /// @@ -1143,401 +1171,391 @@ pub enum TokenType { /// * **Content model**: /// [`LabelMarker`][TokenType::LabelMarker] /// * **Construct**: - /// [`label_end`][crate::construct::label_end] + /// [`label_start_link`][crate::construct::label_start_link] /// /// ## Example /// /// ```markdown - /// > | a ![b](c) d - /// ^ /// > | a [b](c) d - /// ^ + /// ^ /// ``` - LabelEnd, - /// Resource. + LabelLink, + /// Label marker. /// /// ## Info /// /// * **Context**: - /// [`Image`][TokenType::Image], - /// [`Link`][TokenType::Link] + /// [`LabelImage`][TokenType::LabelImage], + /// [`LabelLink`][TokenType::LabelLink], + /// [`LabelEnd`][TokenType::LabelEnd] /// * **Content model**: - /// [`ResourceMarker`][TokenType::ResourceMarker], - /// [`ResourceDestination`][TokenType::ResourceDestination], - /// [`ResourceTitle`][TokenType::ResourceTitle], - /// [`SpaceOrTab`][TokenType::SpaceOrTab], - /// [`LineEnding`][TokenType::LineEnding] + /// void /// * **Construct**: + /// [`label_start_image`][crate::construct::label_start_image], + /// [`label_start_link`][crate::construct::label_start_link], /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown - /// > | a ![b](c "d") e - /// ^^^^^^^ + /// > | a ![b](c) d + /// ^ ^ /// > | a [b](c) d - /// ^^^ + /// ^ ^ /// ``` - Resource, - /// Resource marker. + LabelMarker, + /// Label text. /// /// ## Info /// /// * **Context**: - /// [`Resource`][TokenType::Resource] + /// [`Label`][TokenType::Label] /// * **Content model**: - /// void + /// [text content][crate::content::text] /// * **Construct**: /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown - /// > | a ![b](c "d") e - /// ^ ^ + /// > | a [b] c + /// ^ + /// > | a ![b][c] d + /// ^ + /// > | a [b](c) d + /// ^ /// ``` - ResourceMarker, - /// Resource destination. + LabelText, + /// Line ending. /// /// ## Info /// /// * **Context**: - /// [`Resource`][TokenType::Resource] + /// basically everywhere /// * **Content model**: - /// [`ResourceDestinationLiteral`][TokenType::ResourceDestinationLiteral], - /// [`ResourceDestinationRaw`][TokenType::ResourceDestinationRaw] + /// void /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// n/a /// /// ## Example /// /// ```markdown - /// > | a ![b](c "d") e - /// ^ + /// > | a␊ + /// ^ + /// | b /// ``` - ResourceDestination, - /// Resource destination literal. + LineEnding, + /// Link. /// /// ## Info /// /// * **Context**: - /// [`ResourceDestination`][TokenType::ResourceDestination] + /// [text content][crate::content::text] /// * **Content model**: - /// [`ResourceDestinationLiteralMarker`][TokenType::ResourceDestinationLiteralMarker], - /// [`ResourceDestinationString`][TokenType::ResourceDestinationString] + /// [`Label`][TokenType::Label], + /// [`Resource`][TokenType::Resource], + /// [`Reference`][TokenType::Reference] /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown - /// > | a ![b]( "d") e - /// ^^^ + /// > | a [b] c + /// ^^^ + /// > | a [b][c] d + /// ^^^^^^ + /// > | a [b](c) d + /// ^^^^^^ /// ``` - ResourceDestinationLiteral, - /// Resource destination literal marker. + Link, + /// Whole paragraph. /// /// ## Info /// /// * **Context**: - /// [`ResourceDestinationLiteral`][TokenType::ResourceDestinationLiteral] + /// [flow content][crate::content::flow] /// * **Content model**: - /// void + /// [text content][crate::content::text] /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`paragraph`][crate::construct::paragraph] /// /// ## Example /// /// ```markdown - /// > | a ![b]( "d") e - /// ^ ^ + /// > | a b + /// ^^^ + /// > | c. + /// ^^ /// ``` - ResourceDestinationLiteralMarker, - /// Resource destination raw. + Paragraph, + /// Reference. /// /// ## Info /// /// * **Context**: - /// [`ResourceDestination`][TokenType::ResourceDestination] + /// [`Image`][TokenType::Image], + /// [`Link`][TokenType::Link] /// * **Content model**: - /// [`ResourceDestinationString`][TokenType::ResourceDestinationString] + /// [`ReferenceMarker`][TokenType::ReferenceMarker], + /// [`ReferenceString`][TokenType::ReferenceString] /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`label`][crate::construct::partial_label] /// /// ## Example /// /// ```markdown - /// > | a ![b](c "d") e - /// ^ + /// > | a ![b][c] d + /// ^^^ /// ``` - ResourceDestinationRaw, - /// Resource destination raw. + Reference, + /// Reference marker. /// /// ## Info /// /// * **Context**: - /// [`ResourceDestinationLiteral`][TokenType::ResourceDestinationLiteral], - /// [`ResourceDestinationRaw`][TokenType::ResourceDestinationRaw] + /// [`Reference`][TokenType::Reference] /// * **Content model**: - /// [string content][crate::content::string] + /// void /// * **Construct**: - /// [`destination`][crate::construct::partial_destination] + /// [`label`][crate::construct::partial_label] /// /// ## Example /// /// ```markdown - /// > | a ![b]( "d") e - /// ^ - /// > | a ![b](c "d") e - /// ^ + /// > | a ![b][c] d + /// ^ ^ /// ``` - ResourceDestinationString, - /// Resource title. + ReferenceMarker, + /// Reference string. /// /// ## Info /// /// * **Context**: - /// [`Resource`][TokenType::Resource] + /// [`Reference`][TokenType::Reference] /// * **Content model**: - /// [`ResourceTitleMarker`][TokenType::ResourceTitleMarker], - /// [`ResourceTitleString`][TokenType::ResourceTitleString] + /// [string content][crate::content::string] /// * **Construct**: - /// [`title`][crate::construct::partial_title] + /// [`label`][crate::construct::partial_label] /// /// ## Example /// /// ```markdown - /// > | a ![b]( "d") e - /// ^^^ + /// > | a ![b][c] d + /// ^ /// ``` - ResourceTitle, - /// Resource title marker. + ReferenceString, + /// Resource. /// /// ## Info /// /// * **Context**: - /// [`ResourceTitle`][TokenType::ResourceTitle] + /// [`Image`][TokenType::Image], + /// [`Link`][TokenType::Link] /// * **Content model**: - /// void + /// [`ResourceMarker`][TokenType::ResourceMarker], + /// [`ResourceDestination`][TokenType::ResourceDestination], + /// [`ResourceTitle`][TokenType::ResourceTitle], + /// [`SpaceOrTab`][TokenType::SpaceOrTab], + /// [`LineEnding`][TokenType::LineEnding] /// * **Construct**: - /// [`title`][crate::construct::partial_title] + /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown - /// > | a ![b]( "d") e - /// ^ ^ + /// > | a ![b](c "d") e + /// ^^^^^^^ + /// > | a [b](c) d + /// ^^^ /// ``` - ResourceTitleMarker, - /// Resource title string. + Resource, + /// Resource destination. /// /// ## Info /// /// * **Context**: - /// [`ResourceTitle`][TokenType::ResourceTitle] + /// [`Resource`][TokenType::Resource] /// * **Content model**: - /// [string content][crate::content::string] + /// [`ResourceDestinationLiteral`][TokenType::ResourceDestinationLiteral], + /// [`ResourceDestinationRaw`][TokenType::ResourceDestinationRaw] /// * **Construct**: - /// [`title`][crate::construct::partial_title] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | a ![b]( "d") e - /// ^ + /// > | a ![b](c "d") e + /// ^ /// ``` - ResourceTitleString, - /// Reference. + ResourceDestination, + /// Resource destination literal. /// /// ## Info /// /// * **Context**: - /// [`Image`][TokenType::Image], - /// [`Link`][TokenType::Link] + /// [`ResourceDestination`][TokenType::ResourceDestination] /// * **Content model**: - /// [`ReferenceMarker`][TokenType::ReferenceMarker], - /// [`ReferenceString`][TokenType::ReferenceString] + /// [`ResourceDestinationLiteralMarker`][TokenType::ResourceDestinationLiteralMarker], + /// [`ResourceDestinationString`][TokenType::ResourceDestinationString] /// * **Construct**: - /// [`label`][crate::construct::partial_label] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | a ![b][c] d - /// ^^^ + /// > | a ![b]( "d") e + /// ^^^ /// ``` - Reference, - /// Reference marker. + ResourceDestinationLiteral, + /// Resource destination literal marker. /// /// ## Info /// /// * **Context**: - /// [`Reference`][TokenType::Reference] + /// [`ResourceDestinationLiteral`][TokenType::ResourceDestinationLiteral] /// * **Content model**: /// void /// * **Construct**: - /// [`label`][crate::construct::partial_label] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | a ![b][c] d - /// ^ ^ + /// > | a ![b]( "d") e + /// ^ ^ /// ``` - ReferenceMarker, - /// Reference string. + ResourceDestinationLiteralMarker, + /// Resource destination raw. /// /// ## Info /// /// * **Context**: - /// [`Reference`][TokenType::Reference] + /// [`ResourceDestination`][TokenType::ResourceDestination] /// * **Content model**: - /// [string content][crate::content::string] + /// [`ResourceDestinationString`][TokenType::ResourceDestinationString] /// * **Construct**: - /// [`label`][crate::construct::partial_label] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | a ![b][c] d + /// > | a ![b](c "d") e /// ^ /// ``` - ReferenceString, - /// Link. + ResourceDestinationRaw, + /// Resource destination raw. /// /// ## Info /// /// * **Context**: - /// [text content][crate::content::text] + /// [`ResourceDestinationLiteral`][TokenType::ResourceDestinationLiteral], + /// [`ResourceDestinationRaw`][TokenType::ResourceDestinationRaw] /// * **Content model**: - /// [`Label`][TokenType::Label], - /// [`Resource`][TokenType::Resource], - /// [`Reference`][TokenType::Reference] + /// [string content][crate::content::string] /// * **Construct**: - /// [`label_end`][crate::construct::label_end] + /// [`destination`][crate::construct::partial_destination] /// /// ## Example /// /// ```markdown - /// > | a [b] c - /// ^^^ - /// > | a [b][c] d - /// ^^^^^^ - /// > | a [b](c) d - /// ^^^^^^ + /// > | a ![b]( "d") e + /// ^ + /// > | a ![b](c "d") e + /// ^ /// ``` - Link, - /// Image. + ResourceDestinationString, + /// Resource marker. /// /// ## Info /// /// * **Context**: - /// [text content][crate::content::text] + /// [`Resource`][TokenType::Resource] /// * **Content model**: - /// [`Label`][TokenType::Label], - /// [`Resource`][TokenType::Resource], - /// [`Reference`][TokenType::Reference] + /// void /// * **Construct**: /// [`label_end`][crate::construct::label_end] /// /// ## Example /// /// ```markdown - /// > | a ![b] c - /// ^^^^ - /// > | a ![b][c] d - /// ^^^^^^^ - /// > | a ![b](c) d - /// ^^^^^^^ + /// > | a ![b](c "d") e + /// ^ ^ /// ``` - Image, - /// Label. + ResourceMarker, + /// Resource title. /// /// ## Info /// /// * **Context**: - /// [`Image`][TokenType::Image], - /// [`Link`][TokenType::Link] + /// [`Resource`][TokenType::Resource] /// * **Content model**: - /// [`LabelImage`][TokenType::LabelImage], - /// [`LabelLink`][TokenType::LabelLink], - /// [`LabelEnd`][TokenType::LabelEnd], - /// [`LabelText`][TokenType::LabelText] + /// [`ResourceTitleMarker`][TokenType::ResourceTitleMarker], + /// [`ResourceTitleString`][TokenType::ResourceTitleString] /// * **Construct**: - /// [`label_end`][crate::construct::label_end] + /// [`title`][crate::construct::partial_title] /// /// ## Example /// /// ```markdown - /// > | a [b] c - /// ^^^ - /// > | a ![b][c] d - /// ^^^^ - /// > | a [b](c) d - /// ^^^ + /// > | a ![b]( "d") e + /// ^^^ /// ``` - Label, - /// Label text. + ResourceTitle, + /// Resource title marker. /// /// ## Info /// /// * **Context**: - /// [`Label`][TokenType::Label] + /// [`ResourceTitle`][TokenType::ResourceTitle] /// * **Content model**: - /// [text content][crate::content::text] + /// void /// * **Construct**: - /// [`label_end`][crate::construct::label_end] + /// [`title`][crate::construct::partial_title] /// /// ## Example /// /// ```markdown - /// > | a [b] c - /// ^ - /// > | a ![b][c] d - /// ^ - /// > | a [b](c) d - /// ^ + /// > | a ![b]( "d") e + /// ^ ^ /// ``` - LabelText, - /// Line ending. + ResourceTitleMarker, + /// Resource title string. /// /// ## Info /// /// * **Context**: - /// basically everywhere + /// [`ResourceTitle`][TokenType::ResourceTitle] /// * **Content model**: - /// void + /// [string content][crate::content::string] /// * **Construct**: - /// n/a + /// [`title`][crate::construct::partial_title] /// /// ## Example /// /// ```markdown - /// > | a␊ - /// ^ - /// | b + /// > | a ![b]( "d") e + /// ^ /// ``` - LineEnding, - /// Whole paragraph. + ResourceTitleString, + /// SpaceOrTab. /// /// ## Info /// /// * **Context**: - /// [flow content][crate::content::flow] + /// basically everywhere /// * **Content model**: - /// [text content][crate::content::text] + /// void /// * **Construct**: - /// [`paragraph`][crate::construct::paragraph] + /// n/a /// /// ## Example /// /// ```markdown - /// > | a b - /// ^^^ - /// > | c. - /// ^^ + /// > | ␠* * *␠ + /// ^ ^ ^ ^ /// ``` - Paragraph, + SpaceOrTab, /// Whole thematic break. /// /// ## Info @@ -1575,24 +1593,6 @@ pub enum TokenType { /// ^ ^ ^ /// ``` ThematicBreakSequence, - /// SpaceOrTab. - /// - /// ## Info - /// - /// * **Context**: - /// basically everywhere - /// * **Content model**: - /// void - /// * **Construct**: - /// n/a - /// - /// ## Example - /// - /// ```markdown - /// > | ␠* * *␠ - /// ^ ^ ^ ^ - /// ``` - SpaceOrTab, } /// To do -- cgit