1. Prometheus Research, LLC
  2. Prometheus
  3. htsql

Commits

Kirill Simonov  committed 00cc809

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

  • Participants
  • Parent commits f5e5aa3
  • Branches default

Comments (0)

Files changed (1)

File src/sphinxcontrib/htsqldoc/__init__.py

View file
  • Ignore whitespace
             (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):