Update of /cvsroot/boost/boost/tools/quickbook
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7436
Modified Files:
block.hpp phrase.hpp
Log Message:
* Simple markups can now span a whole block.
* __blurbs__, __admonitions__ and table cells (see __tables__) may now
contain paragraphs.
* `\n` and `[br]` are now deprecated.
Index: block.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/block.hpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- block.hpp 20 Dec 2006 15:40:59 -0000 1.19
+++ block.hpp 27 Feb 2007 15:22:15 -0000 1.20
@@ -33,8 +33,8 @@
struct definition
{
definition(block_grammar const& self)
- : is_not_preformatted(true)
- , common(self.actions, is_not_preformatted)
+ : no_eols(true)
+ , common(self.actions, no_eols)
{
using detail::var;
Actions& actions = self.actions;
@@ -76,7 +76,7 @@
close_bracket =
']' |
- if_p(var(is_not_preformatted))
+ if_p(var(no_eols))
[
eol_p >> eol_p // Make sure that we
don't go
] // past a single
block, except
@@ -87,13 +87,9 @@
; // alpha-numeric or
underscore
comment =
- (
- "[//" >> *(anychar_p - eol_p) >> eol_p
- | "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
- )
- [actions.comment]
+ "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
;
-
+
dummy_block =
'[' >> *(dummy_block | (anychar_p - ']')) >> ']'
;
@@ -151,43 +147,49 @@
h5 = "h5" >> hard_space >> phrase [actions.h5];
h6 = "h6" >> hard_space >> phrase [actions.h6];
+ static const bool true_ = true;
+ static const bool false_ = false;
+
+ inside_paragraph =
+ phrase
[actions.inside_paragraph]
+ >> *(
+ eol >> eol >> phrase
[actions.inside_paragraph]
+ )
+ ;
+
blurb =
"blurb" >> hard_space
- >> phrase [actions.blurb]
+ >> inside_paragraph [actions.blurb]
+ >> eps_p
;
blockquote =
':' >> blank >>
- phrase [actions.blockquote]
+ inside_paragraph [actions.blockquote]
;
admonition =
"warning" >> blank >>
- phrase [self.actions.warning]
+ inside_paragraph [actions.warning]
|
"caution" >> blank >>
- phrase [self.actions.caution]
+ inside_paragraph [actions.caution]
|
"important" >> blank >>
- phrase
[self.actions.important]
+ inside_paragraph [actions.important]
|
"note" >> blank >>
- phrase [self.actions.note]
+ inside_paragraph [actions.note]
|
"tip" >> blank >>
- phrase [self.actions.tip]
+ inside_paragraph [actions.tip]
;
- {
- static const bool true_ = true;
- static const bool false_ = false;
-
- preformatted =
- "pre" >> hard_space
[assign_a(is_not_preformatted, false_)]
- >> !eol >> phrase [actions.preformatted]
- >> eps_p
[assign_a(is_not_preformatted, true_)]
- ;
- }
+ preformatted =
+ "pre" >> hard_space [assign_a(no_eols,
false_)]
+ >> !eol >> phrase [actions.preformatted]
+ >> eps_p [assign_a(no_eols,
true_)]
+ ;
macro_identifier =
+(anychar_p - (space_p | ']'))
@@ -210,7 +212,7 @@
template_ =
"template"
>> hard_space >> template_id
[push_back_a(actions.template_info)]
- >>
+ >>
!(
space >> '['
>> *(
@@ -220,7 +222,7 @@
)
>> template_body [actions.template_body]
;
-
+
template_body =
*(('[' >> template_body >> ']') | (anychar_p - ']'))
>> space >> eps_p(']')
@@ -279,7 +281,7 @@
;
table =
- "table"
+ "table"
>> (eps_p(*blank_p >> eol_p) | hard_space)
>> (*(anychar_p - eol))
[assign_a(actions.table_title)]
>> +eol
@@ -307,7 +309,7 @@
>>
(
(
- phrase
+ inside_paragraph
>> ch_p(']') [actions.end_cell]
>> space
)
@@ -332,7 +334,7 @@
include =
"include"
>> hard_space
- >>
+ >>
!(
':'
>> (*((alnum_p | '_') -
space_p))[assign_a(actions.include_doc_id)]
@@ -341,7 +343,7 @@
>> (*(anychar_p -
close_bracket)) [actions.include]
;
-
+
code =
(
code_line
@@ -403,10 +405,10 @@
;
}
- bool is_not_preformatted;
-
- rule<Scanner> start_, blocks, block_markup, code, code_line,
- paragraph, space, blank, comment, headings, h, h1,
h2,
+ bool no_eols;
+
+ rule<Scanner> start_, blocks, block_markup, code, code_line,
+ paragraph, space, blank, comment, headings, h, h1,
h2,
h3, h4, h5, h6, hr, blurb, blockquote, admonition,
phrase, list, close_bracket, ordered_list,
def_macro,
macro_identifier, table, table_row, variablelist,
@@ -414,10 +416,11 @@
preformatted, list_item, begin_section,
end_section,
xinclude, include, hard_space, eol, paragraph_end,
template_, template_id, template_formal_arg,
- template_body, identifier, dummy_block, import;
+ template_body, identifier, dummy_block, import,
+ inside_paragraph;
symbols<> paragraph_end_markups;
-
+
phrase_grammar<Actions> common;
rule<Scanner> const&
Index: phrase.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/phrase.hpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- phrase.hpp 21 Feb 2007 00:48:28 -0000 1.22
+++ phrase.hpp 27 Feb 2007 15:22:15 -0000 1.23
@@ -23,7 +23,12 @@
template <typename Rule, typename Action>
inline void
- simple_markup(Rule& simple, char mark, Action const& action, Rule const&
eol)
+ simple_markup(
+ Rule& simple
+ , char mark
+ , Action const& action
+ , Rule const& close
+ )
{
simple =
mark >>
@@ -37,8 +42,8 @@
|
( graph_p >> // graph_p must follow mark
*(anychar_p -
- ( eol // Make sure that we don't go
- | (graph_p >> mark) // past a single line
+ ( (graph_p >> mark) // Make sure that we don't go
+ | close // past a single block
)
) >> graph_p // graph_p must precede mark
>> eps_p(mark
@@ -53,8 +58,8 @@
template <typename Actions>
struct phrase_grammar : grammar<phrase_grammar<Actions> >
{
- phrase_grammar(Actions& actions, bool& is_not_preformatted)
- : is_not_preformatted(is_not_preformatted), actions(actions) {}
+ phrase_grammar(Actions& actions, bool& no_eols)
+ : no_eols(no_eols), actions(actions) {}
template <typename Scanner>
struct definition
@@ -77,7 +82,7 @@
close_bracket =
']' |
- if_p(var(self.is_not_preformatted))
+ if_p(var(self.no_eols))
[
eol_p >> eol_p // Make sure that we
don't go
] // past a single
block, except
@@ -88,11 +93,7 @@
; // alpha-numeric or
underscore
comment =
- (
- "[//" >> *(anychar_p - eol_p) >> eol_p
- | "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
- )
- [actions.comment]
+ "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
;
dummy_block =
@@ -185,13 +186,13 @@
;
simple_markup(simple_bold,
- '*', actions.simple_bold, eol);
+ '*', actions.simple_bold, close_bracket);
simple_markup(simple_italic,
- '/', actions.simple_italic, eol);
+ '/', actions.simple_italic, close_bracket);
simple_markup(simple_underline,
- '_', actions.simple_underline, eol);
+ '_', actions.simple_underline, close_bracket);
simple_markup(simple_teletype,
- '=', actions.simple_teletype, eol);
+ '=', actions.simple_teletype, close_bracket);
phrase =
*( common
@@ -397,7 +398,7 @@
start() const { return common; }
};
- bool& is_not_preformatted;
+ bool& no_eols;
Actions& actions;
};
@@ -424,11 +425,7 @@
;
comment =
- (
- "[//" >> *(anychar_p - eol_p) >> eol_p
- | "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
- )
- [actions.comment]
+ "[/" >> *(dummy_block | (anychar_p - ']')) >> ']'
;
dummy_block =
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs