Update of /cvsroot/boost/boost/tools/quickbook/detail
In directory
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23363/tools/quickbook_backend/detail
Modified Files:
Tag: QUICKBOOK_BACKEND
actions.cpp actions.hpp actions_class.cpp actions_class.hpp
utils.cpp
Log Message:
Translation of more markup to templates. Cleaned up templates, and actions.cpp,
to use template escape "[`xyz]".
Index: actions.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions.cpp,v
retrieving revision 1.49.2.5
retrieving revision 1.49.2.6
diff -u -d -r1.49.2.5 -r1.49.2.6
--- actions.cpp 4 Jul 2007 04:30:53 -0000 1.49.2.5
+++ actions.cpp 10 Jul 2007 03:50:48 -0000 1.49.2.6
@@ -23,7 +23,6 @@
namespace quickbook
{
-
inline collector & backend_action::out() const
{
return out_ ? *out_ : actions.out;
@@ -48,14 +47,18 @@
return str;
}
+ inline void backend_action::out_phrase() const
+ {
+ out() << actions.phrase.str();
+ actions.phrase.clear();
+ }
+
void backend_action::operator()(iterator first, iterator last) const
{
actions.template_info.insert(
actions.template_info.begin(),
this->actions.backend_tag+"_"+this->action_name);
do_template_action::operator()(first,last);
- if (out_) { *out_ << actions.phrase.str(); actions.phrase.clear(); }
- if (phrase_) { *phrase_ << actions.phrase.str();
actions.phrase.clear(); }
}
// Handles line-breaks (DEPRECATED!!!)
@@ -79,12 +82,10 @@
std::string str = pop_phrase();
backend_action::operator()(boost::assign::list_of
- ("'''"+str+"'''")
- //~ (str)
+ (str)
);
- out() << actions.phrase.str();
- actions.phrase.clear();
+ out_phrase();
}
void header_action::operator()(iterator first, iterator last) const
@@ -116,8 +117,7 @@
);
}
- out() << phrase().str();
- phrase().clear();
+ out_phrase();
}
void generic_header_action::operator()(iterator first, iterator last) const
@@ -143,8 +143,7 @@
(boost::lexical_cast<std::string>(level_))
);
- out() << phrase().str();
- phrase().clear();
+ out_phrase();
}
void simple_phrase_action::operator()(iterator first, iterator last) const
@@ -545,7 +544,14 @@
bool is_block = (iter != body.end()) && ((*iter == '\r') || (*iter
== '\n'));
bool r = false;
- if (!is_block)
+ if (actions.template_escape)
+ {
+ // escape the body of the template
+ // we just copy out the literal body
+ result = body;
+ r = true;
+ }
+ else if (!is_block)
{
// do a phrase level parse
iterator first(body.begin(), body.end(),
actions.filename.native_file_string().c_str());
@@ -604,6 +610,7 @@
{
actions.pop(); // restore the actions' states
--actions.template_depth;
+ actions.template_escape = false;
return;
}
@@ -618,6 +625,7 @@
{
actions.pop(); // restore the actions' states
--actions.template_depth;
+ actions.template_escape = false;
return;
}
@@ -634,6 +642,7 @@
<< "Expanding template" << std::endl;
actions.pop(); // restore the actions' states
--actions.template_depth;
+ actions.template_escape = false;
return;
}
}
@@ -641,6 +650,7 @@
actions.pop(); // restore the actions' states
actions.phrase << result; // print it!!!
--actions.template_depth;
+ actions.template_escape = false;
}
void link_action::operator()(iterator first, iterator last) const
Index: actions.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions.hpp,v
retrieving revision 1.36.2.4
retrieving revision 1.36.2.5
diff -u -d -r1.36.2.4 -r1.36.2.5
--- actions.hpp 1 Jul 2007 04:52:19 -0000 1.36.2.4
+++ actions.hpp 10 Jul 2007 03:50:49 -0000 1.36.2.5
@@ -681,6 +681,8 @@
std::string pop_phrase() const;
std::string pop_template_arg() const;
+
+ void out_phrase() const;
};
struct generic_header_action : backend_action
Index: actions_class.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions_class.cpp,v
retrieving revision 1.9.2.4
retrieving revision 1.9.2.5
diff -u -d -r1.9.2.4 -r1.9.2.5
--- actions_class.cpp 1 Jul 2007 04:52:19 -0000 1.9.2.4
+++ actions_class.cpp 10 Jul 2007 03:50:49 -0000 1.9.2.5
@@ -64,6 +64,7 @@
, list_indent(-1)
, template_info()
, template_depth(0)
+ , template_escape(false)
, templates()
// actions
@@ -79,7 +80,7 @@
, code_block(phrase, phrase, temp, source_mode, macro, *this)
, inline_code(phrase, temp, source_mode, macro, *this)
, paragraph("paragraph",*this,boost::none,boost::none)
- , inside_paragraph("paragraph",*this,boost::none,temp_para)
+ , inside_paragraph("paragraph",*this,temp_para,boost::none)
, h("heading",*this)
, h1("heading","1",*this)
, h2("heading","2",*this)
Index: actions_class.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions_class.hpp,v
retrieving revision 1.9.2.4
retrieving revision 1.9.2.5
diff -u -d -r1.9.2.4 -r1.9.2.5
--- actions_class.hpp 1 Jul 2007 04:52:19 -0000 1.9.2.4
+++ actions_class.hpp 10 Jul 2007 03:50:49 -0000 1.9.2.5
@@ -91,6 +91,7 @@
int list_indent;
string_list template_info;
int template_depth;
+ bool template_escape;
template_stack templates;
// push/pop the states and the streams
Index: utils.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/utils.cpp,v
retrieving revision 1.14.2.1
retrieving revision 1.14.2.2
diff -u -d -r1.14.2.1 -r1.14.2.2
--- utils.cpp 1 Jul 2007 04:52:19 -0000 1.14.2.1
+++ utils.cpp 10 Jul 2007 03:50:49 -0000 1.14.2.2
@@ -30,8 +30,8 @@
case '>': out << ">"; break;
case '&': out << "&"; break;
case '"': out << """; break;
- case '[': out << "["; break;
- case ']': out << "]"; break;
+ //~ case '[': out << "["; break;
+ //~ case ']': out << "]"; break;
default: out << ch; break;
// note ' is not included. see the curse of apos:
// http://fishbowl.pastiche.org/2003/07/01/the_curse_of_apos
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs