mirror of
https://github.com/tiffany352/rink-rs
synced 2024-09-20 14:12:00 +00:00
Allow units with spaces by wrapping them in ""
This commit is contained in:
parent
06d280b4ae
commit
716efc2edf
3 changed files with 34 additions and 4 deletions
|
@ -679,8 +679,8 @@ arcminute arcmin
|
|||
' arcmin
|
||||
arcsec 1|60 arcmin
|
||||
arcsecond arcsec
|
||||
" arcsec
|
||||
'' "
|
||||
#" arcsec
|
||||
#'' "
|
||||
rightangle 90 degrees
|
||||
quadrant 1|4 circle
|
||||
quintant 1|5 circle
|
||||
|
@ -5364,8 +5364,8 @@ röntgen roentgen
|
|||
ħ hbar
|
||||
‰ 1|1000
|
||||
‱ 1|10000
|
||||
′ ' # U+2032
|
||||
″ " # U+2033
|
||||
#′ ' # U+2032
|
||||
#″ " # U+2033
|
||||
|
||||
#
|
||||
# Square unicode symbols starting at U+3371
|
||||
|
|
|
@ -156,6 +156,21 @@ impl<'a> Iterator for TokenIterator<'a> {
|
|||
}
|
||||
Token::Number(integer, frac, exp)
|
||||
},
|
||||
'"' => {
|
||||
let mut buf = String::new();
|
||||
while let Some(c) = self.0.next() {
|
||||
if c == '\\' {
|
||||
if let Some(c) = self.0.next() {
|
||||
buf.push(c);
|
||||
}
|
||||
} else if c == '"' {
|
||||
break;
|
||||
} else {
|
||||
buf.push(c);
|
||||
}
|
||||
}
|
||||
Token::Ident(buf)
|
||||
},
|
||||
x if is_ident(x) => {
|
||||
let mut buf = String::new();
|
||||
buf.push(x);
|
||||
|
|
|
@ -392,6 +392,21 @@ impl<'a> Iterator for TokenIterator<'a> {
|
|||
}
|
||||
Token::Date(toks)
|
||||
},
|
||||
'"' => {
|
||||
let mut buf = String::new();
|
||||
while let Some(c) = self.0.next() {
|
||||
if c == '\\' {
|
||||
if let Some(c) = self.0.next() {
|
||||
buf.push(c);
|
||||
}
|
||||
} else if c == '"' {
|
||||
break;
|
||||
} else {
|
||||
buf.push(c);
|
||||
}
|
||||
}
|
||||
Token::Ident(buf)
|
||||
},
|
||||
x => {
|
||||
let mut buf = String::new();
|
||||
buf.push(x);
|
||||
|
|
Loading…
Reference in a new issue