CYIdentifier *Replace(CYContext &context);
};
-struct CYComment :
- CYStatement
-{
- const char *value_;
-
- CYComment(const char *value) :
- value_(value)
- {
- }
-
- CYCompact(None)
-
- virtual CYStatement *Replace(CYContext &context);
- virtual void Output(CYOutput &out, CYFlags flags) const;
-};
-
struct CYLabel :
CYStatement
{
virtual void PropertyName(CYOutput &out) const;
};
+struct CYElementValue;
+
+struct CYSpan :
+ CYNext<CYSpan>
+{
+ CYExpression *expression_;
+ CYString *string_;
+
+ CYSpan(CYExpression *expression, CYString *string, CYSpan *next) :
+ CYNext<CYSpan>(next),
+ expression_(expression),
+ string_(string)
+ {
+ }
+
+ CYElementValue *Replace(CYContext &context);
+};
+
+struct CYTemplate :
+ CYExpression
+{
+ CYString *string_;
+ CYSpan *spans_;
+
+ CYTemplate(CYString *string, CYSpan *spans) :
+ string_(string),
+ spans_(spans)
+ {
+ }
+
+ CYPrecedence(0)
+ CYRightHand(false)
+
+ virtual CYExpression *Replace(CYContext &context);
+ virtual void Output(CYOutput &out, CYFlags flags) const;
+};
+
struct CYNumber :
CYTrivial,
CYPropertyName
};
struct CYElement :
- CYNext<CYElement>,
CYThing
+{
+ virtual bool Elision() const = 0;
+
+ virtual void Replace(CYContext &context) = 0;
+};
+
+struct CYElementValue :
+ CYNext<CYElement>,
+ CYElement
{
CYExpression *value_;
- CYElement(CYExpression *value, CYElement *next) :
+ CYElementValue(CYExpression *value, CYElement *next) :
CYNext<CYElement>(next),
value_(value)
{
}
- void Replace(CYContext &context);
- void Output(CYOutput &out) const;
+ virtual bool Elision() const {
+ return value_ == NULL;
+ }
+
+ virtual void Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
+};
+
+struct CYElementSpread :
+ CYElement
+{
+ CYExpression *value_;
+
+ CYElementSpread(CYExpression *value) :
+ value_(value)
+ {
+ }
+
+ virtual bool Elision() const {
+ return false;
+ }
+
+ virtual void Replace(CYContext &context);
+ virtual void Output(CYOutput &out) const;
};
struct CYArray :