|
@@ -79,11 +79,9 @@ class cfg_file:
|
|
|
def get_lines(self):
|
|
def get_lines(self):
|
|
|
def gen_lines():
|
|
def gen_lines():
|
|
|
for lineno, line in enumerate(self.data, 1):
|
|
for lineno, line in enumerate(self.data, 1):
|
|
|
- line = strip_comment(line)
|
|
|
|
|
- if line == '':
|
|
|
|
|
|
|
+ if (line := strip_comment(line)) == '':
|
|
|
continue
|
|
continue
|
|
|
- m = re.fullmatch(r'(\w+)(\s+)(.*)', line)
|
|
|
|
|
- if m:
|
|
|
|
|
|
|
+ if m := re.fullmatch(r'(\w+)(\s+)(.*)', line):
|
|
|
yield self.line_data(m[1], m[3], lineno, None)
|
|
yield self.line_data(m[1], m[3], lineno, None)
|
|
|
else:
|
|
else:
|
|
|
die('CfgFileParseError', f'Parse error in file {self.fn!r}, line {lineno}')
|
|
die('CfgFileParseError', f'Parse error in file {self.fn!r}, line {lineno}')
|