[SVN] Re: Patch to fix C macro parsing

Sam Vaughan samvaughan at mac.com
Thu Jan 11 06:18:10 UTC 2007


Whitespace fixes for the last patch.  The HTML entities in the plist  
file threw me out, sorry 'bout that.

Sam

- - - - - - - -

Index: Syntaxes/C.plist
===================================================================
--- Syntaxes/C.plist	(revision 6438)
+++ Syntaxes/C.plist	(working copy)
@@ -202,10 +202,15 @@
			<string>(?x)
				^\s*\#\s*(define)\s+             # define
				((?<id>[a-zA-Z_][a-zA-Z0-9_]*))  # macro name
-				(\()(
-					\s* \g<id> \s*              # first argument
-					(, \s* \g<id> \s*)*         # additional arguments
-				)(\))
+				(?:                              # and optionally:
+				    (\()                         # an open parenthesis
+				        (
+				            \s* \g<id> \s*       # first argument
+				            (, \s* \g<id> \s*)*  # additional arguments
+				            (?:\.\.\.)?          # varargs ellipsis?
+				        )
+				    (\))                         # a close parenthesis
+				)?
			</string>
			<key>beginCaptures</key>
			<dict>

- - - - - - - -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: meta.preprocessor.macro.c.diff.gz
Type: application/x-gzip
Size: 403 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20070111/83e8978b/attachment.gz>


More information about the textmate-dev mailing list