/* 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 <http://www.gnu.org/licenses/>.
+ * 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 <http://www.gnu.org/licenses/>.
**/
/* }}} */
} break;
case sig::bit_P: _assert(false); break;
- case sig::char_P: return $ CYTypedIdentifier($ CYTypeVariable("char"));
+ case sig::schar_P: return $ CYTypedIdentifier($ CYTypeSigned($ CYTypeVariable("char")));
case sig::double_P: return $ CYTypedIdentifier($ CYTypeVariable("double"));
case sig::float_P: return $ CYTypedIdentifier($ CYTypeVariable("float"));
case sig::int_P: return $ CYTypedIdentifier($ CYTypeVariable("int"));
case sig::short_P: return $ CYTypedIdentifier($ CYTypeShort($ CYTypeVariable("int")));
case sig::void_P: return $ CYTypedIdentifier($ CYTypeVoid());
+ case sig::char_P: return $ CYTypedIdentifier($ CYTypeVariable("char"));
case sig::struct_P: {
- _assert(type->name != NULL);
- return $ CYTypedIdentifier($ CYTypeVariable(type->name));
+ CYTypeStructField *fields(NULL);
+ for (size_t i(type->data.signature.count); i != 0; --i) {
+ sig::Element &element(type->data.signature.elements[i - 1]);
+ CYTypedIdentifier *typed(Decode(pool, element.type));
+ if (element.name != NULL)
+ typed->identifier_ = $I(element.name);
+ fields = $ CYTypeStructField(typed, fields);
+ }
+ CYIdentifier *name(type->name == NULL ? NULL : $I(type->name));
+ return $ CYTypedIdentifier($ CYTypeStruct(name, $ CYStructTail(fields)));
} break;
}