Skip to content

Commit

Permalink
deps: upgrade upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
imkiva committed Apr 13, 2023
1 parent f66bd45 commit 09d3294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/deps.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version.project=0.0.1-SNAPSHOT
version.aya=0.29-SNAPSHOT
version.aya-upstream=0.0.9
version.aya-upstream=0.0.12
12 changes: 7 additions & 5 deletions src/main/java/org/aya/intellij/language/AyaIJParserImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import kala.collection.SeqView;
import kala.collection.immutable.ImmutableSeq;
import kala.control.Either;
import kala.text.StringSlice;
import org.aya.cli.parse.AyaProducer;
import org.aya.concrete.Expr;
import org.aya.concrete.GenericAyaParser;
Expand All @@ -28,7 +29,7 @@

public record AyaIJParserImpl(@NotNull Project project, @NotNull Reporter reporter) implements GenericAyaParser {
@Override public @NotNull Expr expr(@NotNull String code, @NotNull SourcePos overridingSourcePos) {
var producer = new AyaProducer(Either.right(overridingSourcePos), reporter);
var producer = new AyaProducer(code, Either.right(overridingSourcePos), reporter);
var expr = (AyaPsiElement) AyaPsiFactory.expr(project, code);
return producer.expr(new ASTGenericNode(expr.getNode()));
}
Expand All @@ -40,8 +41,9 @@ public record AyaIJParserImpl(@NotNull Project project, @NotNull Reporter report
if (!(psiFile instanceof AyaPsiFile ayaFile))
throw new IllegalArgumentException("File not found in IntelliJ documents: " + codeFile.display());
// TODO: support literate mode
var updated = new SourceFile(codeFile.display(), codeFile.underlying(), ayaFile.getText());
var producer = new AyaProducer(Either.left(updated), reporter);
var code = ayaFile.getText();
var updated = new SourceFile(codeFile.display(), codeFile.underlying(), code);
var producer = new AyaProducer(code, Either.left(updated), reporter);
return producer.program(new ASTGenericNode(ayaFile.getNode())).getLeftValue();
});
}
Expand All @@ -51,8 +53,8 @@ public record ASTGenericNode(@NotNull ASTNode node) implements GenericNode<ASTGe
return node.getElementType();
}

@Override public @NotNull String tokenText() {
return node.getText();
@Override public @NotNull StringSlice tokenText() {
return StringSlice.of(node.getText());
}

@Override public @NotNull TextRange range() {
Expand Down

0 comments on commit 09d3294

Please sign in to comment.