Re: [gedit-list] GtkSourceView



On Tue, Jun 07, 2016 at 01:24:27PM +0200, Stefan Salewski wrote:
In the last days I made a color and syntax scheme for Nim language.

http://ssalewski.de/tmp/NEd-SHD.png

https://github.com/ngtk3/NEd/tree/master/src

Generally its was working really fine, and the documentation is also
fine.

For final tuning I tried to use regexes like this:

<!-- Nim identifier, maybe enclosed in ``, starting lower or upper case -->
<define-regex id="nid">(?'a'`?)[a-zA-Z]\w*(\k'a')</define-regex>

That gave me a lot trouble. Is it a known problem that regexes with
back references are problematic? Or is there maybe a better working
notation available? Unnamed back reference with \1 seems to do not work
at all. Of course I can avoid back references when I do use too ored
regexes, one with `` and one without.

Maybe you can create a context with <start> and <end> tags? But I
haven't tried to understand fully the above regex (still the morning
here).

--
Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]