lips icon indicating copy to clipboard operation
lips copied to clipboard

Try to connect stdin with Lexer/Parser

Open jcubic opened this issue 4 years ago • 3 comments
trafficstars

This would make possible to access Lexer using read from inside syntax extension, and allow to create completely new syntax, the same as Common Lisp reader macros. There would be requirement of new type of specials that don't accept any object that will modify the lexer when it's running.

jcubic avatar Mar 26 '21 18:03 jcubic

There was failed attempt to implement reader macros in #13 but here after Lexer is added that is in fact like character stream this is possible to implement.

jcubic avatar Apr 02 '21 15:04 jcubic

Here is reference for CL Reader Macros

jcubic avatar Aug 22 '22 18:08 jcubic

It should be possible to implement object literal syntax like this:

#{ "foo": "bar" }

The extension should use stdin to read the text and process it. It should be a recursive process. The reader should use Lexer to process the text inside to allow nested objects:

#{ "foo": #(1 2 3) }

It should red string symbol : and a value. until it finds }.

jcubic avatar Jan 23 '24 22:01 jcubic