[gedit-list] gtksourceview for backreferencing sub-patterns ?



The following sample XML markup for c.lang will highlight "timeout" on
line 2 but will not highlight it ever again in the source code. Does
gtksourceview support some sort of backreference on the "sub-pattern"
that will match all instances throughout the file ?

http://developer.gnome.org/gtksourceview/stable/lang-reference.html

/usr/share/gtksourceview-2.0/language-specs/c.lang

<context id="struct" style-ref="struct">
     <match>\bstruct\b\s\w+\s(\w+)</match>
          <include>
               <context sub-pattern="1" style-ref="structname"/>
          </include>
</context>



Example source code:

1. int ns;
2. struct timeval timeout;
3. timeout.tv_sec = 1;
4. timeout.tv_usec = 0;
5.
6. setsockopt(ns, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
7. setsockopt(ns, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));


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