talyz / fromElisp

An Emacs Lisp reader in Nix.
MIT License
33 stars 4 forks source link

parser fails to recognize octals (#o prefix) #3

Closed antifuchs closed 2 years ago

antifuchs commented 3 years ago

The following expression: (set-file-modes server-socket-dir #o700) fails to parse with the error Unrecognized token on line 4694: #o700))

I worked around by using read-from-string, but it would be nice to have these supported natively.

This was originally reported as https://github.com/nix-community/emacs-overlay/issues/164, but I guess emacs-overlay uses this package.

league commented 2 years ago

Yeah, I just encountered this with hexadecimal too, and traced it to here. It started with trying to do something like this in my init:

(setq org-superstar-item-bullet-alist '((?* . ?•)))

But that's a unicode issue (unfortunate). I can use utf8 in comments and strings, but not for characters. So I tried replacing with the code point in hex:

(setq org-superstar-item-bullet-alist '((?* . #x2022)))

and also not parsed. But the decimal version is okay.

(setq org-superstar-item-bullet-alist '((?* . 8226)))
talyz commented 2 years ago

Sorry for the delay in fixing this. I just had some time to look into it - turns out I only accepted uppercase prefixes such as #O, not #o. This should now be rectified and the fix will soon be propagated to emacs-overlay.