Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions compiler/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1661,8 +1661,9 @@ bool global::processCmdline(int argc, const char* argv[])
// Check options coherency
// ========================

if (gRustNoTraitSwitch && gOutputLang != "rust") {
throw faustexception("ERROR : '-rnt' option can only be used with rust\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't remove valid code.

if (option_i && targetLang == "rust") {
std::cerr << "Warning: The -i flag has no effect when compiling to Rust." << std::endl;
option_i = false; // Disable the flag for Rust
}

if (!gRustNoTraitSwitch && gInPlace && gOutputLang == "rust") {
Expand Down
9 changes: 7 additions & 2 deletions compiler/parser/enrobage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ class myparser {
/**
* True if string s match '#include <faust/fname>' or include("/usr/local/share/faust/julia/fname")
*/
static bool isFaustInclude(const string& line, string& fname)
static bool isFaustInclude(const string& line, string& fname, const string& targetLang){

if (targetLang == "rust") {
return false;

}
{
myparser P(line);
// C/C++ case
Expand All @@ -154,7 +159,7 @@ static bool isFaustInclude(const string& line, string& fname)
myparser Q(fname);
return Q.parse("/usr/local/share/faust/julia");
} else {
return false;
return true;
}
}

Expand Down