MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / getUnitname

Function getUnitname

lib/compilers/pascal-utils.ts:35–43  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

33}
34
35export function getUnitname(source: string) {
36 const re = /\s?unit\s+([\w.-]*);/i;
37 const match = source.match(re);
38 if (match) {
39 return match[1];
40 }
41
42 return 'example';
43}
44
45export function getProgName(source: string) {
46 const re = /\s?program\s+([\w.-]*);/i;

Callers

nothing calls this directly

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected