Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 45ceee9a authored by Mark Olesen's avatar Mark Olesen
Browse files

openfoam: tune parser handling of string lists in dictionaries

- While any particular OpenFOAM class using dictionary input
  knows what to expect, our parser does not or cannot.

  For an entry with a list of words, it could have two equivalent
  forms:

      1.  keyword  (abc def);
      2.  keyword  2(abc def);

  The parser tokenizes these as

      1.  STRINGLIST
      2.  LABEL STRINGLIST

  Instead of making the parser itself more aggressive, settle for
  fixing up the parse result. When a dictionary entry matches that
  pattern (ie, has label + stringlist and the sizes match), drop
  the redundant size token.

  To be a bit more conservative, limit the fixup to entries that
  contains no other tokens.

BUG: the token IsLabel() condition was incorrect/overly aggressive

- align some token methods with OpenFOAM equivalents.
  Eg, IsPunctuation(char), IsLabel(int) tests.

STYLE: token qualifiers, consistent infinite loop

- move dictionary read implementation out of line,
  in preparation for using dictionary to support
  meta information for an IOobject.
parent c285d3f7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment