2
是否有可能以某種方式將「通用」錯誤處理(如本教程中給出的)與Nabialek技巧結合使用?就像這樣:Boost.Spirit,Nabialek技巧和錯誤處理
...
on_error<fail>
(
start
, std::cout
<< val("Error! Expecting ")
<< _4 // what failed?
<< val(" here: \"")
<< construct<std::string>(_3, _2) // iterators to error-pos, end
<< val("\"")
<< std::endl
);
start = *(keyword[_a = _1] > lazy(*_a));
some_other_rule.name("other rule's name");
...
現在,當some_other_rule
是懶惰的,所謂的和失敗,錯誤消息說,"lazy"
逐字預期,而不是"other rule's name"
(我需要)。是否應該這樣工作,我只是在其他地方弄錯了,或者還有其他一些特定的技巧?