From 149260a1d7265e7e240dc1f9231ca2193291765b Mon Sep 17 00:00:00 2001 From: ice1000 Date: Thu, 27 Jun 2024 03:09:17 -0400 Subject: [PATCH] module-loader: split `resolve`/`desugar` --- base/src/main/java/org/aya/resolve/StmtResolvers.java | 3 +-- base/src/main/java/org/aya/resolve/module/ModuleLoader.java | 4 +++- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/base/src/main/java/org/aya/resolve/StmtResolvers.java b/base/src/main/java/org/aya/resolve/StmtResolvers.java index 98aca0c915..c66b266948 100644 --- a/base/src/main/java/org/aya/resolve/StmtResolvers.java +++ b/base/src/main/java/org/aya/resolve/StmtResolvers.java @@ -27,7 +27,7 @@ private void resolveBind(@NotNull ImmutableSeq stmts) { binder.bind(rename.bindCtx(), rename.bind(), var)); } - private void desugar(@NotNull ImmutableSeq stmts) { + public void desugar(@NotNull ImmutableSeq stmts) { var salt = new Desalt(info); stmts.forEach(stmt -> stmt.descentInPlace(salt, salt.pattern())); } @@ -39,7 +39,6 @@ public void resolve(@NotNull ImmutableSeq stmts) { var resolving = fillContext(stmts); resolveStmts(resolving); // resolve mutates stmts resolveBind(resolving); // mutates bind blocks - desugar(stmts); info.opSet().reportIfCyclic(); } } diff --git a/base/src/main/java/org/aya/resolve/module/ModuleLoader.java b/base/src/main/java/org/aya/resolve/module/ModuleLoader.java index bc0480e6e6..831157b00d 100644 --- a/base/src/main/java/org/aya/resolve/module/ModuleLoader.java +++ b/base/src/main/java/org/aya/resolve/module/ModuleLoader.java @@ -78,7 +78,9 @@ public interface ModuleLoader extends Problematic { @NotNull ModuleContext context, @NotNull ImmutableSeq 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; } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cdeee3fff6..40288994d6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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