SymbolicFunction expression containing commas inputs fail XML validation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 287
- Forks
- 109
- Avg merge
- 4d 41m
- Merged PRs (30d)
- 5
Description
Describe the bug
A really minor inconvenience, but a SymbolicFunction expression with commas (which are necessary for using some binary functions, e.g. pow(x,y)) fails validation, because our validation regex pattern for strings does not allow commas.
To Reproduce
Steps to reproduce the behavior:
- Modify
examples/functions/function_examples/function_examples.xmlto use a binary builtin function (e.g.pow) - Run the full build up to the XML validation step
- Get error message like
ERROR:SCHEMASV:SCHEMAV_CVC_PATTERN_VALID: Element 'SymbolicFunction', attribute 'expression': [facet 'pattern'] The value 'pow(x,1.5)' is not accepted by the pattern '.*[\[\]`$].*|[^,\{\}]*'.
Expected behavior
Should not fail validation.
Additional context
The reason to not allow commas in string inputs is probably so that regex for string_array is unambiguous (it adds commas between array elements). But I suspect if we allowed it, validation would still work fine, the regex would possibly match a different number of strings (when some are separated by commas with no spaces, they may get mashed into one). This doesn't affect the actual GEOSX parser in any case. Instead, we should prohibit spaces in string regex, because a space is never read by operator>> so a string like "ab cd" will validate but GEOSX will only read "ab".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/functions/function_examples/function_examples.xml and reproduce the failure using a binary function such as pow(x,1.5), then locate the string-input validation pattern used during the XML validation step. Run the full build through XML validation; done means comma-containing SymbolicFunction expressions pass while space handling remains consistent with the parser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100