linny-r 1.2.1 → 1.3.1

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.
@@ -12,7 +12,7 @@ file all have their graphical extensions in file linny-r-gui.js.
12
12
  */
13
13
 
14
14
  /*
15
- Copyright (c) 2017-2022 Delft University of Technology
15
+ Copyright (c) 2017-2023 Delft University of Technology
16
16
 
17
17
  Permission is hereby granted, free of charge, to any person obtaining a copy
18
18
  of this software and associated documentation files (the "Software"), to deal
@@ -290,15 +290,32 @@ class Controller {
290
290
  validName(name) {
291
291
  // Returns TRUE if `name` is a valid Linny-R entity name. These names
292
292
  // must not be empty strings, may not contain brackets, backslashes or
293
- // vertical bars, and must start with an underscore, a letter or a digit;
294
- // this is enforced mainly to preclude parsing issues with variable names
293
+ // vertical bars, may not end with a colon, and must start with an
294
+ // underscore, a letter or a digit. This is enforced mainly to
295
+ // preclude parsing issues with variable names
295
296
  // NOTE: normalize to also accept letters with accents
296
297
  if(name === this.TOP_CLUSTER_NAME) return true;
297
298
  name = name.normalize('NFKD').trim();
298
- return name && !name.match(/\[\\\|\]/) &&
299
+ return name && !name.match(/\[\\\|\]/) && !name.endsWith(':') &&
299
300
  (name.startsWith(this.BLACK_BOX) || name[0].match(/[\w]/));
300
301
  }
301
302
 
303
+ prefixesAndName(name) {
304
+ // Returns name split exclusively at '[non-space]: [non-space]'
305
+ const
306
+ s = name.split(this.PREFIXER),
307
+ pan = [s[0]];
308
+ for(let i = 1; i < s.length; i++) {
309
+ const j = pan.length - 1;
310
+ if(s[i].startsWith(' ') || (i > 0 && pan[j].endsWith(' '))) {
311
+ pan[j] += s[i];
312
+ } else {
313
+ pan.push(s[i]);
314
+ }
315
+ }
316
+ return pan;
317
+ }
318
+
302
319
  nameToID(name) {
303
320
  // Returns a name in lower case with link arrow replaced by three
304
321
  // underscores, constraint link arrow by four underscores, and spaces
@@ -466,6 +483,7 @@ class Controller {
466
483
  rotatingIcon() {}
467
484
  setProgressNeedle() {}
468
485
  updateTimeStep() {}
486
+ updateIssuePanel() {}
469
487
  updateDraggableDialogs() {}
470
488
  logHeapSize() {}
471
489