def on_recover(self, error_code, lexer, stv): """Check that ASI error recovery is really acceptable.""" if error_code == 'asi': # ASI is allowed in three places: # - at the end of the source text # - before a close brace `}` # - after a LineTerminator # Hence the three-part if-condition below. # # The other quirks of ASI are implemented by massaging the syntax, # in parse_esgrammar.py. ifnot self.closed and stv.term != '}'andnot lexer.saw_line_terminator():
lexer.throw("missing semicolon") else: # ASI is always allowed in this one state. assert error_code == 'do_while_asi'
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.