TedStudley / mc-mini

Simple Stokes+Advection/Diffusion solver.
0 stars 4 forks source link

Fix the Parameter Parser to Handle Optional Sections Properly #9

Closed TedStudley closed 8 years ago

TedStudley commented 8 years ago

Currently, the parameter parser will attempt to completely skip an optional section if it does not exist. This causes issues when we want to have an optional section with parameters (with default values) that we want to have inside it, since we need to either skip the entirety of the section or end up with ugly logic to avoid popping an extra section at the end.

The correct solution would be to create 'ghost' parameter section onto the tree when entering an optional section which does not actually exist. This will allow us to query optional parameters properly when inside the optional section, while causing an error when required parameters aren't found. The 'ghost' section can be popped correctly when leaving the section, and should be deleted once popped.

TedStudley commented 8 years ago

This issue should be fixed now that #31 is merged in.