MCPcopy Index your code
hub / github.com/lutzroeder/netron / _identifier

Method _identifier

source/python.js:2178–2208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2176 return null;
2177 }
2178 _identifier() {
2179 let i = this._position;
2180 if (ast._Tokenizer._isIdentifierStartChar(this._get(i))) {
2181 i++;
2182 while (ast._Tokenizer._isIdentifierChar(this._get(i))) {
2183 i++;
2184 }
2185 }
2186 if (i > this._position) {
2187 const text = this._text.substring(this._position, i);
2188 let keyword = false;
2189 switch (text) {
2190 case 'and':
2191 case 'as':
2192 case 'else':
2193 case 'For':
2194 case 'If':
2195 case 'Import':
2196 case 'in':
2197 case 'is':
2198 case 'not':
2199 case 'or':
2200 keyword = true;
2201 break;
2202 default:
2203 break;
2204 }
2205 return { type: 'id', value: text, keyword };
2206 }
2207 return null;
2208 }
2209 _operator() {
2210 let length = 0;
2211 const c0 = this._get(this._position);

Callers 1

_tokenizeMethod · 0.45

Calls 3

_getMethod · 0.45
_isIdentifierCharMethod · 0.45

Tested by

no test coverage detected