Show the variable name when asking the user for some input.

This commit is contained in:
Stefano Sanfilippo 2014-12-02 01:34:39 +01:00
parent 761ce64ca2
commit 8e80aa4969

View File

@ -167,6 +167,10 @@ void Print::emit(std::ostream &stream, int indent) {
} }
void Input::emit(std::ostream &stream, int indent) { void Input::emit(std::ostream &stream, int indent) {
stream << "std::cout << \"";
variable->emit(stream);
stream << "? \";\n";
emitIndent(stream, indent);
stream << "std::cin >> "; stream << "std::cin >> ";
variable->emit(stream); variable->emit(stream);
} }