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

Function looksLikePascalInclude

src/extraction/grammars.ts:713–717  ·  view source on GitHub ↗

* Whether an `.inc` file is a Pascal include rather than a PHP one (#2279). * * A PHP include always opens a PHP tag somewhere, so a tag anywhere keeps the * file PHP. Without one, a Pascal-only line shape (`PASCAL_INCLUDE_SIGNALS`, * or a `begin` … `end;` pair) makes it Pascal. Anything else ke

(source: string)

Source from the content-addressed store, hash-verified

711 * would flip an untouched include whenever the last `.pas` file came or went.
712 */
713function looksLikePascalInclude(source: string): boolean {
714 if (PHP_OPEN_TAG_RE.test(source)) return false;
715 if (PASCAL_INCLUDE_SIGNALS.some((re) => re.test(source))) return true;
716 return PASCAL_BEGIN_RE.test(source) && PASCAL_END_RE.test(source);
717}
718
719/** Whether a JavaScript file's leading comments carry Flow's `@flow` pragma (and not `@noflow`). */
720export function hasFlowPragma(source: string): boolean {

Callers 1

detectLanguageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected