[SVN] Problem with negative look-behind in syntax pattern

Paulo Moura pmoura at mac.com
Fri Jun 3 00:21:43 UTC 2005


Hi!

I need to use negative look-behind on two syntax patterns but I'm  
having trouble in getting it to work. The syntax patterns are:

         {
             begin = "(?<!0)'";
             end = "'";
             name = "string.single-quoted";
             swallow = "\\\\.";
         },
         {
             begin = "(?<!0')\"";
             end = "\"";
             name = "string.double-quoted";
             swallow = "\\\\.";
         },

The negative look-behind is needed because Prolog/Logtalk defines the  
syntax 0'Character to get the numeric code of a (single) character.  
This syntax is covered by the pattern (which appears after the above  
ones):

         {
             match = "\\b(0'.|0b[0-1]+|0o[0-7]+|0x\\h+)\\b";
             name = "constant.numeric";
         },

Am I doing something wrong here?

TIA,

Paulo


-----------------------------------------------------------
Paulo Jorge Lopes de Moura
Dep. of Informatics                   Office 4.3  Ext. 3257
University of Beira Interior          Phone: +351 275319700
6201-001 Covilhã                      Fax:   +351 275319899
Portugal

<mailto:pmoura at di.ubi.pt>
<http://www.di.ubi.pt/~pmoura>     <http://www.logtalk.org>
-----------------------------------------------------------





More information about the textmate-dev mailing list