From 3820d1b1bc4fdd3e5516f27807c3e58ee72e4c20 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 22 Aug 2009 11:30:55 +0200 Subject: Allow string literals for option names --- cli/parser.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cli/parser.cxx b/cli/parser.cxx index 937bf34..e63a7b6 100644 --- a/cli/parser.cxx +++ b/cli/parser.cxx @@ -335,11 +335,19 @@ option_def (Token& t) // while (true) { - if (t.type () != Token::t_identifier) + switch (t.type ()) { - cerr << *id_ << ':' << t.line () << ':' << t.column () << ": error: " - << "option name expected instead of " << t << endl; - throw Error (); + case Token::t_identifier: + case Token::t_string_lit: + { + break; + } + default: + { + cerr << *id_ << ':' << t.line () << ':' << t.column () << ": error: " + << "option name expected instead of " << t << endl; + throw Error (); + } } t = lexer_->next (); -- cgit v1.1