[poincare/parser] Fix theta parsing

This commit is contained in:
Léa Saviot
2019-08-30 15:15:33 +02:00
parent 70befe2b2e
commit 29edb5f12e

View File

@@ -176,17 +176,11 @@ Token Tokenizer::popToken() {
result.setCodePoint(c);
return result;
}
if (c == UCodePointGreekSmallLetterTheta) {
if (c == UCodePointSquareRoot
|| c == UCodePointGreekSmallLetterTheta)
{
Token result(Token::Identifier);
result.setString(start, UTF8Decoder::CharSizeOfCodePoint(UCodePointGreekSmallLetterTheta));
return result;
}
if (c == UCodePointSquareRoot) {
Token result(Token::Identifier);
// TODO compute size manually?
constexpr int squareRootCharLength = 3;
assert(UTF8Decoder::CharSizeOfCodePoint(UCodePointSquareRoot) == squareRootCharLength);
result.setString(start, squareRootCharLength);
result.setString(start, UTF8Decoder::CharSizeOfCodePoint(c));
return result;
}
if (c == UCodePointEmpty) {