@zenuml/core 3.50.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lsp/main.js CHANGED
@@ -30983,6 +30983,32 @@ ${content}`;
30983
30983
  pattern: /\/\/[^\r\n]*/,
30984
30984
  group: COMMENT_GROUP
30985
30985
  });
30986
+ const BLOCK_COMMENT = createToken({
30987
+ name: "BLOCK_COMMENT",
30988
+ pattern: /\/\*[\s\S]*?\*\//,
30989
+ group: HIDDEN_GROUP,
30990
+ line_breaks: true
30991
+ });
30992
+ const HASH_COMMENT = createToken({
30993
+ name: "HASH_COMMENT",
30994
+ pattern: /#[ \t][^\r\n]*/,
30995
+ group: HIDDEN_GROUP
30996
+ });
30997
+ const QUOTE_COMMENT_RE = /'[^\r\n]*/y;
30998
+ const quoteCommentExec = (text, offset) => {
30999
+ if (offset !== 0) {
31000
+ const prev = text.charCodeAt(offset - 1);
31001
+ if (prev !== 10 && prev !== 13) return null;
31002
+ }
31003
+ QUOTE_COMMENT_RE.lastIndex = offset;
31004
+ return QUOTE_COMMENT_RE.exec(text);
31005
+ };
31006
+ const QUOTE_COMMENT = createToken({
31007
+ name: "QUOTE_COMMENT",
31008
+ pattern: quoteCommentExec,
31009
+ group: HIDDEN_GROUP,
31010
+ line_breaks: false
31011
+ });
30986
31012
  const CONSTANT = createToken({
30987
31013
  name: "CONSTANT",
30988
31014
  pattern: uniPattern(/const(?![\p{L}\p{Nd}_])/u),
@@ -31037,6 +31063,26 @@ ${content}`;
31037
31063
  name: "ANNOTATION",
31038
31064
  pattern: /@[a-zA-Z0-9_]*/
31039
31065
  });
31066
+ const WRAPPER_DIRECTIVE = createToken({
31067
+ name: "WRAPPER_DIRECTIVE",
31068
+ pattern: /@(?:startuml|enduml|startzenuml|endzenuml)(?![a-zA-Z0-9_])/,
31069
+ group: HIDDEN_GROUP
31070
+ });
31071
+ const THEME_DIRECTIVE_RE = /!theme[^\r\n]*/y;
31072
+ const themeDirectiveExec = (text, offset) => {
31073
+ if (offset !== 0) {
31074
+ const prev = text.charCodeAt(offset - 1);
31075
+ if (prev !== 10 && prev !== 13) return null;
31076
+ }
31077
+ THEME_DIRECTIVE_RE.lastIndex = offset;
31078
+ return THEME_DIRECTIVE_RE.exec(text);
31079
+ };
31080
+ const THEME_DIRECTIVE = createToken({
31081
+ name: "THEME_DIRECTIVE",
31082
+ pattern: themeDirectiveExec,
31083
+ group: HIDDEN_GROUP,
31084
+ line_breaks: false
31085
+ });
31040
31086
  const kw = (name, pattern) => createToken({ name, pattern });
31041
31087
  const ukw = (name, pattern) => createToken({ name, pattern: uniPattern(pattern), line_breaks: false });
31042
31088
  const TRUE = ukw("TRUE", /true(?![\p{L}\p{Nd}_])/u);
@@ -31178,8 +31224,10 @@ ${content}`;
31178
31224
  DIVIDER,
31179
31225
  WS,
31180
31226
  CR,
31181
- // COMMENT before DIV.
31227
+ // COMMENT before DIV; BLOCK_COMMENT (`/* */`) before DIV too.
31182
31228
  COMMENT,
31229
+ BLOCK_COMMENT,
31230
+ QUOTE_COMMENT,
31183
31231
  // Modifier channel.
31184
31232
  CONSTANT,
31185
31233
  READONLY,
@@ -31187,6 +31235,8 @@ ${content}`;
31187
31235
  AWAIT,
31188
31236
  // Predicated soft keyword.
31189
31237
  TITLE,
31238
+ // Wrapper directives (hidden) before the generic ANNOTATION.
31239
+ WRAPPER_DIRECTIVE,
31190
31240
  // Annotations: fixed forms before the generic one.
31191
31241
  STARTER_LXR,
31192
31242
  ANNOTATION_RET,
@@ -31217,6 +31267,8 @@ ${content}`;
31217
31267
  MONEY,
31218
31268
  DIGIT_LEADING_NAME,
31219
31269
  INT,
31270
+ // HASH_COMMENT (`# …`, space-guarded) before COLOR (`#RRGGBB`).
31271
+ HASH_COMMENT,
31220
31272
  COLOR,
31221
31273
  // Strings: CSTRING wins ties; USTRING right after.
31222
31274
  CSTRING,
@@ -31241,6 +31293,8 @@ ${content}`;
31241
31293
  DIV,
31242
31294
  MOD,
31243
31295
  POW,
31296
+ // `!theme …` at column 0 (hidden) before the `!` NOT operator.
31297
+ THEME_DIRECTIVE,
31244
31298
  NOT,
31245
31299
  SCOL,
31246
31300
  COMMA,
@@ -31268,7 +31322,14 @@ ${content}`;
31268
31322
  "STATIC",
31269
31323
  "AWAIT",
31270
31324
  "EVENT_END",
31271
- "TITLE_END"
31325
+ "TITLE_END",
31326
+ // Wrapper/theme directives are no-ops, ignored by the parser (issue #400).
31327
+ "WRAPPER_DIRECTIVE",
31328
+ "THEME_DIRECTIVE",
31329
+ // Extra comment styles, ignored by the parser (issue #402).
31330
+ "BLOCK_COMMENT",
31331
+ "HASH_COMMENT",
31332
+ "QUOTE_COMMENT"
31272
31333
  ]);
31273
31334
  function cloneForParser(token) {
31274
31335
  const config = {