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

feat: allow using ⇧symbols instead of R #216

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

Conversation

eugenesvk
Copy link
Contributor

@eugenesvk eugenesvk commented Mar 23, 2023

This PR adds a new great feature allowing using various ⇧symbols instead of R: see https://github.com/eugenesvk/GokuRakuJoudo/blob/symbol/KeySymbols.md for a brief overview or the linked issue

It works by prepending replacement functions that convert ⇧›!R before calling the existing from/to parsers

  • Adds generated symbol data tables (allows to easier add variants like ? and , just add it in a list and the full table will be auto-regenerated)
  • Adds various symbol helper functions
  • Adds a few tests of the new keys-symbols functions
  • Adds ReadMe reference and a more detailed file with allowed key tables
  • Allow using strings as keys (with a special symbol at the start to differentiate from regular strings like osascript, not sure if ' would work)

A few TODOs:

  • exiting on syntax warnings is disabled, I don't know why joker is so strict and doesn't accept valid identifier symbols, and how to make it less strict (previously these were broken anyway, so I had variable names with special symbols, and there were no warnings shown, but I understand now why goku would sometimes hang forever if I added a few more vars like that)

Fixes a couple of bugs:

  • Also found a weird bug that hanged the whole process on many warnings, and from https://github.com/babashka/process I understood that what you had with@ proc deref was fine, but testing it turned out that no deref was the right way, not sure what's going on there
  • Another one was syntax warnings were just swallowed, only errors bubbled up since the process exited

Closes #205

- Change FROM rules to replace symbols to Cap names for every key
- Change TO rules to replace symbols to Cap names for every key (including within key vector)
- Replacing modifier symbols with their Cap abbreviations
- Replacing  modifiers with individual prefixes into a single group with a single prefix
- Replacing  keys with symbols with regular keys
- Replacing  map with :keys with symbols with regular keys (in the map)
@eugenesvk eugenesvk force-pushed the symbol branch 2 times, most recently from c0fc71a to 7a984c8 Compare March 28, 2023 19:58
Support for the feature to allow using ⇧symbols instead of R
- Allows proper vertical alignment with tabs and spaces
- To disambiguate from script and other non-key strings requires a ‘ character at the beginning
- Remove all whitespace from the string and then convert it to a keyword, then run the usual pipeline
@ChristinWhite
Copy link

This is dramatically easier to read and write than the letter system, I hope it will be merged.

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.

Allow using modifier symbols instead of their name abbreviations (same for longer key names)
2 participants