goggles icon indicating copy to clipboard operation
goggles copied to clipboard

String literal indexes

Open kenbot opened this issue 8 years ago • 2 comments

Strings seem a common enough index type that a literal syntax could be useful, ie for JSON or XML documents. Single quotes will be the most convenient. I don't think there is any value in supporting double quotes as well.

kenbot avatar Feb 28 '17 22:02 kenbot

This can and should be done, but it's a bit harder than it looks. The lexer & parser really need to be rewritten and combined into a proper monadic parser, instead of the hokey little Either-thing we have. The usual stream of lexed symbols can't be used, because the symbols might be meaningless text inside a string literal.

I suspect the resulting parser will still be small and tailored enough to justify keeping in the codebase; I am keen to avoid the dependency of a parser combinator library if I can help it.

kenbot avatar Apr 22 '17 12:04 kenbot

Descoping from 1.1; it will be a bit of work, and there are more important things to focus on.

kenbot avatar May 17 '17 13:05 kenbot