return NULL;
}
-void CYCatch::Replace(CYContext &context) { $T()
+namespace cy {
+namespace Syntax {
+
+void Catch::Replace(CYContext &context) { $T()
code_.Replace(context);
}
+} }
+
void CYClause::Replace(CYContext &context) { $T()
context.Replace(case_);
statements_ = statements_->ReplaceAll(context);
context.Replace(initialiser_);
}
+CYProperty *CYDeclarations::Property(CYContext &context) { $T(NULL)
+ return $ CYProperty(declaration_->identifier_, declaration_->initialiser_ ?: $U, next_->Property(context));
+}
+
void CYDeclarations::Replace(CYContext &context) { $T()
declaration_->Replace(context);
next_->Replace(context);
CYStatement *CYForEachIn::Replace(CYContext &context) {
CYVariable *cys($V("$cys")), *cyt($V("$cyt"));
- return $ CYWith($ CYObject($ CYProperty($S("$cys"), $D(0), $ CYProperty($S("$cyt"), $D(0)))), $ CYBlock($$->*
- $E($ CYAssign(cys, set_))->*
+ return $ CYLet($L2($L($I("$cys"), set_), $L($I("$cyt"))), $$->*
$ CYForIn(cyt, cys, $ CYBlock($$->*
$E($ CYAssign(initialiser_->ForEachIn(context), $M(cys, cyt)))->*
code_
))
- ));
+ );
}
CYFunctionParameter *CYForEachInComprehension::Parameter(CYContext &context) const {
return NULL;
}
+CYStatement *CYLet::Replace(CYContext &context) {
+ return $ CYWith($ CYObject(declarations_->Property(context)), &code_);
+}
+
void CYMember::Replace_(CYContext &context) {
context.Replace(object_);
context.Replace(property_);
memcpy(value, value_, size_);
memcpy(value + size_, rhs->value_, rhs->size_);
value[size] = '\0';
- return $S(value);
+ return $S(value, size);
}
CYNumber *CYString::Number(CYContext &context) {
return NULL;
}
-CYStatement *CYThrow::Replace(CYContext &context) {
+namespace cy {
+namespace Syntax {
+
+CYStatement *Throw::Replace(CYContext &context) {
context.Replace(value_);
return NULL;
}
+} }
+
CYExpression *CYTrivial::Replace(CYContext &context) {
return NULL;
}
return $S("true");
}
-CYStatement *CYTry::Replace(CYContext &context) {
+namespace cy {
+namespace Syntax {
+
+CYStatement *Try::Replace(CYContext &context) {
code_.Replace(context);
catch_->Replace(context);
finally_->Replace(context);
return NULL;
}
+} }
+
CYStatement *CYVar::Replace(CYContext &context) {
declarations_->Replace(context);
return NULL;