Module aya.cli.impl

Class AyaMdParser

java.lang.Object
org.aya.literate.parser.BaseMdParser
org.aya.cli.literate.AyaMdParser

public class AyaMdParser extends org.aya.literate.parser.BaseMdParser
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.aya.literate.parser.BaseMdParser

    org.aya.literate.parser.BaseMdParser.StripTrailing
  • Field Summary

    Fields inherited from class org.aya.literate.parser.BaseMdParser

    file, languages, linesIndex, reporter
  • Constructor Summary

    Constructors
    Constructor
    Description
    AyaMdParser(@NotNull org.aya.util.error.SourceFile file, @NotNull org.aya.util.reporter.Reporter reporter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    extractAya(@NotNull org.aya.literate.Literate literate)
    Extract all aya code blocks, keep source poses.
    protected @NotNull org.aya.literate.Literate
    mapNode(@NotNull org.commonmark.node.Node node)
     
    protected org.commonmark.parser.Parser.Builder
     

    Methods inherited from class org.aya.literate.parser.BaseMdParser

    collectChildren, etching, flatten, fromSourceSpans, fromSourceSpans, mapChildren, parseLiterate, stripTrailingNewline

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AyaMdParser

      public AyaMdParser(@NotNull @NotNull org.aya.util.error.SourceFile file, @NotNull @NotNull org.aya.util.reporter.Reporter reporter)
  • Method Details

    • parserBuilder

      @NotNull protected org.commonmark.parser.Parser.Builder parserBuilder()
      Overrides:
      parserBuilder in class org.aya.literate.parser.BaseMdParser
    • extractAya

      @NotNull public @NotNull String extractAya(@NotNull @NotNull org.aya.literate.Literate literate)
      Extract all aya code blocks, keep source poses. Replacing non-code content with whitespaces.

      Another strategy: create a lexer that can tokenize some pieces of source code

    • mapNode

      @NotNull protected @NotNull org.aya.literate.Literate mapNode(@NotNull @NotNull org.commonmark.node.Node node)
      Overrides:
      mapNode in class org.aya.literate.parser.BaseMdParser