Sublime Forum

Syntax hightlighting based on real language parser

#1

Is it possible to write a syntax definition that would colour/highlight some source code based on a real language grammar and parser and not on a set of regular expressions? For example CodeMirror has a basic parser API that I can plug in.

0 Likes

#2

This would be a great feature in v3 that would compel many people to upgrade - perhaps integration with something like Colorer take5?

colorer.sourceforge.net/
Colorer take5 is a syntax highlighting and text parsing library, that provides services of text parsing in host editor systems in real-time and transforming results into colored text. Result information allows to search and build outlined lists of functions, structures, and to search and indent programming language constructions (brackets, paired tags). Colorer uses pure C++, XML, it is fully portable and works on either win32/unix/mac platforms.

colorer.sourceforge.net/whatsnew/features.html
Colorer-take5 Library Features
Supports more than two hundred programming languages, scripts and markups.
Uses powerful and flexible HRC syntax description language, based on regular expressions and scheme (context) structure.
Core is on portable C++. Can be easily integrated into any target application.

0 Likes

#3

I’d second this - the C syntax highlighting is quite broken and fixing the regex is a non-starter for me because it’s incomprehensible. :frowning:

0 Likes