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
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Arend is split into several subprojects:
|`api`|open API for writing Arend extensions.|
|`base`|the Arend typechecker.<br/>It depends on `api`, `proto`.|
|`cli`|the CLI frontend of Arend with the ANTLR parser.<br/>It depends on `base`, `parser`, `api`, `proto`.|
|`tester`|Helper for writing unit tests with JUnit4.<br/>It depends on `base`, `parser`, `api`, `cli`.|

The purpose of `parser` is to avoid introducing the dependency of the ANTLR
generator to other subprojects which only requires
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ dependencies {
implementation "com.github.JetBrains.Arend:proto:$arendVersion"
// The main compiler
implementation "com.github.JetBrains.Arend:base:$arendVersion"
// The unit test helpers
testImplementation "com.github.JetBrains.Arend:tester:$arendVersion"
}
```

Expand All @@ -58,5 +60,6 @@ dependencies {
implementation("com.github.JetBrains.Arend:parser:$arendVersion")
implementation("com.github.JetBrains.Arend:proto:$arendVersion")
implementation("com.github.JetBrains.Arend:base:$arendVersion")
testImplementation("com.github.JetBrains.Arend:tester:$arendVersion")
}
```
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ dependencies {
testImplementation(project(":base"))
testImplementation(project(":parser"))
testImplementation(project(":cli"))
testImplementation(project(":tester"))

testImplementation("junit:junit:4.12")
testImplementation("org.hamcrest:hamcrest-library:1.3")
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ include(
"base",
"cli",
"proto",
"tester",
"parser"
)
18 changes: 18 additions & 0 deletions tester/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
java
}

dependencies {
val annotationsVersion: String by rootProject.ext
val antlrVersion: String by rootProject.ext
implementation("org.jetbrains:annotations:$annotationsVersion")
implementation("org.antlr:antlr4-runtime:$antlrVersion")

implementation(project(":api"))
implementation(project(":base"))
implementation(project(":parser"))
implementation(project(":cli"))

implementation("junit:junit:4.12")
implementation("org.hamcrest:hamcrest-library:1.3")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.arend.naming;

import org.arend.ArendTestCase;
import org.arend.core.context.binding.Binding;
import org.arend.frontend.ConcreteReferableProvider;
import org.arend.frontend.reference.ConcreteLocatedReferable;
Expand Down Expand Up @@ -60,7 +61,7 @@ ChildGroup resolveNamesDefGroup(String text, int errors) {
ChildGroup group = parseDef(text);
Scope parentScope = new MergeScope(new SingletonScope(group.getReferable()), PreludeLibrary.getPreludeScope());
new DefinitionResolveNameVisitor(ConcreteReferableProvider.INSTANCE, errorReporter).resolveGroupWithTypes(group, null, CachingScope.make(LexicalScope.insideOf(group, parentScope)));
assertThat(errorList, containsErrors(errors));
assertThat(errorList, ArendTestCase.containsErrors(errors));
return group;
}

Expand All @@ -81,7 +82,7 @@ private void resolveNamesModule(ChildGroup group, int errors) {
Scope scope = CachingScope.make(ScopeFactory.forGroup(group, moduleScopeProvider));
new DefinitionResolveNameVisitor(ConcreteReferableProvider.INSTANCE, errorReporter).resolveGroupWithTypes(group, null, scope);
libraryManager.getInstanceProviderSet().collectInstances(group, CachingScope.make(ScopeFactory.parentScopeForGroup(group, moduleScopeProvider, true)), ConcreteReferableProvider.INSTANCE, null);
assertThat(errorList, containsErrors(errors));
assertThat(errorList, ArendTestCase.containsErrors(errors));
}

protected ChildGroup resolveNamesModule(String text, int errors) {
Expand Down