Commit Graph

5 Commits

Author SHA1 Message Date
Joakim Hove
d26428dd52 Reimplmented ParseMode based on string keys.
Completely reimplemented the ParseMode class. Now the main datastructure
is a map<string,action> where the possible error situations are the
keys. This approach allows for a much more flexible
setting/filtering/querying of the ParseMode settings.
2015-08-10 14:27:53 +02:00
Joakim Hove
e368a05e00 Merge fixup 2015-08-06 15:12:53 +02:00
Joakim Hove
5e64d0f147 Added parser error for 'random text'.
Previously random text in the input deck which was not formatted as a
valid keyword header was simply ignored; i.e. this

   DIMENS
     10 10 10 /

   Mohaha random gibbersih - not according to any Spec.

   GRID

Would suprisingly parse just fine. This will now be handled according
to the ParseMode::randomText setting. Observe that as a side effect of
this it turned out that many of the test datasets had additional
terminating slashes which were now detected as 'ranomdText'.
2015-08-05 22:02:10 +02:00
Joakim Hove
733af54777 Added struct ParseMode to control parse behaviour.
- Introduce a very simple class ParseMode which will become a simple
   value object which can be used to control the behavior when errors
   and inconsistencies are encountered in the parse and EclipseState
   construction phases.

 - Added ParseMode instance as second argument to all parseXXX()
   methods.
2015-08-05 22:02:09 +02:00
Joakim Hove
875fd86c3c Added strict flag to parser:
Have added a new bool strict flag to the parsing functions, if the
strict flag is set to false the parser will just skip lines with unknwon
keywords, including pure garbage in the input. I.e. for a deck like:

TABDIMS
  1 1 1 /

Crap - not a keyword at all

-- Correctly formatted - unknown keyword
IGNORED
  0 1 /

The parser will load the TABDIMS keyword correctly, and skip the rest.
2015-06-18 08:06:40 +02:00