out << ')';
}
-void CYCatch::Output(CYOutput &out) const {
+namespace cy {
+namespace Syntax {
+
+void Catch::Output(CYOutput &out) const {
out << ' ' << "catch" << ' ' << '(' << *name_ << ')' << ' ' << code_;
}
+} }
+
void CYCompound::Output(CYOutput &out, CYFlags flags) const {
if (CYExpression *expression = expressions_)
if (CYExpression *next = expression->next_) {
}
void CYNumber::Output(CYOutput &out, CYFlags flags) const {
- char value[32];
- // XXX: I want this to print 1e3 rather than 1000
- sprintf(value, "%.17g", Value());
- out << value;
+ std::ostringstream str;
+ CYNumerify(str, Value());
+ out << str.str().c_str();
}
void CYNumber::PropertyName(CYOutput &out) const {
CYWord::Output(out);
}
-void CYThrow::Output(CYOutput &out, CYFlags flags) const {
+namespace cy {
+namespace Syntax {
+
+void Throw::Output(CYOutput &out, CYFlags flags) const {
out << "throw";
if (value_ != NULL)
out << ' ' << *value_;
out << ';';
}
-void CYTry::Output(CYOutput &out, CYFlags flags) const {
+void Try::Output(CYOutput &out, CYFlags flags) const {
out << "try" << ' ' << code_ << catch_ << finally_;
}
+} }
+
void CYVar::Output(CYOutput &out, CYFlags flags) const {
out << "var";
declarations_->Output(out, flags);