Open dlee opened 9 years ago
Syntax highlighting would be nice. If an existing syntax module does not already exist for GSS, I can write one overnight if anyone has the grammar specification somewhere.
I believe @paulyoung worked on bringing syntax highlighting to text mate and compatible editors. I've seen screenshots where it did some proper colors and it felt great. I don't know what's the current status though, as it was a side project. I imagine it's difficult to make one-line oriented regex highlighters to do proper highlighting in multiline expressions. But I hardly know anything about it.
Currently we don't have any solution. Give it a shot, if you feel confident. We have PEG grammar for CCSS and VFL in dedicated repos linked from readme. That would be nice to have for sure.
I don't see the links in the readme (https://github.com/gss/engine/blob/master/README.md). Maybe you're referring to a different file?
The links to repos are there. Here're the links to pegs:
https://github.com/gss/vfl-compiler/blob/master/src/grammar.peg https://github.com/gss/parser/blob/master/src/grammar.peg
I suggest checking out the specs for both parsers, they have everything in there. It's pretty mighty thing and our parser is quite an auto-generated monster. We're looking for some experienced parser tinker who could handcraft something less heavy.
I made some progress on this recently with the help of @infininight. I can push what I have in the morning.
Nice work @paulyoung. I am interested in seeing your highlighting rules. Hopefully, I can use some ideas for the vim syntax module I just wrote: https://github.com/Hydrotoast/vim-gss
And because I realized that there wasn't too much interesting in the previous screenshot, here are is a section with combinators and conditionals:
I think all that would be left would be to include the fancy selectors like ++
and ~~
. I can read into those in the morning.
Ahh, pretty! Wonder if we can work out VFL highlighting too.
Personally, I'd like to see local props like height: ==
or height: =
be colored the same way as &[height] ==
, because they are scoped explicitly. But variables like height
should have its own color, to hint that hoisting can happen
@RedHatter – I just made https://github.com/paulyoung/GSS.tmbundle public.
Worth noting that I didn't get too far and was hoping to get some input from @infininight on how he would have implemented it.
Do you know if there are vim syntax modules for GSS?
If so, it would be nice to put a link to it somewhere in the docs.