Gabe Johnson
Gabe Johnson
Haha! The title is a directive, not a description. I know what's going on and think I have a solution. I'll check it out tonight.
It's never as easy as I think. The source of the problem is simple. Syntax templates are being lexed as regular source strings, bookended by `LSYNTAX` and `RSYNTAX` tokens. They...
~This isn't an issue with contextual keywords in general. https://github.com/sweet-js/sweet.js/blob/616f4dfc0c15fed59e1d0513ab096a5606803b74/src/reader/utils.js#L556 checks to see if the preceding token is a keyword.~ ~I think this is an issue with `of` in particular....
> It's not in the list of keyword tokens. It must have be late when I wrote that. I use `Array.of` frequently and have implemented `of` methods a handful of...
@disnet `var` violates lexical nesting so there's precedent. I personally like the block solution. It could be implemented later as a reader macro though.
@WreckedAvent Now that I look at it again I like your solution if we could do: ``` js for syntax const foo ...; for syntax const bar ..., baz ...;...
Now you're speaking my language! I actually started to ask you about this on Gitter a couple of weeks ago but was too tired to get my thoughts straight. It...
> I actually think it might make sense to extract the reader+readtable to its own repo/package since it's generally useful beyond just Sweet. I was holding off suggesting this. It's...
Thinking about it some more, getting rid of `Syntax` would allow me to: 1. Pull `TokenReader::locationInfo` into `CharStream` 2. Merge `TokenReader::readToken` and `TokenReader::readUntil` into `read` 3. Remove `TokenReader::context` (it's only...
I forgot one thing (so far). Sweet's algorithm for regex literal detection relies on looking at the previous results. This wouldn't necessarily be the case for other projects. So each...