Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-i flag to languages #1113

Open
wants to merge 1 commit into
base: master-dev
Choose a base branch
from
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");
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