LIPS-scheme / lips

Scheme based powerful lisp interpreter in JavaScript
https://lips.js.org
Other
414 stars 34 forks source link

You can't define syntax extension that starts with #f and is followed by symbol #343

Closed jcubic closed 6 months ago

jcubic commented 6 months ago

So the problem is this:

(set-special! "#foo" 'frob lips.specials.SYMBOL)

#foo"xxx"

#foo"xxx" is parsed as a single token, and lexer thinks it's a symbol.

The problem is these rules:

    // hash special symbols, lexer don't need to distinguish those
    // we only care if it's not pick up by vectors literals
    [/#/, null, /[bdxoeitf]/i, null, Lexer.symbol],

Those are exceptions to hash (vector literal) to handle special tokens. They need to added and sorted together with specials.