In-REPL syntax highlighting & inspect source code of a hy function / module #2550
atisharma
started this conversation in
Show and tell
Replies: 1 comment
-
It now also has a code beautifier / pretty-printer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I find it useful to examine the source for a hy (or python) function in the REPL. Python's
inspect.getsource
fails for hy source because it relies on a regex.The following code implements (a subset of) getsource for hy and prints it syntax-highlighted.
Using
hylight
forrepl-output-fn
also gives syntax highlighting in the repl.I'll maintain it at https://github.com/atisharma/hyjinx/blob/main/hyjinx/source.hy
Beta Was this translation helpful? Give feedback.
All reactions