Only accept exact matches for selection keywords
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 29 Jun 2015 17:48:33 +0000 (20:48 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 29 Jun 2015 19:07:07 +0000 (21:07 +0200)
commitb8f5c7326fe28aeeca51e3c602dbabe3e9da3506
treebfe3aea0c44c735a29dd5b4ea287ac6d0713d005
parent58be9efbc5ec842147cf3b38c0d4f6bbf816794d
Only accept exact matches for selection keywords

The selection parser tried to be nice to the user and also accept
unambiguous prefixes of keywords, but this also has a lot of side
effects that can be confusing (e.g., it was impossible to create
variables that had names that were prefixes to keywords or to other
variable names).  Additionally, this was the only case where user input
could cause an exception during tokenization of the input string, and
that wasn't handled very well during interactive input, either (it
caused the whole program to stop, instead of just reporting the error
like is done for other parsing errors).

Remove the logic, and only make the parser accept exact matches.
Add a few synonyms for keywords where there is a natural abbreviation.

Change-Id: I6041baa2f5a3b7dab87c3d5991e883d2d74ace66
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/selmethod.cpp
src/gromacs/selection/symrec.cpp
src/gromacs/selection/symrec.h
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesBeta.xml