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),
]
);
}

@ -1,26 +1,26 @@
pub const G_PLUS: &'static[&str] = &["+"];
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_BACKSLASH: &'static[&str] = &["\\\\", "backslash", "setminus"];
pub const G_TIMES: &'static[&str] = &["xx", "times"];
pub const G_DIV: &'static[&str] = &["-:", "div"];
pub const G_LTIMES: &'static[&str] = &["|><", "ltimes"];
pub const G_RTIMES: &'static[&str] = &["><|", "rtimes"];
pub const G_BOWTIE: &'static[&str] = &["|><|", "bowtie"];
pub const G_CIRC: &'static[&str] = &["@", "circ"];
pub const G_OPLUS: &'static[&str] = &["o+", "oplus"];
pub const G_OTIMES: &'static[&str] = &["ox", "otimes"];
pub const G_ODOT: &'static[&str] = &["o.", "odot"];
pub const G_SUM: &'static[&str] = &["sum"];
pub const G_PROD: &'static[&str] = &["prod"];
pub const G_WEDGE: &'static[&str] = &["^^", "wedge"];
pub const G_BIDWEDGE: &'static[&str] = &["^^^", "bidwedge"];
pub const G_VEE: &'static[&str] = &["vv", "vee"];
pub const G_BIGVEE: &'static[&str] = &["vvv", "bigvee"];
pub const G_CAP: &'static[&str] = &["nn", "cap"];
pub const G_BIGCAP: &'static[&str] = &["nnn", "bigcap"];
pub const G_CUP: &'static[&str] = &["uu", "cup"];
pub const G_BIGCUP: &'static[&str] = &["uuu", "bigcup"];
pub const G_PLUS: &'static [&str] = &["+"];
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_BACKSLASH: &'static [&str] = &["\\\\", "backslash", "setminus"];
pub const G_TIMES: &'static [&str] = &["xx", "times"];
pub const G_DIV: &'static [&str] = &["-:", "div"];
pub const G_LTIMES: &'static [&str] = &["|><", "ltimes"];
pub const G_RTIMES: &'static [&str] = &["><|", "rtimes"];
pub const G_BOWTIE: &'static [&str] = &["|><|", "bowtie"];
pub const G_CIRC: &'static [&str] = &["@", "circ"];
pub const G_OPLUS: &'static [&str] = &["o+", "oplus"];
pub const G_OTIMES: &'static [&str] = &["ox", "otimes"];
pub const G_ODOT: &'static [&str] = &["o.", "odot"];
pub const G_SUM: &'static [&str] = &["sum"];
pub const G_PROD: &'static [&str] = &["prod"];
pub const G_WEDGE: &'static [&str] = &["^^", "wedge"];
pub const G_BIDWEDGE: &'static [&str] = &["^^^", "bidwedge"];
pub const G_VEE: &'static [&str] = &["vv", "vee"];
pub const G_BIGVEE: &'static [&str] = &["vvv", "bigvee"];
pub const G_CAP: &'static [&str] = &["nn", "cap"];
pub const G_BIGCAP: &'static [&str] = &["nnn", "bigcap"];
pub const G_CUP: &'static [&str] = &["uu", "cup"];
pub const G_BIGCUP: &'static [&str] = &["uuu", "bigcup"];

Loading…
Cancel
Save