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

Lua: extract marshaling code to pandoc-lua-marshal package #7719

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented Nov 26, 2021

The marshaling functions for pandoc's AST are extracted into a separate
package. The switch comes with a number of changes:

  • Pandoc's List module was rewritten in C, thereby improving error
    messages.

  • Data files pandoc.lua and pandoc.List.lua have been removed.

  • Lists of Block and Inline elements are marshaled using the new
    list types Blocks and Inlines, respectively. These types
    currently behave identical to the generic List type, but give better
    error messages. This also opens up the possibility of adding
    element-specific methods to these lists in the future.

  • Elements of type MetaValue are no longer pushed as values which
    have .t and .tag properties. This was already true for
    MetaString and MetaBool values, which are still marshaled as Lua
    strings and booleans, respectively. Affected values:

    • MetaBlocks values are marshaled as a Blocks list;

    • MetaInlines values are marshaled as a Inlines list;

    • MetaList values are marshaled as a generic pandoc Lists.

    • MetaMap values are marshaled as plain tables and no longer
      given any metatable.

  • The test suite for marshaled objects and their constructors has
    been extended and improved.

  • A bug in Citation objects, where setting a citation's suffix
    modified it's prefix, has been fixed.

The marshaling functions for pandoc's AST are extracted into a separate
package. The package comes with a number of changes:

  - Pandoc's List module was rewritten in C, thereby improving error
    messages.

  - Lists of `Block` and `Inline` elements are marshaled using the new
    list types `Blocks` and `Inlines`, respectively. These types
    currently behave identical to the generic List type, but give better
    error messages. This also opens up the possibility of adding
    element-specific methods to these lists in the future.

  - Elements of type `MetaValue` are no longer pushed as values which
    have `.t` and `.tag` properties. This was already true for
    `MetaString` and `MetaBool` values, which are still marshaled as Lua
    strings and booleans, respectively. Affected values:

      + `MetaBlocks` values are marshaled as a `Blocks` list;

      + `MetaInlines` values are marshaled as a `Inlines` list;

      + `MetaList` values are marshaled as a generic pandoc `List`s.

      + `MetaMap` values are marshaled as plain tables and no longer
        given any metatable.

  - The test suite for marshaled objects and their constructors has
    been extended and improved.

  - A bug in Citation objects, where setting a citation's suffix
    modified it's prefix, has been fixed.
@tarleb tarleb changed the title Lua: switch to hslua-pandoc-types for marshaling Lua: extract marshaling code to pandoc-lua-marshal package Nov 27, 2021
@tarleb tarleb marked this pull request as ready for review November 27, 2021 22:03
@jgm jgm merged commit 3692a1d into jgm:master Nov 28, 2021
@tarleb tarleb deleted the hslua-pandoc-types branch November 29, 2021 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants