X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/fd5cdf97150f0c0f2126d61f6e91511cc6b22936..af340def1b563beaf9f7ea38ddc09be7eefd1f4d:/Output.cpp?ds=sidebyside diff --git a/Output.cpp b/Output.cpp index 6022514..12c72df 100644 --- a/Output.cpp +++ b/Output.cpp @@ -1,21 +1,21 @@ /* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2013 Jay Freeman (saurik) + * Copyright (C) 2009-2015 Jay Freeman (saurik) */ -/* GNU General Public License, Version 3 {{{ */ +/* GNU Affero General Public License, Version 3 {{{ */ /* - * Cycript is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * Cycript is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Cycript. If not, see . + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . **/ /* }}} */ @@ -118,8 +118,7 @@ void CYArgument::Output(CYOutput &out) const { if (value_ != NULL) value_->Output(out, CYAssign::Precedence_, CYNoFlags); if (next_ != NULL) { - if (next_->name_ == NULL) - out << ','; + out << ','; out << ' ' << *next_; } } @@ -250,7 +249,7 @@ void CYDeclaration::Output(CYOutput &out, CYFlags flags) const { void CYForDeclarations::Output(CYOutput &out, CYFlags flags) const { out << "var"; - Output(out, CYRight(flags)); + declarations_->Output(out, CYRight(flags)); } void CYDeclarations::Output(CYOutput &out) const { @@ -330,6 +329,10 @@ void CYExpression::Output(CYOutput &out, int precedence, CYFlags flags) const { Output(out, flags); } +void CYExternal::Output(CYOutput &out, CYFlags flags) const { + out << "extern" << abi_ << typed_ << ';'; +} + void CYFatArrow::Output(CYOutput &out, CYFlags flags) const { out << '(' << parameters_ << ')' << ' ' << "=>" << ' ' << code_; } @@ -441,6 +444,10 @@ void CYIfComprehension::Output(CYOutput &out) const { out << "if" << ' ' << '(' << *test_ << ')' << next_; } +void CYImport::Output(CYOutput &out, CYFlags flags) const { + out << "@import"; +} + void CYIndirectMember::Output(CYOutput &out, CYFlags flags) const { object_->Output(out, Precedence(), CYLeft(flags)); if (const char *word = property_->Word()) @@ -548,6 +555,12 @@ void CYLetStatement::Output(CYOutput &out, CYFlags flags) const { code_->Single(out, CYRight(flags)); } +void CYModule::Output(CYOutput &out) const { + out << part_; + if (next_ != NULL) + out << '.' << next_; +} + namespace cy { namespace Syntax {