aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-22 14:46:51 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-22 14:46:51 +0200
commit6fdaffb3a8b4517a3b5c1e39dc1e16649c6eb0da (patch)
tree39426778d5a150612059070196d50daadcebfb0e /src/construct
parent33b69eb9189fb2fd0f731530285baf3ac20c5eb0 (diff)
downloadmarkdown-rs-6fdaffb3a8b4517a3b5c1e39dc1e16649c6eb0da.tar.gz
markdown-rs-6fdaffb3a8b4517a3b5c1e39dc1e16649c6eb0da.tar.bz2
markdown-rs-6fdaffb3a8b4517a3b5c1e39dc1e16649c6eb0da.zip
Rename `Whitespace` token to `SpaceOrTab`
Diffstat (limited to 'src/construct')
-rw-r--r--src/construct/blank_line.rs2
-rw-r--r--src/construct/code_fenced.rs4
-rw-r--r--src/construct/code_indented.rs2
-rw-r--r--src/construct/definition.rs6
-rw-r--r--src/construct/heading_atx.rs6
-rw-r--r--src/construct/heading_setext.rs4
-rw-r--r--src/construct/partial_space_or_tab.rs2
7 files changed, 13 insertions, 13 deletions
diff --git a/src/construct/blank_line.rs b/src/construct/blank_line.rs
index 1fd22fd..153a008 100644
--- a/src/construct/blank_line.rs
+++ b/src/construct/blank_line.rs
@@ -20,7 +20,7 @@
//!
//! ## Tokens
//!
-//! * [`Whitespace`][crate::tokenizer::TokenType::Whitespace]
+//! * [`SpaceOrTab`][crate::tokenizer::TokenType::SpaceOrTab]
//!
//! ## References
//!
diff --git a/src/construct/code_fenced.rs b/src/construct/code_fenced.rs
index 724a0b3..d71c01e 100644
--- a/src/construct/code_fenced.rs
+++ b/src/construct/code_fenced.rs
@@ -84,7 +84,7 @@
//! * [`CodeFencedFenceMeta`][TokenType::CodeFencedFenceMeta]
//! * [`CodeFlowChunk`][TokenType::CodeFlowChunk]
//! * [`LineEnding`][TokenType::LineEnding]
-//! * [`Whitespace`][TokenType::Whitespace]
+//! * [`SpaceOrTab`][TokenType::SpaceOrTab]
//!
//! ## References
//!
@@ -194,7 +194,7 @@ fn before_sequence_open(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult
let mut prefix = 0;
if let Some(event) = tail {
- if event.token_type == TokenType::Whitespace {
+ if event.token_type == TokenType::SpaceOrTab {
let span = from_exit_event(&tokenizer.events, tokenizer.events.len() - 1);
prefix = span.end_index - span.start_index;
}
diff --git a/src/construct/code_indented.rs b/src/construct/code_indented.rs
index a0b543a..f476965 100644
--- a/src/construct/code_indented.rs
+++ b/src/construct/code_indented.rs
@@ -31,7 +31,7 @@
//! * [`CodeIndented`][TokenType::CodeIndented]
//! * [`CodeFlowChunk`][TokenType::CodeFlowChunk]
//! * [`LineEnding`][TokenType::LineEnding]
-//! * [`Whitespace`][TokenType::Whitespace]
+//! * [`SpaceOrTab`][TokenType::SpaceOrTab]
//!
//! ## References
//!
diff --git a/src/construct/definition.rs b/src/construct/definition.rs
index 3dd1fbb..7f32858 100644
--- a/src/construct/definition.rs
+++ b/src/construct/definition.rs
@@ -57,7 +57,7 @@
//! * [`DefinitionTitleMarker`][TokenType::DefinitionTitleMarker]
//! * [`DefinitionTitleString`][TokenType::DefinitionTitleString]
//! * [`LineEnding`][TokenType::LineEnding]
-//! * [`Whitespace`][TokenType::Whitespace]
+//! * [`SpaceOrTab`][TokenType::SpaceOrTab]
//!
//! ## References
//!
@@ -179,7 +179,7 @@ fn destination_before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
let event = tokenizer.events.last().unwrap();
// Whitespace.
- if (event.token_type == TokenType::LineEnding || event.token_type == TokenType::Whitespace)
+ if (event.token_type == TokenType::LineEnding || event.token_type == TokenType::SpaceOrTab)
// Blank line not ok.
&& !matches!(
code,
@@ -291,7 +291,7 @@ fn title_before_after_optional_whitespace(tokenizer: &mut Tokenizer, code: Code)
fn title_before_marker(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
let event = tokenizer.events.last().unwrap();
- if event.token_type == TokenType::LineEnding || event.token_type == TokenType::Whitespace {
+ if event.token_type == TokenType::LineEnding || event.token_type == TokenType::SpaceOrTab {
tokenizer.go(
|t, c| {
title(
diff --git a/src/construct/heading_atx.rs b/src/construct/heading_atx.rs
index 6460235..ae16d3d 100644
--- a/src/construct/heading_atx.rs
+++ b/src/construct/heading_atx.rs
@@ -40,7 +40,7 @@
//! * [`HeadingAtx`][TokenType::HeadingAtx]
//! * [`HeadingAtxSequence`][TokenType::HeadingAtxSequence]
//! * [`HeadingAtxText`][TokenType::HeadingAtxText]
-//! * [`HeadingAtxWhitespace`][TokenType::HeadingAtxWhitespace]
+//! * [`HeadingAtxSpaceOrTab`][TokenType::HeadingAtxSpaceOrTab]
//!
//! ## References
//!
@@ -105,7 +105,7 @@ fn sequence_open(tokenizer: &mut Tokenizer, code: Code, rank: usize) -> StateFnR
_ if rank > 0 => {
tokenizer.exit(TokenType::HeadingAtxSequence);
tokenizer.go(
- space_or_tab(TokenType::HeadingAtxWhitespace, 1, usize::MAX),
+ space_or_tab(TokenType::HeadingAtxSpaceOrTab, 1, usize::MAX),
at_break,
)(tokenizer, code)
}
@@ -129,7 +129,7 @@ fn at_break(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
(State::Ok, Some(vec![code]))
}
Code::VirtualSpace | Code::Char('\t' | ' ') => tokenizer.go(
- space_or_tab(TokenType::HeadingAtxWhitespace, 1, usize::MAX),
+ space_or_tab(TokenType::HeadingAtxSpaceOrTab, 1, usize::MAX),
at_break,
)(tokenizer, code),
Code::Char('#') => {
diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs
index 924f840..0cb8687 100644
--- a/src/construct/heading_setext.rs
+++ b/src/construct/heading_setext.rs
@@ -202,7 +202,7 @@ fn text_line_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
let index = tokenizer.events.len() - 2;
// Link the whitespace, if it exists.
- if tokenizer.events[index].token_type == TokenType::Whitespace {
+ if tokenizer.events[index].token_type == TokenType::SpaceOrTab {
link(&mut tokenizer.events, index);
}
@@ -263,7 +263,7 @@ fn underline_sequence_start(tokenizer: &mut Tokenizer, code: Code) -> StateFnRes
let mut prefix = 0;
if let Some(event) = tail {
- if event.token_type == TokenType::Whitespace {
+ if event.token_type == TokenType::SpaceOrTab {
let span = from_exit_event(&tokenizer.events, tokenizer.events.len() - 1);
prefix = span.end_index - span.start_index;
}
diff --git a/src/construct/partial_space_or_tab.rs b/src/construct/partial_space_or_tab.rs
index 1c4b367..cbb2cf3 100644
--- a/src/construct/partial_space_or_tab.rs
+++ b/src/construct/partial_space_or_tab.rs
@@ -34,7 +34,7 @@ pub fn space_or_tab_opt() -> Box<StateFn> {
/// space_or_tab_min_max ::= x*y( ' ' '\t' )
/// ```
pub fn space_or_tab_min_max(min: usize, max: usize) -> Box<StateFn> {
- space_or_tab(TokenType::Whitespace, min, max)
+ space_or_tab(TokenType::SpaceOrTab, min, max)
}
/// Between `x` and `y` `space_or_tab`, with the given token type.