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

Function ParseToken

tests/external/gmock-1.7.0/gtest/scripts/pump.py:243–250  ·  view source on GitHub ↗
(lines, pos, regex, token_type)

Source from the content-addressed store, hash-verified

241
242
243def ParseToken(lines, pos, regex, token_type):
244 line = lines[pos.line][pos.column:]
245 m = regex.search(line)
246 if m and not m.start():
247 return MakeToken(lines, pos, pos + m.end(), token_type)
248 else:
249 print 'ERROR: %s expected at %s.' % (token_type, pos)
250 sys.exit(1)
251
252
253ID_REGEX = re.compile(r'[_A-Za-z]\w*')

Callers 1

TokenizeLinesFunction · 0.85

Calls 2

MakeTokenFunction · 0.85
endMethod · 0.45

Tested by

no test coverage detected