Fix parsing of slash (// instead of ////)

pull/9/head
trivernis 4 years ago
parent 1a1ce2c3f6
commit 9692f19b4b

@ -2,7 +2,7 @@
name = "asciimath-rs"
description = "AsciiMath parser"
repository = "https://github.com/trivernis/asciimath-rs"
version = "0.4.7"
version = "0.4.8"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
readme = "README.md"

@ -118,7 +118,7 @@ mod tests {
#[test]
fn it_tokenizes_expressions3() {
let expression = "[[1, 2],[3, 4]]";
let expression = "[[1, 2],[3, 4]] //";
let mut tokenizer = Tokenizer::new(expression.to_string());
let tokens = tokenizer.parse();
assert_eq!(
@ -139,6 +139,8 @@ mod tests {
Token::Text(Text::Number("4".to_string())),
Token::Grouping(Grouping::LBracket),
Token::Grouping(Grouping::LBracket),
Token::Text(Text::Whitespace),
Token::Operation(Operation::Slash),
]
);
}

@ -3,7 +3,7 @@ pub const G_MINUS: &'static[&str] = &["-"];
pub const G_CDOT: &'static [&str] = &["*", "cdot"];
pub const G_AST: &'static [&str] = &["**", "ast"];
pub const G_STAR: &'static [&str] = &["***", "star"];
pub const G_SLASH: &'static[&str] = &["////"];
pub const G_SLASH: &'static [&str] = &["//"];
pub const G_BACKSLASH: &'static [&str] = &["\\\\", "backslash", "setminus"];
pub const G_TIMES: &'static [&str] = &["xx", "times"];
pub const G_DIV: &'static [&str] = &["-:", "div"];

Loading…
Cancel
Save