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

Class _BlockInfo

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

Stores information about a generic block of code.

Source from the content-addressed store, hash-verified

2203
2204
2205class _BlockInfo(object):
2206 """Stores information about a generic block of code."""
2207
2208 def __init__(self, linenum, seen_open_brace):
2209 self.starting_linenum = linenum
2210 self.seen_open_brace = seen_open_brace
2211 self.open_parentheses = 0
2212 self.inline_asm = _NO_ASM
2213 self.check_namespace_indentation = False
2214
2215 def CheckBegin(self, filename, clean_lines, linenum, error):
2216 """Run checks that applies to text up to the opening brace.
2217
2218 This is mostly for checking the text after the class identifier
2219 and the "{", usually where the base class is specified. For other
2220 blocks, there isn't much to check, so we always pass.
2221
2222 Args:
2223 filename: The name of the current file.
2224 clean_lines: A CleansedLines instance containing the file.
2225 linenum: The number of the line to check.
2226 error: The function to call with any errors found.
2227 """
2228 pass
2229
2230 def CheckEnd(self, filename, clean_lines, linenum, error):
2231 """Run checks that applies to text after the closing brace.
2232
2233 This is mostly used for checking end of namespace comments.
2234
2235 Args:
2236 filename: The name of the current file.
2237 clean_lines: A CleansedLines instance containing the file.
2238 linenum: The number of the line to check.
2239 error: The function to call with any errors found.
2240 """
2241 pass
2242
2243 def IsBlockInfo(self):
2244 """Returns true if this block is a _BlockInfo.
2245
2246 This is convenient for verifying that an object is an instance of
2247 a _BlockInfo, but not an instance of any of the derived classes.
2248
2249 Returns:
2250 True for this class, False for derived classes.
2251 """
2252 return self.__class__ == _BlockInfo
2253
2254
2255class _ExternCInfo(_BlockInfo):

Callers 1

UpdateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…