MCPcopy Create free account
hub / github.com/nodejs/node / TranslateToGnChars

Function TranslateToGnChars

tools/gypi_to_gn.py:210–217  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

208
209
210def TranslateToGnChars(s):
211 for code in s.encode('utf-8'):
212 if code in (34, 36, 92): # For '"', '$', or '\\'.
213 yield '\\' + chr(code)
214 elif 32 <= code < 127:
215 yield chr(code)
216 else:
217 yield '$0x%02X' % code
218
219
220def LoadPythonDictionary(path):

Callers 1

GenerateTokensFunction · 0.85

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected