MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / skipAnnotation

Function skipAnnotation

src/resolution/dart-libraries.ts:171–194  ·  view source on GitHub ↗

The index past the metadata annotation at `i` (`@TestOn('vm')`, `@Tags(['slow'])`, `@JS()`).

(src: string, i: number)

Source from the content-addressed store, hash-verified

169
170/** The index past the metadata annotation at `i` (`@TestOn('vm')`, `@Tags(['slow'])`, `@JS()`). */
171function skipAnnotation(src: string, i: number): number {
172 i++;
173 for (;;) {
174 i = skipTrivia(src, i);
175 IDENTIFIER.lastIndex = i;
176 const name = IDENTIFIER.exec(src);
177 if (!name) return i;
178 i += name[0].length;
179 const next = skipTrivia(src, i);
180 if (src[next] !== '.') break;
181 i = next + 1;
182 }
183 i = skipTrivia(src, i);
184 if (src[i] === '<') {
185 const end = skipGroup(src, i, '<', '>');
186 if (end < 0) return src.length;
187 i = skipTrivia(src, end);
188 }
189 if (src[i] === '(') {
190 const end = skipGroup(src, i, '(', ')');
191 return end < 0 ? src.length : end;
192 }
193 return i;
194}
195
196type DirectiveToken =
197 | { kind: 'string'; value: string }

Callers 1

readDartDirectivesFunction · 0.85

Calls 3

skipTriviaFunction · 0.70
skipGroupFunction · 0.70
execMethod · 0.65

Tested by

no test coverage detected