double CYCastDouble(CYUTF8String value);
void CYNumerify(std::ostringstream &str, double value);
-void CYStringify(std::ostringstream &str, const char *data, size_t size, bool c = false);
+
+enum CYStringifyMode {
+ CYStringifyModeLegacy,
+ CYStringifyModeCycript,
+ CYStringifyModeNative,
+};
+
+void CYStringify(std::ostringstream &str, const char *data, size_t size, CYStringifyMode mode);
// XXX: this really should not be here ... :/
void *CYPoolFile(CYPool &pool, const char *path, size_t *psize);
struct CYExpression;
struct CYAssignment;
struct CYIdentifier;
+struct CYNumber;
struct CYPropertyName {
virtual bool Computed() const {
return NULL;
}
+ virtual CYNumber *Number(CYContext &context) {
+ return NULL;
+ }
+
virtual CYExpression *PropertyName(CYContext &context) = 0;
virtual void PropertyName(CYOutput &out) const = 0;
};
CYPrecedence(0)
+ virtual CYString *String(CYContext &context);
+
virtual CYTarget *Replace(CYContext &context);
virtual void Output(CYOutput &out, CYFlags flags) const;
};
virtual void Output(CYOutput &out, CYFlags flags) const;
};
+struct CYAttemptMember :
+ CYMember
+{
+ CYAttemptMember(CYExpression *object, CYExpression *property) :
+ CYMember(object, property)
+ {
+ }
+
+ CYPrecedence(1)
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
struct CYIndirectMember :
CYMember
{
virtual void Output(CYOutput &out) const;
};
+struct CYTypeFloating :
+ CYTypeSpecifier
+{
+ int length_;
+
+ CYTypeFloating(int length) :
+ length_(length)
+ {
+ }
+
+ virtual CYTarget *Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
struct CYTypeVoid :
CYTypeSpecifier
{