ppannuto avatar ppannuto committed 6966f4d Draft

Fixup accidental deletion of the Clay Lexer from bad merge

Comments (0)

Files changed (1)

pygments/lexers/compiled.py

            'GoLexer', 'FelixLexer', 'AdaLexer', 'Modula2Lexer', 'BlitzMaxLexer',
            'NimrodLexer', 'FantomLexer', 'RustLexer', 'CudaLexer', 'MonkeyLexer',
            'DylanLidLexer', 'DylanConsoleLexer', 'CobolLexer',
-           'CobolFreeformatLexer', 'LogosLexer']
+           'CobolFreeformatLexer', 'LogosLexer', 'ClayLexer']
 
 
 class CFamilyLexer(RegexLexer):
         ],
     }
 
+
+class ClayLexer(RegexLexer):
+    """
+    For `Clay <http://claylabs.com/clay/>`_source.
+
+    *New in Pygments 1.7.*
+    """
+    name = 'Clay'
+    filenames = ['*.clay']
+    aliases = ['clay']
+    mimetypes = ['text/x-clay']
+
+    tokens = {
+        'root': [
+            (r'\s', Text),
+            (r'//.*?$', Comment.Singleline),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+            (r'\b(public|private|import|as|record|variant|instance'
+             r'|define|overload|default|external|alias'
+             r'|rvalue|ref|forward|inline|noinline|forceinline'
+             r'|enum|var|and|or|not|if|else|goto|return|while'
+             r'|switch|case|break|continue|for|in|true|false|try|catch|throw'
+             r'|finally|onerror|staticassert|eval|when|newtype'
+             r'|__FILE__|__LINE__|__COLUMN__|__ARG__'
+             r')\b', Keyword),
+            (r'[~!%^&*+=|:<>/-]', Operator),
+            (r'[#(){}\[\],;.]', Punctuation),
+            (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
+            (r'\d+[LlUu]*', Number.Integer),
+            (r'\b(true|false)\b', Name.Builtin),
+            (r'(?i)[a-z_?][a-z_?0-9]*', Name),
+            (r'"""', String, 'tdqs'),
+            (r'"', String, 'dqs'),
+        ],
+        'strings': [
+            (r'(?i)\\(x[0-9a-f]{2}|.)', String.Escape),
+            (r'.', String),
+        ],
+        'nl': [
+            (r'\n', String),
+        ],
+        'dqs': [
+            (r'"', String, '#pop'),
+            include('strings'),
+        ],
+        'tdqs': [
+            (r'"""', String, '#pop'),
+            include('strings'),
+            include('nl'),
+        ],
+    }
+
+
 class DLexer(RegexLexer):
     """
     For D source.
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.