}
if ((curr_token().cat() == catComment && curr_token().cs().empty()))
continue;
- if (skip_comments && curr_token().cat() == catComment)
- cerr << " Ignoring comment: " << curr_token().asInput();
- else {
+ if (skip_comments && curr_token().cat() == catComment) {
+ // If positions_ is not empty we are doing some kind
+ // of look ahead
+ if (!positions_.empty())
+ cerr << " Ignoring comment: "
+ << curr_token().asInput();
+ } else {
putback();
break;
}
putback();
else if (skip_comments && curr_token().cat() == catComment) {
// TODO: Get rid of this
- cerr << "Unignoring comment: " << curr_token().asInput();
+ // If positions_ is not empty we are doing some kind
+ // of look ahead
+ if (!positions_.empty())
+ cerr << "Unignoring comment: "
+ << curr_token().asInput();
putback();
}
else
}
-string Parser::getFullOpt()
+string Parser::getFullOpt(bool keepws)
{
Arg arg = getFullArg('[', ']');
if (arg.first)
return '[' + arg.second + ']';
+ if (keepws)
+ unskip_spaces(true);
return string();
}
}
-string Parser::getOptContent()
-// the same as getOpt but without the brackets
-{
- string const res = getArg('[', ']');
- return res.empty() ? string() : res;
-}
-
-
string Parser::getFullParentheseArg()
{
Arg arg = getFullArg('(', ')');