tools/nocompile_driver.py
def ParseExpectation(expectation_string):
  """Extracts expectation definition from the trailing comment on the ifdef.

  See the comment on NCTEST_CONFIG_RE for examples of the format we are parsing.

  Args:
    expectation_string: A string like "// [r'some_regex']"

  Returns:
    A list of compiled regular expressions indicating all possible valid
    compiler outputs.  If the list is empty, all outputs are considered valid.
  """
  assert expectation_string is not None

  match = EXTRACT_EXPECTATION_RE.match(expectation_string)
  assert match

  raw_expectation = ast.literal_eval(match.group(1))
  assert type(raw_expectation) is list

  expectation = []
  for regex_str in raw_expectation:
    assert type(regex_str) is str
    expectation.append(re.compile(regex_str))
  return expectation
Extracts expectation definition from the trailing comment on the ifdef.

  See the comment on NCTEST_CONFIG_RE for examples of the format we are parsing.

  Args:
    expectation_string: A string like "// [r'some_regex']"

  Returns:
    A list of compiled regular expressions indicating all possible valid
    compiler outputs.  If the list is empty, all outputs are considered valid.
  
Extracts expectation definition from the trailing comment on the ifdef.
See the comment on NCTEST_CONFIG_RE for examples of the format we are parsing.
Extracts expectation definition from the trailing comment on the ifdef . See the comment on NCTEST_CONFIG_RE for examples of the format we are parsing .
def ParseExpectation(expectation_string):
  assert expectation_string is not None
  match = EXTRACT_EXPECTATION_RE.match(expectation_string)
  assert match
  raw_expectation = ast.literal_eval(match.group(1))
  assert type(raw_expectation) is list
  expectation = []
  for regex_str in raw_expectation:
    assert type(regex_str) is str
    expectation.append(re.compile(regex_str))
  return expectation
def ParseExpectation ( expectation_string ) : assert expectation_string is not None match = EXTRACT_EXPECTATION_RE . match ( expectation_string ) assert match raw_expectation = ast . literal_eval ( match . group ( 1 ) ) assert type ( raw_expectation ) is list expectation = [ ] for regex_str in raw_expectation : assert type ( regex_str ) is str expectation . append ( re . compile ( regex_str ) ) return expectation
Extracts expectation definition from the trailing comment on the ifdef.
Extracts expectation definition from the trailing comment on the ifdef .
"""Extracts expectation definition from the trailing comment on the ifdef.

  See the comment on NCTEST_CONFIG_RE for examples of the format we are parsing.

  Args:
    expectation_string: A string like "// [r'some_regex']"

  Returns:
    A list of compiled regular expressions indicating all possible valid
    compiler outputs.  If the list is empty, all outputs are considered valid.
  """
A list of compiled regular expressions indicating all possible valid
compiler outputs.  If the list is empty, all outputs are considered valid.
A list of compiled regular expressions indicating all possible valid compiler outputs . If the list is empty all outputs are considered valid .
expectation_string
A string like "// [r'some_regex']"
A string like " // [ r ' some_regex ' ] "