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

Improved reader #39

Closed
dundalek opened this issue Dec 7, 2017 · 0 comments
Closed

Improved reader #39

dundalek opened this issue Dec 7, 2017 · 0 comments

Comments

@dundalek
Copy link
Owner

dundalek commented Dec 7, 2017

We use built-in clojure reader to parse the command mode, but it does not accept some shell forms.

Possible approaches:

  1. Try to hack the current reader to accept those forms (this would be my favorite if possible).
  2. Build the parse for command mode, then hand the forms in clojure code the built-in reader (probably a way to go).

Interesting inspiration might be Racket, since it is so flexible defining new languages.

Current limitations I am aware of:

  • IP addresses (invalid number error)
    replace ping 8.8.8.8
    with ping "8.8.8.8"
  • unquoted brace expansion (gets parsed as symbol and a map)
    replace ls *.{cljc,clj}
    with ls (expand "*.{cljc,clj}")
  • tilde with slash
    e.g. vim ~/.closhrc
  • at sign, tries to deref var e.g. git clone git@github.com:dundalek/closh.git
  • multiple variable expansion, e.g. echo $USER/$DISPLAY
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

No branches or pull requests

1 participant