Tim Hatch avatar Tim Hatch committed 7d1273e

Speed/correctness improvements to GoodData lexers

Comments (0)

Files changed (1)

pygments/lexers/other.py

         'root': [
             # IDENTITY
             (r'IDENTIFIER\b', Name.Builtin),
-            # FUNCNAME
-            (r'[[:alpha:]]\w*\b', Name.Function),
             # IDENTIFIER
             (r'\{[^}]+\}', Name.Variable),
             # NUMBER
              r'DATATYPE|INT|BIGINT|DOUBLE|DATE|VARCHAR|DECIMAL|'
              r'SYNCHRONIZE|TYPE|DEFAULT|ORDER|ASC|DESC|HYPERLINK|'
              r'INCLUDE|TEMPLATE|MODIFY)\b', Keyword),
+            # FUNCNAME
+            (r'[a-zA-Z]\w*\b', Name.Function),
             # Comments
             (r'#.*', Comment.Single),
             # Punctuation
             (r'[,;\(\)]', Token.Punctuation),
             # Space is not significant
-            (r'\s', Text)
+            (r'\s+', Text)
         ],
         'string-literal': [
             (r'\\[tnrfbae"\\]', String.Escape),
             (r'"', Literal.String, '#pop'),
-            (r'.', Literal.String)
+            (r'[^\\"]+', Literal.String)
         ]
     }
 
             # Comments
             (r'#.*', Comment.Single),
             # Function call
-            (r'[a-zA-Z0-9]+', Name.Function),
+            (r'[a-zA-Z]\w*', Name.Function),
             # Argument list
             (r'\(', Token.Punctuation, 'args-list'),
             # Punctuation
             (r';', Token.Punctuation),
             # Space is not significant
-            (r'\s', Text)
+            (r'\s+', Text)
         ],
         'args-list': [
             (r'\)', Token.Punctuation, '#pop'),
             (r',', Token.Punctuation),
-            (r'[a-zA-Z0-9]+', Name.Variable),
+            (r'[a-zA-Z]\w*', Name.Variable),
             (r'=', Operator),
             (r'"', Literal.String, 'string-literal'),
             (r'[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]{1,3})?', Literal.Number),
         'string-literal': [
             (r'\\[tnrfbae"\\]', String.Escape),
             (r'"', Literal.String, '#pop'),
-            (r'.', Literal.String)
+            (r'[^\\"]+', Literal.String)
         ]
     }
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 ProjectModifiedEvent.java.
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.