MCPcopy Index your code
hub / github.com/nodejs/node / ReadConfigurationInto

Function ReadConfigurationInto

tools/test.py:1342–1376  ·  view source on GitHub ↗
(path, sections, defs)

Source from the content-addressed store, hash-verified

1340
1341
1342def ReadConfigurationInto(path, sections, defs):
1343 current_section = Section(Constant(True))
1344 sections.append(current_section)
1345 prefix = []
1346 for line in utils.ReadLinesFrom(path):
1347 header_match = HEADER_PATTERN.match(line)
1348 if header_match:
1349 condition_str = header_match.group(1).strip()
1350 condition = ParseCondition(condition_str)
1351 new_section = Section(condition)
1352 sections.append(new_section)
1353 current_section = new_section
1354 continue
1355 rule_match = RULE_PATTERN.match(line)
1356 if rule_match:
1357 path = prefix + SplitPath(rule_match.group(1).strip())
1358 value_str = rule_match.group(2).strip()
1359 value = ParseCondition(value_str)
1360 if not value:
1361 return False
1362 current_section.AddRule(Rule(rule_match.group(1), path, value))
1363 continue
1364 def_match = DEF_PATTERN.match(line)
1365 if def_match:
1366 name = def_match.group(1).lower()
1367 value = ParseCondition(def_match.group(2).strip())
1368 if not value:
1369 return False
1370 defs[name] = value
1371 continue
1372 prefix_match = PREFIX_PATTERN.match(line)
1373 if prefix_match:
1374 prefix = SplitPath(prefix_match.group(1).strip())
1375 continue
1376 raise Exception("Malformed line: '%s'." % line)
1377
1378
1379# ---------------

Callers 1

GetTestStatusMethod · 0.85

Calls 8

AddRuleMethod · 0.95
SectionClass · 0.85
ParseConditionFunction · 0.85
SplitPathFunction · 0.85
RuleClass · 0.85
ConstantClass · 0.70
matchMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…