Next / Previous / Contents / Shipman's homepage

27. Scan.error(): Issue an error message

These methods all pass the messages through to the Log() singleton, but they also take care of echoing the current position, calling the callback if there is one, and also echoing the current line when this is the first message for the current line.

logscan.py
# - - -   S c a n . e r r o r

    def error(self, *L):
        '''Send an error message to Log().
        '''
        self.msgKind(ERROR_KIND, *L)

# - - -   S c a n . s y n t a x

    def syntax(self, *L):
        '''Send an error message and raise SyntaxError.
        '''
        self.error(*L)
        raise SyntaxError(''.join(L))

# - - -   S c a n . w a r n i n g

    def warning(self, *L):
        '''Send a warning to Log().
        '''
        self.msgKind(WARNING_KIND, *L)