java.lang.Object
org.aya.cli.literate.AyaMdParser
-
Constructor Summary
ConstructorsConstructorDescriptionAyaMdParser(@NotNull org.aya.util.error.SourceFile file, @NotNull org.aya.util.reporter.Reporter reporter) -
Method Summary
Modifier and TypeMethodDescription@NotNull StringextractAya(@NotNull org.aya.concrete.remark.Literate literate) Extract all aya code blocks, keep source poses.@Nullable org.aya.util.error.SourcePosfromSourceSpans(@NotNull kala.collection.Seq<org.commonmark.node.SourceSpan> sourceSpans) static @Nullable org.aya.util.error.SourcePosfromSourceSpans(@NotNull org.aya.util.error.SourceFile file, int startFrom, @NotNull kala.collection.Seq<org.commonmark.node.SourceSpan> sourceSpans) Build aSourcePosfrom a list ofSourceSpan@NotNull org.aya.concrete.remark.Literate
-
Constructor Details
-
AyaMdParser
public AyaMdParser(@NotNull @NotNull org.aya.util.error.SourceFile file, @NotNull @NotNull org.aya.util.reporter.Reporter reporter)
-
-
Method Details
-
parseLiterate
@NotNull public @NotNull org.aya.concrete.remark.Literate parseLiterate() -
extractAya
@NotNull public @NotNull String extractAya(@NotNull @NotNull org.aya.concrete.remark.Literate literate) Extract all aya code blocks, keep source poses. Fill the space between two code blocks with comment.Another strategy: create a lexer that can tokenize some pieces of source code
-
fromSourceSpans
@Nullable public @Nullable org.aya.util.error.SourcePos fromSourceSpans(@NotNull @NotNull kala.collection.Seq<org.commonmark.node.SourceSpan> sourceSpans) -
fromSourceSpans
@Contract(pure=true) @Nullable public static @Nullable org.aya.util.error.SourcePos fromSourceSpans(@NotNull @NotNull org.aya.util.error.SourceFile file, int startFrom, @NotNull @NotNull kala.collection.Seq<org.commonmark.node.SourceSpan> sourceSpans) Build aSourcePosfrom a list ofSourceSpan- Parameters:
startFrom- the SourcePos should start from. (inclusive)sourceSpans- a not null sequence- Returns:
- null if an empty sourceSpans
-