Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ jobs:
- name: Test with Maven
run: mvn -B --update-snapshots compile test

- name: Publish Test Reports
if: ${{ !cancelled() }}
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'target/rascal-test-reports/*.json'
github-report: true
file-report: true
pull-request-report: true
summary-delta-report: true
insights-report: true
fail-rate-report: true
slowest-report: true
upload-artifact: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Attach artifact
id: build-artifact
uses: SWAT-engineering/maven-full-artifacts-action@v1
Expand Down
40 changes: 9 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<plugin>
<groupId>org.rascalmpl</groupId>
<artifactId>rascal-maven-plugin</artifactId>
<version>0.30.3</version>
<version>0.32.0-RC7</version>
<configuration>
<errorsAsWarnings>false</errorsAsWarnings>
<bin>${project.build.outputDirectory}</bin>
Expand All @@ -81,14 +81,20 @@
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>it-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
<execution>
<id>default-cli</id>
<phase>compile</phase>
<goals>
<goal>tutor</goal>
</goals>
<configuration>
<enableStandardLibrary>true</enableStandardLibrary>
<errorsAsWarnings>false</errorsAsWarnings>
<bin>${project.build.outputDirectory}</bin>
<sources>|http://github.com/usethesource/clair/blob/main|</sources>
Expand Down Expand Up @@ -119,43 +125,15 @@
<arguments>-Drascal.compile.skip -DskipTests -Drascal.tutor.skip</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<configuration>
<argLine>
-ea
-Xmx2G
-Xss128m
-Dfile.encoding=UTF-8
</argLine>
<includes>
<include>**/*Tests.java</include>
</includes>
<testSourceDirectory>${basedir}/src/</testSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>org.rascalmpl</groupId>
<artifactId>rascal</artifactId>
<version>0.41.2</version>
<version>0.43.0-RC17</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions src/lang/cpp/internal/BindingsResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class BindingsResolver {
public ISetWriter containment;

private ISourceLocation translationUnit;
private ISourceLocation translationUnitRoot = URIUtil.rootLocation("cpp+translationUnit");
private ISourceLocation translationUnitRoot = URIUtil.rootLocation("cpp+translationunit");

private void out(String msg) {
// stdOut.println(spaces() + msg.replace("\n", "\n" + spaces()));
Expand Down Expand Up @@ -170,7 +170,7 @@ public BindingsResolver(IValueFactory vf, PrintWriter stdOut, PrintWriter stdErr
this.vf = vf;
this.stdErr = stdErr;
this.containment = vf.setWriter();
this.translationUnit = URIUtil.rootLocation("cpp+translationUnit");
this.translationUnit = URIUtil.rootLocation("cpp+translationunit");
this.NYI = makeBinding("NYI", null, null);
this.FIXME = makeBinding("FIXME", null, null);
}
Expand All @@ -183,9 +183,9 @@ private ISourceLocation ownedBinding(IBinding binding, String scheme, String pos
String name = renameOperators(binding.getName()) + postfix;
ISourceLocation ownerLocation = resolveOwner(binding, origin);
ISourceLocation location = null;
boolean isAtRoot = "cpp+translationUnit".equals(ownerLocation.getScheme());
boolean isAtRoot = "cpp+translationunit".equals(ownerLocation.getScheme());

// * When we are at the root, we want a different parent from |cpp+translationUnit:///| as containment parent; name it should contain the file name from `translationUnit`
// * When we are at the root, we want a different parent from |cpp+translationunit:///| as containment parent; name it should contain the file name from `translationUnit`
// * Also when we are the root, `static` variables and functions need to be prefixed with the file name because they are local to the current translationUnit

if (isStatic) {
Expand Down
21 changes: 11 additions & 10 deletions src/lang/cpp/internal/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.core.runtime.CoreException;
import org.rascalmpl.debug.IRascalMonitor;
import org.rascalmpl.ast.AbstractAST;
import org.rascalmpl.exceptions.RuntimeExceptionFactory;
import org.rascalmpl.interpreter.Evaluator;
import org.rascalmpl.uri.URIUtil;
Expand Down Expand Up @@ -303,7 +304,7 @@ public IList parseFiles(IList files, IString charset, IBool inferCharset, IList
IASTTranslationUnit tu = parser.parseFileAsCpp(file, charset, inferCharset);
try {
IValue result = convertCdtToRascal(tu, false);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath());
result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl);
asts.append(result);
}
Expand All @@ -330,11 +331,11 @@ public IValue parseC(ISourceLocation file, IString charset, IBool inferCharset,

try {
IValue result = convertCdtToRascal(tu, false);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath());
result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl);

if (result == null) {
throw RuntimeExceptionFactory.parseError(file, null, null);
throw RuntimeExceptionFactory.parseError(file, (AbstractAST) null, null);
}
return result;
}
Expand All @@ -358,10 +359,10 @@ public IValue parseCpp(ISourceLocation file, IString charset, IBool inferCharset

try {
IValue result = convertCdtToRascal(tu, false);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath());
result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl);
if (result == null) {
throw RuntimeExceptionFactory.parseError(file, null, null);
throw RuntimeExceptionFactory.parseError(file, (AbstractAST) null, null);
}
return result;
}
Expand All @@ -380,7 +381,7 @@ public ITuple parseCToM3AndAst(ISourceLocation file, IString charset, IBool infe
this.stdLib = stdLib;

IValue m3 = builder.M3_m3(file);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath());
br.setTranslationUnit(tuDecl);
CDTParser parser = new CDTParser(vf,stdOut, stdErr, stdLib, includeDirs, standardMacros, additionalMacros,
includeStdLib.getValue());
Expand Down Expand Up @@ -438,7 +439,7 @@ public ITuple parseCppToM3AndAst(ISourceLocation file, IString charset, IBool in
this.stdLib = stdLib;

IValue m3 = builder.M3_m3(file);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath());
br.setTranslationUnit(tuDecl);
CDTParser parser = new CDTParser(vf, stdOut, stdErr, stdLib, includeDirs, standardMacros, additionalMacros,
includeStdLib.getValue());
Expand Down Expand Up @@ -621,7 +622,7 @@ public IValue parseString(IString code, ISourceLocation loc) throws CoreExceptio

try {
IValue result = convertCdtToRascal(tu, false);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", loc == null ? "" : loc.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", loc == null ? "" : loc.getPath());
return ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl);
}
catch (NullPointerException e) {
Expand Down Expand Up @@ -650,7 +651,7 @@ public IValue convertCdtToRascal(IASTTranslationUnit translationUnit, boolean to
stack.iterator().forEachRemaining(it -> err(it.toString()));

ISourceLocation file = locs.forNode(translationUnit);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath());
return ast.asWithKeywordParameters().setParameter("decl", tuDecl);
}

Expand Down Expand Up @@ -823,7 +824,7 @@ public int visit(IASTTranslationUnit tu) {
boolean isMacroExpansion = isMacroExpansion(tu);
IListWriter declarations = vf.listWriter();
ISourceLocation tuLoc = locs.forNode(tu);
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", tuLoc.getPath());
ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", tuLoc.getPath());

monitor.jobStart("ClaiR AST marshalling");
declLoop: for (IASTDeclaration declaration : tu.getDeclarations()) {
Expand Down
12 changes: 0 additions & 12 deletions src/lang/cpp/internal/RunTests.java

This file was deleted.

Loading