diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-24 11:54:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-24 11:54:14 +0200 |
commit | 469605e872aeca50c7556708de5d50d7e7935d83 (patch) | |
tree | 646940c7653065dbb97346f171d097515ec45afd /cli/parser.cxx | |
parent | 7e9cb673ccfc77c5871292aa5491fc2c2dc2a663 (diff) |
Implement support for documentation inside classes
Diffstat (limited to 'cli/parser.cxx')
-rw-r--r-- | cli/parser.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/cli/parser.cxx b/cli/parser.cxx index 164a3c0..aee5c04 100644 --- a/cli/parser.cxx +++ b/cli/parser.cxx @@ -224,9 +224,8 @@ def_unit () } cerr << *path_ << ':' << t.line () << ':' << t.column () << ": error: " - << "expected namespace, class, or documentation declaration or " - << "instead of " << t - << endl; + << "expected namespace, class, or documentation instead of " + << t << endl; throw error (); } catch (error const&) @@ -588,8 +587,8 @@ namespace_def () if (t.punctuation () != token::p_rcbrace) { cerr << *path_ << ':' << t.line () << ':' << t.column () << ": error: " - << "expected namespace, class, or documentation declaration or '}' " - << "instead of " << t << endl; + << "expected namespace, class, documentation, or '}' instead of " + << t << endl; throw error (); } } @@ -684,7 +683,7 @@ class_def () auto_restore<scope> new_scope (scope_, n); - // decl-seq + // class-decl-seq // t = lexer_->next (); @@ -692,8 +691,16 @@ class_def () { try { - if (!option_def (t)) - break; + if (t.type () == token::t_string_lit || + t.punctuation () == token::p_lcbrace) + { + scope_doc (t); + } + else + { + if (!option_def (t)) + break; + } t = lexer_->next (); } @@ -707,7 +714,7 @@ class_def () if (t.punctuation () != token::p_rcbrace) { cerr << *path_ << ':' << t.line () << ':' << t.column () << ": error: " - << "expected option declaration or '}' instead of " << t << endl; + << "expected option, documentation, or '}' instead of " << t << endl; throw error (); } |