(self)
return False
Returns whether the current statement (if any) may end in this context.
Returns whether the current statement (if any) may end in this context.
Returns whether the current statement ( if any ) may end in this context .
def _StatementCouldEndInContext(self):
    """Returns whether the current statement (if any) may end in this context."""
    # In the basic statement or variable declaration context, statement can
    # always end in this context.
    if self._context.type in (EcmaContext.STATEMENT, EcmaContext.VAR):
      return True

    # End of a ternary false branch inside a statement can also be the
    # end of the statement, for example:
    # var x = foo ? foo.bar() : null
    # In this case the statement ends after the null, when the context stack
    # looks like ternary_false > var > statement > root.
    if (self._context.type == EcmaContext.TERNARY_FALSE and
        self._context.parent.type in (EcmaContext.STATEMENT, EcmaContext.VAR)):
      return True

    # In all other contexts like object and array literals, ternary true, etc.
    # the statement can't yet end.
    return False
def _StatementCouldEndInContext ( self ) : # In the basic statement or variable declaration context, statement can # always end in this context. if self . _context . type in ( EcmaContext . STATEMENT , EcmaContext . VAR ) : return True # End of a ternary false branch inside a statement can also be the # end of the statement, for example: # var x = foo ? foo.bar() : null # In this case the statement ends after the null, when the context stack # looks like ternary_false > var > statement > root. if ( self . _context . type == EcmaContext . TERNARY_FALSE and self . _context . parent . type in ( EcmaContext . STATEMENT , EcmaContext . VAR ) ) : return True # In all other contexts like object and array literals, ternary true, etc. # the statement can't yet end. return False