|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65348 - branches/quickbook-1.5-spirit2/src
From: dnljms_at_[hidden]
Date: 2010-09-07 18:38:21
Author: danieljames
Date: 2010-09-07 18:38:09 EDT (Tue, 07 Sep 2010)
New Revision: 65348
URL: http://svn.boost.org/trac/boost/changeset/65348
Log:
Use more expectation operators.
All over the main grammar. This passes all the tests, but it does break
some things in other documentation.
Text files modified:
branches/quickbook-1.5-spirit2/src/doc_info_grammar.cpp | 85 +++++++++++++++++++++++++++------------
branches/quickbook-1.5-spirit2/src/grammar.cpp | 1
2 files changed, 59 insertions(+), 27 deletions(-)
Modified: branches/quickbook-1.5-spirit2/src/doc_info_grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/src/doc_info_grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/src/doc_info_grammar.cpp 2010-09-07 18:38:09 EDT (Tue, 07 Sep 2010)
@@ -73,9 +73,9 @@
repo::confix(space >> '[' >> space, space >> ']' >> +qi::eol)
[ qi::raw[local.doc_types] [member_assign(&doc_info::doc_type)]
>> hard_space
- >> local.doc_info_title [member_assign(&doc_info::doc_title)]
- >> local.quickbook_version [actions.process]
- >> *repo::confix(space >> '[', space >> ']' >> +qi::eol)
+ > local.doc_info_title [member_assign(&doc_info::doc_title)]
+ > local.quickbook_version [actions.process]
+ > *repo::confix(space >> '[', space >> ']' >> +qi::eol)
[ local.doc_version [member_assign(&doc_info::doc_version)]
| local.doc_id [member_assign(&doc_info::doc_id)]
| local.doc_dirname [member_assign(&doc_info::doc_dirname)]
@@ -90,70 +90,92 @@
// correct encoding.
| local.doc_source_mode [ph::ref(actions.state_.source_mode) = qi::_1]
]
+ > &(space >> ']' >> +qi::eol)
]
;
+ doc_info_details.name("documentation information");
+
local.quickbook_version =
position [member_assign(&version::position)]
>> -repo::confix(space >> '[', space >> ']')
[ "quickbook"
- >> hard_space
- >> qi::uint_ [member_assign(&version::major)]
- >> '.'
- >> uint2_t() [member_assign(&version::minor)]
+ > hard_space
+ > qi::uint_ [member_assign(&version::major)]
+ > '.'
+ > uint2_t() [member_assign(&version::minor)]
]
;
- local.doc_version = "version" >> hard_space >> local.doc_info_text;
- local.doc_id = "id" >> hard_space >> local.doc_info_text;
- local.doc_dirname = "dirname" >> hard_space >> local.doc_info_text;
- local.doc_category="category" >> hard_space >> local.doc_info_text;
- local.doc_last_revision = "last-revision" >> hard_space >> local.doc_info_text;
+ local.quickbook_version.name("quickbook version");
+
+ local.doc_version = "version" >> hard_space > local.doc_info_text;
+ local.doc_id = "id" >> hard_space > local.doc_info_text;
+ local.doc_dirname = "dirname" >> hard_space > local.doc_info_text;
+ local.doc_category="category" >> hard_space > local.doc_info_text;
+ local.doc_last_revision = "last-revision" >> hard_space > local.doc_info_text;
+
+ local.doc_version.name("version");
+ local.doc_id.name("document id");
+ local.doc_dirname.name("document dirname");
+ local.doc_category.name("category");
+ local.doc_last_revision.name("document last revision");
local.doc_copyright =
"copyright"
>> hard_space
- >> (+(qi::uint_ >> space)) [member_assign(&doc_info::copyright_entry::years)]
- >> local.doc_info_text [member_assign(&doc_info::copyright_entry::holder)]
+ > (+(qi::uint_ >> space)) [member_assign(&doc_info::copyright_entry::years)]
+ > local.doc_info_text [member_assign(&doc_info::copyright_entry::holder)]
;
+ local.doc_copyright.name("document copyright");
+
local.doc_purpose =
"purpose"
>> hard_space
- >> local.doc_info_phrase
+ > local.doc_info_phrase
;
+ local.doc_purpose.name("document purpose");
+
local.doc_author =
'['
- >> space
- >> local.doc_info_text_comma [member_assign(&doc_info::author::surname)]
- >> ',' >> space
- >> local.doc_info_text [member_assign(&doc_info::author::firstname)]
- >> ']'
+ > space
+ > local.doc_info_text_comma [member_assign(&doc_info::author::surname)]
+ > ','
+ > space
+ > local.doc_info_text [member_assign(&doc_info::author::firstname)]
+ > ']'
;
local.doc_authors
= "authors"
>> hard_space
- >> ( (local.doc_author >> space)
- % -(qi::char_(',') >> space)
+ > ( (local.doc_author > space)
+ % -(qi::char_(',') > space)
);
+ local.doc_author.name("document author");
+ local.doc_author.name("document authors");
+
local.doc_license =
"license"
>> hard_space
- >> local.doc_info_phrase
+ > local.doc_info_phrase
;
+ local.doc_license.name("document license");
+
local.doc_source_mode =
"source-mode" >> hard_space
- >> (
- qi::string("c++")
+ > ( qi::string("c++")
| qi::string("python")
| qi::string("teletype")
)
;
+ local.doc_source_mode.name("document source mode");
+
local.doc_info_phrase =
qi::raw[
local.doc_info_phrase_impl [member_assign(&docinfo_string::encoded)]
@@ -190,10 +212,10 @@
local.doc_info_text_impl =
qi::eps [actions.phrase_push]
- >> *( escape
+ > *( escape
| (~qi::char_(']')) [actions.process]
)
- >> qi::eps [actions.phrase_pop]
+ > qi::eps [actions.phrase_pop]
;
local.doc_info_text_comma_impl =
@@ -212,5 +234,14 @@
)
>> qi::eps [actions.phrase_pop]
;
+
+ local.doc_info_phrase.name("phrase");
+ local.doc_info_text.name("text");
+ local.doc_info_text_comma.name("text");
+ local.doc_info_title.name("title");
+ local.doc_info_phrase_impl.name("phrase");
+ local.doc_info_text_impl.name("text");
+ local.doc_info_text_comma_impl.name("text");
+ local.doc_info_title_impl.name("title");
}
}
Modified: branches/quickbook-1.5-spirit2/src/grammar.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/src/grammar.cpp (original)
+++ branches/quickbook-1.5-spirit2/src/grammar.cpp 2010-09-07 18:38:09 EDT (Tue, 07 Sep 2010)
@@ -65,6 +65,7 @@
, doc_info(impl_->doc_info_details, "doc_info")
{
qi::on_error(impl_->block_start, error_handler(a));
+ qi::on_error(impl_->doc_info_details, error_handler(a));
}
quickbook_grammar::~quickbook_grammar()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk