diff --git a/Cargo.toml b/Cargo.toml index 91dd2f9..998deec 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.7" +version = "0.4.8" authors = ["trivernis "] edition = "2018" readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index dff1b11..5533075 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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), ] ); } diff --git a/src/tokens/constants/operations.rs b/src/tokens/constants/operations.rs index a76a993..ee63dac 100644 --- a/src/tokens/constants/operations.rs +++ b/src/tokens/constants/operations.rs @@ -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"]; \ No newline at end of file +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"];