justinethier / cyclone

:cyclone: A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
http://justinethier.github.io/cyclone/
MIT License
823 stars 42 forks source link

Cannot use period as an identifier #500

Open Zambito1 opened 1 year ago

Zambito1 commented 1 year ago

Given the following two programs:

(import (scheme base)
    (scheme write))

(define |.| 'hello)

(display |.|)
(newline)
(import (scheme base)
    (scheme write))
;; hex code for .
(define |\x2e;| 'hello)

(display |\x2e;|)
(newline)

Both programs should compile and print hello. Currently, neither program will compile with the following error:

Error: Unbound variable(s):
(. hello)

It seems like the identifier is not terminating until the closing parenthesis. Here is another example that may be helpful:

(import (scheme base)
    (scheme write))

(define |.| 5)

(display |.|)
(newline)
Error: length - invalid parameter, expected list:
5