mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 05:34:14 +00:00
Merge pull request #43 from tiffany352/unicode-minus-sign
Parse U+2212 as minus sign (Fixes #33)
This commit is contained in:
commit
87495995e1
2 changed files with 6 additions and 0 deletions
|
@ -123,6 +123,7 @@ impl<'a> Iterator for TokenIterator<'a> {
|
|||
},
|
||||
_ => Token::Minus
|
||||
},
|
||||
'\u{2212}' => Token::Minus,
|
||||
'/' => match self.0.peek() {
|
||||
Some(&'/') => loop {
|
||||
match self.0.next() {
|
||||
|
|
|
@ -569,3 +569,8 @@ fn test_formula() {
|
|||
);
|
||||
test("C60", "C60: molar_mass = 0.72066 kilogram / mole");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unicode_minus() {
|
||||
test("\u{2212}10", "-10 (dimensionless)");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue