Commits

Kirill Simonov  committed 00cc809

Updated pygments-based syntax highlighter for HTSQL to support locators.

  • Participants
  • Parent commits f5e5aa3

Comments (0)

Files changed (1)

File src/sphinxcontrib/htsqldoc/__init__.py

             (r'\'(?:[^\']|\'\')*\'', String),
             (r'~|!~|<=|<|>=|>|==|=|!==|!=|!|'
              r'&|\||->|\?|\^|/|\*|\+|-', Operator),
-            (r'\.|,|\(|\)|\{|\}|\[|\]|:=|:|\$|@', Punctuation),
-        ]
+            (r'\.|,|\(|\)|\{|\}|:=|:|\$|@', Punctuation),
+            (r'\[', Punctuation, 'locator'),
+        ],
+        'locator': [
+            (r'\s+', Text),
+            (r'\(|\[', Punctuation, '#push'),
+            (r'\)|\]', Punctuation, '#pop'),
+            (r'[\w-]+', String),
+            (r'\'(?:[^\']|\'\')*\'', String),
+            (r'\.', Punctuation),
+        ],
     }
 
     def get_tokens_unprocessed(self, text):