Skip to content

Commit

Permalink
module-loader: split resolve/desugar
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Jun 27, 2024
1 parent eaf822f commit 149260a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions base/src/main/java/org/aya/resolve/StmtResolvers.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void resolveBind(@NotNull ImmutableSeq<ResolvingStmt> stmts) {
binder.bind(rename.bindCtx(), rename.bind(), var));
}

private void desugar(@NotNull ImmutableSeq<Stmt> stmts) {
public void desugar(@NotNull ImmutableSeq<Stmt> stmts) {
var salt = new Desalt(info);
stmts.forEach(stmt -> stmt.descentInPlace(salt, salt.pattern()));
}
Expand All @@ -39,7 +39,6 @@ public void resolve(@NotNull ImmutableSeq<Stmt> stmts) {
var resolving = fillContext(stmts);
resolveStmts(resolving); // resolve mutates stmts
resolveBind(resolving); // mutates bind blocks
desugar(stmts);
info.opSet().reportIfCyclic();
}
}
4 changes: 3 additions & 1 deletion base/src/main/java/org/aya/resolve/module/ModuleLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public interface ModuleLoader extends Problematic {
@NotNull ModuleContext context, @NotNull ImmutableSeq<Stmt> program, @NotNull ModuleLoader recurseLoader
) {
var resolveInfo = new ResolveInfo(context, primFactory, shapeFactory, opSet);
new StmtResolvers(recurseLoader, resolveInfo).resolve(program);
var resolver = new StmtResolvers(recurseLoader, resolveInfo);
resolver.resolve(program);
resolver.desugar(program);
return resolveInfo;
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 149260a

Please sign in to comment.