Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement parsing extensions #123

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Commits on Jun 8, 2016

  1. Implement and expose block parsing API.

    + Document the parser structure for internal usage.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    b8af879 View commit details
    Browse the repository at this point in the history
  2. [API]: parser: Expose 'setter' methods in cmark_parser.

    As opposed to the previous commit, where I exposed getters for
    the private parser structure, this exposes two methods that
    will influence parsing, cmark_parser_add_child and
    cmark_parser_advance_offset.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    f2e9eff View commit details
    Browse the repository at this point in the history
  3. [API]: node: implement and expose cmark_node_set_type.

    This is necessary for extensions implementing vertical rules.
    
    An example is setext headings:
    
    A heading
    ---------
    
    When cmark parses 'A heading', it first creates a paragraph
    block to contain it, it's only when cmark parses the second line
    that the type of the block is changed to the
    CMARK_NODE_TYPE_HEADING type.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    96f966e View commit details
    Browse the repository at this point in the history
  4. [API]: node: implement and expose cmark_node_set_user_data_free_func.

    Ideally, this would be passed in set_user_data, but this would
    break API.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    8075d64 View commit details
    Browse the repository at this point in the history
  5. [API]: node: Expose string_content.

    By implementing cmark_node_get_string_content and
    cmark_node_set_string_content.
    
    This is useful for vertical rules in extensions, as they may need
    to access it in order to decide whether to update the block.
    
    Unfortunately, this overlaps with get_literal and set_literal.
    
    As far as I can tell we should deprecate these functions, and
    have them follow the get_string_content code path and
    set_string_content for the while.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    0839b4b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    19ffd43 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9d8a9dc View commit details
    Browse the repository at this point in the history
  8. Define syntax extensions

    And expose and implement block parsing hooks
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    d2f829f View commit details
    Browse the repository at this point in the history
  9. Implement plugin loading and discovery

    Linux-only support
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    1bc58d0 View commit details
    Browse the repository at this point in the history
  10. cmark executable: add extension switches

    Allow listing and attaching extensions.
    
    Also cleanup valgrind a little by removing exits and using
    cleanup gotos
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    e707529 View commit details
    Browse the repository at this point in the history
  11. Define blocks constituting a table.

    We have no syntax rules yet for creating them natively, but
    future extensions may provide some.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    fe08f83 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    634833c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    228be72 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c174e30 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    315f477 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    5f64582 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7fbb2e6 View commit details
    Browse the repository at this point in the history
  18. cmark_parser: improve lifecycle management.

    This slightly breaks API as finish will now return NULL
    after it has been called once, but I believe that's for the
    best.
    
    This fixes potential leaks of root when a parser was fed but
    not finished, and makes reusing a parser instance multiple
    times possible.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    44b2d76 View commit details
    Browse the repository at this point in the history
  19. syntax-extension: add "priv" field.

    + And pointer to a free function as well.
    MathieuDuponchelle committed Jun 8, 2016
    Configuration menu
    Copy the full SHA
    cf19502 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    389216b View commit details
    Browse the repository at this point in the history