aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/lexers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lexers')
-rw-r--r--lib/lexers/devicetree.tes25
-rw-r--r--lib/lexers/python.tes68
2 files changed, 93 insertions, 0 deletions
diff --git a/lib/lexers/devicetree.tes b/lib/lexers/devicetree.tes
new file mode 100644
index 0000000..7551458
--- /dev/null
+++ b/lib/lexers/devicetree.tes
@@ -0,0 +1,25 @@
+!*
+ * Linux device tree files
+ *
+ * Limitations:
+ * - Keywords like /dts-v1/ cannot be highlighted.
+ * - Properties beginning with `#` are highlighted like preprocessor statements.
+ *!
+
+@[lexer.test.devicetree]{
+ :EN*.dtsQ*"S -1 '
+ :EN*.dtsiQ*
+}
+
+@[lexer.set.devicetree]{
+ ESSETILEXERcpp
+ :M[color.comment],1M[color.set]
+ :M[color.comment],2M[color.set]
+ :M[color.comment],3M[color.set]
+ :M[color.number],4M[color.set]
+ :M[color.keyword],5M[color.set]
+ :M[color.string],6M[color.set]
+ :M[color.string2],7M[color.set]
+ :M[color.preproc],9M[color.set]
+ :M[color.operator],10M[color.set]
+}
diff --git a/lib/lexers/python.tes b/lib/lexers/python.tes
new file mode 100644
index 0000000..0106f5c
--- /dev/null
+++ b/lib/lexers/python.tes
@@ -0,0 +1,68 @@
+!* Python lexer *!
+
+@[lexer.test.python]{
+ _#!MpythonM[lexer.checkheader]"S -1 '
+ :EN*.pyQ*"S -1 '
+ :EN*.pywQ*"S -1 '
+ :EN*.pyxQ*"S -1 '
+ :EN*.pxdQ*"S -1 '
+ :EN*.pxiQ*
+}
+
+@[lexer.set.python]{
+ ESSETILEXERpython
+ 0ESSETKEYWORDS
+ False None True and as assert break class continue
+ def del elif else except finally for from global if import in is lambda
+ nonlocal not or pass raise return try while with yield
+ cdef cimport cpdef
+ 2,11ESALLOCATESUBSTYLESU.s
+ Q.s+0ESSETIDENTIFIERS
+ __main__ _dummy_thread _thread abc aifc argparse
+ array ast asynchat asyncio asyncore atexit audioop
+ base64 bdb binascii binhex bisect builtins bz2
+ calendar cgi cgitb chunk cmath cmd code codecs
+ codeop collections colorsys compileall concurrent
+ configparser contextlib copy copyreg crypt csv
+ ctypes curses datetime dbm decimal difflib dis
+ distutils dummy_threading email ensurepip enum
+ errno faulthandler fcntl filecmp fileinput fnmatch
+ formatter fpectl fractions ftplib functools gc getopt
+ getpass gettext glob grp gzip hashlib heapq hmac
+ html http http imaplib imghdr importlib inspect io
+ ipaddress itertools json keyword linecache locale
+ logging lzma macpath mailbox mailcap marshal math
+ mimetypes mmap modulefinder msilib msvcrt
+ multiprocessing netrc nis nntplib numbers operator
+ os os ossaudiodev parser pathlib pdb pickle
+ pickletools pipes pkgutil platform plistlib poplib posix
+ pprint pty pwd py_compile pyclbr queue quopri
+ random re readline reprlib resource rlcompleter runpy
+ sched select selectors shelve shlex shutil signal site
+ smtpd smtplib sndhdr socket socketserver spwd
+ sqlite3 ssl stat statistics string stringprep struct
+ subprocess sunau symbol symtable sys sysconfig
+ syslog tabnanny tarfile telnetlib tempfile termios
+ textwrap threading time timeit tkinter token
+ tokenize trace traceback tracemalloc tty turtle
+ types unicodedata unittest urllib uu uuid venv warnings
+ wave weakref webbrowser winreg winsound wsgiref
+ xdrlib xml xmlrpc zipfile zipimport zlib
+ Q.s+1ESSETIDENTIFIERS
+ __future__ with_statement unicode_literals print_function
+ :M[color.comment],1M[color.set]
+ :M[color.number],2M[color.set]
+ :M[color.string],3M[color.set]
+ :M[color.string2],4M[color.set]
+ :M[color.keyword],5M[color.set]
+ :M[color.string2],6M[color.set]
+ :M[color.string],7M[color.set]
+ :M[color.operator],10M[color.set]
+ :M[color.string],12M[color.set]
+ :M[color.string],16M[color.set]
+ :M[color.string2],17M[color.set]
+ :M[color.string2],18M[color.set]
+ :M[color.string],19M[color.set]
+ :M[color.variable],Q.s+0M[color.set]
+ :M[color.variable],Q.s+1M[color.set]
+}