Skip to content

Commit 448bb35

Browse files
committed
Cleanup.
1 parent 0dc4d95 commit 448bb35

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
if not faust.exists():
7979
sys.exit(f"Faust executable not found at {faust}")
8080
81-
examples_root = repo_root / "examples"
81+
examples_root = repo_root / "examples" / "reverb"
8282
if not examples_root.exists():
8383
sys.exit(f"Examples directory not found at {examples_root}")
8484

compiler/global.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,25 +2539,25 @@ string global::printHelp()
25392539

25402540
string global::printLibDir()
25412541
{
2542-
namespace fs = std::filesystem;
2542+
namespace fs = std::filesystem;
25432543
fs::path path = fs::path(gFaustRootDir) / "lib";
25442544
return path.string() + '\n';
25452545
}
25462546
string global::printIncludeDir()
25472547
{
2548-
namespace fs = std::filesystem;
2548+
namespace fs = std::filesystem;
25492549
fs::path path = fs::path(gFaustRootDir) / "include";
25502550
return path.string() + '\n';
25512551
}
25522552
string global::printArchDir()
25532553
{
2554-
namespace fs = std::filesystem;
2554+
namespace fs = std::filesystem;
25552555
fs::path path = fs::path(gFaustRootDir) / "share" / "faust";
25562556
return path.string() + '\n';
25572557
}
25582558
string global::printDspDir()
25592559
{
2560-
namespace fs = std::filesystem;
2560+
namespace fs = std::filesystem;
25612561
fs::path path = fs::path(gFaustRootDir) / "share" / "faust";
25622562
return path.string() + '\n';
25632563
}

compiler/parser/enrobage.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <optional>
3232

3333
#include "enrobage.hh"
34-
#include "compatibility.hh"
3534
#include "exception.hh"
3635
#include "garbageable.hh"
3736
#include "global.hh"
@@ -103,17 +102,13 @@ static string& replaceClassName(string& str)
103102
* A minimalistic parser used to recognize '#include <faust/...>' patterns when copying
104103
* architecture files
105104
*/
106-
class myparser {
107-
108-
private:
105+
struct faustparser {
109106

110107
string str;
111108
size_t N;
112109
size_t p;
113-
114-
public:
115-
116-
myparser(const string& s) : str(s), N(s.length()), p(0) {}
110+
111+
faustparser(const string& s) : str(s), N(s.length()), p(0) {}
117112

118113
bool skip()
119114
{
@@ -150,14 +145,14 @@ class myparser {
150145
*/
151146
static bool isFaustInclude(const string& line, string& fname)
152147
{
153-
myparser P(line);
148+
faustparser P(line);
154149
// C/C++ case
155150
if (P.skip() && P.parse("#include") && P.skip() && P.filename(fname)) {
156-
myparser Q(fname);
151+
faustparser Q(fname);
157152
return Q.parse("faust/");
158153
// Julia case
159154
} else if (P.skip() && P.parse("include(") && P.skip() && P.filename(fname)) {
160-
myparser Q(fname);
155+
faustparser Q(fname);
161156
return Q.parse("/usr/local/share/faust/julia");
162157
} else {
163158
return false;
@@ -167,7 +162,6 @@ static bool isFaustInclude(const string& line, string& fname)
167162
/**
168163
* Inject file fname into dst ostream
169164
*/
170-
171165
static void inject(ostream& dst, const string& fname)
172166
{
173167
if (gGlobal->gAlreadyIncluded.find(fname) == gGlobal->gAlreadyIncluded.end()) {
@@ -208,6 +202,7 @@ static bool checkFile(const char* filename)
208202
}
209203
}
210204

205+
// Construct a resolver seeded with all known import search directories maintained in global state
211206
static FileResolver buildImportResolver()
212207
{
213208
FileResolver resolver;
@@ -217,6 +212,7 @@ static FileResolver buildImportResolver()
217212
return resolver;
218213
}
219214

215+
// Construct a resolver seeded with all known architecture search directories maintained in global state
220216
static FileResolver buildArchitectureResolver()
221217
{
222218
FileResolver resolver;
@@ -355,7 +351,6 @@ void streamCopyLicense(istream& src, ostream& dst, const string& exceptiontag)
355351
/**
356352
* Copy src to dst until a specific line
357353
*/
358-
359354
void streamCopyUntil(istream& src, ostream& dst, const string& until)
360355
{
361356
string fname, line;

compiler/parser/sourcereader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include <emscripten.h>
4040
#endif
4141

42-
#include "compatibility.hh"
4342
#include "sourcereader.hh"
4443
#include "sourcefetcher.hh"
4544
#include "enrobage.hh"
@@ -197,9 +196,10 @@ void SourceReader::checkName()
197196
if (gGlobal->gMasterDocument == FAUSTfilename) {
198197
Tree name = tree("name");
199198
if (gGlobal->gMetaDataSet.find(name) == gGlobal->gMetaDataSet.end()) {
200-
gGlobal->gMetaDataSet[name].insert(tree(quote(stripEnd(basename((char*)FAUSTfilename), ".dsp"))));
199+
string base = fileBasename(FAUSTfilename);
200+
gGlobal->gMetaDataSet[name].insert(tree(quote(stripEnd(base, ".dsp"))));
201201
}
202-
gGlobal->gMetaDataSet[tree("filename")].insert(tree(quote(basename((char*)FAUSTfilename))));
202+
gGlobal->gMetaDataSet[tree("filename")].insert(tree(quote(fileBasename(FAUSTfilename))));
203203
}
204204
}
205205

0 commit comments

Comments
 (0)