s-expressionists / Eclector

A portable Common Lisp reader that is highly customizable, can recover from errors and can return concrete syntax trees
https://s-expressionists.github.io/Eclector/
BSD 2-Clause "Simplified" License
108 stars 9 forks source link

Wrong END-OF-FILE error when reading macro sub-char fails #56

Closed scymtym closed 5 years ago

scymtym commented 5 years ago

When reading incomplete input such as # (using the standard readtable), the signaled condition is of type cl:end-of-file instead of eclector.reader:end-of-file. This is bad for clients which only handle eclector.base:stream-position-reader-error or even specifically eclector.reader:end-of-file. It is also (I think) the single place in which this can happen.

The reason is probably the current module structure in which eclector.reader depends on the readtable modules eclector.readtable[.simple] so that the latter cannot use functions and conditions defined in the former.

The solution probably consists in moving eclector.reader:end-of-file and eclector.reader:read-char to eclector.base.