MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / PrintIndentifiers

Function PrintIndentifiers

tests/external/gmock-1.7.0/scripts/generator/cpp/ast.py:1666–1687  ·  view source on GitHub ↗

Prints all identifiers for a C++ source file. Args: filename: 'file1' should_print: predicate with signature: bool Function(token)

(filename, should_print)

Source from the content-addressed store, hash-verified

1664
1665
1666def PrintIndentifiers(filename, should_print):
1667 """Prints all identifiers for a C++ source file.
1668
1669 Args:
1670 filename: 'file1'
1671 should_print: predicate with signature: bool Function(token)
1672 """
1673 source = utils.ReadFile(filename, False)
1674 if source is None:
1675 sys.stderr.write('Unable to find: %s\n' % filename)
1676 return
1677
1678 #print('Processing %s' % actual_filename)
1679 builder = BuilderFromSource(source, filename)
1680 try:
1681 for node in builder.Generate():
1682 if should_print(node):
1683 print(node.name)
1684 except KeyboardInterrupt:
1685 return
1686 except:
1687 pass
1688
1689
1690def PrintAllIndentifiers(filenames, should_print):

Callers 1

PrintAllIndentifiersFunction · 0.85

Calls 3

BuilderFromSourceFunction · 0.85
writeMethod · 0.45
GenerateMethod · 0.45

Tested by

no test coverage detected