Conversation
danmar
left a comment
There was a problem hiding this comment.
hmm these functions are for usage in the debugger. will I be able to call these during debugging? I guess std::cout symbol is not available while I debug inside the simplecpp.
We don't need to have these functions in release builds? would that solve your itch?
|
Not directly specifying any stream is good style as you do not want some "random" print something. It would also allow to use it in more contexts. Not sure about calling it directly from the debugger since I rarely do that. I thought about adding a default parameter but I did not want to have the |
jcfr
left a comment
There was a problem hiding this comment.
Integrating the proposed API while maintaining the possibility to just call the function seems like a reasonable trade-off to finalize this.
| void printAll() const; | ||
| void printOut() const; | ||
| void printAll(std::ostream& ostr) const; | ||
| void printOut(std::ostream& ostr) const; |
There was a problem hiding this comment.
| void printOut(std::ostream& ostr) const; | |
| void printOut(std::ostream& ostr) const; | |
| void printAll() const { | |
| this->printAll(std::cout); | |
| } | |
| void printOut() const { | |
| this->printOut(std::cout); | |
| } |
| void push_back(Token *tok); | ||
|
|
||
| void dump() const; | ||
| void dump(std::ostream& ostr) const; |
There was a problem hiding this comment.
| void dump(std::ostream& ostr) const; | |
| void dump(std::ostream& ostr) const; | |
| void dump() const { | |
| this->dump(std::cout); | |
| } |
Like I said that would introduce the Also we could use default parameters which would require less code. |
No description provided.