In-REPL syntax highlighting & inspect source code of a hy function / module #2550
atisharma
started this conversation in
Show and tell
Replies: 2 comments
-
|
It now also has a code beautifier / pretty-printer. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
And now a fancy REPL (hy-fancy-repl). |
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.getsourcefails 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
hylightforrepl-output-fnalso gives syntax highlighting in the repl.I'll maintain it at
https://github.com/atisharma/hyjinx/blob/main/hyjinx/source.hyEDIT: moved to https://github.com/atisharma/beautifhy
Beta Was this translation helpful? Give feedback.
All reactions