Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75441 - in branches/quickbook-dev/tools/quickbook: src test/include
From: dnljms_at_[hidden]
Date: 2011-11-10 13:15:31


Author: danieljames
Date: 2011-11-10 13:15:30 EST (Thu, 10 Nov 2011)
New Revision: 75441
URL: http://svn.boost.org/trac/boost/changeset/75441

Log:
Quickbook: Parse version as for any other docinfo attribute.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp | 5 ++---
   branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp | 25 ++++++++-----------------
   branches/quickbook-dev/tools/quickbook/src/doc_info_tags.hpp | 2 +-
   branches/quickbook-dev/tools/quickbook/test/include/compatibility-1_5.quickbook | 2 +-
   4 files changed, 12 insertions(+), 22 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/doc_info_actions.cpp 2011-11-10 13:15:30 EST (Thu, 10 Nov 2011)
@@ -92,9 +92,7 @@
         // Skip over invalid attributes
 
         while (values.check(value::default_tag)) values.consume();
-
- value qbk_version = values.optional_consume(doc_info_tags::qbk_version);
-
+
         value doc_title;
         if (values.check())
         {
@@ -109,6 +107,7 @@
 
         std::vector<std::string> duplicates;
 
+ value qbk_version = consume_list(values, doc_info_attributes::qbk_version, &duplicates);
         value id = consume_value_in_list(values, doc_info_attributes::id, &duplicates);
         value dirname = consume_value_in_list(values, doc_info_attributes::dirname, &duplicates);
         value last_revision = consume_value_in_list(values, doc_info_attributes::last_revision, &duplicates);

Modified: branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/doc_info_grammar.cpp 2011-11-10 13:15:30 EST (Thu, 10 Nov 2011)
@@ -112,11 +112,6 @@
>> hard_space
>> actions.to_value(doc_info_tags::title)
                 [ *(~cl::eps_p(cl::ch_p('[') | ']' | cl::eol_p) >> local.char_) ]
- >> !(
- space >> '[' >>
- local.quickbook_version
- >> space >> ']'
- )
>> *(
                     space
>> '['
@@ -139,19 +134,7 @@
>> (+cl::eol_p | cl::end_p)
             ;
 
- local.quickbook_version =
- actions.values.list(doc_info_tags::qbk_version)
- [ "quickbook"
- >> hard_space
- >> ( cl::uint_p [actions.values.entry(ph::arg1)]
- >> '.'
- >> uint2_t() [actions.values.entry(ph::arg1)]
- )
- ]
- ;
-
         // TODO: Clear phrase afterwards?
-
         local.doc_fallback = (*(~cl::eps_p(']') >> local.char_));
 
         // TODO: Restrictions on doc_id and doc_dirname?
@@ -165,6 +148,14 @@
         local.attribute_rules[doc_info_attributes::lang] = &local.doc_simple;
         local.attribute_rules[doc_info_attributes::xmlbase] = &local.doc_simple;
 
+ local.quickbook_version =
+ cl::uint_p [actions.values.entry(ph::arg1)]
+ >> '.'
+ >> uint2_t() [actions.values.entry(ph::arg1)]
+ ;
+
+ local.attribute_rules[doc_info_attributes::qbk_version] = &local.quickbook_version;
+
         local.doc_copyright_holder
             = *( ~cl::eps_p
                     ( ']'

Modified: branches/quickbook-dev/tools/quickbook/src/doc_info_tags.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/doc_info_tags.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/doc_info_tags.hpp 2011-11-10 13:15:30 EST (Thu, 10 Nov 2011)
@@ -14,7 +14,6 @@
 namespace quickbook
 {
     QUICKBOOK_VALUE_TAGS(doc_info_tags, 0x400,
- (qbk_version)
         (type)
         (title)
         (author_surname)(author_first)
@@ -24,6 +23,7 @@
     )
 
     QUICKBOOK_VALUE_NAMED_TAGS(doc_info_attributes, 0x450,
+ ((qbk_version)("quickbook"))
         ((id)("id"))
         ((dirname)("dirname"))
         ((last_revision)("last-revision"))

Modified: branches/quickbook-dev/tools/quickbook/test/include/compatibility-1_5.quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/include/compatibility-1_5.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/include/compatibility-1_5.quickbook 2011-11-10 13:15:30 EST (Thu, 10 Nov 2011)
@@ -1,7 +1,7 @@
 [article Test Compatibility Mode
-[quickbook 1.6]
 [compatibility-mode 1.5]
 [id compatibility]
+[quickbook 1.6]
 ]
 
 [section Outer]


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