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

Add __tostring() metamethods (with useful formatting and colorization) for all "class"-style modules #388

Open
4 tasks
Duckwhale opened this issue Dec 22, 2023 · 0 comments

Comments

@Duckwhale
Copy link
Member

Duckwhale commented Dec 22, 2023

Goal: If someone prints one of those objects, the output should be something more useful than table: 0xdeadbeef.

Should be somewhat consistent with the JS developer tools (can change the colors later, if need be).

  • All "class"-style modules should support have a __tostring metamethod that prints a useful representation of properties
  • This output should be colorized in a standardized fashion, using fixed colors for class name, property name, values
  • To make this simpler, can add something like COLORIZE_CLASS_NAME or COLORIZE_BOOL_PROPERTY
  • Either put this into the transform library, or possibly oop if it has been implemented by then (?)

In this context, "class-style modules" means anything with a Construct function (and according __call metamethod).


Probably requires #387? Later, can extend this to colorized dump output maybe? (separate issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Soon™
Development

No branches or pull requests

1 participant