Esempio n. 1
0
def parse_position(posn):
    if not posn:
        return None
    line = get_value(posn, 'line')
    column = get_value(posn, 'column')
    if line is not None and column is not None:
        return symbols.Position(line, column)
    return None
Esempio n. 2
0
    def to_error(errmsg):
        filename, line, column, messy_details = errmsg.groups()
        line, column = int(line), int(column)

        column = ghc_column_to_sublime_column(view, line, column)
        line = line - 1
        # Record the absolute, normalized path.
        return OutputMessage(os.path.normpath(os.path.join(base_dir, filename)),
                             symbols.Region(symbols.Position(line, column)),
                             messy_details.strip(),
                             'warning' if 'warning' in messy_details.lower() else 'error')
Esempio n. 3
0
        def to_error(errmsg):
            filename, line, column, messy_details = errmsg.groups()
            filename = os.path.normpath(os.path.join(base_dir, filename))
            line, column = int(line), int(column)

            ## print('filename {0} line {1} column {2} messy_details {3}'.format(filename, line, column, messy_details))

            column = ghc_column_to_sublime_column(view, line, column)
            line = line - 1
            # Record the absolute, normalized path.
            return OutputMessage(
                view.window().find_open_file(filename), filename,
                Symbols.Region(Symbols.Position(line, column)),
                messy_details.strip(),
                'warning' if 'warning' in messy_details.lower() else 'error')