* @param ArrowFunctionCreationExpression|AnonymousFunctionCreationExpression|FunctionDeclaration|MethodDeclaration $parentNode a node with FunctionReturnType trait
* Double-quoted and heredoc strings support a basic set of expression types, described in http://php.net/manual/en/language.types.string.php#language.types.string.parsing
* Supported: $x, $x->p, $x[0], $x[$y]
* Not supported: $x->p1->p2, $x[0][1], etc.
* Since there is a relatively small finite set of allowed forms, I implement it here rather than trying to reuse the general expression parsing code.
// Workarounds for https://github.com/Microsoft/tolerant-php-parser/issues/19#issue-201714377
// Parse `!$a = $b` as `!($a = $b)` - PHP constrains the Left Hand Side of an assignment to a variable. A unary operator (`@`, `!`, etc.) is not a variable.
// Instanceof has similar constraints for the LHS.
// So does `!$a += $b`
// TODO: Any other operators?
if($leftOperandinstanceofUnaryOpExpression){
$shouldOperatorTakePrecedenceOverUnary=true;
}
break;
caseTokenKind::InstanceOfKeyword:
// Unlike assignment, the instanceof operator doesn't have restrictions on what can go in the left hand side.
// `!` is the only unary operator with lower precedence than instanceof.
$catchClause->qualifiedNameList=$this->parseQualifiedNameCatchList($catchClause)??newMissingToken(TokenKind::QualifiedName,$this->token->fullStart);// TODO generate missing token or error if null