Teuchos: Line Returns in Flow Mappings and Sequences
Created by: danielsjensen1
Many YAML input files have long lists of variables such as the following
Nodal Quantities: >
Ex, Ey, Ez,
Bx, By, Bz,
ion_px, ion_py, ion_pz, ion_rho, ion_rho_E,
ion_ux, ion_uy, ion_uz, ion_n, ion_P,
Internally, we have been converting these strings to arrays but it would be fantastic if we could just use flow sequences with line returns as follows
Nodal Quantities: [
Ex, Ey, Ez,
Bx, By, Bz,
ion_px, ion_py, ion_pz, ion_rho, ion_rho_E,
ion_ux, ion_uy, ion_uz, ion_n, ion_P]
Flow sequences and flow maps currently work if they are on one line only such as foo: [a b]
and foo: {a: 1, b:2}
but they fail if there are any line returns as in the Nodal Quantities
example above.
@trilinos/Teuchos
enhancement
@trilinos/Teuchos
Expectations
The following input
FooPL:
sequence: [1, 2,
3]
map: {a: 1, b: 2,
c: 3}
should be equivalent to
FooPL:
sequence: [1, 2, 3]
map: {a: 1, b: 2, c: 3}
Current Behavior
The input above produces the following error message
Teuchos in Trilinos 12.13 (Dev)
terminate called after throwing an instance of 'Teuchos::ParserFail'
what(): error: Parser failure at line 3 column 14 of foo.yaml
3]
^
Expected one of {!, ", ', -, ., OTHERCHAR, WS, [, {}
Got: NEWLINE
Lexer text: "
"
Parser was in state 169
Motivation and Context
Users familiar with YAML files expect flow mappings and sequences to work properly even if there are line returns present. Input files become unnecessarily long either in width or height when line returns aren't allowed in flow mappings and sequences.
Definition of Done
The examples given above could be used in creating unit tests.
Possible Solution
Steps to Reproduce
Your Environment
- Relevant repo SHA1s:
- Relevant configure flags or configure script:
- Operating system and version:
- Compiler and TPL versions:
Related Issues
- Blocks
- Is blocked by
- Follows
- Precedes
- Related to
- Part of
- Composed of