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

Pretty Encoding #32

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

Pretty Encoding #32

wants to merge 7 commits into from

Commits on Aug 5, 2019

  1. First implementation of pretty encode

    Any encoders with the same indent share a cache. Only one assignment is made on depth change.
    
    `space` is equivalent to the third argument of [javascript's JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)
    Ayplow committed Aug 5, 2019
    Configuration menu
    Copy the full SHA
    8429ddc View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2019

  1. Lua 5.1 compatability

    Ayplow committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    a62dd99 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    353cbeb View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2019

  1. Use a local variable instead of ENV for delimiters

    Turns out using the environment has zero performance benefit in any version of lua, so it just serves to make the code less readable
    Ayplow committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    9488f33 View commit details
    Browse the repository at this point in the history
  2. Clearer variable name

    Ayplow committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    80805ad View commit details
    Browse the repository at this point in the history
  3. Move the space parameter to the encode function

    This brings the interface more in line with the rest of the library
    Ayplow committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    f0dc1f6 View commit details
    Browse the repository at this point in the history
  4. Restore empty _ENV

    This doesn't really do anything for consumers, however it is valuable for ensuring variables are made local
    Ayplow committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    579ee3a View commit details
    Browse the repository at this point in the history