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

Method GetName

tests/external/gmock-1.7.0/scripts/generator/cpp/ast.py:927–950  ·  view source on GitHub ↗

Returns ([tokens], next_token_info).

(self, seq=None)

Source from the content-addressed store, hash-verified

925 self.token_queue.extend(reversed(tokens))
926
927 def GetName(self, seq=None):
928 """Returns ([tokens], next_token_info)."""
929 GetNextToken = self._GetNextToken
930 if seq is not None:
931 it = iter(seq)
932 GetNextToken = lambda: next(it)
933 next_token = GetNextToken()
934 tokens = []
935 last_token_was_name = False
936 while (next_token.token_type == tokenize.NAME or
937 (next_token.token_type == tokenize.SYNTAX and
938 next_token.name in ('::', '<'))):
939 # Two NAMEs in a row means the identifier should terminate.
940 # It's probably some sort of variable declaration.
941 if last_token_was_name and next_token.token_type == tokenize.NAME:
942 break
943 last_token_was_name = next_token.token_type == tokenize.NAME
944 tokens.append(next_token)
945 # Handle templated names.
946 if next_token.name == '<':
947 tokens.extend(self._GetMatchingChar('<', '>', GetNextToken))
948 last_token_was_name = True
949 next_token = GetNextToken()
950 return tokens, next_token
951
952 def GetMethod(self, modifiers, templated_types):
953 return_type_and_name = self._GetTokensUpTo(tokenize.SYNTAX, '(')

Callers 7

_GetNestedTypeMethod · 0.95
handle_structMethod · 0.95
_GetTemplatedTypesMethod · 0.95
_GetBasesMethod · 0.95
_GetClassMethod · 0.95
handle_namespaceMethod · 0.95

Calls 2

_GetMatchingCharMethod · 0.95
nextFunction · 0.85

Tested by

no test coverage detected