mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 01:48:18 +00:00
fix parsing of binary operstors following a bracket expression
This commit is contained in:
@@ -387,7 +387,10 @@ function parseNewExpression(e) {
|
|||||||
*/
|
*/
|
||||||
function parse_expression_term(e) {
|
function parse_expression_term(e) {
|
||||||
if (e.expr[0] === '(') {
|
if (e.expr[0] === '(') {
|
||||||
return parseBracketOrCastExpression(new ExpressionText(e.expr));
|
const subexpr = new ExpressionText(e.expr);
|
||||||
|
const bexpr = parseBracketOrCastExpression(subexpr);
|
||||||
|
e.expr = subexpr.expr;
|
||||||
|
return bexpr;
|
||||||
}
|
}
|
||||||
const unop = e.expr.match(/^(?:(!\s?)+|(~\s?)+|(?:([+-]\s?)+(?![\d.])))/);
|
const unop = e.expr.match(/^(?:(!\s?)+|(~\s?)+|(?:([+-]\s?)+(?![\d.])))/);
|
||||||
if (unop) {
|
if (unop) {
|
||||||
@@ -411,7 +414,7 @@ function parse_expression_term(e) {
|
|||||||
* @param {string} s
|
* @param {string} s
|
||||||
*/
|
*/
|
||||||
function getBinaryOperator(s) {
|
function getBinaryOperator(s) {
|
||||||
const binary_op_match = s.match(/^([/%*&|^+-]=|<<=|>>>?=|[><!=]=|<<|>>>?|[><]|&&|\|\||[/%*&|^]|\+(?=[^+]|[+][\w\d.])|\-(?=[^-]|[-][\w\d.])|instanceof\b|\?)/);
|
const binary_op_match = s.match(/^([!=/%*&|^+-]=?|<<?=?|>>?[>=]?|&&|\|\||[/%*&|^]|\+(?=[^+]|[+][\w\d.])|\-(?=[^-]|[-][\w\d.])|instanceof\b|\?)/);
|
||||||
return binary_op_match ? binary_op_match[0] : null;
|
return binary_op_match ? binary_op_match[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user