Skip to content

Commit

Permalink
implement ec flag
Browse files Browse the repository at this point in the history
  • Loading branch information
crop2000 committed Nov 10, 2024
1 parent 0cda84a commit 1c38dcf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions compiler/generator/rust/rust_code_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,17 @@ void RustCodeContainer::produceClass()
// Parameter getter/setter
produceParameterGetterSetter(n + 1, parameterLookup);

// Control
if (gGlobal->gExtControl) {
tab(n + 1, *fOut);
tab(n + 1, *fOut);
*fOut << "fn control(&mut self) {";
tab(n + 2, *fOut);
generateControlDeclarations(&fCodeProducer);
back(1, *fOut);
*fOut << "}";
}

// Compute
generateCompute(n + 1);
generateComputeInterface(n + 1);
Expand Down
4 changes: 2 additions & 2 deletions compiler/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,9 +1684,9 @@ bool global::processCmdline(int argc, const char* argv[])
"backends\n");
}

if (gExtControl && gOutputLang != "cpp" && gOutputLang != "c" && gOutputLang != "cmajor") {
if (gExtControl && gOutputLang != "cpp" && gOutputLang != "c" && gOutputLang != "cmajor" && gOutputLang != "rust") {
throw faustexception(
"ERROR : '-ec' option can only be used with 'cpp', 'c' or 'cmajor' "
"ERROR : '-ec' option can only be used with 'cpp', 'c', 'cmajor' or 'rust' "
"backends\n");
}

Expand Down

0 comments on commit 1c38dcf

Please sign in to comment.