Fixed consecutive percentage signs error

This commit is contained in:
Kasper 2020-11-14 05:00:22 +01:00
parent 03b9df2362
commit 7284422ec0

View File

@ -437,6 +437,10 @@ pub fn lex(input: &str, allow_trailing_operators: bool, default_degree: Unit) ->
// "10%!" should be a percentage
tokens[token_index] = Token::UnaryOperator(Percent);
},
Some(Token::LexerKeyword(PercentChar)) => {
// "10%%" should be a percentage
tokens[token_index] = Token::UnaryOperator(Percent);
},
None => {
// percent if there's no element afterwards
tokens[token_index] = Token::UnaryOperator(Percent);