/* Check if the identifier matches with a symbol */
const gmx::SelectionParserSymbol *symbol
- = state->sc->symtab->findSymbol(std::string(yytext, yyleng), false);
+ = state->sc->symtab->findSymbol(std::string(yytext, yyleng));
/* If there is no match, return the token as a string */
if (!symbol)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{NULL, &sm_altloc},
{NULL, &sm_occupancy},
{NULL, &sm_betafactor},
+ {"beta", &sm_betafactor},
{NULL, &sm_x},
{NULL, &sm_y},
{NULL, &sm_z},
{NULL, &sm_distance},
+ {"dist", &sm_distance},
{NULL, &sm_mindistance},
+ {"mindist", &sm_mindistance},
{NULL, &sm_within},
{NULL, &sm_insolidangle},
{NULL, &sm_same},
continue;
}
/* Check that the name does not conflict with a method */
- if (symtab.findSymbol(param[i].name, true))
+ if (symtab.findSymbol(param[i].name))
{
report_param_error(fp, name, param[i].name, "error: name conflicts with another method or a keyword");
bOk = false;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
const SelectionParserSymbol *
-SelectionParserSymbolTable::findSymbol(const std::string &name,
- bool bExact) const
+SelectionParserSymbolTable::findSymbol(const std::string &name) const
{
Impl::SymbolMap::const_iterator sym = impl_->symbols_.lower_bound(name);
if (sym == impl_->symbols_.end())
{
return sym->second.get();
}
- if (!bExact && startsWith(sym->second->name(), name))
- {
- Impl::SymbolMap::const_iterator next = sym;
- ++next;
- if (next != impl_->symbols_.end()
- && startsWith(next->second->name(), name))
- {
- GMX_THROW(InvalidInputError("'" + name + "' is ambiguous"));
- }
- if (sym->second->type() == SelectionParserSymbol::MethodSymbol)
- {
- return sym->second.get();
- }
- }
return NULL;
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* Finds a symbol by name.
*
* \param[in] name Symbol name to find.
- * \param[in] bExact If false, symbols that begin with \p name are also
- * considered.
* \returns Pointer to the symbol with name \p name, or
* NULL if not found.
- * \throws InvalidInputError if \p bExact is false and an ambiguous
- * symbol is provided.
*
- * If no exact match is found and \p bExact is false, returns a symbol
- * that begins with \p name if a unique matching symbol is found.
- * Only selection methods are considered for this inexact match.
+ * Does not throw.
*/
const SelectionParserSymbol *
- findSymbol(const std::string &name, bool bExact) const;
+ findSymbol(const std::string &name) const;
/*! \brief
* Returns the start iterator for iterating symbols of a given type.
<ParsedSelections Name="Parsed">
<ParsedSelection Name="Selection1">
<String Name="Input">beta 0</String>
- <String Name="Text">betafactor 0</String>
+ <String Name="Text">beta 0</String>
<Bool Name="Dynamic">false</Bool>
</ParsedSelection>
<ParsedSelection Name="Selection2">
<String Name="Input">beta >= 0.3</String>
- <String Name="Text">betafactor >= 0.3</String>
+ <String Name="Text">beta >= 0.3</String>
<Bool Name="Dynamic">false</Bool>
</ParsedSelection>
</ParsedSelections>