Skip to content

Ignore command in quoted text #1493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 0 additions & 165 deletions parser/src/code_block.rs

This file was deleted.

12 changes: 6 additions & 6 deletions parser/src/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::code_block::ColorCodeBlocks;
use crate::error::Error;
use crate::ignore_block::IgnoreBlocks;
use crate::token::{Token, Tokenizer};

pub mod assign;
Expand Down Expand Up @@ -33,7 +33,7 @@ pub enum Command<'a> {
pub struct Input<'a> {
all: &'a str,
parsed: usize,
code: ColorCodeBlocks,
ignore: IgnoreBlocks,

// A list of possible bot names.
bot: Vec<&'a str>,
Expand Down Expand Up @@ -64,7 +64,7 @@ impl<'a> Input<'a> {
Input {
all: input,
parsed: 0,
code: ColorCodeBlocks::new(input),
ignore: IgnoreBlocks::new(input),
bot,
}
}
Expand Down Expand Up @@ -141,11 +141,11 @@ impl<'a> Input<'a> {
}

if self
.code
.overlaps_code((self.parsed)..(self.parsed + tok.position()))
.ignore
.overlaps_ignore((self.parsed)..(self.parsed + tok.position()))
.is_some()
{
log::info!("command overlaps code; code: {:?}", self.code);
log::info!("command overlaps ignored block; ignore: {:?}", self.ignore);
return None;
}

Expand Down
Loading