bool analyze(_It& it, _Param& param)
{
_asm nop;
- _It it_backup=it;
+ char c=*it;
T t;
bool b = t.analyze(it, param);
if ( b ){
- if ( *it_backup == '\r' )
+ if ( c == '\r' )
param << _cr_t;
- else if ( *it_backup == '\n' )
+ else if ( c == '\n' )
param << _lf_t;
}
return b;
struct angle_bracket_invalid : public xml_parse_exception{
angle_bracket_invalid() : xml_parse_exception("Angle bracket Invalid.") {} };
- struct comment_invalid_hyphyp : public xml_parse_exception{
- comment_invalid_hyphyp() : xml_parse_exception("The thing including \"--\" cannot be done in the Comment except the terminal.") {} };
+ struct comment_invalid_start : public xml_parse_exception{
+ comment_invalid_start() : xml_parse_exception("Comment Format Invalid. (Need Start \"<!--\")") {} };
+
+ struct comment_invalid_end : public xml_parse_exception{
+ comment_invalid_end() : xml_parse_exception("The thing including \"--\" cannot be done in the Comment except the terminal.") {} };
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
> comment_str;
typedef seq<
- lesser, exclamation, hyphen, hyphen, // <!--
+ lesser, exclamation, // <!
+ false_ret_to_exception<seq<hyphen, hyphen>, // --
+ comment_invalid_start>,
+
comment_str,
+
skip<2>, //hyphen, hyphen // --
false_ret_to_exception<greater, // >
- comment_invalid_hyphyp>
+ comment_invalid_end>
> comment;
//typedef opt_repeat<comment> opt_comments;