in evaluation/latex2sympy/gen/PSParser.py [0:0]
def unary(self):
localctx = PSParser.UnaryContext(self, self._ctx, self.state)
self.enterRule(localctx, 40, self.RULE_unary)
self._la = 0 # Token type
try:
self.state = 336
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [47, 48]:
self.enterOuterAlt(localctx, 1)
self.state = 329
_la = self._input.LA(1)
if not(_la == 47 or _la == 48):
self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 330
self.unary()
pass
elif token in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 51, 53, 55, 57, 59, 61, 63, 65, 66, 68, 69, 70, 72, 74, 76, 78, 80, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 121, 122, 123, 124, 125, 126, 127, 128, 150, 151, 154, 155, 161, 163, 173, 174, 176, 179, 180, 190, 191, 192, 193, 194]:
self.enterOuterAlt(localctx, 2)
self.state = 332
self._errHandler.sync(self)
_alt = 1
while _alt != 2 and _alt != ATN.INVALID_ALT_NUMBER:
if _alt == 1:
self.state = 331
self.postfix()
else:
raise NoViableAltException(self)
self.state = 334
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input, 20, self._ctx)
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx