Mercurial > lcfOS
diff python/pyburg.py @ 396:fb3c1f029b30
Added baselexer into c3 lexer
author | Windel Bouwman |
---|---|
date | Tue, 27 May 2014 22:19:32 +0200 |
parents | 0c44e494ef58 |
children |
line wrap: on
line diff
--- a/python/pyburg.py Fri May 23 14:28:03 2014 +0200 +++ b/python/pyburg.py Tue May 27 22:19:32 2014 +0200 @@ -59,7 +59,7 @@ import io import types import argparse -from ppci import Token +from ppci import Token, SourceLocation from pyyacc import ParserException import yacc import baselex @@ -87,14 +87,15 @@ header_lines = [] section = 0 for line in lines: + loc = SourceLocation(self.filename, 0, 0, 0) line = line.strip() if not line: continue # Skip empty lines elif line == '%%': section += 1 if section == 1: - yield Token('header', header_lines) - yield Token('%%', '%%') + yield Token('header', header_lines, loc) + yield Token('%%', '%%', loc) else: if section == 0: header_lines.append(line)