From 1a1ce2c3f6fca52f16cfc881664355f733a85038 Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 6 Aug 2020 11:35:25 +0200 Subject: [PATCH] Fix iff arrow parsing --- Cargo.toml | 2 +- src/lib.rs | 2 +- src/parsing/tokenizer.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1251002..91dd2f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "asciimath-rs" description = "AsciiMath parser" repository = "https://github.com/trivernis/asciimath-rs" -version = "0.4.6" +version = "0.4.7" authors = ["trivernis "] edition = "2018" readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index d2e851f..dff1b11 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -364,7 +364,7 @@ mod tests { //#[test] fn it_writes_mathml() { let str_expression = - "alpha sqrt 1 in NN implies 2^4 + sum_(k = 1)^3 - ((1),(2))[[2, 3 + 3],[4, 5]] + alpha"; + "alpha sqrt 1 in NN implies 2^4 + <=> sum_(k = 1)^3 - ((1),(2))[[2, 3 + 3],[4, 5]] + alpha"; let expression = parse(str_expression.to_string()); fs::write( "test-files/test.html", diff --git a/src/parsing/tokenizer.rs b/src/parsing/tokenizer.rs index 69f4872..678c2a7 100644 --- a/src/parsing/tokenizer.rs +++ b/src/parsing/tokenizer.rs @@ -36,14 +36,14 @@ impl Tokenizer { tokens.push(Token::Grouping(grouping)) } else if let Some(arrow) = self.parse_arrows() { tokens.push(Token::Arrow(arrow)) + } else if let Some(logical) = self.parse_logical() { + tokens.push(Token::Logical(logical)) } else if let Some(relation) = self.parse_relation() { tokens.push(Token::Relation(relation)) } else if let Some(operation) = self.parse_operation() { tokens.push(Token::Operation(operation)) } else if let Some(misc) = self.parse_misc() { tokens.push(Token::Misc(misc)) - } else if let Some(logical) = self.parse_logical() { - tokens.push(Token::Logical(logical)) } else if let Some(accent) = self.parse_accent() { tokens.push(Token::Accent(accent)) } else if let Some(greek) = self.parse_greek() {