Add keyword pounds-force

This commit is contained in:
Kasper 2020-11-26 18:23:47 +01:00
parent 7826834447
commit 6cc278a829

View File

@ -261,8 +261,8 @@ pub fn lex(input: &str, allow_trailing_operators: bool, default_degree: Unit) ->
"kg" | "kilo" | "kilos" | "kilogram" | "kilograms" => tokens.push(Token::Unit(Kilogram)), "kg" | "kilo" | "kilos" | "kilogram" | "kilograms" => tokens.push(Token::Unit(Kilogram)),
"t" | "tonne" | "tonnes" | "metric ton" | "metric tons" | "metric tonne" | "metric tonnes" => tokens.push(Token::Unit(MetricTon)), "t" | "tonne" | "tonnes" | "metric ton" | "metric tons" | "metric tonne" | "metric tonnes" => tokens.push(Token::Unit(MetricTon)),
"oz" | "ounces" => tokens.push(Token::Unit(Ounce)), "oz" | "ounces" => tokens.push(Token::Unit(Ounce)),
"lb" | "lbs" | "pounds" => tokens.push(Token::Unit(Pound)), "lb" | "lbs" => tokens.push(Token::Unit(Pound)),
"pound" => { "pound" | "pounds" => {
let str_len = "-force".len(); let str_len = "-force".len();
match input.get(end_index+1..=end_index+str_len) { match input.get(end_index+1..=end_index+str_len) {
Some("-force") => { Some("-force") => {