Further fix for multi-line non-block code at the start of batchcode file
This commit is contained in:
parent
2bb0b23688
commit
ab1cd445e4
1 changed files with 4 additions and 2 deletions
|
|
@ -354,8 +354,10 @@ class BatchCodeProcessor(object):
|
||||||
for imatch, match in enumerate(list(_RE_CODE_OR_HEADER.finditer(text))):
|
for imatch, match in enumerate(list(_RE_CODE_OR_HEADER.finditer(text))):
|
||||||
mtype = match.group(1).strip()
|
mtype = match.group(1).strip()
|
||||||
# we need to handle things differently at the start of the file
|
# we need to handle things differently at the start of the file
|
||||||
mgroup = 3 if mtype else 2
|
if mtype:
|
||||||
istart, iend = match.span(mgroup)
|
istart, iend = match.span(3)
|
||||||
|
else:
|
||||||
|
istart, iend = match.start(2), match.end(3)
|
||||||
code = text[istart:iend]
|
code = text[istart:iend]
|
||||||
if mtype == "#HEADER":
|
if mtype == "#HEADER":
|
||||||
headers.append(code)
|
headers.append(code)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue