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

Function CleanseComments

tools/cpplint.py:2106–2119  ·  view source on GitHub ↗

Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.

(line)

Source from the content-addressed store, hash-verified

2104
2105
2106def CleanseComments(line):
2107 """Removes //-comments and single-line C-style /* */ comments.
2108
2109 Args:
2110 line: A line of C++ source.
2111
2112 Returns:
2113 The line with single-line comments removed.
2114 """
2115 commentpos = line.find("//")
2116 if commentpos != -1 and not IsCppString(line[:commentpos]):
2117 line = line[:commentpos].rstrip()
2118 # get rid of /* ... */
2119 return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub("", line)
2120
2121
2122def ReplaceAlternateTokens(line):

Callers 2

__init__Method · 0.85
CheckEmptyBlockBodyFunction · 0.85

Calls 2

IsCppStringFunction · 0.85
findMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…