Jean-Marc Lasgouttes schrieb:
> Your getParenthesesOpt function has a problem: since it is modelled
> after getOpt(), it allows for an optional argument. But () arguments
> are not optional in general.
Yes they are required, but the function uses the Parser::getFullArg function which is valid for all
types of parentheses.
> So at least this function should be renamed to Parser::getFullParentheseArg()
Fine with me.
> and should fail (how?) when the opening parenthesis is not found.
How that? But nevertheless I checked in my patch that the first character is a
"(":
if (p.next_token().character() == '(')
I think therefore that this function is very misleading.
I at least renamed now the function from opt to arg.
What could be
useful for ERT, though, is a version of getFullArg that returns the
outer delimiters. Moreover, one could make use of the currently unused
FLAG_OPTION = 1 << 11, // read [...] style option
FLAG_BRACED = 1 << 12, // read {...} style argument
enum flags instead of passing explicitly the left and right
delimiters.
Could you do this?
regards Uwe