MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get_token

Method get_token

tools/python-3.11.9-amd64/Lib/shlex.py:101–131  ·  view source on GitHub ↗

Get a token from the input stream (or from stack if it's nonempty)

(self)

Source from the content-addressed store, hash-verified

99 self.state = ' '
100
101 def get_token(self):
102 "Get a token from the input stream (or from stack if it's nonempty)"
103 if self.pushback:
104 tok = self.pushback.popleft()
105 if self.debug >= 1:
106 print("shlex: popping token " + repr(tok))
107 return tok
108 # No pushback. Get a token.
109 raw = self.read_token()
110 # Handle inclusions
111 if self.source is not None:
112 while raw == self.source:
113 spec = self.sourcehook(self.read_token())
114 if spec:
115 (newfile, newstream) = spec
116 self.push_source(newstream, newfile)
117 raw = self.get_token()
118 # Maybe we got EOF instead?
119 while raw == self.eof:
120 if not self.filestack:
121 return self.eof
122 else:
123 self.pop_source()
124 raw = self.get_token()
125 # Neither inclusion nor EOF
126 if self.debug >= 1:
127 if raw != self.eof:
128 print("shlex: token=" + repr(raw))
129 else:
130 print("shlex: token=EOF")
131 return raw
132
133 def read_token(self):
134 quoted = False

Callers 2

__next__Method · 0.95
_print_tokensFunction · 0.45

Calls 5

read_tokenMethod · 0.95
sourcehookMethod · 0.95
push_sourceMethod · 0.95
pop_sourceMethod · 0.95
printFunction · 0.50

Tested by

no test coverage detected