Skip to content

Commit 7cbd5d9

Browse files
committed
update line-directive for #sourceLocation.
1 parent 92a038c commit 7cbd5d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/line-directive

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ import re
2121
import subprocess
2222
import sys
2323

24-
line_pattern = re.compile(r'^// ###setline ([0-9]+) "([^"]+)"\s*')
24+
line_pattern = re.compile(r'^// ###sourceLocation\(file:\s*"([^"]+)",\s*line:\s*([0-9]+)\s*\)')
2525

2626

2727
def _make_line_map(filename, stream=None):
2828
"""
2929
>>> from StringIO import StringIO
3030
>>> _make_line_map('box',
31-
... StringIO('''// ###setline 3 "foo.bar"
31+
... StringIO('''// ###sourceLocation(file: "foo.bar", line: 3)
3232
... line 2
3333
... line 3
3434
... line 4
35-
... // ###setline 20 "baz.txt"
35+
... // ###sourceLocation(file: "baz.txt", line: 20)
3636
... line 6
3737
... line 7
3838
... '''))
@@ -43,7 +43,7 @@ def _make_line_map(filename, stream=None):
4343
for i, l in enumerate(input.readlines()):
4444
m = line_pattern.match(l)
4545
if m:
46-
result.append((i + 1, m.group(2), int(m.group(1))))
46+
result.append((i + 1, m.group(1), int(m.group(2))))
4747
return result
4848

4949
_line_maps = {}

0 commit comments

Comments
 (0)