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

Function looksLikePascalInclude

src/extraction/grammars.ts:714–718  ·  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

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

Callers 1

detectLanguageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected