Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting for vim (and others)? #171

Open
dlee opened this issue Feb 21, 2015 · 11 comments
Open

Syntax highlighting for vim (and others)? #171

dlee opened this issue Feb 21, 2015 · 11 comments

Comments

@dlee
Copy link

dlee commented Feb 21, 2015

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.

@Hydrotoast
Copy link

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.

@Inviz
Copy link
Contributor

Inviz commented Feb 22, 2015

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.

@dlee
Copy link
Author

dlee commented Feb 22, 2015

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?

@Inviz
Copy link
Contributor

Inviz commented Feb 22, 2015

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.

@paulyoung
Copy link
Contributor

I made some progress on this recently with the help of @infininight. I can push what I have in the morning.

@paulyoung
Copy link
Contributor

screen shot 2015-01-26 at 10 25 24 pm
screen shot 2015-01-26 at 10 25 32 pm

@Hydrotoast
Copy link

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

screen

@Hydrotoast
Copy link

And because I realized that there wasn't too much interesting in the previous screenshot, here are is a section with combinators and conditionals:

screen2

I think all that would be left would be to include the fancy selectors like ++ and ~~. I can read into those in the morning.

@Inviz
Copy link
Contributor

Inviz commented Feb 22, 2015

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

@paulyoung
Copy link
Contributor

@RedHatter – I just made https://github.com/paulyoung/GSS.tmbundle public.

@paulyoung
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants