MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / lang_cls_text

Function lang_cls_text

src/discover/language.c:1440–1458  ·  view source on GitHub ↗

Disambiguate .cls files: shared by InterSystems ObjectScript UDL, Salesforce * Apex and Visual Basic 6 class modules (#721). ObjectScript class files begin * with a line of the form "Class ..."; VB6 class modules * carry the VB6 header markers and are reported as unsupported (CBM_LANG_COUNT) * until a Visual Basic grammar exists. Defaults to Apex on any doubt. */

Source from the content-addressed store, hash-verified

1438 * carry the VB6 header markers and are reported as unsupported (CBM_LANG_COUNT)
1439 * until a Visual Basic grammar exists. Defaults to Apex on any doubt. */
1440static CBMLanguage lang_cls_text(const char *buf) {
1441 if (has_vb6_markers(buf)) {
1442 return CBM_LANG_COUNT;
1443 }
1444
1445 const char *line = buf;
1446 while (*line) {
1447 if (strncmp(line, "Class ", SLEN("Class ")) == 0 &&
1448 isupper((unsigned char)line[SLEN("Class ")])) {
1449 return CBM_LANG_OBJECTSCRIPT_UDL;
1450 }
1451 const char *nl = strchr(line, '\n');
1452 if (!nl) {
1453 break;
1454 }
1455 line = nl + SKIP_ONE;
1456 }
1457 return CBM_LANG_APEX;
1458}
1459
1460CBMLanguage cbm_disambiguate_cls(const char *path) {
1461 unsigned char head[LANG_PROBE_HEAD];

Callers 2

cbm_disambiguate_clsFunction · 0.85

Calls 1

has_vb6_markersFunction · 0.85

Tested by

no test coverage detected