Commit 1071e67
committed
Correct parsing of Label attribute
The changes propose a better (but still not flawless) approach to
parsing the Label attribute.
Re ECFLOW-1890
Explanation of the Problem:
A Label attribute is stores in the .def file in the following format:
> label <name> "<value>" # "<new-value>"
with the double quotes and hash symbol used as separators.
This approach works fine while <value> or <new-value> do not contain
any double quotes or hash symbols.
When the values contain double quotes or hash symbols, the parsing
becomes ambiguous. In the following example
> label <name> "value X " # " and Y " # " value Z"
Should the parser consider
<value> = "value X " # " and Y "
<new-value> = " value Z"
or
<value> = "value X "
<new-value> " and Y " # " value Z"
?
Both might be correct depending on the user's intents!
This becomes even more convoluted when the value contains double quotes,
as in this example:
label <name> " "value X" " # " # " # " "value Y" "1 parent 34fdfba commit 1071e67
File tree
4 files changed
+493
-3
lines changed- libs
- attribute
- src/ecflow/attribute
- test
- core/src/ecflow/core
4 files changed
+493
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
389 | 392 | | |
390 | 393 | | |
391 | 394 | | |
| |||
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
434 | | - | |
| 437 | + | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| |||
459 | 462 | | |
460 | 463 | | |
461 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
462 | 508 | | |
463 | 509 | | |
464 | 510 | | |
| |||
0 commit comments