57 edits += _parent->bubble_edit(e,
true);
60 if (!args_expansion_done()) {
61 edits += edit_trailing_args(e,_cur_arg);
63 edits += edit_buf(_value,e);
65 if (edits && _parent) {
66 edits += _parent->bubble_edit(e,
true);
69 if (edits && !_parent) {
70 report_intermediate_value();
79 for (
auto i = seek_expandable_arg();
80 i != args().size(); ++_cur_arg,
81 i = seek_expandable_arg()) {
82 edits += expand(args()[i]);
84 edits += substitute();
85 }
else if (!callee()->defn()) {
88 }
else if (callee()->defn()->empty()) {
93 _value = callee()->format()->str();
97 edits += bubble_edit(*
this,
false);
98 report_intermediate_value();
100 return edits += expand(_value);
112 chew = off + sym->
id().length();
125 <<
"Macro expansion of \"" << eb.reference::invocation()
126 <<
"\" abandoned. Will exceed max expansion size "
127 << max_expansion_size() <<
" bytes" <<
emit();
131 if (str.compare(off,e.
value().size(),e.
value()) == 0) {
136 edits += edit_buf(str,e,off + e.
invocation().size());
137 edits += edit_trailing_args(e,_cur_arg + 1);
139 edits += bubble_edit(e,
false);
140 report_intermediate_value();
148 if (!_parent && explaining()) {
149 cout <<
"Edit #" << setw(3) << setfill(
'0') << ++_step <<
": >>"
150 << (args_expansion_done() ? value() : invocation())
struct symbol::locator encapsulates a symbol table entry.
bool in_progress() const
Say whether a determination the symbol's state is in progress.
static locator find_any_in(chewer< CharSeq > &chew, size_t &off)
Search a terminal portion of a CharSeq for any known symbol name.
std::string const & id() const
Get the name of the symbol.
bool configured() const
Say whether the symbol is configured.
warning_msg< 35 > warning_incomplete_expansion
Report a macro reference not fully expanded.
struct explained_expansion encapsulates macro-expansion of a reference when the --explain option is o...
The tag class is inserted in a diagnostic_base to tell it to emit itself.
unsigned expand() override
Perform the explained expansion of the reference, returning the numbe of edits applied.
`template struct chewer<CharSeq> is a cursor-like type that is associated with a character-sequence t...
std::string const & value() const
Get the current expanded value of the reference.
struct expansion_base is an abstract base for classes that encapsulate a mode of macro-expansion of a...
std::string const & invocation() const override
Get a string representing the invocation of the reference with the current expansions of its argument...
void report_intermediate_value()
Report the latest value of the expansion.
unsigned bubble_edit(explained_expansion const &e, bool do_self=true)
Recursively replace remaining occurrences of a reference in the parents of this explained_expansion a...