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

Function scanPropertyOverride

src/extraction/languages/pascal-preparse.ts:416–427  ·  view source on GitHub ↗

* After a `property` keyword running from `start` to `propertyEnd`, * recognize a property override, which names an inherited property without * its type to publish it or change a specifier — `property OwnsObjects;`, * `property Cursor default crIBeam;`, `property Color stored IsColorStored;` *

(s: string, start: number, propertyEnd: number, ranges: number[])

Source from the content-addressed store, hash-verified

414 * the index to resume scanning from.
415 */
416function scanPropertyOverride(s: string, start: number, propertyEnd: number, ranges: number[]): number {
417 const nameStart = skipTrivia(s, propertyEnd);
418 if (!isIdentStart(s.charCodeAt(nameStart))) return propertyEnd;
419 const i = skipTrivia(s, wordEnd(s, nameStart + 1));
420 const next = s.charCodeAt(i);
421 if (next === CH_COLON || next === CH_LBRACKET) return propertyEnd;
422 const end = semicolonEnd(s, i, MAX_OVERRIDE_LENGTH);
423 if (end < 0) return propertyEnd;
424 const classStart = classBefore(s, start);
425 ranges.push(classStart >= 0 ? classStart : start, end);
426 return end;
427}
428
429/**
430 * A conditional compiler directive group, from its `{$IF…}`, `{$IFDEF…}`,

Callers 1

preParsePascalFunction · 0.85

Calls 6

isIdentStartFunction · 0.85
semicolonEndFunction · 0.85
classBeforeFunction · 0.85
pushMethod · 0.80
skipTriviaFunction · 0.70
wordEndFunction · 0.70

Tested by

no test coverage detected