Skip to content

Commit

Permalink
Merge pull request #78 from usethesource/77-parsefiles-contains-debug…
Browse files Browse the repository at this point in the history
…-prints

Remove debug prints
  • Loading branch information
jurgenvinju authored Dec 29, 2023
2 parents bd0b80d + 8b13b24 commit d7fad14
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/lang/cpp/internal/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,6 @@ public IList parseFiles(IList files, IString charset, IBool inferCharset, IList
CDTParser parser = new CDTParser(vf, stdOut, stdErr, stdLib, includeDirs, standardMacros, additionalMacros,
includeStdLib.getValue());
monitor.jobStart("ClaiR parseFiles");
Instant begin = Instant.now();
out("Beginning at " + begin.toString());
IListWriter asts = vf.listWriter();
for (IValue v : files) {
if (monitor.jobIsCanceled("ClaiR parseFiles")) {
Expand All @@ -316,9 +314,6 @@ public IList parseFiles(IList files, IString charset, IBool inferCharset, IList
}
}

Instant done = Instant.now();
out("Parsing and marshalling " + files.size() + " files took "
+ (Duration.between(begin, done).toMillis() * 1.0d) / 1000 + "seconds");
reset();
monitor.jobEnd("ClaiR parseFiles", true);

Expand Down Expand Up @@ -358,22 +353,14 @@ public IValue parseCpp(ISourceLocation file, IString charset, IBool inferCharset
this.includeStdLib = includeStdLib.getValue() || stdLib.isEmpty();
this.stdLib = stdLib;

Instant begin = Instant.now();
out("Beginning at " + begin.toString());
CDTParser parser = new CDTParser(vf, stdOut, stdErr, stdLib, includeDirs, standardMacros, additionalMacros,
includeStdLib.getValue());
IASTTranslationUnit tu = parser.parseFileAsCpp(file, charset, inferCharset);
Instant between = Instant.now();
out("CDT took " + (Duration.between(begin, between).toMillis() * 1.0d) / 1000 + "seconds");

try {
IValue result = convertCdtToRascal(tu, false);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl);
Instant done = Instant.now();
out("Marshalling took " + (Duration.between(between, done).toMillis() * 1.0d) / 1000
+ "seconds");

if (result == null) {
throw RuntimeExceptionFactory.parseError(file, null, null);
}
Expand Down

0 comments on commit d7fad14

Please sign in to comment.