Sent: Wednesday, September 13, 2017 at 5:28 PM
From: "Ronie Salgado" <roniesalg(a)gmail.com>
To: "Moose-related development" <moose-dev(a)list.inf.unibe.ch>
Subject: [Moose-dev] Re: Syntax highlighting for custom language on the GTInspector
Hi Doru,
Thanks for the response. I managed to make the following:
The only problem with this is that I end duplicating some logic, and that it could also
be not easy for supporting the different themes.
The solution I used for supporting different themes for XML and XPath highlighting was to
reuse the current theme's Shout styles, like this:
SHTextStylerST80 new attributesFor: aShoutProperty
where aShoutProperty is something like #comment or #string. Not every language construct
will have an equivalent in Pharo, so you may have to get creative.
Maybe I should try making a syntax highlighting
framework that can use either, PetitParser grammars, or regular expressions for basic
support of languages as C/C++/Java (comments, keyword, identifiers, literals).
Best regards,Ronie
2017-09-12 14:26 GMT+02:00 Tudor Girba
<tudor@tudorgirba.com[mailto:tudor@tudorgirba.com]>:Hi,
Thanks for the ping :).
Please take a look at the Pillar syntax highlighter. You can find it in the following
way:
- Download Pillar:
Gofer new smalltalkhubUser: 'Pier' project: 'Pillar';
configuration; loadDevelopment.
- Browse
GTPillarHighlighterTextDecorator (this is what hooks the parser with Rubric)
GTPillarHighlighter (this is the parser that produces syntax highlighting)
Please let me know if you have issues with this.
Cheers,
Doru
On Sep 12, 2017, at 12:11 PM, Ronie Salgado
<roniesalg@gmail.com[mailto:roniesalg@gmail.com]> wrote:
Hi,
I have some custom programming languages (Lowtalk for low-level programming, and Dastrel
for GPU shaders) whose grammar are defined by using PetitParser.
How can I add syntax highlighting support for them by using the GTInspector?
Best regards,
Ronie> _______________________________________________
Moose-dev mailing list
Moose-dev@list.inf.unibe.ch[mailto:Moose-dev@list.inf.unibe.ch]
https://www.list.inf.unibe.ch/listinfo/moose-dev[https://www.list.inf.unibe…
--
www.tudorgirba.com[http://www.tudorgirba.com]
www.feenk.com[http://www.feenk.com]
"Every successful trip needs a suitable vehicle."
_______________________________________________
Moose-dev mailing list
Moose-dev@list.inf.unibe.ch[mailto:Moose-dev@list.inf.unibe.ch]
https://www.list.inf.unibe.ch/listinfo/moose-dev___________________________…
Moose-dev mailing list Moose-dev(a)list.inf.unibe.ch
https://www.list.inf.unibe.ch/listinfo/moose-dev[https://www.list.inf.unibe…