}
CYExpression *CYArray::Replace(CYContext &context) {
- elements_->Replace(context);
+ if (elements_ != NULL)
+ elements_->Replace(context);
return this;
}
next_->Replace(context);
}
-CYStatement *CYComment::Replace(CYContext &context) {
- return this;
-}
-
CYExpression *CYCompound::Replace(CYContext &context) {
context.Replace(expression_);
context.Replace(next_);
return this;
}
-void CYElement::Replace(CYContext &context) { $T()
+void CYElementSpread::Replace(CYContext &context) {
context.Replace(value_);
- next_->Replace(context);
+}
+
+void CYElementValue::Replace(CYContext &context) {
+ context.Replace(value_);
+ if (next_ != NULL)
+ next_->Replace(context);
}
CYStatement *CYEmpty::Replace(CYContext &context) {
typedef std::set<CYIdentifier *, IdentifierUsageLess> IdentifierUsages;
}
-void CYProgram::Replace(CYContext &context) {
+void CYScript::Replace(CYContext &context) {
CYScope scope(true, context);
context.nextlocal_ = $ CYNonLocal();
}
}
+CYElementValue *CYSpan::Replace(CYContext &context) { $T(NULL)
+ return $ CYElementValue(expression_, $ CYElementValue(string_, next_->Replace(context)));
+}
+
CYStatement *CYStatement::Return() {
return this;
}
return this;
}
+CYExpression *CYTemplate::Replace(CYContext &context) {
+ return $C2($M($M($M($V("String"), $S("prototype")), $S("concat")), $S("apply")), $S(""), $ CYArray($ CYElementValue(string_, spans_->Replace(context))));
+}
+
CYExpression *CYThis::Replace(CYContext &context) {
if (context.this_ != NULL)
return $V(context.this_->Identifier(context));