Anonymous avatar Anonymous committed cf85ae0

[svn] Implement goto label support for C, C++, Delphi.

Comments (0)

Files changed (3)

-before 0.5
+for 0.5
 - improve guess_lexer heuristics (esp. for template langs)
-- more unit tests
-- goto label HL support for languages that use it
 for 0.6
+- more unit tests
 - allow "overlay" token types (e.g. Diff + X) 
   - highlight specials: nth line, a word etc.
   - dhtml: overlays toggleable by javascript


              r'declspec|finally|int64|try|leave)\b', Keyword.Reserved),
             (r'(true|false|NULL)\b', Keyword.Constant),
+            ('[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
             ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
         'root': [
              r'identifier|forceinline|event|assume)\b', Keyword.Reserved),
             (r'(true|false|NULL)\b', Keyword.Constant),
+            ('[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
             ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
         'classname': [
             (r'\#\$?[0-9]{1,3}', Number),
             (r'[0-9]', Number),
             (r'[@~!%^&*()+=|\[\]:;,.<>/?-]', Text),
-            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name)
+            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
         'uses': [
             (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace),
             (r'(class)(\s+)', bygroups(Keyword, Text), 'class'),
             (r'"(\\\\|\\"|[^"])*"', String),
             (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
             (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
             (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
             (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number),


                 ttypestr, val ='\t', 1)
             except ValueError:
                 val =
-                ttype = Error 
+                ttype = Error
                 ttype = _ttype_cache.get(ttypestr)
                 if not ttype:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.