fix: add classLiteral to the language for class diagram namespace

This commit is contained in:
Krishna Upadhyay
2025-08-04 16:56:55 -05:00
parent 4ab98c2ec7
commit c99bce6bab
4 changed files with 27 additions and 0 deletions

View File

@@ -15,4 +15,12 @@ describe('class diagram', function () {
expect(() => parser.parse(`classDiagram\nnamespace ${prop} {\n\tclass A\n}`)).not.toThrow();
});
});
describe('backtick escaping', function () {
it('should handle backtick-quoted namespace names', function () {
expect(() =>
parser.parse(`classDiagram\nnamespace \`A::B\` {\n\tclass \`IPC::Sender\`\n}`)
).not.toThrow();
});
});
});

View File

@@ -242,6 +242,7 @@ classLabel
namespaceName
: alphaNumToken { $$=$1; }
| classLiteralName { $$=$1; }
| alphaNumToken DOT namespaceName { $$=$1+'.'+$3; }
| alphaNumToken namespaceName { $$=$1+$2; }
;