small tweaks to support type labels with single and double quotes. add tests

This commit is contained in:
Axel Kohlmeyer
2022-09-03 19:04:24 -04:00
parent b143f87d10
commit bb45137b1a
4 changed files with 14 additions and 4 deletions

View File

@ -137,7 +137,7 @@ void LabelMap::modify_lmap(int narg, char **arg)
int itype = utils::inumeric(FLERR, arg[iarg++], false, lmp);
if ((itype < 1) || (itype > ntypes))
error->all(FLERR, "Labelmap {} type {} must be within 1-{}", tlabel, itype, ntypes);
std::string slabel(arg[iarg++]);
std::string slabel = utils::trim(arg[iarg++]);
if (isdigit(slabel[0]) || (slabel[0] == '#') || (slabel[0] == '*'))
error->all(FLERR, "Label {} for {} type {} must not start with a number, a '#', or a '*'",
slabel, tlabel, itype);