def skip_until (self, expr): regexp = re.compile(expr) while Parser.read_line(self): match = regexp.match(self.line) if match is None: continue self.line = self.line[match.end():] self.pos_char += match.end() return
def read_line (self): while Parser.read_line(self): match = re_command.match(self.line.strip()) if match is None: return True vars = dict(self.latex_dep.vars.items()) vars['line'] = self.pos_line args = parse_line(match.group("arg"), vars) self.latex_dep.command(match.group("cmd"), args, vars) return False
def __init__ (self, file, dep): Parser.__init__(self, file) self.latex_dep = dep