MCPcopy Create free account
hub / github.com/tensorflow/tfjs / CheckCompletedBlocks

Method CheckCompletedBlocks

tfjs-backend-wasm/tools/cpplint.py:2758–2777  ·  view source on GitHub ↗

Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.

(self, filename, error)

Source from the content-addressed store, hash-verified

2756 return None
2757
2758 def CheckCompletedBlocks(self, filename, error):
2759 """Checks that all classes and namespaces have been completely parsed.
2760
2761 Call this when all lines in a file have been processed.
2762 Args:
2763 filename: The name of the current file.
2764 error: The function to call with any errors found.
2765 """
2766 # Note: This test can result in false positives if #ifdef constructs
2767 # get in the way of brace matching. See the testBuildClass test in
2768 # cpplint_unittest.py for an example of this.
2769 for obj in self.stack:
2770 if isinstance(obj, _ClassInfo):
2771 error(filename, obj.starting_linenum, 'build/class', 5,
2772 'Failed to find complete declaration of class %s' %
2773 obj.name)
2774 elif isinstance(obj, _NamespaceInfo):
2775 error(filename, obj.starting_linenum, 'build/namespaces', 5,
2776 'Failed to find complete declaration of namespace %s' %
2777 obj.name)
2778
2779
2780def CheckForNonStandardConstructs(filename, clean_lines, linenum,

Callers 1

ProcessFileDataFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected