def exitStartStopQualifier(self, ctx):
"""
Consumes nothing
Produces a (datetime, datetime) 2-tuple containing the start and stop
times.
"""
start_str = _literal_terminal_to_python_val(ctx.StringLiteral(0))
stop_str = _literal_terminal_to_python_val(ctx.StringLiteral(1))
# If the language used timestamp literals here, this could go away...
try:
start_dt = _str_to_datetime(start_str)
stop_dt = _str_to_datetime(stop_str)
except ValueError as e:
# re-raise as MatcherException.
raise six.raise_from(MatcherException(*e.args), e)
self.__push((start_dt, stop_dt), u"exitStartStopQualifier")
评论列表
文章目录