Right now it can handle most simple cases, but since regex cannot detect enclosing parenthesis it has a hard time dealing with cases like "if (sum(a, b) == 10) a = b".
What should be done is match a "if (..)" pattern and ignore enclosing parenthesis. The rest of the string should be matched to see if there is a 'then' keyword or nothing. In those cases it means that the shorthand is not being used.
Right now it can handle most simple cases, but since regex cannot detect enclosing parenthesis it has a hard time dealing with cases like "if (sum(a, b) == 10) a = b".
What should be done is match a "if (..)" pattern and ignore enclosing parenthesis. The rest of the string should be matched to see if there is a 'then' keyword or nothing. In those cases it means that the shorthand is not being used.