ENH: improve dictionary parsing behaviour for ill-formed entries (closes #510)

- mostly associated with forgotten quotes around "(abd|def)" ...

- Address different potential problems:

      (key) { key1   entry1; }
      (key) { key1   entry1; };    // <- Note trailing ';'
      (key) entry2;
This commit is contained in:
Mark Olesen
2017-07-19 11:00:44 +02:00
parent efe9b04adc
commit cc290b7c02
3 changed files with 82 additions and 18 deletions

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object testDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Test some parsing
// #default
internalField uniform 10;
// #default
dimensions [ 0 2 -2 0 0 0 0 ];
active
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.1;
value $internalField;
}
// #inputMode error
active
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.1;
value 100;
}
(U|k|epsilon|omega)
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0;
}
/*
;
*/
(rho) smoothSolver
//OK smoothSolver // <- missing ';' as well
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //