[poincare/parser] Comment about parseCaretWithParenthesis

This commit is contained in:
Léa Saviot
2019-06-26 10:05:13 +02:00
committed by LeaNumworks
parent 2ff03bb6a0
commit 596a438557

View File

@@ -215,6 +215,10 @@ void Parser::parseCaret(Expression & leftHandSide, Token::Type stoppingType) {
}
void Parser::parseCaretWithParenthesis(Expression & leftHandSide, Token::Type stoppingType) {
/* When parsing 2^(4) ! (with system parentheses), the factorial should stay
* out of the power. To do this, we tokenized ^( as one token that should be
* matched by a closing parenthesis. Otherwise, the ! would take precendence
* over the power. */
if (leftHandSide.isUninitialized()) {
m_status = Status::Error; // Power must have a left operand
return;