from pygments.token import * from pygments.lexer import RegexLexer, ExtendedRegexLexer, bygroups, using, \ include, this import re class BetterTypeScriptLexer(RegexLexer): """ For `TypeScript `_ source code. """ name = 'TypeScript' aliases = ['ts'] filenames = ['*.ts'] mimetypes = ['text/x-typescript'] flags = re.DOTALL tokens = { 'commentsandwhitespace': [ (r'\s+', Text), (r'