We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf4a1ec commit ffa5c4eCopy full SHA for ffa5c4e
InputOutput.hpp
100644
100755
@@ -20,16 +20,17 @@ class UserInput : public Expression {
20
};
21
22
class Output : public Tree {
23
+ std::vector<Expression *> out;
24
public:
- Output(Expression *o)
25
- : Tree(o, nullptr) {}
+ Output(std::vector<Expression *> &o)
26
+ : Tree(nullptr, nullptr), out{ o } {}
27
virtual void emit() override {
- Expression *out = dynamic_cast<Expression*>(left);
28
- if (!out || (out->type() != ExpI::StringT)) {
29
- throw std::runtime_error("needs to be a StringExp for output");
30
- }
31
output << indent << "print(";
32
- out->emit();
+ for (auto sep = ""; auto& o : out) {
+ output << sep;
+ o->emit();
+ sep = " + ";
33
+ }
34
output << ");\n";
35
if (right) {
36
right->emit();
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments