Skip to content

Commit

Permalink
Try alternative way of determining parenthesis level for `BinaryExpre…
Browse files Browse the repository at this point in the history
…ssion` when AST doesn't provide `_INSIDE_PARENTHESES_LEVEL` flag (#4807)
  • Loading branch information
Laurens-W authored Dec 23, 2024
1 parent da6561e commit e59e48b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2540,6 +2540,10 @@ private int sourceLengthOfString(ConstantExpression expr) {
} else if (node instanceof MethodCallExpression) {
MethodCallExpression expr = (MethodCallExpression) node;
return determineParenthesisLevel(expr.getObjectExpression().getLineNumber(), expr.getLineNumber(), expr.getObjectExpression().getColumnNumber(), expr.getColumnNumber());
} else if (node instanceof BinaryExpression) {
BinaryExpression expr = (BinaryExpression) node;
return determineParenthesisLevel(expr.getLeftExpression().getLineNumber(), expr.getLineNumber(), expr.getLeftExpression().getColumnNumber(), expr.getColumnNumber());

}
return null;
}
Expand Down

0 comments on commit e59e48b

Please sign in to comment.