Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParmParse: Option to disable multi-line support #3433

Merged

Conversation

WeiqunZhang
Copy link
Member

By default, ParmParse supports multi-line values. For example,

    plot_vars = dens vx vy vx
                energy entropy

This can be disabled by calling setMultiLineSupport(false) before amrex::Initialize(). This can avoid errors in inputs like,

    algo.current_deposition = direct

    # Enable galilean
    psatd.use_default_v_galilean # Unfortunately we forgot = 1

With multi-line support, this is unfortunately equivalent to

    algo.current_deposition = direct psatd.use_default_v_galilean

With multi-line support disabled, it will abort. Note that even after multi-line support is disabled, one is still allowed to have

    f = "x + y
         + sin(z)"

because here what's inside the pair of double quotes is considered a single string.

@WeiqunZhang WeiqunZhang requested a review from atmyers July 20, 2023 03:58
@WeiqunZhang WeiqunZhang force-pushed the parmparse_multiline branch 2 times, most recently from 4b7b262 to 6216179 Compare July 20, 2023 04:31
By default, ParmParse supports multi-line values. For example,
```
    plot_vars = dens vx vy vx
                energy entropy
```

This can be disabled by calling setMultiLineSupport(false) before
amrex::Initialize(). This can avoid errors in inputs like,
```
    algo.current_deposition = direct

    # Enable galilean
    psatd.use_default_v_galilean # Unfortunately we forgot = 1
```
With multi-line support, this is unfortunately equivalent to
```
    algo.current_deposition = direct psatd.use_default_v_galilean
```
With multi-line support disabled, it will abort. Note that even
after multi-line support is disabled, one is still allowed to have
```
    f = "x + y
         + sin(z)"
```
because here what's inside the pair of double quotes is considered a single
string.
@WeiqunZhang WeiqunZhang merged commit abc6696 into AMReX-Codes:development Jul 20, 2023
66 checks passed
@WeiqunZhang WeiqunZhang deleted the parmparse_multiline branch July 20, 2023 17:49
WeiqunZhang added a commit to WeiqunZhang/amrex that referenced this pull request Jul 21, 2023
In AMReX-Codes#3433, we added an option to disable multi-line support to avoid certain
types of errors. Since multi-line support seems to be desirable feature, we
add a new feature that uses `\` as line continuation. To avoid confusion, we
have decided to stop supporting the old style of multi-line values and make
it a runtime error. Hopefully it does not cause too much trouble for users.
WeiqunZhang added a commit to WeiqunZhang/amrex that referenced this pull request Jul 21, 2023
In AMReX-Codes#3433, we added an option to disable multi-line support to avoid certain
types of errors. Since multi-line support seems to be desirable feature, we
add a new feature that uses `\` as line continuation. To avoid confusion, we
have decided to stop supporting the old style of multi-line values and make
it a runtime error. Hopefully it does not cause too much trouble for users.
WeiqunZhang added a commit that referenced this pull request Jul 21, 2023
In #3433, we added an option to disable multi-line support to avoid
certain types of errors. Since multi-line support seems to be desirable
feature, we add a new feature that uses `\` as line continuation. To
avoid confusion, we have decided to stop supporting the old style of
multi-line values and make it a runtime error. Hopefully it does not
cause too much trouble for users.
mirenradia added a commit to GRTLCollaboration/GRTeclyn that referenced this pull request Aug 4, 2023
Following AMReX-Codes/amrex#3433 and AMReX-Codes/amrex#3437, line
continuation is only supported with a '\' character.
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.

2 participants