Quickbook: Match macros in simple markup in the grammar.

[SVN r72392]
This commit is contained in:
Daniel James
2011-06-04 16:17:51 +00:00
parent 43486c773a
commit 3f3fe90bc6
4 changed files with 11 additions and 20 deletions

View File

@@ -380,14 +380,7 @@ namespace quickbook
values.finish();
out << markup.pre;
if (std::string const* ptr = find(macro, content.get_quickbook().c_str()))
{
out << *ptr;
}
else
{
out << content.get_boostbook();
}
out << content.get_boostbook();
out << markup.post;
}

View File

@@ -124,16 +124,13 @@ namespace quickbook
simple_phrase_action(
collector& out
, string_symbols const& macro
, quickbook::actions& actions)
: out(out)
, macro(macro)
, actions(actions) {}
void operator()(char) const;
collector& out;
string_symbols const& macro;
quickbook::actions& actions;
};

View File

@@ -75,7 +75,7 @@ namespace quickbook
, raw_char(phrase, *this)
, escape_unicode(phrase, *this)
, simple_markup(phrase, macro, *this)
, simple_markup(phrase, *this)
, break_(phrase, *this)
, do_macro(phrase, *this)

View File

@@ -368,10 +368,10 @@ namespace quickbook
;
local.simple_markup =
cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
>> cl::eps_p(cl::graph_p) // graph_p must follow first mark
cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
>> cl::eps_p(cl::graph_p) // graph_p must follow first mark
>> lookback
[ cl::anychar_p
[ cl::anychar_p // skip back over the markup
>> ~cl::eps_p(cl::f_ch_p(local.simple_markup.mark))
// first mark not be preceeded by
// the same character.
@@ -384,11 +384,12 @@ namespace quickbook
[
actions.scoped_output()
[
(+( ~cl::eps_p(local.simple_markup_end)
>> local.nested_char
)) [actions.docinfo_value(ph::arg1, ph::arg2)]
]
>> cl::f_ch_p(local.simple_markup.mark)
( cl::eps_p(actions.macro >> local.simple_markup_end)
>> actions.macro [actions.do_macro]
| +(~cl::eps_p(local.simple_markup_end) >> local.nested_char)
) [actions.docinfo_value(ph::arg1, ph::arg2)]
]
>> cl::f_ch_p(local.simple_markup.mark)
[actions.simple_markup]
]
;