Skip to content

Conversation

marcosbento
Copy link
Collaborator

@marcosbento marcosbento commented May 6, 2025

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 "" # ""

with the double quotes and hash symbol used as separators. This approach works fine while or 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 "value X " # " and Y " # " value Z"

Should the parser consider
= "value X " # " and Y "
= " value Z"
or
= "value X "
" 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 " "value X" " # " # " # " "value Y" "

🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/ecflow/pull-requests/PR-184

@marcosbento marcosbento force-pushed the feature/parsing_label_state branch from c078473 to 8cd8eb9 Compare May 7, 2025 08:23
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch from 8cd8eb9 to 53bac01 Compare May 16, 2025 14:53
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch from 53bac01 to a1d006d Compare June 19, 2025 09:03
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch from a1d006d to 1071e67 Compare July 4, 2025 11:04
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch 5 times, most recently from 17287ee to 5da7bd5 Compare July 19, 2025 06:31
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch from 5da7bd5 to 0e42807 Compare July 22, 2025 12:31
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch 3 times, most recently from e637a60 to 98b5e43 Compare August 28, 2025 13:49
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch 2 times, most recently from 7acab1e to 0b57baa Compare September 5, 2025 10:18
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch 2 times, most recently from 00515f6 to 7e5b760 Compare September 11, 2025 08:26
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" "
@marcosbento marcosbento force-pushed the feature/parsing_label_state branch from 7e5b760 to f9d1922 Compare September 12, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant