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 Table pretty printer #41

Merged
merged 3 commits into from
Sep 3, 2024
Merged

Lua Table pretty printer #41

merged 3 commits into from
Sep 3, 2024

Conversation

davydog187
Copy link
Contributor

@davydog187 davydog187 commented Sep 2, 2024

Adds a very basic implementation of a pretty printer that take's an Elixir representation of a table, and outputs a syntactically valid Lua table constructor (literal).

Currently doesn't nicely format large tables into multilines, and will inspect :userdata values as is.

Example

iex> Lua.Table.as_string([{"a", 1}, {"b", 2}])
"{a = 1, b = 2}"

iex> Lua.Table.as_string([{1, "foo"}, {2, "bar"}])
~S[{"foo", "bar"}]

Closes #40

Adds a very basic implementation of a pretty printer that take's an
Elixir representation of a table, and outputs a syntactically valid Lua table constuctor (literal).

Currently doesn't nicely format large tables into multilines, and will inspect :userdata values as is.
@davydog187 davydog187 changed the title Lua Table printer printer Lua Table pretty printer Sep 2, 2024
@davydog187 davydog187 merged commit af9a000 into main Sep 3, 2024
1 check passed
@davydog187 davydog187 deleted the table-formatter branch September 3, 2024 13:38
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.

Lua.Table pretty printer
1 participant