mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-12 16:28:17 +00:00
Fixed [tasks] section parsing
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
This commit is contained in:
parent
f7f5135508
commit
f1d3be3914
|
@ -244,36 +244,45 @@ def read_sbyconfig(sbydata, taskname):
|
||||||
|
|
||||||
line = line.split(":")
|
line = line.split(":")
|
||||||
if len(line) == 1:
|
if len(line) == 1:
|
||||||
tnames, line = line[:1], line[1:]
|
line = line[0].split()
|
||||||
|
if len(line) > 0:
|
||||||
|
lhs, rhs = line[:1], line[1:]
|
||||||
|
else:
|
||||||
|
return
|
||||||
elif len(line) == 2:
|
elif len(line) == 2:
|
||||||
tnames, line = line[0].split(), line[1].split()
|
lhs, rhs = line[0].split(), line[1].split()
|
||||||
else:
|
else:
|
||||||
print("ERROR: Syntax error in tasks block.", file=sys.stderr)
|
print("ERROR: Syntax error in tasks block.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
for tname in tnames:
|
for tagname in rhs:
|
||||||
if tname == "":
|
for c in tagname:
|
||||||
continue
|
if c in "(?*.[]|)":
|
||||||
tpattern = False
|
break
|
||||||
|
else:
|
||||||
|
task_tags_all.add(tagname)
|
||||||
|
|
||||||
|
for tname in lhs:
|
||||||
for c in tname:
|
for c in tname:
|
||||||
if c in "(?*.[]|)":
|
if c in "(?*.[]|)":
|
||||||
tpattern = True
|
break
|
||||||
if not tpattern:
|
else:
|
||||||
if tname not in tasklist:
|
if tname not in tasklist:
|
||||||
tasklist.append(tname)
|
tasklist.append(tname)
|
||||||
task_tags_all.add(tname)
|
task_tags_all.add(tname)
|
||||||
|
|
||||||
if taskname is not None and re.fullmatch(tname, taskname):
|
if taskname is not None and re.fullmatch(tname, taskname):
|
||||||
task_matched = True
|
task_matched = True
|
||||||
task_tags_active.add(tname)
|
task_tags_active.add(tname)
|
||||||
for t in line:
|
for tagname in rhs:
|
||||||
if t == "":
|
for c in tagname:
|
||||||
continue
|
if c in "(?*.[]|)":
|
||||||
task_tags_active.add(t)
|
for t in task_tags_all:
|
||||||
|
if re.fullmatch(tagname, t):
|
||||||
for t in line:
|
task_tags_active.add(t)
|
||||||
if t == "":
|
break
|
||||||
continue
|
else:
|
||||||
task_tags_all.add(t)
|
task_tags_active.add(tagname)
|
||||||
|
|
||||||
elif line == "[tasks]":
|
elif line == "[tasks]":
|
||||||
if taskname is None:
|
if taskname is None:
|
||||||
|
|
Loading…
Reference in a new issue