Initial public upload from Projekte/CodingAgent (part 5)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +1 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/INSTALLER +1 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/METADATA +57 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/RECORD +348 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/REQUESTED +0 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/WHEEL +4 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/entry_points.txt +2 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/licenses/AUTHORS +292 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/licenses/LICENSE +25 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/modula2.py +1579 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/mojo.py +707 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/monte.py +203 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/mosel.py +447 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ncl.py +894 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/nimrod.py +199 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/nit.py +63 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/nix.py +144 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/numbair.py +63 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/oberon.py +120 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/objective.py +513 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ooc.py +84 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/openscad.py +96 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/other.py +41 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/parasail.py +78 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/parsers.py +798 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pascal.py +644 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pawn.py +202 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pddl.py +82 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/perl.py +733 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/phix.py +363 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/php.py +335 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pointless.py +70 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pony.py +93 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/praat.py +303 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/procfile.py +41 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/prolog.py +318 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/promql.py +176 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/prql.py +251 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ptx.py +119 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/python.py +1204 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/q.py +187 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/qlik.py +117 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/qvt.py +153 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/r.py +196 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rdf.py +468 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rebol.py +419 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rego.py +57 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rell.py +68 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/resource.py +83 -0
- hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ride.py +138 -0
.gitattributes
CHANGED
|
@@ -39,3 +39,4 @@ hai-mcp-pr7/.venv/bin/python3.13 filter=lfs diff=lfs merge=lfs -text
|
|
| 39 |
hai-mcp-pr7/.venv/lib/python3.13/site-packages/_cffi_backend.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 40 |
hai-mcp-pr7/.venv/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 41 |
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 39 |
hai-mcp-pr7/.venv/lib/python3.13/site-packages/_cffi_backend.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 40 |
hai-mcp-pr7/.venv/lib/python3.13/site-packages/cryptography/hazmat/bindings/_rust.abi3.so filter=lfs diff=lfs merge=lfs -text
|
| 41 |
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
hai-mcp-pr7/.venv/lib/python3.13/site-packages/rpds/rpds.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
uv
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: Pygments
|
| 3 |
+
Version: 2.20.0
|
| 4 |
+
Summary: Pygments is a syntax highlighting package written in Python.
|
| 5 |
+
Project-URL: Homepage, https://pygments.org
|
| 6 |
+
Project-URL: Documentation, https://pygments.org/docs
|
| 7 |
+
Project-URL: Source, https://github.com/pygments/pygments
|
| 8 |
+
Project-URL: Bug Tracker, https://github.com/pygments/pygments/issues
|
| 9 |
+
Project-URL: Changelog, https://github.com/pygments/pygments/blob/master/CHANGES
|
| 10 |
+
Author-email: Georg Brandl <georg@python.org>
|
| 11 |
+
Maintainer: Matthäus G. Chajdas
|
| 12 |
+
Maintainer-email: Georg Brandl <georg@python.org>, Jean Abou Samra <jean@abou-samra.fr>
|
| 13 |
+
License-Expression: BSD-2-Clause
|
| 14 |
+
License-File: AUTHORS
|
| 15 |
+
License-File: LICENSE
|
| 16 |
+
Keywords: syntax highlighting
|
| 17 |
+
Classifier: Development Status :: 6 - Mature
|
| 18 |
+
Classifier: Intended Audience :: Developers
|
| 19 |
+
Classifier: Intended Audience :: End Users/Desktop
|
| 20 |
+
Classifier: Intended Audience :: System Administrators
|
| 21 |
+
Classifier: Operating System :: OS Independent
|
| 22 |
+
Classifier: Programming Language :: Python
|
| 23 |
+
Classifier: Programming Language :: Python :: 3
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 26 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 27 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 28 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 29 |
+
Classifier: Programming Language :: Python :: 3.14
|
| 30 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 31 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 32 |
+
Classifier: Topic :: Text Processing :: Filters
|
| 33 |
+
Classifier: Topic :: Utilities
|
| 34 |
+
Requires-Python: >=3.9
|
| 35 |
+
Provides-Extra: plugins
|
| 36 |
+
Provides-Extra: windows-terminal
|
| 37 |
+
Requires-Dist: colorama>=0.4.6; extra == 'windows-terminal'
|
| 38 |
+
Description-Content-Type: text/x-rst
|
| 39 |
+
|
| 40 |
+
Pygments
|
| 41 |
+
~~~~~~~~
|
| 42 |
+
|
| 43 |
+
Pygments is a syntax highlighting package written in Python.
|
| 44 |
+
|
| 45 |
+
It is a generic syntax highlighter suitable for use in code hosting, forums,
|
| 46 |
+
wikis or other applications that need to prettify source code. Highlights
|
| 47 |
+
are:
|
| 48 |
+
|
| 49 |
+
* a wide range of over 500 languages and other text formats is supported
|
| 50 |
+
* special attention is paid to details, increasing quality by a fair amount
|
| 51 |
+
* support for new languages and formats are added easily
|
| 52 |
+
* a number of output formats, presently HTML, LaTeX, RTF, SVG, all image
|
| 53 |
+
formats that PIL supports and ANSI sequences
|
| 54 |
+
* it is usable as a command-line tool and as a library
|
| 55 |
+
|
| 56 |
+
Copyright 2006-present by the Pygments team, see ``AUTHORS``.
|
| 57 |
+
Licensed under the BSD, see ``LICENSE`` for details.
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
../../../bin/pygmentize,sha256=JyEcB7gq9vCMhqifJIJkquD1VVL-SgbQM1HG6IfN7MM,345
|
| 2 |
+
pygments-2.20.0.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
|
| 3 |
+
pygments-2.20.0.dist-info/METADATA,sha256=4FKPUbMEJ_rpRyNmK6Yi-NjbKk2NPxNlaY1npSRQqEU,2476
|
| 4 |
+
pygments-2.20.0.dist-info/RECORD,,
|
| 5 |
+
pygments-2.20.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 6 |
+
pygments-2.20.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
| 7 |
+
pygments-2.20.0.dist-info/entry_points.txt,sha256=uUXw-XhMKBEX4pWcCtpuTTnPhL3h7OEE2jWi51VQsa8,53
|
| 8 |
+
pygments-2.20.0.dist-info/licenses/AUTHORS,sha256=DbYDpfRJn2kMRCVHf_ZkwWbaMl06zDtajU3j2wckQ9A,10873
|
| 9 |
+
pygments-2.20.0.dist-info/licenses/LICENSE,sha256=qdZvHVJt8C4p3Oc0NtNOVuhjL0bCdbvf_HBWnogvnxc,1331
|
| 10 |
+
pygments/__init__.py,sha256=ZzpnXpvnv0c7r_OIS8h7UeaESqYNKMy__pV7KCiWXxw,2962
|
| 11 |
+
pygments/__main__.py,sha256=QZWj0T6TTRsqr-w-0YvVILo1DyAvzzydGCRONwdEzqo,351
|
| 12 |
+
pygments/cmdline.py,sha256=_dOnrta_2GIe8Jg-1Y0pb5vWi8L6QTiJzyoTuHrYrbM,23542
|
| 13 |
+
pygments/console.py,sha256=C189JAwhC1Qh0AKgshzb1wVDzFqBnv1VZ45kTEDIO30,1721
|
| 14 |
+
pygments/filter.py,sha256=1dnbkq2AdC3AkHt3DaXwnOkTBLChl1kR6naSLwnr_tc,1913
|
| 15 |
+
pygments/filters/__init__.py,sha256=03ZYdIYmxnWCh7gNXD7lEQ869Df4kzHnOGM44iJxan8,40349
|
| 16 |
+
pygments/formatter.py,sha256=PTBnTW0EHke2vzlAKuvHJkj3-_CMj8duIx-3yVUie-o,4369
|
| 17 |
+
pygments/formatters/__init__.py,sha256=qPG4q5cuaZRGBglmEJVLP4SDv43QI3tAUskj30M-mOY,5352
|
| 18 |
+
pygments/formatters/_mapping.py,sha256=1Cw37FuQlNacnxRKmtlPX4nyLoX9_ttko5ZwscNUZZ4,4176
|
| 19 |
+
pygments/formatters/bbcode.py,sha256=lvG1REZJv0pM6VMe-QwLSuo0Yl1Ra_X51wh93fW8A2k,3299
|
| 20 |
+
pygments/formatters/groff.py,sha256=anF3fNbDYwwOlppOUoKTZg4FzzPbZrE4jcJCMd49_1g,5085
|
| 21 |
+
pygments/formatters/html.py,sha256=qe4P6qIV462HkZovS8s5xKKyYXPQQvUjz6Wj7HX1CxY,36053
|
| 22 |
+
pygments/formatters/img.py,sha256=41uSY0pKg9VmKJYrHuavCVgg0z-mg81p28QEMktwf1o,23304
|
| 23 |
+
pygments/formatters/irc.py,sha256=hdOqAvF02bI8CY8_tutnUptBZpWEBLzVAqS4_YA0tew,4907
|
| 24 |
+
pygments/formatters/latex.py,sha256=cQmE1Nj4E9q5N0XQJBqpc6dLtu5UNOtYq3plPyCX1Hk,19261
|
| 25 |
+
pygments/formatters/other.py,sha256=Hq6qY4POBZ_llAWRr1gzSO9UoeYPONlLMBK60RkW4bg,4989
|
| 26 |
+
pygments/formatters/pangomarkup.py,sha256=L4jU6oO18UqEMqXeN5FkPtkisXrXuXq9wcecgy_6dzo,2209
|
| 27 |
+
pygments/formatters/rtf.py,sha256=YQYW8NTrB4XfOjLbQzutyD4j35TimFNZ0T39dET9DOo,11924
|
| 28 |
+
pygments/formatters/svg.py,sha256=oksXT-ZnTHDsn1WtWgBs9V7qmKFswAKx7jV37tb2tYY,7141
|
| 29 |
+
pygments/formatters/terminal.py,sha256=q7jLLanle33eCZkDr4CoHAN-dHBFf1DBhi4FcBQ8_1E,4629
|
| 30 |
+
pygments/formatters/terminal256.py,sha256=PpA_oATHCih3UTjrbfKqIRUcvsyp_TeBaGw3kpIxeBA,11717
|
| 31 |
+
pygments/lexer.py,sha256=gNMYzmdSkTNyWfqiLJ37oUd1KrN_dMXtsPyaX2-n9EA,35154
|
| 32 |
+
pygments/lexers/__init__.py,sha256=G4dtqE5QMEAqoaaD1rwSZZeuqKhMyS4utlMz1szkrTg,12070
|
| 33 |
+
pygments/lexers/_ada_builtins.py,sha256=dZb-lodsSM6L5emLlgLg-rClm2HumvnHK72CetnSRdA,1546
|
| 34 |
+
pygments/lexers/_asy_builtins.py,sha256=zg54fGhgzWXQUk6-qZ6OW5GTL9d4OrnB8SJQkjrD0xs,27290
|
| 35 |
+
pygments/lexers/_cl_builtins.py,sha256=oBF00ZkJyD14LkYuR603EDFIMyitkze12aT7UzDYLYs,13997
|
| 36 |
+
pygments/lexers/_cocoa_builtins.py,sha256=ab6sq-iy5LapE1cNYyl8PJXLg6EINXx-lMRbwERdKYs,105176
|
| 37 |
+
pygments/lexers/_csound_builtins.py,sha256=wuWiQjmEMhaVvsV8b_efsebgU0YKIoMC0ECpOavTCIM,18417
|
| 38 |
+
pygments/lexers/_css_builtins.py,sha256=qhmC4tRGG53zvzMQE1qn794LvbVODRtVacxWCP3kIkA,12449
|
| 39 |
+
pygments/lexers/_googlesql_builtins.py,sha256=mGfOGuKKjZoHHAAZq6Hpc68x0qKycx-SX_wGDScSOYI,16135
|
| 40 |
+
pygments/lexers/_julia_builtins.py,sha256=u6v0yAzZjqUENjiIQ5qMfcso1r_6ERqGbj3aHwFnyqA,11886
|
| 41 |
+
pygments/lexers/_lasso_builtins.py,sha256=YO_c_f05ZoxspHxCR3oWQCpZhbAJUzBJBhVuuwTjr5c,134513
|
| 42 |
+
pygments/lexers/_lilypond_builtins.py,sha256=-_4i4gpgDgcFHvaZMJL2s1rI9dSNY2ZC6vO6ul7Hml0,115114
|
| 43 |
+
pygments/lexers/_lua_builtins.py,sha256=MsDV9sEbJngKoXSZu0xXawGvd6XjFf125nuXBNoffdU,8111
|
| 44 |
+
pygments/lexers/_luau_builtins.py,sha256=YLUj2bcZ0Cb0SBkIlNXWHFGDUFkpddOJx-ukrZx1cMc,958
|
| 45 |
+
pygments/lexers/_mapping.py,sha256=YbQJB1eqeGk7ol5NgMMPLrD3VGdTwgQCl3TvLwtxwxA,70758
|
| 46 |
+
pygments/lexers/_mql_builtins.py,sha256=CkcvMyHYh4U5rGgV6AgShxRnTOv0tmqEbOiVdpaFLqs,24716
|
| 47 |
+
pygments/lexers/_mysql_builtins.py,sha256=SqiVYVVirtnN4lSgtfeRPxtVpcumjUvvUq9n8JObuQ4,26876
|
| 48 |
+
pygments/lexers/_openedge_builtins.py,sha256=AzF1o6eAkMc6vnvmeVqNnUZUVijzbNYkjzrUdtCQe3M,49401
|
| 49 |
+
pygments/lexers/_php_builtins.py,sha256=9g-WLT3qbSGolQJB_4PS6FW_r7HVXBWvI5OWxKtbwok,108054
|
| 50 |
+
pygments/lexers/_postgres_builtins.py,sha256=QGg2mBTThgv4LdXjFm5wrKaKnCU9DubmJi6lXB7y2Mg,13346
|
| 51 |
+
pygments/lexers/_qlik_builtins.py,sha256=3ZkCSDjtxSxXDI9erigWTLSUct_ap_W0LqfZjFeKQYI,12598
|
| 52 |
+
pygments/lexers/_scheme_builtins.py,sha256=O3BRtt5suTESbZ_bSReQ6D0r0G_Sq_i4wCcUkdUrdS0,32567
|
| 53 |
+
pygments/lexers/_scilab_builtins.py,sha256=E33R0mknNc-5eZ9Ugu7u7Av_vUxAaQoMTtdx3MceyxU,52414
|
| 54 |
+
pygments/lexers/_sourcemod_builtins.py,sha256=8qspLxCLsfN9J7N0SWZRNs0A-qJOIGRBAJaNMeWaOBQ,26780
|
| 55 |
+
pygments/lexers/_sql_builtins.py,sha256=fLphonB6wv6Oit8zanJiExgRoLvZoFW4l9lNH-PTYvw,6770
|
| 56 |
+
pygments/lexers/_stan_builtins.py,sha256=sIoONg4TjLkGN7Ab0tZB1HM7tQ071_Z2c41n9lXZl04,16623
|
| 57 |
+
pygments/lexers/_stata_builtins.py,sha256=ymh8GxEca6eSCgHnqsLqsi9OrfRqYnt5O8yBeinJ7DE,27230
|
| 58 |
+
pygments/lexers/_tsql_builtins.py,sha256=Mw6UnMByju0U-OBgT8af3A4utfrS00Tn5lDnaxBtj9c,15463
|
| 59 |
+
pygments/lexers/_usd_builtins.py,sha256=SGp_ePf2VuktrFV59q6df4mTyxZV7AZYs0TJFSWoBAI,1661
|
| 60 |
+
pygments/lexers/_vbscript_builtins.py,sha256=TFtyc11yvpD_OlNrrFbcCOJoUYkWMq3EeHHCpw_zJNc,4228
|
| 61 |
+
pygments/lexers/_vim_builtins.py,sha256=bB6kdLFM33uoY-sAtsRuUZOoccaa4gDAsdFg4WAEsoU,57069
|
| 62 |
+
pygments/lexers/actionscript.py,sha256=kbHhoDl7JjVzREMv1UuxYBRJaPrxHDkmEAC5COmOIVw,11737
|
| 63 |
+
pygments/lexers/ada.py,sha256=m2O7dYzJVc3iuSgaC-Ti-Gh3CG-JmpZit_DPZpu1IIM,5356
|
| 64 |
+
pygments/lexers/agile.py,sha256=Du-vjnGZEPHuE40XxTMO-XLt56pYcIaKIAxIwcYHFH0,899
|
| 65 |
+
pygments/lexers/algebra.py,sha256=2iQSGxfVuBXBHAJdzbbPvtpvROYTfxfMivDagk9yfh8,10032
|
| 66 |
+
pygments/lexers/ambient.py,sha256=8Nk8WX4qrId9zj_zgjJBuFT40yQXG2OXxFhhF3R00g8,2608
|
| 67 |
+
pygments/lexers/amdgpu.py,sha256=KMDLdb-1aK9RJaNsSkPyiU3DQE_HdjBF0paw_yiJMRA,1726
|
| 68 |
+
pygments/lexers/ampl.py,sha256=IKuMVE6aXsa4S6qpuc_DvEsJmJpyKDNga09BPFLvYxA,4179
|
| 69 |
+
pygments/lexers/apdlexer.py,sha256=puSpLBWevciSc8G0wg2Y_yQIoGgqPes0UBkpFImqvO4,30803
|
| 70 |
+
pygments/lexers/apl.py,sha256=-jhPYsBVT4ckL7CZmukIZNi6tfaJJbBk2vutld372rs,3407
|
| 71 |
+
pygments/lexers/archetype.py,sha256=buhH2WHtxBowy_KD5SPm5vgHpmLoKMdV9tgMs_bE4xU,11577
|
| 72 |
+
pygments/lexers/arrow.py,sha256=e6mb3Ix4jL7TMGNUpk8iRbJy_VF7VY2J0VUknlo1EvA,3567
|
| 73 |
+
pygments/lexers/arturo.py,sha256=GkklOaiEJTOz8E0zdxd_hd1zXwv7lYgp8IJl7uh13hg,11417
|
| 74 |
+
pygments/lexers/asc.py,sha256=CvFSi7FYDW6eu-5oiKGc0MN3aF1XVZDoFI5-3mHpBDk,1696
|
| 75 |
+
pygments/lexers/asm.py,sha256=jHJ3CDtvHgu4hX4kVvvJyciFLWM6FAYFDPG_zjBTyrc,42219
|
| 76 |
+
pygments/lexers/asn1.py,sha256=MLakOeBFkdhKKr42eHFzonpGITEJxR_God8vqjWPva4,4267
|
| 77 |
+
pygments/lexers/automation.py,sha256=gdSYslkW9sblDcvMeK1ay15rb9vRuK56pPOJzdxlIvg,19834
|
| 78 |
+
pygments/lexers/bare.py,sha256=AdqL9Z20nd0bhNGWielLhAHej6V8_8m1OWUkCOrSBx8,3023
|
| 79 |
+
pygments/lexers/basic.py,sha256=NqNxIeHhjBUtenwCdJ88WWEE3N7a16DA9g1_D1mdmF0,27992
|
| 80 |
+
pygments/lexers/bdd.py,sha256=KeuOzXBLJRxxM2gV7aMuYsdV_aJFHyBuF8ptBpWxD5M,1644
|
| 81 |
+
pygments/lexers/berry.py,sha256=vIfT4sBtm6ao64WdNkJTVJmS00BiFdEWvb3obBXBeX8,3212
|
| 82 |
+
pygments/lexers/bibtex.py,sha256=sgfFqXyNyCxROHIe8C0gre69rzbADALnpDtTaqHfSas,4814
|
| 83 |
+
pygments/lexers/blueprint.py,sha256=dW-L5bFIiWxRPDashee2EOYmXIRHdwuCZ1y3iN-a6_0,6191
|
| 84 |
+
pygments/lexers/boa.py,sha256=VqYF1Yg_XdDA5tK_Eiuo1rr7ediBsKUTpB6xza_B5d4,3924
|
| 85 |
+
pygments/lexers/bqn.py,sha256=se4W2XPsNiT36z0Am9X5F4yNLrQvMI5X8miY6R9SEM8,3674
|
| 86 |
+
pygments/lexers/business.py,sha256=MXYomjQiYaTmnUgjQ7LUxjcU1i2iVDjZdXPTeqOlDjM,28348
|
| 87 |
+
pygments/lexers/c_cpp.py,sha256=2ViQoLY22Y6xdzXDmwz30rMcij7EemNq4vpTEsfl7sg,18321
|
| 88 |
+
pygments/lexers/c_like.py,sha256=rafLNQqcEbf-97VpDtSIQZSSmdiMD4oBYeEs7DZyByg,32024
|
| 89 |
+
pygments/lexers/capnproto.py,sha256=kc3rT95GkeQmrW1LeP5HMVb7Nk8sqXkW6OJkkWIHYbA,2177
|
| 90 |
+
pygments/lexers/carbon.py,sha256=_M-0YbofjZMrJIaiXKoT6wpkd3_6fFq-OdSZ7V961I4,3214
|
| 91 |
+
pygments/lexers/cddl.py,sha256=7Wri2q2yKexWo0CD7s2c7AoCAMbrwyEE6f_gz5B6x1Y,5079
|
| 92 |
+
pygments/lexers/chapel.py,sha256=SvZXNJijW0greFToDHZQ0yeo4_3niyTx31Iz_yLctck,5159
|
| 93 |
+
pygments/lexers/clean.py,sha256=_oV3Tbmrpl3S1phPMS6gyMWyGZGj6Wy0q8adpf5vunY,6421
|
| 94 |
+
pygments/lexers/codeql.py,sha256=hAX51uWeG5Zk9JhXSnOxPMaznFOpaX4ZnZHZ2krrPGk,2579
|
| 95 |
+
pygments/lexers/comal.py,sha256=0fcTyV5h36zPlxoQPWWGet2yaYi5ESXiFpx6EbsqP00,3182
|
| 96 |
+
pygments/lexers/compiled.py,sha256=PRimy7eb2weP7X6bEukz1JaSLuQAETO34K7maHLGbxA,1429
|
| 97 |
+
pygments/lexers/configs.py,sha256=YDBIWV_R2SiRb0Cbxol-S8RRieDfAg_YcThc1BmZ90I,50925
|
| 98 |
+
pygments/lexers/console.py,sha256=MrTIkXDYQ71z0yDepwbpO9WwXPQRPHAFAOvt_ngscxU,4183
|
| 99 |
+
pygments/lexers/cplint.py,sha256=wPs_Zh0OJ2_UUeF9_mu_r-X_65DJSWMCTKOmOyjWLz8,1392
|
| 100 |
+
pygments/lexers/crystal.py,sha256=k8Xy8TpfGKTPvsP1WikxILScILD8iXZ5qceLZopsLYE,15757
|
| 101 |
+
pygments/lexers/csound.py,sha256=7KHoJv8wtuIe9dques4mFFkQLULcGQ23dgZ_KBd0f_k,17001
|
| 102 |
+
pygments/lexers/css.py,sha256=OVjsd0Kn9pNH6iltS4ikjy9nnilPlCVx-VAZ26n3UJ8,26439
|
| 103 |
+
pygments/lexers/d.py,sha256=ee5oImP1BcHYZ93UwXoHIzw6BztgR3WCCv3ksu2J-o0,9923
|
| 104 |
+
pygments/lexers/dalvik.py,sha256=0f5mB5y8g0l1ID2liJ_5qM2NjyR_SBs7ckuIDeNbbj8,4609
|
| 105 |
+
pygments/lexers/data.py,sha256=MhLXoZXYMZFmmKlqL8RV5zp-eUwVb0yFzsyzXYrpKiw,27049
|
| 106 |
+
pygments/lexers/dax.py,sha256=N-5fxukBfFtFCT2LJoyg1VJsfldWHxXKLY3ZPLnPrig,8101
|
| 107 |
+
pygments/lexers/devicetree.py,sha256=Tig-tTSrpmGzbGxN2ka4MMTiC344roav9A4hoc9o_kw,4826
|
| 108 |
+
pygments/lexers/diff.py,sha256=-627lmuYpJ2uUVUM_orVGgXJGXIBGSVHbmlqflCEeaM,5385
|
| 109 |
+
pygments/lexers/dns.py,sha256=ElzSN3IEoRs1g6iWMnzVIV8H0x9WSEF1wBjm2a0ByxE,3894
|
| 110 |
+
pygments/lexers/dotnet.py,sha256=GmoaOxSoITkYdAUaVJ0Z1RQa6MvcRxh1gQ3XxgEs4X8,39444
|
| 111 |
+
pygments/lexers/dsls.py,sha256=a6Jdv3w1aF3vpQJrnF32MNHAl6pEZkkeGB1cYv-x2Hw,36753
|
| 112 |
+
pygments/lexers/dylan.py,sha256=fi8mSyni4dnGP5x1crE6BKNqLWJs4dDWdmkur-TbbNc,10412
|
| 113 |
+
pygments/lexers/ecl.py,sha256=XJ66PU9EjkXJwA4f1OfC0RdfP49v8N62RZXnFVVAYNo,6374
|
| 114 |
+
pygments/lexers/eiffel.py,sha256=m2eVPDG9J-VXieCeOy0S7zHPjiFHQB9F6bOIy-K3MDQ,2693
|
| 115 |
+
pygments/lexers/elm.py,sha256=Xj3HlbUTEkEUFwhem4NCujx55tQ2TS61_Kcf6BCPHAI,3155
|
| 116 |
+
pygments/lexers/elpi.py,sha256=RZqAVzdxfA_BqBmtMHj8ATw5f9e24SKL-QeO14QuKk4,7904
|
| 117 |
+
pygments/lexers/email.py,sha256=NPlGc2L6F3KWWDop3ZOJGpUM6LDnOEqKZj1YJG3vP2M,4807
|
| 118 |
+
pygments/lexers/erlang.py,sha256=2aUlVBVFtQdR2QISsDeKTOPjGrV7r1ckyXL17KJot9c,19150
|
| 119 |
+
pygments/lexers/esoteric.py,sha256=tmJ9Pa1wYtYgR6yDqgp3zDYuXPFzXw7SLTHOH_eE3p0,10503
|
| 120 |
+
pygments/lexers/ezhil.py,sha256=tbGYtGnqZAB8ffnyPdeMMJHtKYJ7OAciUFRrR_8QpXM,3275
|
| 121 |
+
pygments/lexers/factor.py,sha256=HBUqNcwd4VplYw30ScuC8YgdipFAYiqjRgWsyT0s4xQ,19533
|
| 122 |
+
pygments/lexers/fantom.py,sha256=w9IU1x61Codd7Oxv5DpvVlkVPn_bfvVLiP8Ae3660zM,10234
|
| 123 |
+
pygments/lexers/felix.py,sha256=DvPOs_Em6fFtUBQCaZWWHWgnvAFeBrDe97Cy9XyQ8ps,9658
|
| 124 |
+
pygments/lexers/fift.py,sha256=Q9OLJivp4ngqFso7APCvX85h-ghdbp9ZqpP8GKHws1M,1647
|
| 125 |
+
pygments/lexers/floscript.py,sha256=TcyuCiv9bAb89x1_7_Zq6nUhsdsHAF2DPsKZ6m1W1NU,2670
|
| 126 |
+
pygments/lexers/forth.py,sha256=4e0OCfJGcElkQrHInmQMucvsI9dljuPx4FYg38dyjno,7196
|
| 127 |
+
pygments/lexers/fortran.py,sha256=ouvOHdMbj56j40Nrj21WCRf4rNKpuwphxmtlUVsnzhc,10385
|
| 128 |
+
pygments/lexers/foxpro.py,sha256=nV8yyES39QoFmTNlM8xl3MteOsvmt6yV1l6x6xnXqIU,26298
|
| 129 |
+
pygments/lexers/freefem.py,sha256=ZmZLIYLXtCK2kWqGzBmrkp7ychOy7vgfaorafUkUl1I,26916
|
| 130 |
+
pygments/lexers/func.py,sha256=ZjOerj3njJcaGnHWc_npWjxb4D5O-udxBRK7RLHEibU,3703
|
| 131 |
+
pygments/lexers/functional.py,sha256=4m9JlAnfpXxSkQQIrNOob2VTwin6hPLAqWuhv9aVkAg,697
|
| 132 |
+
pygments/lexers/futhark.py,sha256=mCU2yvloJF5LN7uRE_8rCVqA8HAINny04HXVxjSiM4g,3746
|
| 133 |
+
pygments/lexers/gcodelexer.py,sha256=t8JMWaaDjWZwdGiRGwrpsYtfjKTmibwlRyOLCiJZ8qw,877
|
| 134 |
+
pygments/lexers/gdscript.py,sha256=VNOwd7KcDREvoBAfw66GjxxQygPsHH2akdzRbPNKqoQ,7569
|
| 135 |
+
pygments/lexers/gleam.py,sha256=Jx6LnUpWV9pmjdSYLUMt16c3UamZ-v5X6CcuEhWxf-8,2395
|
| 136 |
+
pygments/lexers/go.py,sha256=ynHVStw2XUJFlUiTS4UqY65fLkvcJBMNzoYtSNSl_BU,3786
|
| 137 |
+
pygments/lexers/grammar_notation.py,sha256=ZGYcwhSvOolw1J7cA9Pc7hVpcIselaCgxwsvAf5yRgc,8046
|
| 138 |
+
pygments/lexers/graph.py,sha256=X_IsdjxXZn5p9Dq4cLXyqwo4C8emcYA8NP6VZ9ZTBaU,4111
|
| 139 |
+
pygments/lexers/graphics.py,sha256=IeruxvEQR1Wsu-YyLpAjkUnisLDzUrk2cd0xXrDCbjw,39148
|
| 140 |
+
pygments/lexers/graphql.py,sha256=RWE_kfVUDEAnv_-SYyOi9IJUks61NvOakmUfWOlorzo,5604
|
| 141 |
+
pygments/lexers/graphviz.py,sha256=DRNWwetEWasJDtiLkdqkKsQHDryJ5W80wUD2PE6oKCs,1937
|
| 142 |
+
pygments/lexers/gsql.py,sha256=pzSj5Pd4vtNLES-pIdxaG0vOVTqUWE9UuOUw0RrY-oc,3993
|
| 143 |
+
pygments/lexers/hare.py,sha256=eCrRPwcswXL-ZHTWNlhE1A05G9rxzS20_IqSddv2M9Y,2652
|
| 144 |
+
pygments/lexers/haskell.py,sha256=sr5gq3U7xt0D2Bi41xdTsBaponX6otP1qPyRMCuxM7E,33323
|
| 145 |
+
pygments/lexers/haxe.py,sha256=_MzQJTWx18kD9bP_sniBshKbtOZDRm4OZnifaOgw_aY,31169
|
| 146 |
+
pygments/lexers/hdl.py,sha256=2jYX3fRWZ9mAZ_QER1WH58SvJaOdYQt0OmOxo3X2JK0,22741
|
| 147 |
+
pygments/lexers/hexdump.py,sha256=VvYp_NTaE-6NUuSG4FMezwcjxbPnAz0fOWMzr3Y2Gm4,3656
|
| 148 |
+
pygments/lexers/html.py,sha256=O6qkpyOylH2n1Zi1qzlmBsIEW31RfvzBn7jKTaAR2LQ,21999
|
| 149 |
+
pygments/lexers/idl.py,sha256=W2QRH1j9LMaNvC5jb6MkP4dLYo_OQU6lQlCAlQveFH4,15452
|
| 150 |
+
pygments/lexers/igor.py,sha256=Sv5EGBJeKy0UOyl6-GF3lBeeoWArVcMDJtQtl2RXRYo,31636
|
| 151 |
+
pygments/lexers/inferno.py,sha256=cjVMyOg6jhJ6nYX333Z6KaCCeS0pNVHv4WTxyFGY8Tg,3138
|
| 152 |
+
pygments/lexers/installers.py,sha256=ioK2JUPSJk9vcsoe3NASvMt-paXd1_Nn3e8WmaqJ7CE,14494
|
| 153 |
+
pygments/lexers/int_fiction.py,sha256=BUjvXilUiuMF-euXEQDzQZs45jn_aLs17eTKcfEptrI,56547
|
| 154 |
+
pygments/lexers/iolang.py,sha256=kMUBUqVvdHlB79ez0pFZPRf0NgiEC2SdtYUwdjnbE90,1908
|
| 155 |
+
pygments/lexers/j.py,sha256=56qUbs1C7wKdZ6-WpNnxHntNqsxWroqiO7keI2yoR1o,4856
|
| 156 |
+
pygments/lexers/javascript.py,sha256=muyCVZQAsXbhT7IHZkoqAkI5myhRaHze6JMAR4zILNs,63246
|
| 157 |
+
pygments/lexers/jmespath.py,sha256=726PDpRr1g2Ky_x5pZORhbXofXxkfr5HXQ8eHMhX5xg,2085
|
| 158 |
+
pygments/lexers/jslt.py,sha256=UOVw1J3uK-hVRWomoFK2jMS_yeuo5iqga-LhXUJI660,3703
|
| 159 |
+
pygments/lexers/json5.py,sha256=GyeZ58AxKkJJiiH7JuPmakDZXropa6bDkFRguJHifqU,2505
|
| 160 |
+
pygments/lexers/jsonnet.py,sha256=_T7Y16sW7nFuAoGFuyWUKCrUyJAC4FTWZVoeSt0mTXk,5639
|
| 161 |
+
pygments/lexers/jsx.py,sha256=O0evHioyudtWLhVmAXRrIfkEd5KRiokgHu8l9_Kn8sM,2696
|
| 162 |
+
pygments/lexers/julia.py,sha256=F0twMg0iLBNDdedsoJG4Rn5LoMciVu9cufyUVdxKQPY,11713
|
| 163 |
+
pygments/lexers/jvm.py,sha256=cf5V7NOLIvB2s7RM9wghESYRCoCDyrGjRuPmY8bfGAw,72936
|
| 164 |
+
pygments/lexers/kuin.py,sha256=n2lMina8SskpfA2KbPYQFwVJOSHgNYu10U5pz5YiajE,11408
|
| 165 |
+
pygments/lexers/kusto.py,sha256=pyUfWLf9Q0Qwqu74DyPAbRh20lkPDLhxnExD1FVl8Z4,3480
|
| 166 |
+
pygments/lexers/ldap.py,sha256=_ya4_InnSIRj-RYjGagWFZJDy1NdgQUocQzVWjiRp68,6554
|
| 167 |
+
pygments/lexers/lean.py,sha256=qP_iwUQ7MJZ1C5s3KYBW8Wu6-uuVj4PAG3a2Ghjp99U,8588
|
| 168 |
+
pygments/lexers/lilypond.py,sha256=o264ovGZFrcx8ZwpKRX-gjUECK1w5T8T0n6LoTjP92U,9755
|
| 169 |
+
pygments/lexers/lisp.py,sha256=a5MGcmtrWTaeEj_5Uv8YMODr3dVV6s1v1_SMBh_Ch9Q,157903
|
| 170 |
+
pygments/lexers/macaulay2.py,sha256=hLNDs1TdubudvqqovYN6a4Ne9JjnU4FvNE6EE2hPn8Q,34139
|
| 171 |
+
pygments/lexers/make.py,sha256=wAV0KRRXTAFMliLfAKXDihQIE2VAVUvWjFZ-yuM7a08,7834
|
| 172 |
+
pygments/lexers/maple.py,sha256=OBjODNLgqanyw522CE7n9thZctWi47Uua2hPBfj7KF4,7963
|
| 173 |
+
pygments/lexers/markup.py,sha256=4TMRfujXvOE9xiWwTiT_fq1lau4dKSoXYac1hWMLYRs,65264
|
| 174 |
+
pygments/lexers/math.py,sha256=Nspl6IZtCyh9egiYUahboWSmy4cJCVZUBxyVnCuF1ag,698
|
| 175 |
+
pygments/lexers/matlab.py,sha256=QYVBdA-IRNcuWggBJNC9lpq3jgX_1w9GQwpv907VfZM,133030
|
| 176 |
+
pygments/lexers/maxima.py,sha256=ha-f-JzGkjggAr5kxmVq7_uJTCcpHstQWnsLHYIhNwU,2718
|
| 177 |
+
pygments/lexers/meson.py,sha256=ZpNVp7lSHwJHEj7pwXlGcy9Lftdc6MMgJiOoY2TnfM8,4345
|
| 178 |
+
pygments/lexers/mime.py,sha256=l5BsFkad3agJ6KDg_IHI6nU0Ao0Y9EcwjYoYP8vQD-g,7585
|
| 179 |
+
pygments/lexers/minecraft.py,sha256=bBbMbqvsVgTfO7CBxf03oGP_qOAgrw06PSzH1QF7txs,13701
|
| 180 |
+
pygments/lexers/mips.py,sha256=QpgBoMPzsk1t90cIF0W_EV-QZ8LwgTapS-fSISxZcFc,4659
|
| 181 |
+
pygments/lexers/ml.py,sha256=shDPgWARTzTEhGDeblV7ZW2j6yZEeBiYqx2z24SDP7A,35393
|
| 182 |
+
pygments/lexers/modeling.py,sha256=2_ucVFy7Z4yoKx90E9-ASI9t4t1LIoeQ3yHarhghz-c,13764
|
| 183 |
+
pygments/lexers/modula2.py,sha256=dXW0KNFu3ETgABsPMsIhdJI0DKF-KWtT831FKsz2VXw,53075
|
| 184 |
+
pygments/lexers/mojo.py,sha256=imOlg8mQCoKwi_rsuMiifZrzsAsSqT2KckCs_MV5uVE,24236
|
| 185 |
+
pygments/lexers/monte.py,sha256=JTx-jSrFKlWRwA1qzhPd647ETGSElwhP4YMlVrfXyX8,6292
|
| 186 |
+
pygments/lexers/mosel.py,sha256=HEYOmZiANhe9VdkTpBt7mhPi_tPGBUkVsnzTh2HVdVI,9300
|
| 187 |
+
pygments/lexers/ncl.py,sha256=RZXkxOK-iHspLX_sFVT0wc5H6v-pa4kKghP79fJGQPQ,64002
|
| 188 |
+
pygments/lexers/nimrod.py,sha256=L8Ww5CUaP-ojywoQZXnjC08m5Be64fBynSf5aWGIaPw,6416
|
| 189 |
+
pygments/lexers/nit.py,sha256=xwu2P49Hu8YxEL7mgpV5WWFw6OYF1iJg9DVnc7H1SXk,2728
|
| 190 |
+
pygments/lexers/nix.py,sha256=M2E-k--F7pneuMAOae9ag4srJsKhWJ1f1fRueO6PtKM,4424
|
| 191 |
+
pygments/lexers/numbair.py,sha256=KZOw96Tj7Gly-f9F8NA-tdGd53SIt5UgbpokZsfnzWM,1761
|
| 192 |
+
pygments/lexers/oberon.py,sha256=uH1FkPeXCfdd0IQ_--S8SHUNaf2dnjiQZjtIT-jxu4A,4216
|
| 193 |
+
pygments/lexers/objective.py,sha256=KME-J0UL2HJYAk2fHNhf7ApQe4XF8GH6qGOvYA1wPS4,23300
|
| 194 |
+
pygments/lexers/ooc.py,sha256=HEjWHdQDVk7tRb_TuEb1_C5qi-peJwwyYBVAhf49MS0,3005
|
| 195 |
+
pygments/lexers/openscad.py,sha256=te2iL8VkfXul_PYXlz8UK3_QtMjdmNgt0YHCYEvdEtM,3703
|
| 196 |
+
pygments/lexers/other.py,sha256=OAlXzsrVDUx4Ma25fyG98U5LaBEHyt-LJZ2IHvMJJWY,1766
|
| 197 |
+
pygments/lexers/parasail.py,sha256=oPcs7fRYNkV0isPSRmw-2cPfMgzTtNPi6bJOm7vq-9o,2722
|
| 198 |
+
pygments/lexers/parsers.py,sha256=g4tVvf36yhT_aH_b737o0o1joojcf-XckD2HdNoNbsQ,26598
|
| 199 |
+
pygments/lexers/pascal.py,sha256=4dewXkwc12f_iiMfdNDqbxb_oqAEX2dCzb5VIZ62V54,30992
|
| 200 |
+
pygments/lexers/pawn.py,sha256=adsa-7sPuPk7mO7lB08auabEpeZdNewVqTBg6FS8mCk,8256
|
| 201 |
+
pygments/lexers/pddl.py,sha256=a8A2keCF9qNQvVZQirgBV5fH4u3cjrta8-eZJ8tsxmY,2992
|
| 202 |
+
pygments/lexers/perl.py,sha256=uYMj6amZPawLf-KjICg9LLU5-ADKzqEYKqi7VXnvm0k,39195
|
| 203 |
+
pygments/lexers/phix.py,sha256=nEWWt5-OoIDapw4IJ_cNL19Th8Ztt6OIQgeuogVed10,23252
|
| 204 |
+
pygments/lexers/php.py,sha256=U6wmxPM-pS-SY1N3qdv0ebUDBxLH6-EFIFcatUvg74w,13171
|
| 205 |
+
pygments/lexers/pointless.py,sha256=gNcuhhOY9cEpIPyGFjMh2DItNB1UD8CmjceXkDRModE,1977
|
| 206 |
+
pygments/lexers/pony.py,sha256=HKqf5AngUOdXN1N1VvSg0jTj3NUAzGBOPdXwSFamvmM,3282
|
| 207 |
+
pygments/lexers/praat.py,sha256=sfVAd7zfRsI-TcCouuYMWlcU8EBxAwJ4wkh0ZuNsZ34,12679
|
| 208 |
+
pygments/lexers/procfile.py,sha256=fhRTtscyMMPcPbvzjxVtXix1mYlpO-4JuWUL7Db4ENI,1158
|
| 209 |
+
pygments/lexers/prolog.py,sha256=4YvPZbAFLWNZMbZhvtIulWib0PQLA_TB93gjkNywFRA,12869
|
| 210 |
+
pygments/lexers/promql.py,sha256=04fS_R6HBWhpKNe3WPp_QXgIdFvJr5p6KxStZYw7yHU,4741
|
| 211 |
+
pygments/lexers/prql.py,sha256=XJhd8dpEWPBIKmQXx_09-z1NyotLXIskpuzX36HykHo,8750
|
| 212 |
+
pygments/lexers/ptx.py,sha256=dEaNSReAjAymIwVM_MnbdY4hd3muK79q200hYwN72cw,4504
|
| 213 |
+
pygments/lexers/python.py,sha256=79A_yJqjVHp_ZeS1rY8Pcc4cwZ_7-zI2WWkeUmZgUrA,54202
|
| 214 |
+
pygments/lexers/q.py,sha256=2CbJYgRu8uz8wOSp5FMr086KCC7IjSRmIODVY0uKrCA,6939
|
| 215 |
+
pygments/lexers/qlik.py,sha256=9b6Q-6jXeeraIRcWtsKsYWCOlBhfmjNzIN49pUvMR-I,3696
|
| 216 |
+
pygments/lexers/qvt.py,sha256=rpT5oD4awEKMs3uBCbNlzY1zCz7AVeqM-BikLTQHo8k,6106
|
| 217 |
+
pygments/lexers/r.py,sha256=hzgUUH9gCsqqwTG9eCt1JVMd9RW0dy6IY_jTvRntF-U,6477
|
| 218 |
+
pygments/lexers/rdf.py,sha256=FM154fB1lxfOpSpeW6bWOVld5kJBgEuYyT9udt-EcK0,16063
|
| 219 |
+
pygments/lexers/rebol.py,sha256=CQ3pMaAz64UMqiQVrYoREnOgjU5QPeF_H3aaHNdVRC8,18262
|
| 220 |
+
pygments/lexers/rego.py,sha256=Yi0G4secTWOL7CUhLLCzJ9gA6SJzDJpPJNij3hXixC0,1751
|
| 221 |
+
pygments/lexers/rell.py,sha256=0gZStI953aFjFMyMVX_UKfwZmzV3uj3Tnl_5F20BPx0,2487
|
| 222 |
+
pygments/lexers/resource.py,sha256=RDEY7iSv2hgQ3V-I1DeOKVOumNKgFqbV2Me_9Y21o10,2930
|
| 223 |
+
pygments/lexers/ride.py,sha256=1zg7kGYPKRIekyuZY3f6OVqRlXyrX-sR-tHEX1M9nz4,5038
|
| 224 |
+
pygments/lexers/rita.py,sha256=fCNElPik6dDIZzGd96kKgdlY4Qqp_zVI87waTBHMBfg,1130
|
| 225 |
+
pygments/lexers/rnc.py,sha256=PNfnnTlnZjNvvG33BNMCqPzdA9LZEYvDsGoaDd_2mn8,1975
|
| 226 |
+
pygments/lexers/roboconf.py,sha256=l6BeJIS-ZAUb3zc5GEuVIb0edrRpPFmKdffEBx74Zxg,2077
|
| 227 |
+
pygments/lexers/robotframework.py,sha256=8s1U7GldhzRPGR7d8_rMSG0ZJz9ZOm-LGqBTGILwt2U,18451
|
| 228 |
+
pygments/lexers/ruby.py,sha256=BxndG-3gLg7wEGvICiNDAMygQR9Qs0xrmq7DwfoLvMs,22756
|
| 229 |
+
pygments/lexers/rust.py,sha256=7qD3KGVir-tUWf_bPBt4EX8l9aIWe8TblMCFI75oorc,8263
|
| 230 |
+
pygments/lexers/sas.py,sha256=9hmGYhmKo7ri9oCmZdsoEFMz6z3AwKD4LcTUIn52lYU,9459
|
| 231 |
+
pygments/lexers/savi.py,sha256=HCllgBe3rzP_7-2b1hSUEbE2dYz08Iysxc6Dcxj3f2c,4881
|
| 232 |
+
pygments/lexers/scdoc.py,sha256=9n64S-bO1dI4x-2Kzh2jrDM6gEmB5YI7ch6ndPB4-cw,2527
|
| 233 |
+
pygments/lexers/scripting.py,sha256=c-i_cMFhYEHQZZbLgJn0jyiD52vWeZVxUK6wFV2Fib4,82959
|
| 234 |
+
pygments/lexers/sgf.py,sha256=ya_sG4TOvDWwzEM6cIi40XSbhkTuHCqvo-uHnNYfi5Q,1988
|
| 235 |
+
pygments/lexers/shell.py,sha256=si6MAn6S7pHfyX65NkwQdjxtLtEu1M4l7K2lUHvyzWw,36384
|
| 236 |
+
pygments/lexers/sieve.py,sha256=CXR9S1nGeVTln2u5R600hxgkAmJFVVTTTBh_k3aw-pk,2517
|
| 237 |
+
pygments/lexers/slash.py,sha256=molh5sNG8UtheHffQGjjHLxVtyg2oCp4B8cvgDyf004,8487
|
| 238 |
+
pygments/lexers/smalltalk.py,sha256=q52NHegl3pjn1jMkJWA9J0nOA_A5VzUULZAPgb-6uNU,7207
|
| 239 |
+
pygments/lexers/smithy.py,sha256=hqEImo4B-i0hddNo1r0k5eHLOlArtRW4W5PsLBdllk4,2662
|
| 240 |
+
pygments/lexers/smv.py,sha256=D51In9Qr2nWFicYAOX_bJpeFgmJ3BUkEXnvXPmA04D4,2808
|
| 241 |
+
pygments/lexers/snobol.py,sha256=BX_1VPUZi-ckKCYlF2sttQprF2bLUHOi8blhInFHv9s,2781
|
| 242 |
+
pygments/lexers/solidity.py,sha256=pz0DZ0xiHwufhbQ9hdCPrHMjA7NMsa6hxZ1nO-A4Y3E,3166
|
| 243 |
+
pygments/lexers/soong.py,sha256=TVqBJzJxLwCEDmb5Aix2_AVuZILYyPWcAzFbzINNQAM,2342
|
| 244 |
+
pygments/lexers/sophia.py,sha256=MAkWLYxhHJNcc3UUzWD3VDLzVRbf6IAd2uz4q7DY3wI,3379
|
| 245 |
+
pygments/lexers/special.py,sha256=8gpTiLICFNwIcahm282mi8Nqi_6gwYMsAfjJIM2Bq6k,3588
|
| 246 |
+
pygments/lexers/spice.py,sha256=UcrjK2KJDDKSEgEOeLXTayqRwirWdsywrfH9MqwPPIY,2801
|
| 247 |
+
pygments/lexers/sql.py,sha256=zz_TFZtf5R29cvkBFG1PDJ-0KKrY7FjA-RDky-gfNlk,41656
|
| 248 |
+
pygments/lexers/srcinfo.py,sha256=MHj02VB7WP3AcoOz1WVYAqNM_3oFLjEaAda075kXVBU,1749
|
| 249 |
+
pygments/lexers/stata.py,sha256=KojmkxWHlEk-HvmxI313a52nzH_JHNqfv6r3jJoFDy8,6418
|
| 250 |
+
pygments/lexers/supercollider.py,sha256=H-qwP6sUaotemsXxuugpui6KnU3jtIdDfS3bGt3Jvh4,3700
|
| 251 |
+
pygments/lexers/tablegen.py,sha256=ryuzw-ArLdvlY55YJBn6ebOzDo3L8UnbR5xcZB8xMso,4012
|
| 252 |
+
pygments/lexers/tact.py,sha256=YbOWYNp302ZBPM5affzM4-CudJ4xRZyJb-_vSDCozCo,10812
|
| 253 |
+
pygments/lexers/tal.py,sha256=xZYmhv8mBr-A3oeoFkcSP7nDbX1r21kKOnhsLTtL3bE,2907
|
| 254 |
+
pygments/lexers/tcl.py,sha256=MXMAo2wCZeq5oR7VzsNbamawun_vMOk2gOEDnGk6yOc,5515
|
| 255 |
+
pygments/lexers/teal.py,sha256=pgpPi9xWPumSr-heSpGBGDcU5s3qN0aFUj2maHLE3MM,3525
|
| 256 |
+
pygments/lexers/templates.py,sha256=ndJMdue33qQ_thsortAra1fm_-szMN40S5bZXBLY54w,75734
|
| 257 |
+
pygments/lexers/teraterm.py,sha256=YCdvILRq-FdOJ_HfiIkYVToH3c6I2QRbQoH17Q49Hx8,10045
|
| 258 |
+
pygments/lexers/testing.py,sha256=GF5SpanGwjgKKoYari32SdtdOWWXXje8xVX5-ZzTjLg,10813
|
| 259 |
+
pygments/lexers/text.py,sha256=yq6mOLz3PizKNMm4_Y8UHn9vEeBfqEY5W-3M7dk1jYs,1071
|
| 260 |
+
pygments/lexers/textedit.py,sha256=V-Ijh0eULTWtx3S_6vT7JcyjQO-CNirpAbEpkczLGCE,7763
|
| 261 |
+
pygments/lexers/textfmts.py,sha256=WSiJDzNKCcOsBoTU4NCYU33ti5ZHGi0Px29eGjT6pB0,15527
|
| 262 |
+
pygments/lexers/theorem.py,sha256=c-eg6tIYWUbxSYgrOtLZfFxro4g91JcAIwrIJGLPooU,17903
|
| 263 |
+
pygments/lexers/thingsdb.py,sha256=FNKjArS1vadHEN3ZXaZdDLqvcG59GbF6Ak5M8RMsTLU,6257
|
| 264 |
+
pygments/lexers/tlb.py,sha256=vWsFq_MrIrzgG2q-qdzpcoNiv9KkNow4x9ebs9_HAwA,1453
|
| 265 |
+
pygments/lexers/tls.py,sha256=GZ1lvZ8PUk1-LThq1KuiqSEnMqJVqiHo_A-16aKuJOc,1543
|
| 266 |
+
pygments/lexers/tnt.py,sha256=MNYTfkix0x5L1pDV8V8zGLS7GU8z7bt-wpiBap2W09U,10459
|
| 267 |
+
pygments/lexers/trafficscript.py,sha256=1Tawom6bKJM-u1kYey21xFaHep3D9kl62rV3RaHSvcI,1509
|
| 268 |
+
pygments/lexers/typoscript.py,sha256=dWAuOYYk0X4xE_fxKgcXz-sMYlG2wxQR4m_d7PW2PYs,8335
|
| 269 |
+
pygments/lexers/typst.py,sha256=ZtV37NCQCoSqEKrAhffuZtUp1kDahKQx8PxMLrR2G6k,7170
|
| 270 |
+
pygments/lexers/ul4.py,sha256=joM-US0-2BEWRHHK6eyZ-Y--306YgbMrevMY0hg8QTY,10502
|
| 271 |
+
pygments/lexers/unicon.py,sha256=9D-GilKOqIEaowGHmdvHRjhqyigRk320ARAr-G_snew,18628
|
| 272 |
+
pygments/lexers/urbi.py,sha256=j87k6fe60kZdbJ6AJA4g9E0no1EP0bxJY06UVP0YgnU,6085
|
| 273 |
+
pygments/lexers/usd.py,sha256=tP9kHPZUJcE_flPvKEsF7wTck4FuQW75S8ELh4IYJEI,3307
|
| 274 |
+
pygments/lexers/varnish.py,sha256=INCtYbol1yV_NXMh51CMDZDacEHgiB3SmR3H5uW-Fkc,7476
|
| 275 |
+
pygments/lexers/verification.py,sha256=QISJmmz7cmYaXZphW5so4PfdKJo0rdZWuj_de64mafk,3937
|
| 276 |
+
pygments/lexers/verifpal.py,sha256=0iZTQWawF9f7lFZnFNPTwYRiu6L_25PtEI83tuCAmKY,2664
|
| 277 |
+
pygments/lexers/vip.py,sha256=pM5xFoeu-2GPWqAVzZJe6xPYr6WJPlozVI5084SHQ80,5714
|
| 278 |
+
pygments/lexers/vyper.py,sha256=rw2yD9c2L7yPtXqKPd0RdxJSZK-aJbW5jEa0gHfKEO0,5618
|
| 279 |
+
pygments/lexers/web.py,sha256=YMrxoHlKlQwfFJlae9_T9F1Vp03YA7IWsmgqLzh6pgI,916
|
| 280 |
+
pygments/lexers/webassembly.py,sha256=Y48VdBp8b4SI10PEt8biOm-gteYgmNc_bRR-KvulfnQ,5701
|
| 281 |
+
pygments/lexers/webidl.py,sha256=MQMaZFskluB29lMGpiGP2f6fzoja4vV8FtoCGFQH6fM,10519
|
| 282 |
+
pygments/lexers/webmisc.py,sha256=GnSTSHfsAUGy5DYF_qwFmMsyabnzTstaEG96Fub53fk,40567
|
| 283 |
+
pygments/lexers/wgsl.py,sha256=vgDtY_q42TGRvcsyS7viSadU8D3eHvatfoCNNnEP0zE,11883
|
| 284 |
+
pygments/lexers/whiley.py,sha256=MC2V7o1s7LIoLy0Fk-i8OymBoN0dpK2BPjIrdQwsnVk,4020
|
| 285 |
+
pygments/lexers/wowtoc.py,sha256=XnLSSX7p_RkwZIzlmYXO873d4byX9-A3dfvzNL5Eocw,4079
|
| 286 |
+
pygments/lexers/wren.py,sha256=2lhzwpS27xW6nERY_NeODgNN9X6mB7vl3odXSPngqY8,3232
|
| 287 |
+
pygments/lexers/x10.py,sha256=77pAyohtv9PFwPvJPGgq-Vw8tEXo9Sny1MnTchFpTTI,1946
|
| 288 |
+
pygments/lexers/xorg.py,sha256=LUKU91t1Opc3W_F64UGzx0nB-HqKlN3Cn_6tFzt5IYw,928
|
| 289 |
+
pygments/lexers/yang.py,sha256=yIvwteHWBWL2-8zZscnCPJOnq3rMOXh5lxJujywA_Zo,4502
|
| 290 |
+
pygments/lexers/yara.py,sha256=_ISzhko7v9AhJ-1cWINZSyG3my2vJOyFSHxSjm4VdTY,2430
|
| 291 |
+
pygments/lexers/zig.py,sha256=q0tuplpRFAUSS29hg_XiRH22Ctve2EFAT5xo7TNAlrk,3975
|
| 292 |
+
pygments/modeline.py,sha256=me8g5rySidvPtMBOrDy2O1sMqZd02lBHMY5KDZefUws,1008
|
| 293 |
+
pygments/plugin.py,sha256=P6zIw-vkSQ0k1WKHrzbBTjpwlCZPbR-6Qe_dO9Bjdu0,1928
|
| 294 |
+
pygments/regexopt.py,sha256=d2hTvazlow5zzZIOCVnfeEG2CY0GrY_igH1kCSSf7ow,3308
|
| 295 |
+
pygments/scanner.py,sha256=DtoLi1pOKpNu-6jiakJpSQLUi_ep29SQQhv7oAwYWME,3095
|
| 296 |
+
pygments/sphinxext.py,sha256=qmiWv5b7qq6bNUT2Y2wZejV2ImQmvtzGJFg6LcGENl0,7901
|
| 297 |
+
pygments/style.py,sha256=Hrie373bgWU81ZNwVjZM-GNBoxBxVe1W1Tr3MzJLdkY,6411
|
| 298 |
+
pygments/styles/__init__.py,sha256=2vgGKnbyt0nf_CSDEtMhHxppPSAPr2jafzl5FiXFuGs,2009
|
| 299 |
+
pygments/styles/_mapping.py,sha256=6lovFUE29tz6EsV3XYY4hgozJ7q1JL7cfO3UOlgnS8w,3312
|
| 300 |
+
pygments/styles/abap.py,sha256=T7Ad121Kjz8ZbuphyhulULwXyvXubSS6Czc0MDOFiJ8,752
|
| 301 |
+
pygments/styles/algol.py,sha256=6v6ZXLxPJsm_1qPqOu5ihAuWhVk644NdPXPcZqiOTTI,2265
|
| 302 |
+
pygments/styles/algol_nu.py,sha256=581Lf5db303g7zDb7z-VlvGlFNpbXMIlAnrRBxtjGts,2286
|
| 303 |
+
pygments/styles/arduino.py,sha256=oFF5gjfbQNBigKxFhC7giUIHWl0ieCshhsm9UxCIzqg,4560
|
| 304 |
+
pygments/styles/autumn.py,sha256=P9IX5utjDvdJgevM0kNGwE-wvVysRh1lgMkjO1dhDDE,2198
|
| 305 |
+
pygments/styles/borland.py,sha256=V8qTD8SrS0wLohp2udIirlijbHfPoIlWZkYpqxSdkSw,1614
|
| 306 |
+
pygments/styles/bw.py,sha256=e4Fo6Kyax2aRhqKsjsqvi2CW6lkU9QnjKoPrESZAj-I,1409
|
| 307 |
+
pygments/styles/coffee.py,sha256=0jxdctCEKbR1AqzA59fFQK4sVBdErrRkGCUn6fPF4sg,2311
|
| 308 |
+
pygments/styles/colorful.py,sha256=opkfOcjFTtDn9Fty6ogM7okFMB6bA0iR0VtTdBPE9NE,2835
|
| 309 |
+
pygments/styles/default.py,sha256=WFLDucKJS_ac5Jqutmglbz4ITc4jTTQEOnqLIMpSttA,2591
|
| 310 |
+
pygments/styles/dracula.py,sha256=H-EM1WM3Ixd2OBY9bzoObKl4IzdmhirfDVFbJ9Wsi0Q,2185
|
| 311 |
+
pygments/styles/emacs.py,sha256=iEYWPgQrDQk4RdDf8-g7j4mtoFRzo2xcKvZE1ys9mJU,2538
|
| 312 |
+
pygments/styles/friendly.py,sha256=S43XMczW53tKftmarEL4-nTroPVdN6k8fbNrINzR_QU,2607
|
| 313 |
+
pygments/styles/friendly_grayscale.py,sha256=el2E804DEkKZ6ApXt3N5FTmHAkIhqkJj-omhE1E8mdE,2831
|
| 314 |
+
pygments/styles/fruity.py,sha256=mrNDixp39QIoitRBo-yMOr8tnYLAwGd0EIMw2A6Gd8g,1327
|
| 315 |
+
pygments/styles/gh_dark.py,sha256=yb4EOBAYsQ9g5IGEOqyZ5LKI-MUbwz32l9WB5EcMLaA,3593
|
| 316 |
+
pygments/styles/gruvbox.py,sha256=_QZtRq9y1s3NYADHqek-DXELQqueOnVDXvWJ_1aTGgo,3390
|
| 317 |
+
pygments/styles/igor.py,sha256=QO_M5-Z1xIxVnusEU4LZr4VT--nTERVt-cpfbnOv4yk,740
|
| 318 |
+
pygments/styles/inkpot.py,sha256=bJvNWikqnAWLjx2AH4t_tW4jR0TsrUyVFXFVPAfOgkM,2407
|
| 319 |
+
pygments/styles/lightbulb.py,sha256=CnDv1mF1X5k1msVvRS_diR4tkp06E_jg0tK9cdHEFCQ,3175
|
| 320 |
+
pygments/styles/lilypond.py,sha256=gSCiazPPWfR_9-BV5BYHe6-2gSor4vOHnz3nyFQI2QA,2069
|
| 321 |
+
pygments/styles/lovelace.py,sha256=vZ-S9tS-QUOwfA0RHYBhSTRE3h1ZU-bZnuMW7O6ksyw,3181
|
| 322 |
+
pygments/styles/manni.py,sha256=dpsJC1Zees0e9IcWirqWuSzQxwD0jIbjhFquM23dmWM,2446
|
| 323 |
+
pygments/styles/material.py,sha256=eyyAaJgp1Fnjl4-_D39_l1wH5CW4W0VWScQ3Q0jtAgU,4204
|
| 324 |
+
pygments/styles/monokai.py,sha256=3CwJJm_YVGibzFi8nhK_b5d4cNzgV8z-L6RzC1UVA7Q,5187
|
| 325 |
+
pygments/styles/murphy.py,sha256=HsPd80nObb3Ov3-7yJQbnJr3z9mCyz30Pjn_nkWkMYo,2808
|
| 326 |
+
pygments/styles/native.py,sha256=oazEJUbuaHqqOZR5vx-jIhTPIw7dC6QZnKxW-xLr7fs,2046
|
| 327 |
+
pygments/styles/nord.py,sha256=t7fZj04LUgsLaHpio66FqOGMKb7a2VC3teUlmInPfRg,5394
|
| 328 |
+
pygments/styles/onedark.py,sha256=UXrMzVvA9OVP7OhCQ5gL0CaZrk5jo_I84HJm7LEN5GQ,2126
|
| 329 |
+
pygments/styles/paraiso_dark.py,sha256=rx5_j4gnZRy2j-3hAhFmWpnjnd-Vfz3Z7fcwEXRUGm0,5665
|
| 330 |
+
pygments/styles/paraiso_light.py,sha256=iERjbYRemqgsisv_9TjanBig4bJ_-80xRz5B5puhMc0,5671
|
| 331 |
+
pygments/styles/pastie.py,sha256=mnKebFiJ2do9A_wTPq4tKtgw-TQqpb0lP3kNbemQ2to,2528
|
| 332 |
+
pygments/styles/perldoc.py,sha256=-e1T4QBEQNE_l17RYW-WBowNprg2uL_hFjhSDcaMiDM,2233
|
| 333 |
+
pygments/styles/rainbow_dash.py,sha256=YP2HPVXJLmOy8Yz8p8u5GbkAyuKxLlNmu6ITZBMa1Mc,2393
|
| 334 |
+
pygments/styles/rrt.py,sha256=vs4pnWwmMIQR0eGczp06AYazsYiR0KFcRiRUzSf3rXc,1295
|
| 335 |
+
pygments/styles/sas.py,sha256=ER-JjZgU2wEJWk5K06iHAFPjVYD1iMkvjjE0rlNOt2Y,1443
|
| 336 |
+
pygments/styles/solarized.py,sha256=VdtLYhQ7xDj_iTHP_Ekr6rAdMcE3fRSrglngVSal63M,4250
|
| 337 |
+
pygments/styles/staroffice.py,sha256=peExkIBqPkRhqXFpW99n49t6pMwehI_pDYVUmQwkgdA,834
|
| 338 |
+
pygments/styles/stata_dark.py,sha256=N6imWykqHoT5drOn-sVRUzt1AZMKG3HHU-Q7LKz2d50,1260
|
| 339 |
+
pygments/styles/stata_light.py,sha256=YW7ih4teXoEuUHImOK2rGSCVxfnj43tlcKPXUsrDkRg,1292
|
| 340 |
+
pygments/styles/tango.py,sha256=Af0WVTxpH_cUdHr_ua69JDijTLI5aG1RmBTF7o2KTgk,7140
|
| 341 |
+
pygments/styles/trac.py,sha256=-h5iU-LjSmt-dQ7y5jXwJ5LQ9ABR5QD5RlPRjhnzmv8,1984
|
| 342 |
+
pygments/styles/vim.py,sha256=dWqCVC2YT45dLSpMTwLBPkKYgRsT1-cFf7ZHoc2PQpA,2022
|
| 343 |
+
pygments/styles/vs.py,sha256=7HJehhtiHE5nibjC3r3X-aYHBm5BccL33LgO_4anEiU,1133
|
| 344 |
+
pygments/styles/xcode.py,sha256=HmB6aPkxvmo4za5DijhLb5AXSyv6UbWnwOUoRUNBaZA,1507
|
| 345 |
+
pygments/styles/zenburn.py,sha256=Ax7iBbMzvVQNTpT3YdMwCEkL-nIXnpr60aVrR4Lpa6o,2206
|
| 346 |
+
pygments/token.py,sha256=DVil5T2ltHkTgQTUYy1dMtgyigjavCs1ypE4Qf2CrGo,6229
|
| 347 |
+
pygments/unistring.py,sha256=Z4w4HfOVUhueCURRkfhAqQ2b-69UzkhY4xuHevYEy5g,63211
|
| 348 |
+
pygments/util.py,sha256=zk935tJSpwSA9zxNmV1TuhcEP0MfboXiRZSGQnLPEqk,10046
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/REQUESTED
ADDED
|
File without changes
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: hatchling 1.29.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[console_scripts]
|
| 2 |
+
pygmentize = pygments.cmdline:main
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/licenses/AUTHORS
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Pygments is written and maintained by Georg Brandl <georg@python.org>.
|
| 2 |
+
|
| 3 |
+
Major developers are Tim Hatch <tim@timhatch.com> and Armin Ronacher
|
| 4 |
+
<armin.ronacher@active-4.com>.
|
| 5 |
+
|
| 6 |
+
Other contributors, listed alphabetically, are:
|
| 7 |
+
|
| 8 |
+
* Sam Aaron -- Ioke lexer
|
| 9 |
+
* Jean Abou Samra -- LilyPond lexer
|
| 10 |
+
* João Abecasis -- JSLT lexer
|
| 11 |
+
* Ali Afshar -- image formatter
|
| 12 |
+
* Thomas Aglassinger -- Easytrieve, JCL, Rexx, Transact-SQL and VBScript
|
| 13 |
+
lexers
|
| 14 |
+
* Maxence Ahlouche -- PostgreSQL Explain lexer
|
| 15 |
+
* Muthiah Annamalai -- Ezhil lexer
|
| 16 |
+
* Nikolay Antipov -- OpenSCAD lexer
|
| 17 |
+
* Kumar Appaiah -- Debian control lexer
|
| 18 |
+
* Andreas Amann -- AppleScript lexer
|
| 19 |
+
* Timothy Armstrong -- Dart lexer fixes
|
| 20 |
+
* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
|
| 21 |
+
* Eiríkr Åsheim -- Uxntal lexer
|
| 22 |
+
* Jeremy Ashkenas -- CoffeeScript lexer
|
| 23 |
+
* José Joaquín Atria -- Praat lexer
|
| 24 |
+
* Stefan Matthias Aust -- Smalltalk lexer
|
| 25 |
+
* Lucas Bajolet -- Nit lexer
|
| 26 |
+
* Ben Bangert -- Mako lexers
|
| 27 |
+
* Max Battcher -- Darcs patch lexer
|
| 28 |
+
* Thomas Baruchel -- APL lexer
|
| 29 |
+
* Tim Baumann -- (Literate) Agda lexer
|
| 30 |
+
* Paul Baumgart, 280 North, Inc. -- Objective-J lexer
|
| 31 |
+
* Michael Bayer -- Myghty lexers
|
| 32 |
+
* Thomas Beale -- Archetype lexers
|
| 33 |
+
* John Benediktsson -- Factor lexer
|
| 34 |
+
* David Benjamin, Google LLC -- TLS lexer
|
| 35 |
+
* Trevor Bergeron -- mIRC formatter
|
| 36 |
+
* Vincent Bernat -- LessCSS lexer
|
| 37 |
+
* Christopher Bertels -- Fancy lexer
|
| 38 |
+
* Sébastien Bigaret -- QVT Operational lexer
|
| 39 |
+
* Jarrett Billingsley -- MiniD lexer
|
| 40 |
+
* Adam Blinkinsop -- Haskell, Redcode lexers
|
| 41 |
+
* Stéphane Blondon -- Procfile, SGF and Sieve lexers
|
| 42 |
+
* Frits van Bommel -- assembler lexers
|
| 43 |
+
* Pierre Bourdon -- bugfixes
|
| 44 |
+
* Martijn Braam -- Kernel log lexer, BARE lexer
|
| 45 |
+
* JD Browne, Google LLC -- GoogleSQL lexer
|
| 46 |
+
* Matthias Bussonnier -- ANSI style handling for terminal-256 formatter
|
| 47 |
+
* chebee7i -- Python traceback lexer improvements
|
| 48 |
+
* Hiram Chirino -- Scaml and Jade lexers
|
| 49 |
+
* Mauricio Caceres -- SAS and Stata lexers.
|
| 50 |
+
* Michael Camilleri, John Gabriele, sogaiu -- Janet lexer
|
| 51 |
+
* Daren Chandisingh -- Gleam lexer
|
| 52 |
+
* Ian Cooper -- VGL lexer
|
| 53 |
+
* David Corbett -- Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers
|
| 54 |
+
* Leaf Corcoran -- MoonScript lexer
|
| 55 |
+
* Fraser Cormack -- TableGen lexer
|
| 56 |
+
* Gabriel Corona -- ASN.1 lexer
|
| 57 |
+
* Christopher Creutzig -- MuPAD lexer
|
| 58 |
+
* Daniël W. Crompton -- Pike lexer
|
| 59 |
+
* Pete Curry -- bugfixes
|
| 60 |
+
* Bryan Davis -- EBNF lexer
|
| 61 |
+
* Bruno Deferrari -- Shen lexer
|
| 62 |
+
* Walter Dörwald -- UL4 lexer
|
| 63 |
+
* Luke Drummond -- Meson lexer
|
| 64 |
+
* Giedrius Dubinskas -- HTML formatter improvements
|
| 65 |
+
* Owen Durni -- Haxe lexer
|
| 66 |
+
* Alexander Dutton, Oxford University Computing Services -- SPARQL lexer
|
| 67 |
+
* James Edwards -- Terraform lexer
|
| 68 |
+
* Nick Efford -- Python 3 lexer
|
| 69 |
+
* Sven Efftinge -- Xtend lexer
|
| 70 |
+
* Artem Egorkine -- terminal256 formatter
|
| 71 |
+
* Matthew Fernandez -- CAmkES lexer
|
| 72 |
+
* Paweł Fertyk -- GDScript lexer, HTML formatter improvements
|
| 73 |
+
* Michael Ficarra -- CPSA lexer
|
| 74 |
+
* James H. Fisher -- PostScript lexer
|
| 75 |
+
* Amanda Fitch, Google LLC -- GoogleSQL lexer
|
| 76 |
+
* William S. Fulton -- SWIG lexer
|
| 77 |
+
* Carlos Galdino -- Elixir and Elixir Console lexers
|
| 78 |
+
* Michael Galloy -- IDL lexer
|
| 79 |
+
* Naveen Garg -- Autohotkey lexer
|
| 80 |
+
* Simon Garnotel -- FreeFem++ lexer
|
| 81 |
+
* Laurent Gautier -- R/S lexer
|
| 82 |
+
* Alex Gaynor -- PyPy log lexer
|
| 83 |
+
* Richard Gerkin -- Igor Pro lexer
|
| 84 |
+
* Alain Gilbert -- TypeScript lexer
|
| 85 |
+
* Alex Gilding -- BlitzBasic lexer
|
| 86 |
+
* GitHub, Inc -- DASM16, Augeas, TOML, and Slash lexers
|
| 87 |
+
* Bertrand Goetzmann -- Groovy lexer
|
| 88 |
+
* Krzysiek Goj -- Scala lexer
|
| 89 |
+
* Rostyslav Golda -- FloScript lexer
|
| 90 |
+
* Andrey Golovizin -- BibTeX lexers
|
| 91 |
+
* Matt Good -- Genshi, Cheetah lexers
|
| 92 |
+
* Michał Górny -- vim modeline support
|
| 93 |
+
* Alex Gosse -- TrafficScript lexer
|
| 94 |
+
* Patrick Gotthardt -- PHP namespaces support
|
| 95 |
+
* Hubert Gruniaux -- C and C++ lexer improvements
|
| 96 |
+
* Olivier Guibe -- Asymptote lexer
|
| 97 |
+
* Phil Hagelberg -- Fennel lexer
|
| 98 |
+
* Florian Hahn -- Boogie lexer
|
| 99 |
+
* Martin Harriman -- SNOBOL lexer
|
| 100 |
+
* Matthew Harrison -- SVG formatter
|
| 101 |
+
* Steven Hazel -- Tcl lexer
|
| 102 |
+
* Dan Michael Heggø -- Turtle lexer
|
| 103 |
+
* Aslak Hellesøy -- Gherkin lexer
|
| 104 |
+
* Greg Hendershott -- Racket lexer
|
| 105 |
+
* Justin Hendrick -- ParaSail lexer
|
| 106 |
+
* Jordi Gutiérrez Hermoso -- Octave lexer
|
| 107 |
+
* David Hess, Fish Software, Inc. -- Objective-J lexer
|
| 108 |
+
* Ken Hilton -- Typographic Number Theory and Arrow lexers
|
| 109 |
+
* Varun Hiremath -- Debian control lexer
|
| 110 |
+
* Rob Hoelz -- Perl 6 lexer
|
| 111 |
+
* Doug Hogan -- Mscgen lexer
|
| 112 |
+
* Ben Hollis -- Mason lexer
|
| 113 |
+
* Max Horn -- GAP lexer
|
| 114 |
+
* Fred Hornsey -- OMG IDL Lexer
|
| 115 |
+
* Alastair Houghton -- Lexer inheritance facility
|
| 116 |
+
* Tim Howard -- BlitzMax lexer
|
| 117 |
+
* Dustin Howett -- Logos lexer
|
| 118 |
+
* Ivan Inozemtsev -- Fantom lexer
|
| 119 |
+
* Hiroaki Itoh -- Shell console rewrite, Lexers for PowerShell session,
|
| 120 |
+
MSDOS session, BC, WDiff
|
| 121 |
+
* Brian R. Jackson -- Tea lexer
|
| 122 |
+
* Alex Jeffery, ChromaWay AB -- Rell lexer
|
| 123 |
+
* Christian Jann -- ShellSession lexer
|
| 124 |
+
* Jonas Camillus Jeppesen -- Line numbers and line highlighting for
|
| 125 |
+
RTF-formatter
|
| 126 |
+
* Dennis Kaarsemaker -- sources.list lexer
|
| 127 |
+
* Dmitri Kabak -- Inferno Limbo lexer
|
| 128 |
+
* Igor Kalnitsky -- vhdl lexer
|
| 129 |
+
* Colin Kennedy - USD lexer
|
| 130 |
+
* Alexander Kit -- MaskJS lexer
|
| 131 |
+
* Pekka Klärck -- Robot Framework lexer
|
| 132 |
+
* Gerwin Klein -- Isabelle lexer
|
| 133 |
+
* Eric Knibbe -- Lasso lexer
|
| 134 |
+
* Stepan Koltsov -- Clay lexer
|
| 135 |
+
* Oliver Kopp - Friendly grayscale style
|
| 136 |
+
* Adam Koprowski -- Opa lexer
|
| 137 |
+
* Benjamin Kowarsch -- Modula-2 lexer
|
| 138 |
+
* Domen Kožar -- Nix lexer
|
| 139 |
+
* Oleh Krekel -- Emacs Lisp lexer
|
| 140 |
+
* Alexander Kriegisch -- Kconfig and AspectJ lexers
|
| 141 |
+
* Marek Kubica -- Scheme lexer
|
| 142 |
+
* Jochen Kupperschmidt -- Markdown processor
|
| 143 |
+
* Gerd Kurzbach -- Modelica lexer
|
| 144 |
+
* Jon Larimer, Google Inc. -- Smali lexer
|
| 145 |
+
* Olov Lassus -- Dart lexer
|
| 146 |
+
* Matt Layman -- TAP lexer
|
| 147 |
+
* Dan Lazin, Google LLC -- GoogleSQL lexer
|
| 148 |
+
* Kristian Lyngstøl -- Varnish lexers
|
| 149 |
+
* Sylvestre Ledru -- Scilab lexer
|
| 150 |
+
* Chee Sing Lee -- Flatline lexer
|
| 151 |
+
* Mark Lee -- Vala lexer
|
| 152 |
+
* Thomas Linder Puls -- Visual Prolog lexer
|
| 153 |
+
* Pete Lomax -- Phix lexer
|
| 154 |
+
* Valentin Lorentz -- C++ lexer improvements
|
| 155 |
+
* Ben Mabey -- Gherkin lexer
|
| 156 |
+
* Angus MacArthur -- QML lexer
|
| 157 |
+
* Louis Mandel -- X10 lexer
|
| 158 |
+
* Louis Marchand -- Eiffel lexer
|
| 159 |
+
* Simone Margaritelli -- Hybris lexer
|
| 160 |
+
* Tim Martin - World of Warcraft TOC lexer
|
| 161 |
+
* Kirk McDonald -- D lexer
|
| 162 |
+
* Gordon McGregor -- SystemVerilog lexer
|
| 163 |
+
* Stephen McKamey -- Duel/JBST lexer
|
| 164 |
+
* Brian McKenna -- F# lexer
|
| 165 |
+
* Charles McLaughlin -- Puppet lexer
|
| 166 |
+
* Kurt McKee -- Tera Term macro lexer, PostgreSQL updates, MySQL overhaul, JSON lexer
|
| 167 |
+
* Joe Eli McIlvain -- Savi lexer
|
| 168 |
+
* Lukas Meuser -- BBCode formatter, Lua lexer
|
| 169 |
+
* Cat Miller -- Pig lexer
|
| 170 |
+
* Paul Miller -- LiveScript lexer
|
| 171 |
+
* Hong Minhee -- HTTP lexer
|
| 172 |
+
* Michael Mior -- Awk lexer
|
| 173 |
+
* Bruce Mitchener -- Dylan lexer rewrite
|
| 174 |
+
* Reuben Morais -- SourcePawn lexer
|
| 175 |
+
* Jon Morton -- Rust lexer
|
| 176 |
+
* Paulo Moura -- Logtalk lexer
|
| 177 |
+
* Mher Movsisyan -- DTD lexer
|
| 178 |
+
* Dejan Muhamedagic -- Crmsh lexer
|
| 179 |
+
* Adrien Nayrat -- PostgreSQL Explain lexer
|
| 180 |
+
* Ana Nelson -- Ragel, ANTLR, R console lexers
|
| 181 |
+
* David Neto, Google LLC -- WebGPU Shading Language lexer
|
| 182 |
+
* Kurt Neufeld -- Markdown lexer
|
| 183 |
+
* Nam T. Nguyen -- Monokai style
|
| 184 |
+
* Jesper Noehr -- HTML formatter "anchorlinenos"
|
| 185 |
+
* Mike Nolta -- Julia lexer
|
| 186 |
+
* Avery Nortonsmith -- Pointless lexer
|
| 187 |
+
* Jonas Obrist -- BBCode lexer
|
| 188 |
+
* Edward O'Callaghan -- Cryptol lexer
|
| 189 |
+
* David Oliva -- Rebol lexer
|
| 190 |
+
* Pat Pannuto -- nesC lexer
|
| 191 |
+
* Jon Parise -- Protocol buffers and Thrift lexers
|
| 192 |
+
* Benjamin Peterson -- Test suite refactoring
|
| 193 |
+
* Ronny Pfannschmidt -- BBCode lexer
|
| 194 |
+
* Dominik Picheta -- Nimrod lexer
|
| 195 |
+
* Andrew Pinkham -- RTF Formatter Refactoring
|
| 196 |
+
* Clément Prévost -- UrbiScript lexer
|
| 197 |
+
* Tanner Prynn -- cmdline -x option and loading lexers from files
|
| 198 |
+
* Oleh Prypin -- Crystal lexer (based on Ruby lexer)
|
| 199 |
+
* Nick Psaris -- K and Q lexers
|
| 200 |
+
* Xidorn Quan -- Web IDL lexer
|
| 201 |
+
* Elias Rabel -- Fortran fixed form lexer
|
| 202 |
+
* raichoo -- Idris lexer
|
| 203 |
+
* Daniel Ramirez -- GDScript lexer
|
| 204 |
+
* Kashif Rasul -- CUDA lexer
|
| 205 |
+
* Nathan Reed -- HLSL lexer
|
| 206 |
+
* Justin Reidy -- MXML lexer
|
| 207 |
+
* Jonathon Reinhart, Google LLC -- Soong lexer
|
| 208 |
+
* Norman Richards -- JSON lexer
|
| 209 |
+
* Corey Richardson -- Rust lexer updates
|
| 210 |
+
* Fabrizio Riguzzi -- cplint leder
|
| 211 |
+
* Lubomir Rintel -- GoodData MAQL and CL lexers
|
| 212 |
+
* Andre Roberge -- Tango style
|
| 213 |
+
* Georg Rollinger -- HSAIL lexer
|
| 214 |
+
* Michiel Roos -- TypoScript lexer
|
| 215 |
+
* Konrad Rudolph -- LaTeX formatter enhancements
|
| 216 |
+
* Mario Ruggier -- Evoque lexers
|
| 217 |
+
* Miikka Salminen -- Lovelace style, Hexdump lexer, lexer enhancements
|
| 218 |
+
* Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers
|
| 219 |
+
* Matteo Sasso -- Common Lisp lexer
|
| 220 |
+
* Joe Schafer -- Ada lexer
|
| 221 |
+
* Max Schillinger -- TiddlyWiki5 lexer
|
| 222 |
+
* Andrew Schmidt -- X++ lexer
|
| 223 |
+
* Ken Schutte -- Matlab lexers
|
| 224 |
+
* René Schwaiger -- Rainbow Dash style
|
| 225 |
+
* Sebastian Schweizer -- Whiley lexer
|
| 226 |
+
* Tassilo Schweyer -- Io, MOOCode lexers
|
| 227 |
+
* Pablo Seminario -- PromQL lexer
|
| 228 |
+
* Ted Shaw -- AutoIt lexer
|
| 229 |
+
* Joerg Sieker -- ABAP lexer
|
| 230 |
+
* Robert Simmons -- Standard ML lexer
|
| 231 |
+
* Kirill Simonov -- YAML lexer
|
| 232 |
+
* Corbin Simpson -- Monte lexer
|
| 233 |
+
* Ville Skyttä -- ASCII armored lexer
|
| 234 |
+
* Alexander Smishlajev -- Visual FoxPro lexer
|
| 235 |
+
* Steve Spigarelli -- XQuery lexer
|
| 236 |
+
* Jerome St-Louis -- eC lexer
|
| 237 |
+
* Camil Staps -- Clean and NuSMV lexers; Solarized style
|
| 238 |
+
* James Strachan -- Kotlin lexer
|
| 239 |
+
* Tom Stuart -- Treetop lexer
|
| 240 |
+
* Colin Sullivan -- SuperCollider lexer
|
| 241 |
+
* Ben Swift -- Extempore lexer
|
| 242 |
+
* tatt61880 -- Kuin lexer
|
| 243 |
+
* Edoardo Tenani -- Arduino lexer
|
| 244 |
+
* Tiberius Teng -- default style overhaul
|
| 245 |
+
* Jeremy Thurgood -- Erlang, Squid config lexers
|
| 246 |
+
* Brian Tiffin -- OpenCOBOL lexer
|
| 247 |
+
* Bob Tolbert -- Hy lexer
|
| 248 |
+
* Doug Torrance -- Macaulay2 lexer
|
| 249 |
+
* Matthias Trute -- Forth lexer
|
| 250 |
+
* Tuoa Spi T4 -- Bdd lexer
|
| 251 |
+
* Erick Tryzelaar -- Felix lexer
|
| 252 |
+
* Alexander Udalov -- Kotlin lexer improvements
|
| 253 |
+
* Thomas Van Doren -- Chapel lexer
|
| 254 |
+
* Dave Van Ee -- Uxntal lexer updates
|
| 255 |
+
* Daniele Varrazzo -- PostgreSQL lexers
|
| 256 |
+
* Abe Voelker -- OpenEdge ABL lexer
|
| 257 |
+
* Pepijn de Vos -- HTML formatter CTags support
|
| 258 |
+
* Matthias Vallentin -- Bro lexer
|
| 259 |
+
* Benoît Vinot -- AMPL lexer
|
| 260 |
+
* Linh Vu Hong -- RSL lexer
|
| 261 |
+
* Taavi Väänänen -- Debian control, PHP lexers
|
| 262 |
+
* Immanuel Washington -- Smithy lexer
|
| 263 |
+
* Nathan Weizenbaum -- Haml and Sass lexers
|
| 264 |
+
* Nathan Whetsell -- Csound lexers
|
| 265 |
+
* Dietmar Winkler -- Modelica lexer
|
| 266 |
+
* Nils Winter -- Smalltalk lexer
|
| 267 |
+
* Davy Wybiral -- Clojure lexer
|
| 268 |
+
* Whitney Young -- ObjectiveC lexer
|
| 269 |
+
* Diego Zamboni -- CFengine3 lexer
|
| 270 |
+
* Enrique Zamudio -- Ceylon lexer
|
| 271 |
+
* Alex Zimin -- Nemerle lexer
|
| 272 |
+
* Rob Zimmerman -- Kal lexer
|
| 273 |
+
* Evgenii Zheltonozhskii -- Maple lexer
|
| 274 |
+
* Vincent Zurczak -- Roboconf lexer
|
| 275 |
+
* Hubert Gruniaux -- C and C++ lexer improvements
|
| 276 |
+
* Thomas Symalla -- AMDGPU Lexer
|
| 277 |
+
* 15b3 -- Image Formatter improvements
|
| 278 |
+
* Fabian Neumann -- CDDL lexer
|
| 279 |
+
* Thomas Duboucher -- CDDL lexer
|
| 280 |
+
* Philipp Imhof -- Pango Markup formatter
|
| 281 |
+
* Thomas Voss -- Sed lexer
|
| 282 |
+
* Martin Fischer -- WCAG contrast testing
|
| 283 |
+
* Marc Auberer -- Spice lexer
|
| 284 |
+
* Amr Hesham -- Carbon lexer
|
| 285 |
+
* diskdance -- Wikitext lexer
|
| 286 |
+
* vanillajonathan -- PRQL lexer
|
| 287 |
+
* Nikolay Antipov -- OpenSCAD lexer
|
| 288 |
+
* Markus Meyer, Nextron Systems -- YARA lexer
|
| 289 |
+
* Hannes Römer -- Mojo lexer
|
| 290 |
+
* Jan Frederik Schaefer -- PDDL lexer
|
| 291 |
+
|
| 292 |
+
Many thanks for all contributions!
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments-2.20.0.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2006-2022 by the respective authors (see AUTHORS file).
|
| 2 |
+
All rights reserved.
|
| 3 |
+
|
| 4 |
+
Redistribution and use in source and binary forms, with or without
|
| 5 |
+
modification, are permitted provided that the following conditions are
|
| 6 |
+
met:
|
| 7 |
+
|
| 8 |
+
* Redistributions of source code must retain the above copyright
|
| 9 |
+
notice, this list of conditions and the following disclaimer.
|
| 10 |
+
|
| 11 |
+
* Redistributions in binary form must reproduce the above copyright
|
| 12 |
+
notice, this list of conditions and the following disclaimer in the
|
| 13 |
+
documentation and/or other materials provided with the distribution.
|
| 14 |
+
|
| 15 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 16 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 17 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 18 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 19 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 20 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 21 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 22 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 23 |
+
THEORY OF LIABILITY, WHETHER IN CON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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.modula2
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Multi-Dialect Lexer for Modula-2.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include
|
| 14 |
+
from pygments.util import get_bool_opt, get_list_opt
|
| 15 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, \
|
| 16 |
+
String, Number, Punctuation, Error
|
| 17 |
+
|
| 18 |
+
__all__ = ['Modula2Lexer']
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
# Multi-Dialect Modula-2 Lexer
|
| 22 |
+
class Modula2Lexer(RegexLexer):
|
| 23 |
+
"""
|
| 24 |
+
For Modula-2 source code.
|
| 25 |
+
|
| 26 |
+
The Modula-2 lexer supports several dialects. By default, it operates in
|
| 27 |
+
fallback mode, recognising the *combined* literals, punctuation symbols
|
| 28 |
+
and operators of all supported dialects, and the *combined* reserved words
|
| 29 |
+
and builtins of PIM Modula-2, ISO Modula-2 and Modula-2 R10, while not
|
| 30 |
+
differentiating between library defined identifiers.
|
| 31 |
+
|
| 32 |
+
To select a specific dialect, a dialect option may be passed
|
| 33 |
+
or a dialect tag may be embedded into a source file.
|
| 34 |
+
|
| 35 |
+
Dialect Options:
|
| 36 |
+
|
| 37 |
+
`m2pim`
|
| 38 |
+
Select PIM Modula-2 dialect.
|
| 39 |
+
`m2iso`
|
| 40 |
+
Select ISO Modula-2 dialect.
|
| 41 |
+
`m2r10`
|
| 42 |
+
Select Modula-2 R10 dialect.
|
| 43 |
+
`objm2`
|
| 44 |
+
Select Objective Modula-2 dialect.
|
| 45 |
+
|
| 46 |
+
The PIM and ISO dialect options may be qualified with a language extension.
|
| 47 |
+
|
| 48 |
+
Language Extensions:
|
| 49 |
+
|
| 50 |
+
`+aglet`
|
| 51 |
+
Select Aglet Modula-2 extensions, available with m2iso.
|
| 52 |
+
`+gm2`
|
| 53 |
+
Select GNU Modula-2 extensions, available with m2pim.
|
| 54 |
+
`+p1`
|
| 55 |
+
Select p1 Modula-2 extensions, available with m2iso.
|
| 56 |
+
`+xds`
|
| 57 |
+
Select XDS Modula-2 extensions, available with m2iso.
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
Passing a Dialect Option via Unix Commandline Interface
|
| 61 |
+
|
| 62 |
+
Dialect options may be passed to the lexer using the `dialect` key.
|
| 63 |
+
Only one such option should be passed. If multiple dialect options are
|
| 64 |
+
passed, the first valid option is used, any subsequent options are ignored.
|
| 65 |
+
|
| 66 |
+
Examples:
|
| 67 |
+
|
| 68 |
+
`$ pygmentize -O full,dialect=m2iso -f html -o /path/to/output /path/to/input`
|
| 69 |
+
Use ISO dialect to render input to HTML output
|
| 70 |
+
`$ pygmentize -O full,dialect=m2iso+p1 -f rtf -o /path/to/output /path/to/input`
|
| 71 |
+
Use ISO dialect with p1 extensions to render input to RTF output
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
Embedding a Dialect Option within a source file
|
| 75 |
+
|
| 76 |
+
A dialect option may be embedded in a source file in form of a dialect
|
| 77 |
+
tag, a specially formatted comment that specifies a dialect option.
|
| 78 |
+
|
| 79 |
+
Dialect Tag EBNF::
|
| 80 |
+
|
| 81 |
+
dialectTag :
|
| 82 |
+
OpeningCommentDelim Prefix dialectOption ClosingCommentDelim ;
|
| 83 |
+
|
| 84 |
+
dialectOption :
|
| 85 |
+
'm2pim' | 'm2iso' | 'm2r10' | 'objm2' |
|
| 86 |
+
'm2iso+aglet' | 'm2pim+gm2' | 'm2iso+p1' | 'm2iso+xds' ;
|
| 87 |
+
|
| 88 |
+
Prefix : '!' ;
|
| 89 |
+
|
| 90 |
+
OpeningCommentDelim : '(*' ;
|
| 91 |
+
|
| 92 |
+
ClosingCommentDelim : '*)' ;
|
| 93 |
+
|
| 94 |
+
No whitespace is permitted between the tokens of a dialect tag.
|
| 95 |
+
|
| 96 |
+
In the event that a source file contains multiple dialect tags, the first
|
| 97 |
+
tag that contains a valid dialect option will be used and any subsequent
|
| 98 |
+
dialect tags will be ignored. Ideally, a dialect tag should be placed
|
| 99 |
+
at the beginning of a source file.
|
| 100 |
+
|
| 101 |
+
An embedded dialect tag overrides a dialect option set via command line.
|
| 102 |
+
|
| 103 |
+
Examples:
|
| 104 |
+
|
| 105 |
+
``(*!m2r10*) DEFINITION MODULE Foobar; ...``
|
| 106 |
+
Use Modula2 R10 dialect to render this source file.
|
| 107 |
+
``(*!m2pim+gm2*) DEFINITION MODULE Bazbam; ...``
|
| 108 |
+
Use PIM dialect with GNU extensions to render this source file.
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
Algol Publication Mode:
|
| 112 |
+
|
| 113 |
+
In Algol publication mode, source text is rendered for publication of
|
| 114 |
+
algorithms in scientific papers and academic texts, following the format
|
| 115 |
+
of the Revised Algol-60 Language Report. It is activated by passing
|
| 116 |
+
one of two corresponding styles as an option:
|
| 117 |
+
|
| 118 |
+
`algol`
|
| 119 |
+
render reserved words lowercase underline boldface
|
| 120 |
+
and builtins lowercase boldface italic
|
| 121 |
+
`algol_nu`
|
| 122 |
+
render reserved words lowercase boldface (no underlining)
|
| 123 |
+
and builtins lowercase boldface italic
|
| 124 |
+
|
| 125 |
+
The lexer automatically performs the required lowercase conversion when
|
| 126 |
+
this mode is activated.
|
| 127 |
+
|
| 128 |
+
Example:
|
| 129 |
+
|
| 130 |
+
``$ pygmentize -O full,style=algol -f latex -o /path/to/output /path/to/input``
|
| 131 |
+
Render input file in Algol publication mode to LaTeX output.
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
Rendering Mode of First Class ADT Identifiers:
|
| 135 |
+
|
| 136 |
+
The rendering of standard library first class ADT identifiers is controlled
|
| 137 |
+
by option flag "treat_stdlib_adts_as_builtins".
|
| 138 |
+
|
| 139 |
+
When this option is turned on, standard library ADT identifiers are rendered
|
| 140 |
+
as builtins. When it is turned off, they are rendered as ordinary library
|
| 141 |
+
identifiers.
|
| 142 |
+
|
| 143 |
+
`treat_stdlib_adts_as_builtins` (default: On)
|
| 144 |
+
|
| 145 |
+
The option is useful for dialects that support ADTs as first class objects
|
| 146 |
+
and provide ADTs in the standard library that would otherwise be built-in.
|
| 147 |
+
|
| 148 |
+
At present, only Modula-2 R10 supports library ADTs as first class objects
|
| 149 |
+
and therefore, no ADT identifiers are defined for any other dialects.
|
| 150 |
+
|
| 151 |
+
Example:
|
| 152 |
+
|
| 153 |
+
``$ pygmentize -O full,dialect=m2r10,treat_stdlib_adts_as_builtins=Off ...``
|
| 154 |
+
Render standard library ADTs as ordinary library types.
|
| 155 |
+
|
| 156 |
+
.. versionchanged:: 2.1
|
| 157 |
+
Added multi-dialect support.
|
| 158 |
+
"""
|
| 159 |
+
name = 'Modula-2'
|
| 160 |
+
url = 'http://www.modula2.org/'
|
| 161 |
+
aliases = ['modula2', 'm2']
|
| 162 |
+
filenames = ['*.def', '*.mod']
|
| 163 |
+
mimetypes = ['text/x-modula2']
|
| 164 |
+
version_added = '1.3'
|
| 165 |
+
|
| 166 |
+
flags = re.MULTILINE | re.DOTALL
|
| 167 |
+
|
| 168 |
+
tokens = {
|
| 169 |
+
'whitespace': [
|
| 170 |
+
(r'\n+', Text), # blank lines
|
| 171 |
+
(r'\s+', Text), # whitespace
|
| 172 |
+
],
|
| 173 |
+
'dialecttags': [
|
| 174 |
+
# PIM Dialect Tag
|
| 175 |
+
(r'\(\*!m2pim\*\)', Comment.Special),
|
| 176 |
+
# ISO Dialect Tag
|
| 177 |
+
(r'\(\*!m2iso\*\)', Comment.Special),
|
| 178 |
+
# M2R10 Dialect Tag
|
| 179 |
+
(r'\(\*!m2r10\*\)', Comment.Special),
|
| 180 |
+
# ObjM2 Dialect Tag
|
| 181 |
+
(r'\(\*!objm2\*\)', Comment.Special),
|
| 182 |
+
# Aglet Extensions Dialect Tag
|
| 183 |
+
(r'\(\*!m2iso\+aglet\*\)', Comment.Special),
|
| 184 |
+
# GNU Extensions Dialect Tag
|
| 185 |
+
(r'\(\*!m2pim\+gm2\*\)', Comment.Special),
|
| 186 |
+
# p1 Extensions Dialect Tag
|
| 187 |
+
(r'\(\*!m2iso\+p1\*\)', Comment.Special),
|
| 188 |
+
# XDS Extensions Dialect Tag
|
| 189 |
+
(r'\(\*!m2iso\+xds\*\)', Comment.Special),
|
| 190 |
+
],
|
| 191 |
+
'identifiers': [
|
| 192 |
+
(r'([a-zA-Z_$][\w$]*)', Name),
|
| 193 |
+
],
|
| 194 |
+
'prefixed_number_literals': [
|
| 195 |
+
#
|
| 196 |
+
# Base-2, whole number
|
| 197 |
+
(r'0b[01]+(\'[01]+)*', Number.Bin),
|
| 198 |
+
#
|
| 199 |
+
# Base-16, whole number
|
| 200 |
+
(r'0[ux][0-9A-F]+(\'[0-9A-F]+)*', Number.Hex),
|
| 201 |
+
],
|
| 202 |
+
'plain_number_literals': [
|
| 203 |
+
#
|
| 204 |
+
# Base-10, real number with exponent
|
| 205 |
+
(r'[0-9]+(\'[0-9]+)*' # integral part
|
| 206 |
+
r'\.[0-9]+(\'[0-9]+)*' # fractional part
|
| 207 |
+
r'[eE][+-]?[0-9]+(\'[0-9]+)*', # exponent
|
| 208 |
+
Number.Float),
|
| 209 |
+
#
|
| 210 |
+
# Base-10, real number without exponent
|
| 211 |
+
(r'[0-9]+(\'[0-9]+)*' # integral part
|
| 212 |
+
r'\.[0-9]+(\'[0-9]+)*', # fractional part
|
| 213 |
+
Number.Float),
|
| 214 |
+
#
|
| 215 |
+
# Base-10, whole number
|
| 216 |
+
(r'[0-9]+(\'[0-9]+)*', Number.Integer),
|
| 217 |
+
],
|
| 218 |
+
'suffixed_number_literals': [
|
| 219 |
+
#
|
| 220 |
+
# Base-8, whole number
|
| 221 |
+
(r'[0-7]+B', Number.Oct),
|
| 222 |
+
#
|
| 223 |
+
# Base-8, character code
|
| 224 |
+
(r'[0-7]+C', Number.Oct),
|
| 225 |
+
#
|
| 226 |
+
# Base-16, number
|
| 227 |
+
(r'[0-9A-F]+H', Number.Hex),
|
| 228 |
+
],
|
| 229 |
+
'string_literals': [
|
| 230 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
| 231 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
| 232 |
+
],
|
| 233 |
+
'digraph_operators': [
|
| 234 |
+
# Dot Product Operator
|
| 235 |
+
(r'\*\.', Operator),
|
| 236 |
+
# Array Concatenation Operator
|
| 237 |
+
(r'\+>', Operator), # M2R10 + ObjM2
|
| 238 |
+
# Inequality Operator
|
| 239 |
+
(r'<>', Operator), # ISO + PIM
|
| 240 |
+
# Less-Or-Equal, Subset
|
| 241 |
+
(r'<=', Operator),
|
| 242 |
+
# Greater-Or-Equal, Superset
|
| 243 |
+
(r'>=', Operator),
|
| 244 |
+
# Identity Operator
|
| 245 |
+
(r'==', Operator), # M2R10 + ObjM2
|
| 246 |
+
# Type Conversion Operator
|
| 247 |
+
(r'::', Operator), # M2R10 + ObjM2
|
| 248 |
+
# Assignment Symbol
|
| 249 |
+
(r':=', Operator),
|
| 250 |
+
# Postfix Increment Mutator
|
| 251 |
+
(r'\+\+', Operator), # M2R10 + ObjM2
|
| 252 |
+
# Postfix Decrement Mutator
|
| 253 |
+
(r'--', Operator), # M2R10 + ObjM2
|
| 254 |
+
],
|
| 255 |
+
'unigraph_operators': [
|
| 256 |
+
# Arithmetic Operators
|
| 257 |
+
(r'[+-]', Operator),
|
| 258 |
+
(r'[*/]', Operator),
|
| 259 |
+
# ISO 80000-2 compliant Set Difference Operator
|
| 260 |
+
(r'\\', Operator), # M2R10 + ObjM2
|
| 261 |
+
# Relational Operators
|
| 262 |
+
(r'[=#<>]', Operator),
|
| 263 |
+
# Dereferencing Operator
|
| 264 |
+
(r'\^', Operator),
|
| 265 |
+
# Dereferencing Operator Synonym
|
| 266 |
+
(r'@', Operator), # ISO
|
| 267 |
+
# Logical AND Operator Synonym
|
| 268 |
+
(r'&', Operator), # PIM + ISO
|
| 269 |
+
# Logical NOT Operator Synonym
|
| 270 |
+
(r'~', Operator), # PIM + ISO
|
| 271 |
+
# Smalltalk Message Prefix
|
| 272 |
+
(r'`', Operator), # ObjM2
|
| 273 |
+
],
|
| 274 |
+
'digraph_punctuation': [
|
| 275 |
+
# Range Constructor
|
| 276 |
+
(r'\.\.', Punctuation),
|
| 277 |
+
# Opening Chevron Bracket
|
| 278 |
+
(r'<<', Punctuation), # M2R10 + ISO
|
| 279 |
+
# Closing Chevron Bracket
|
| 280 |
+
(r'>>', Punctuation), # M2R10 + ISO
|
| 281 |
+
# Blueprint Punctuation
|
| 282 |
+
(r'->', Punctuation), # M2R10 + ISO
|
| 283 |
+
# Distinguish |# and # in M2 R10
|
| 284 |
+
(r'\|#', Punctuation),
|
| 285 |
+
# Distinguish ## and # in M2 R10
|
| 286 |
+
(r'##', Punctuation),
|
| 287 |
+
# Distinguish |* and * in M2 R10
|
| 288 |
+
(r'\|\*', Punctuation),
|
| 289 |
+
],
|
| 290 |
+
'unigraph_punctuation': [
|
| 291 |
+
# Common Punctuation
|
| 292 |
+
(r'[()\[\]{},.:;|]', Punctuation),
|
| 293 |
+
# Case Label Separator Synonym
|
| 294 |
+
(r'!', Punctuation), # ISO
|
| 295 |
+
# Blueprint Punctuation
|
| 296 |
+
(r'\?', Punctuation), # M2R10 + ObjM2
|
| 297 |
+
],
|
| 298 |
+
'comments': [
|
| 299 |
+
# Single Line Comment
|
| 300 |
+
(r'^//.*?\n', Comment.Single), # M2R10 + ObjM2
|
| 301 |
+
# Block Comment
|
| 302 |
+
(r'\(\*([^$].*?)\*\)', Comment.Multiline),
|
| 303 |
+
# Template Block Comment
|
| 304 |
+
(r'/\*(.*?)\*/', Comment.Multiline), # M2R10 + ObjM2
|
| 305 |
+
],
|
| 306 |
+
'pragmas': [
|
| 307 |
+
# ISO Style Pragmas
|
| 308 |
+
(r'<\*.*?\*>', Comment.Preproc), # ISO, M2R10 + ObjM2
|
| 309 |
+
# Pascal Style Pragmas
|
| 310 |
+
(r'\(\*\$.*?\*\)', Comment.Preproc), # PIM
|
| 311 |
+
],
|
| 312 |
+
'root': [
|
| 313 |
+
include('whitespace'),
|
| 314 |
+
include('dialecttags'),
|
| 315 |
+
include('pragmas'),
|
| 316 |
+
include('comments'),
|
| 317 |
+
include('identifiers'),
|
| 318 |
+
include('suffixed_number_literals'), # PIM + ISO
|
| 319 |
+
include('prefixed_number_literals'), # M2R10 + ObjM2
|
| 320 |
+
include('plain_number_literals'),
|
| 321 |
+
include('string_literals'),
|
| 322 |
+
include('digraph_punctuation'),
|
| 323 |
+
include('digraph_operators'),
|
| 324 |
+
include('unigraph_punctuation'),
|
| 325 |
+
include('unigraph_operators'),
|
| 326 |
+
]
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
# C o m m o n D a t a s e t s
|
| 330 |
+
|
| 331 |
+
# Common Reserved Words Dataset
|
| 332 |
+
common_reserved_words = (
|
| 333 |
+
# 37 common reserved words
|
| 334 |
+
'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
|
| 335 |
+
'DO', 'ELSE', 'ELSIF', 'END', 'EXIT', 'FOR', 'FROM', 'IF',
|
| 336 |
+
'IMPLEMENTATION', 'IMPORT', 'IN', 'LOOP', 'MOD', 'MODULE', 'NOT',
|
| 337 |
+
'OF', 'OR', 'POINTER', 'PROCEDURE', 'RECORD', 'REPEAT', 'RETURN',
|
| 338 |
+
'SET', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE',
|
| 339 |
+
)
|
| 340 |
+
|
| 341 |
+
# Common Builtins Dataset
|
| 342 |
+
common_builtins = (
|
| 343 |
+
# 16 common builtins
|
| 344 |
+
'ABS', 'BOOLEAN', 'CARDINAL', 'CHAR', 'CHR', 'FALSE', 'INTEGER',
|
| 345 |
+
'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NIL', 'ODD', 'ORD', 'REAL',
|
| 346 |
+
'TRUE',
|
| 347 |
+
)
|
| 348 |
+
|
| 349 |
+
# Common Pseudo-Module Builtins Dataset
|
| 350 |
+
common_pseudo_builtins = (
|
| 351 |
+
# 4 common pseudo builtins
|
| 352 |
+
'ADDRESS', 'BYTE', 'WORD', 'ADR'
|
| 353 |
+
)
|
| 354 |
+
|
| 355 |
+
# P I M M o d u l a - 2 D a t a s e t s
|
| 356 |
+
|
| 357 |
+
# Lexemes to Mark as Error Tokens for PIM Modula-2
|
| 358 |
+
pim_lexemes_to_reject = (
|
| 359 |
+
'!', '`', '@', '$', '%', '?', '\\', '==', '++', '--', '::', '*.',
|
| 360 |
+
'+>', '->', '<<', '>>', '|#', '##',
|
| 361 |
+
)
|
| 362 |
+
|
| 363 |
+
# PIM Modula-2 Additional Reserved Words Dataset
|
| 364 |
+
pim_additional_reserved_words = (
|
| 365 |
+
# 3 additional reserved words
|
| 366 |
+
'EXPORT', 'QUALIFIED', 'WITH',
|
| 367 |
+
)
|
| 368 |
+
|
| 369 |
+
# PIM Modula-2 Additional Builtins Dataset
|
| 370 |
+
pim_additional_builtins = (
|
| 371 |
+
# 16 additional builtins
|
| 372 |
+
'BITSET', 'CAP', 'DEC', 'DISPOSE', 'EXCL', 'FLOAT', 'HALT', 'HIGH',
|
| 373 |
+
'INC', 'INCL', 'NEW', 'NIL', 'PROC', 'SIZE', 'TRUNC', 'VAL',
|
| 374 |
+
)
|
| 375 |
+
|
| 376 |
+
# PIM Modula-2 Additional Pseudo-Module Builtins Dataset
|
| 377 |
+
pim_additional_pseudo_builtins = (
|
| 378 |
+
# 5 additional pseudo builtins
|
| 379 |
+
'SYSTEM', 'PROCESS', 'TSIZE', 'NEWPROCESS', 'TRANSFER',
|
| 380 |
+
)
|
| 381 |
+
|
| 382 |
+
# I S O M o d u l a - 2 D a t a s e t s
|
| 383 |
+
|
| 384 |
+
# Lexemes to Mark as Error Tokens for ISO Modula-2
|
| 385 |
+
iso_lexemes_to_reject = (
|
| 386 |
+
'`', '$', '%', '?', '\\', '==', '++', '--', '::', '*.', '+>', '->',
|
| 387 |
+
'<<', '>>', '|#', '##',
|
| 388 |
+
)
|
| 389 |
+
|
| 390 |
+
# ISO Modula-2 Additional Reserved Words Dataset
|
| 391 |
+
iso_additional_reserved_words = (
|
| 392 |
+
# 9 additional reserved words (ISO 10514-1)
|
| 393 |
+
'EXCEPT', 'EXPORT', 'FINALLY', 'FORWARD', 'PACKEDSET', 'QUALIFIED',
|
| 394 |
+
'REM', 'RETRY', 'WITH',
|
| 395 |
+
# 10 additional reserved words (ISO 10514-2 & ISO 10514-3)
|
| 396 |
+
'ABSTRACT', 'AS', 'CLASS', 'GUARD', 'INHERIT', 'OVERRIDE', 'READONLY',
|
| 397 |
+
'REVEAL', 'TRACED', 'UNSAFEGUARDED',
|
| 398 |
+
)
|
| 399 |
+
|
| 400 |
+
# ISO Modula-2 Additional Builtins Dataset
|
| 401 |
+
iso_additional_builtins = (
|
| 402 |
+
# 26 additional builtins (ISO 10514-1)
|
| 403 |
+
'BITSET', 'CAP', 'CMPLX', 'COMPLEX', 'DEC', 'DISPOSE', 'EXCL', 'FLOAT',
|
| 404 |
+
'HALT', 'HIGH', 'IM', 'INC', 'INCL', 'INT', 'INTERRUPTIBLE', 'LENGTH',
|
| 405 |
+
'LFLOAT', 'LONGCOMPLEX', 'NEW', 'PROC', 'PROTECTION', 'RE', 'SIZE',
|
| 406 |
+
'TRUNC', 'UNINTERRUBTIBLE', 'VAL',
|
| 407 |
+
# 5 additional builtins (ISO 10514-2 & ISO 10514-3)
|
| 408 |
+
'CREATE', 'DESTROY', 'EMPTY', 'ISMEMBER', 'SELF',
|
| 409 |
+
)
|
| 410 |
+
|
| 411 |
+
# ISO Modula-2 Additional Pseudo-Module Builtins Dataset
|
| 412 |
+
iso_additional_pseudo_builtins = (
|
| 413 |
+
# 14 additional builtins (SYSTEM)
|
| 414 |
+
'SYSTEM', 'BITSPERLOC', 'LOCSPERBYTE', 'LOCSPERWORD', 'LOC',
|
| 415 |
+
'ADDADR', 'SUBADR', 'DIFADR', 'MAKEADR', 'ADR',
|
| 416 |
+
'ROTATE', 'SHIFT', 'CAST', 'TSIZE',
|
| 417 |
+
# 13 additional builtins (COROUTINES)
|
| 418 |
+
'COROUTINES', 'ATTACH', 'COROUTINE', 'CURRENT', 'DETACH', 'HANDLER',
|
| 419 |
+
'INTERRUPTSOURCE', 'IOTRANSFER', 'IsATTACHED', 'LISTEN',
|
| 420 |
+
'NEWCOROUTINE', 'PROT', 'TRANSFER',
|
| 421 |
+
# 9 additional builtins (EXCEPTIONS)
|
| 422 |
+
'EXCEPTIONS', 'AllocateSource', 'CurrentNumber', 'ExceptionNumber',
|
| 423 |
+
'ExceptionSource', 'GetMessage', 'IsCurrentSource',
|
| 424 |
+
'IsExceptionalExecution', 'RAISE',
|
| 425 |
+
# 3 additional builtins (TERMINATION)
|
| 426 |
+
'TERMINATION', 'IsTerminating', 'HasHalted',
|
| 427 |
+
# 4 additional builtins (M2EXCEPTION)
|
| 428 |
+
'M2EXCEPTION', 'M2Exceptions', 'M2Exception', 'IsM2Exception',
|
| 429 |
+
'indexException', 'rangeException', 'caseSelectException',
|
| 430 |
+
'invalidLocation', 'functionException', 'wholeValueException',
|
| 431 |
+
'wholeDivException', 'realValueException', 'realDivException',
|
| 432 |
+
'complexValueException', 'complexDivException', 'protException',
|
| 433 |
+
'sysException', 'coException', 'exException',
|
| 434 |
+
)
|
| 435 |
+
|
| 436 |
+
# M o d u l a - 2 R 1 0 D a t a s e t s
|
| 437 |
+
|
| 438 |
+
# Lexemes to Mark as Error Tokens for Modula-2 R10
|
| 439 |
+
m2r10_lexemes_to_reject = (
|
| 440 |
+
'!', '`', '@', '$', '%', '&', '<>',
|
| 441 |
+
)
|
| 442 |
+
|
| 443 |
+
# Modula-2 R10 reserved words in addition to the common set
|
| 444 |
+
m2r10_additional_reserved_words = (
|
| 445 |
+
# 12 additional reserved words
|
| 446 |
+
'ALIAS', 'ARGLIST', 'BLUEPRINT', 'COPY', 'GENLIB', 'INDETERMINATE',
|
| 447 |
+
'NEW', 'NONE', 'OPAQUE', 'REFERENTIAL', 'RELEASE', 'RETAIN',
|
| 448 |
+
# 2 additional reserved words with symbolic assembly option
|
| 449 |
+
'ASM', 'REG',
|
| 450 |
+
)
|
| 451 |
+
|
| 452 |
+
# Modula-2 R10 builtins in addition to the common set
|
| 453 |
+
m2r10_additional_builtins = (
|
| 454 |
+
# 26 additional builtins
|
| 455 |
+
'CARDINAL', 'COUNT', 'EMPTY', 'EXISTS', 'INSERT', 'LENGTH', 'LONGCARD',
|
| 456 |
+
'OCTET', 'PTR', 'PRED', 'READ', 'READNEW', 'REMOVE', 'RETRIEVE', 'SORT',
|
| 457 |
+
'STORE', 'SUBSET', 'SUCC', 'TLIMIT', 'TMAX', 'TMIN', 'TRUE', 'TSIZE',
|
| 458 |
+
'UNICHAR', 'WRITE', 'WRITEF',
|
| 459 |
+
)
|
| 460 |
+
|
| 461 |
+
# Modula-2 R10 Additional Pseudo-Module Builtins Dataset
|
| 462 |
+
m2r10_additional_pseudo_builtins = (
|
| 463 |
+
# 13 additional builtins (TPROPERTIES)
|
| 464 |
+
'TPROPERTIES', 'PROPERTY', 'LITERAL', 'TPROPERTY', 'TLITERAL',
|
| 465 |
+
'TBUILTIN', 'TDYN', 'TREFC', 'TNIL', 'TBASE', 'TPRECISION',
|
| 466 |
+
'TMAXEXP', 'TMINEXP',
|
| 467 |
+
# 4 additional builtins (CONVERSION)
|
| 468 |
+
'CONVERSION', 'TSXFSIZE', 'SXF', 'VAL',
|
| 469 |
+
# 35 additional builtins (UNSAFE)
|
| 470 |
+
'UNSAFE', 'CAST', 'INTRINSIC', 'AVAIL', 'ADD', 'SUB', 'ADDC', 'SUBC',
|
| 471 |
+
'FETCHADD', 'FETCHSUB', 'SHL', 'SHR', 'ASHR', 'ROTL', 'ROTR', 'ROTLC',
|
| 472 |
+
'ROTRC', 'BWNOT', 'BWAND', 'BWOR', 'BWXOR', 'BWNAND', 'BWNOR',
|
| 473 |
+
'SETBIT', 'TESTBIT', 'LSBIT', 'MSBIT', 'CSBITS', 'BAIL', 'HALT',
|
| 474 |
+
'TODO', 'FFI', 'ADDR', 'VARGLIST', 'VARGC',
|
| 475 |
+
# 11 additional builtins (ATOMIC)
|
| 476 |
+
'ATOMIC', 'INTRINSIC', 'AVAIL', 'SWAP', 'CAS', 'INC', 'DEC', 'BWAND',
|
| 477 |
+
'BWNAND', 'BWOR', 'BWXOR',
|
| 478 |
+
# 7 additional builtins (COMPILER)
|
| 479 |
+
'COMPILER', 'DEBUG', 'MODNAME', 'PROCNAME', 'LINENUM', 'DEFAULT',
|
| 480 |
+
'HASH',
|
| 481 |
+
# 5 additional builtins (ASSEMBLER)
|
| 482 |
+
'ASSEMBLER', 'REGISTER', 'SETREG', 'GETREG', 'CODE',
|
| 483 |
+
)
|
| 484 |
+
|
| 485 |
+
# O b j e c t i v e M o d u l a - 2 D a t a s e t s
|
| 486 |
+
|
| 487 |
+
# Lexemes to Mark as Error Tokens for Objective Modula-2
|
| 488 |
+
objm2_lexemes_to_reject = (
|
| 489 |
+
'!', '$', '%', '&', '<>',
|
| 490 |
+
)
|
| 491 |
+
|
| 492 |
+
# Objective Modula-2 Extensions
|
| 493 |
+
# reserved words in addition to Modula-2 R10
|
| 494 |
+
objm2_additional_reserved_words = (
|
| 495 |
+
# 16 additional reserved words
|
| 496 |
+
'BYCOPY', 'BYREF', 'CLASS', 'CONTINUE', 'CRITICAL', 'INOUT', 'METHOD',
|
| 497 |
+
'ON', 'OPTIONAL', 'OUT', 'PRIVATE', 'PROTECTED', 'PROTOCOL', 'PUBLIC',
|
| 498 |
+
'SUPER', 'TRY',
|
| 499 |
+
)
|
| 500 |
+
|
| 501 |
+
# Objective Modula-2 Extensions
|
| 502 |
+
# builtins in addition to Modula-2 R10
|
| 503 |
+
objm2_additional_builtins = (
|
| 504 |
+
# 3 additional builtins
|
| 505 |
+
'OBJECT', 'NO', 'YES',
|
| 506 |
+
)
|
| 507 |
+
|
| 508 |
+
# Objective Modula-2 Extensions
|
| 509 |
+
# pseudo-module builtins in addition to Modula-2 R10
|
| 510 |
+
objm2_additional_pseudo_builtins = (
|
| 511 |
+
# None
|
| 512 |
+
)
|
| 513 |
+
|
| 514 |
+
# A g l e t M o d u l a - 2 D a t a s e t s
|
| 515 |
+
|
| 516 |
+
# Aglet Extensions
|
| 517 |
+
# reserved words in addition to ISO Modula-2
|
| 518 |
+
aglet_additional_reserved_words = (
|
| 519 |
+
# None
|
| 520 |
+
)
|
| 521 |
+
|
| 522 |
+
# Aglet Extensions
|
| 523 |
+
# builtins in addition to ISO Modula-2
|
| 524 |
+
aglet_additional_builtins = (
|
| 525 |
+
# 9 additional builtins
|
| 526 |
+
'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
|
| 527 |
+
'CARDINAL32', 'INTEGER8', 'INTEGER16', 'INTEGER32',
|
| 528 |
+
)
|
| 529 |
+
|
| 530 |
+
# Aglet Modula-2 Extensions
|
| 531 |
+
# pseudo-module builtins in addition to ISO Modula-2
|
| 532 |
+
aglet_additional_pseudo_builtins = (
|
| 533 |
+
# None
|
| 534 |
+
)
|
| 535 |
+
|
| 536 |
+
# G N U M o d u l a - 2 D a t a s e t s
|
| 537 |
+
|
| 538 |
+
# GNU Extensions
|
| 539 |
+
# reserved words in addition to PIM Modula-2
|
| 540 |
+
gm2_additional_reserved_words = (
|
| 541 |
+
# 10 additional reserved words
|
| 542 |
+
'ASM', '__ATTRIBUTE__', '__BUILTIN__', '__COLUMN__', '__DATE__',
|
| 543 |
+
'__FILE__', '__FUNCTION__', '__LINE__', '__MODULE__', 'VOLATILE',
|
| 544 |
+
)
|
| 545 |
+
|
| 546 |
+
# GNU Extensions
|
| 547 |
+
# builtins in addition to PIM Modula-2
|
| 548 |
+
gm2_additional_builtins = (
|
| 549 |
+
# 21 additional builtins
|
| 550 |
+
'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
|
| 551 |
+
'CARDINAL32', 'CARDINAL64', 'COMPLEX32', 'COMPLEX64', 'COMPLEX96',
|
| 552 |
+
'COMPLEX128', 'INTEGER8', 'INTEGER16', 'INTEGER32', 'INTEGER64',
|
| 553 |
+
'REAL8', 'REAL16', 'REAL32', 'REAL96', 'REAL128', 'THROW',
|
| 554 |
+
)
|
| 555 |
+
|
| 556 |
+
# GNU Extensions
|
| 557 |
+
# pseudo-module builtins in addition to PIM Modula-2
|
| 558 |
+
gm2_additional_pseudo_builtins = (
|
| 559 |
+
# None
|
| 560 |
+
)
|
| 561 |
+
|
| 562 |
+
# p 1 M o d u l a - 2 D a t a s e t s
|
| 563 |
+
|
| 564 |
+
# p1 Extensions
|
| 565 |
+
# reserved words in addition to ISO Modula-2
|
| 566 |
+
p1_additional_reserved_words = (
|
| 567 |
+
# None
|
| 568 |
+
)
|
| 569 |
+
|
| 570 |
+
# p1 Extensions
|
| 571 |
+
# builtins in addition to ISO Modula-2
|
| 572 |
+
p1_additional_builtins = (
|
| 573 |
+
# None
|
| 574 |
+
)
|
| 575 |
+
|
| 576 |
+
# p1 Modula-2 Extensions
|
| 577 |
+
# pseudo-module builtins in addition to ISO Modula-2
|
| 578 |
+
p1_additional_pseudo_builtins = (
|
| 579 |
+
# 1 additional builtin
|
| 580 |
+
'BCD',
|
| 581 |
+
)
|
| 582 |
+
|
| 583 |
+
# X D S M o d u l a - 2 D a t a s e t s
|
| 584 |
+
|
| 585 |
+
# XDS Extensions
|
| 586 |
+
# reserved words in addition to ISO Modula-2
|
| 587 |
+
xds_additional_reserved_words = (
|
| 588 |
+
# 1 additional reserved word
|
| 589 |
+
'SEQ',
|
| 590 |
+
)
|
| 591 |
+
|
| 592 |
+
# XDS Extensions
|
| 593 |
+
# builtins in addition to ISO Modula-2
|
| 594 |
+
xds_additional_builtins = (
|
| 595 |
+
# 9 additional builtins
|
| 596 |
+
'ASH', 'ASSERT', 'DIFFADR_TYPE', 'ENTIER', 'INDEX', 'LEN',
|
| 597 |
+
'LONGCARD', 'SHORTCARD', 'SHORTINT',
|
| 598 |
+
)
|
| 599 |
+
|
| 600 |
+
# XDS Modula-2 Extensions
|
| 601 |
+
# pseudo-module builtins in addition to ISO Modula-2
|
| 602 |
+
xds_additional_pseudo_builtins = (
|
| 603 |
+
# 22 additional builtins (SYSTEM)
|
| 604 |
+
'PROCESS', 'NEWPROCESS', 'BOOL8', 'BOOL16', 'BOOL32', 'CARD8',
|
| 605 |
+
'CARD16', 'CARD32', 'INT8', 'INT16', 'INT32', 'REF', 'MOVE',
|
| 606 |
+
'FILL', 'GET', 'PUT', 'CC', 'int', 'unsigned', 'size_t', 'void'
|
| 607 |
+
# 3 additional builtins (COMPILER)
|
| 608 |
+
'COMPILER', 'OPTION', 'EQUATION'
|
| 609 |
+
)
|
| 610 |
+
|
| 611 |
+
# P I M S t a n d a r d L i b r a r y D a t a s e t s
|
| 612 |
+
|
| 613 |
+
# PIM Modula-2 Standard Library Modules Dataset
|
| 614 |
+
pim_stdlib_module_identifiers = (
|
| 615 |
+
'Terminal', 'FileSystem', 'InOut', 'RealInOut', 'MathLib0', 'Storage',
|
| 616 |
+
)
|
| 617 |
+
|
| 618 |
+
# PIM Modula-2 Standard Library Types Dataset
|
| 619 |
+
pim_stdlib_type_identifiers = (
|
| 620 |
+
'Flag', 'FlagSet', 'Response', 'Command', 'Lock', 'Permission',
|
| 621 |
+
'MediumType', 'File', 'FileProc', 'DirectoryProc', 'FileCommand',
|
| 622 |
+
'DirectoryCommand',
|
| 623 |
+
)
|
| 624 |
+
|
| 625 |
+
# PIM Modula-2 Standard Library Procedures Dataset
|
| 626 |
+
pim_stdlib_proc_identifiers = (
|
| 627 |
+
'Read', 'BusyRead', 'ReadAgain', 'Write', 'WriteString', 'WriteLn',
|
| 628 |
+
'Create', 'Lookup', 'Close', 'Delete', 'Rename', 'SetRead', 'SetWrite',
|
| 629 |
+
'SetModify', 'SetOpen', 'Doio', 'SetPos', 'GetPos', 'Length', 'Reset',
|
| 630 |
+
'Again', 'ReadWord', 'WriteWord', 'ReadChar', 'WriteChar',
|
| 631 |
+
'CreateMedium', 'DeleteMedium', 'AssignName', 'DeassignName',
|
| 632 |
+
'ReadMedium', 'LookupMedium', 'OpenInput', 'OpenOutput', 'CloseInput',
|
| 633 |
+
'CloseOutput', 'ReadString', 'ReadInt', 'ReadCard', 'ReadWrd',
|
| 634 |
+
'WriteInt', 'WriteCard', 'WriteOct', 'WriteHex', 'WriteWrd',
|
| 635 |
+
'ReadReal', 'WriteReal', 'WriteFixPt', 'WriteRealOct', 'sqrt', 'exp',
|
| 636 |
+
'ln', 'sin', 'cos', 'arctan', 'entier', 'ALLOCATE', 'DEALLOCATE',
|
| 637 |
+
)
|
| 638 |
+
|
| 639 |
+
# PIM Modula-2 Standard Library Variables Dataset
|
| 640 |
+
pim_stdlib_var_identifiers = (
|
| 641 |
+
'Done', 'termCH', 'in', 'out'
|
| 642 |
+
)
|
| 643 |
+
|
| 644 |
+
# PIM Modula-2 Standard Library Constants Dataset
|
| 645 |
+
pim_stdlib_const_identifiers = (
|
| 646 |
+
'EOL',
|
| 647 |
+
)
|
| 648 |
+
|
| 649 |
+
# I S O S t a n d a r d L i b r a r y D a t a s e t s
|
| 650 |
+
|
| 651 |
+
# ISO Modula-2 Standard Library Modules Dataset
|
| 652 |
+
iso_stdlib_module_identifiers = (
|
| 653 |
+
# TO DO
|
| 654 |
+
)
|
| 655 |
+
|
| 656 |
+
# ISO Modula-2 Standard Library Types Dataset
|
| 657 |
+
iso_stdlib_type_identifiers = (
|
| 658 |
+
# TO DO
|
| 659 |
+
)
|
| 660 |
+
|
| 661 |
+
# ISO Modula-2 Standard Library Procedures Dataset
|
| 662 |
+
iso_stdlib_proc_identifiers = (
|
| 663 |
+
# TO DO
|
| 664 |
+
)
|
| 665 |
+
|
| 666 |
+
# ISO Modula-2 Standard Library Variables Dataset
|
| 667 |
+
iso_stdlib_var_identifiers = (
|
| 668 |
+
# TO DO
|
| 669 |
+
)
|
| 670 |
+
|
| 671 |
+
# ISO Modula-2 Standard Library Constants Dataset
|
| 672 |
+
iso_stdlib_const_identifiers = (
|
| 673 |
+
# TO DO
|
| 674 |
+
)
|
| 675 |
+
|
| 676 |
+
# M 2 R 1 0 S t a n d a r d L i b r a r y D a t a s e t s
|
| 677 |
+
|
| 678 |
+
# Modula-2 R10 Standard Library ADTs Dataset
|
| 679 |
+
m2r10_stdlib_adt_identifiers = (
|
| 680 |
+
'BCD', 'LONGBCD', 'BITSET', 'SHORTBITSET', 'LONGBITSET',
|
| 681 |
+
'LONGLONGBITSET', 'COMPLEX', 'LONGCOMPLEX', 'SHORTCARD', 'LONGLONGCARD',
|
| 682 |
+
'SHORTINT', 'LONGLONGINT', 'POSINT', 'SHORTPOSINT', 'LONGPOSINT',
|
| 683 |
+
'LONGLONGPOSINT', 'BITSET8', 'BITSET16', 'BITSET32', 'BITSET64',
|
| 684 |
+
'BITSET128', 'BS8', 'BS16', 'BS32', 'BS64', 'BS128', 'CARDINAL8',
|
| 685 |
+
'CARDINAL16', 'CARDINAL32', 'CARDINAL64', 'CARDINAL128', 'CARD8',
|
| 686 |
+
'CARD16', 'CARD32', 'CARD64', 'CARD128', 'INTEGER8', 'INTEGER16',
|
| 687 |
+
'INTEGER32', 'INTEGER64', 'INTEGER128', 'INT8', 'INT16', 'INT32',
|
| 688 |
+
'INT64', 'INT128', 'STRING', 'UNISTRING',
|
| 689 |
+
)
|
| 690 |
+
|
| 691 |
+
# Modula-2 R10 Standard Library Blueprints Dataset
|
| 692 |
+
m2r10_stdlib_blueprint_identifiers = (
|
| 693 |
+
'ProtoRoot', 'ProtoComputational', 'ProtoNumeric', 'ProtoScalar',
|
| 694 |
+
'ProtoNonScalar', 'ProtoCardinal', 'ProtoInteger', 'ProtoReal',
|
| 695 |
+
'ProtoComplex', 'ProtoVector', 'ProtoTuple', 'ProtoCompArray',
|
| 696 |
+
'ProtoCollection', 'ProtoStaticArray', 'ProtoStaticSet',
|
| 697 |
+
'ProtoStaticString', 'ProtoArray', 'ProtoString', 'ProtoSet',
|
| 698 |
+
'ProtoMultiSet', 'ProtoDictionary', 'ProtoMultiDict', 'ProtoExtension',
|
| 699 |
+
'ProtoIO', 'ProtoCardMath', 'ProtoIntMath', 'ProtoRealMath',
|
| 700 |
+
)
|
| 701 |
+
|
| 702 |
+
# Modula-2 R10 Standard Library Modules Dataset
|
| 703 |
+
m2r10_stdlib_module_identifiers = (
|
| 704 |
+
'ASCII', 'BooleanIO', 'CharIO', 'UnicharIO', 'OctetIO',
|
| 705 |
+
'CardinalIO', 'LongCardIO', 'IntegerIO', 'LongIntIO', 'RealIO',
|
| 706 |
+
'LongRealIO', 'BCDIO', 'LongBCDIO', 'CardMath', 'LongCardMath',
|
| 707 |
+
'IntMath', 'LongIntMath', 'RealMath', 'LongRealMath', 'BCDMath',
|
| 708 |
+
'LongBCDMath', 'FileIO', 'FileSystem', 'Storage', 'IOSupport',
|
| 709 |
+
)
|
| 710 |
+
|
| 711 |
+
# Modula-2 R10 Standard Library Types Dataset
|
| 712 |
+
m2r10_stdlib_type_identifiers = (
|
| 713 |
+
'File', 'Status',
|
| 714 |
+
# TO BE COMPLETED
|
| 715 |
+
)
|
| 716 |
+
|
| 717 |
+
# Modula-2 R10 Standard Library Procedures Dataset
|
| 718 |
+
m2r10_stdlib_proc_identifiers = (
|
| 719 |
+
'ALLOCATE', 'DEALLOCATE', 'SIZE',
|
| 720 |
+
# TO BE COMPLETED
|
| 721 |
+
)
|
| 722 |
+
|
| 723 |
+
# Modula-2 R10 Standard Library Variables Dataset
|
| 724 |
+
m2r10_stdlib_var_identifiers = (
|
| 725 |
+
'stdIn', 'stdOut', 'stdErr',
|
| 726 |
+
)
|
| 727 |
+
|
| 728 |
+
# Modula-2 R10 Standard Library Constants Dataset
|
| 729 |
+
m2r10_stdlib_const_identifiers = (
|
| 730 |
+
'pi', 'tau',
|
| 731 |
+
)
|
| 732 |
+
|
| 733 |
+
# D i a l e c t s
|
| 734 |
+
|
| 735 |
+
# Dialect modes
|
| 736 |
+
dialects = (
|
| 737 |
+
'unknown',
|
| 738 |
+
'm2pim', 'm2iso', 'm2r10', 'objm2',
|
| 739 |
+
'm2iso+aglet', 'm2pim+gm2', 'm2iso+p1', 'm2iso+xds',
|
| 740 |
+
)
|
| 741 |
+
|
| 742 |
+
# D a t a b a s e s
|
| 743 |
+
|
| 744 |
+
# Lexemes to Mark as Errors Database
|
| 745 |
+
lexemes_to_reject_db = {
|
| 746 |
+
# Lexemes to reject for unknown dialect
|
| 747 |
+
'unknown': (
|
| 748 |
+
# LEAVE THIS EMPTY
|
| 749 |
+
),
|
| 750 |
+
# Lexemes to reject for PIM Modula-2
|
| 751 |
+
'm2pim': (
|
| 752 |
+
pim_lexemes_to_reject,
|
| 753 |
+
),
|
| 754 |
+
# Lexemes to reject for ISO Modula-2
|
| 755 |
+
'm2iso': (
|
| 756 |
+
iso_lexemes_to_reject,
|
| 757 |
+
),
|
| 758 |
+
# Lexemes to reject for Modula-2 R10
|
| 759 |
+
'm2r10': (
|
| 760 |
+
m2r10_lexemes_to_reject,
|
| 761 |
+
),
|
| 762 |
+
# Lexemes to reject for Objective Modula-2
|
| 763 |
+
'objm2': (
|
| 764 |
+
objm2_lexemes_to_reject,
|
| 765 |
+
),
|
| 766 |
+
# Lexemes to reject for Aglet Modula-2
|
| 767 |
+
'm2iso+aglet': (
|
| 768 |
+
iso_lexemes_to_reject,
|
| 769 |
+
),
|
| 770 |
+
# Lexemes to reject for GNU Modula-2
|
| 771 |
+
'm2pim+gm2': (
|
| 772 |
+
pim_lexemes_to_reject,
|
| 773 |
+
),
|
| 774 |
+
# Lexemes to reject for p1 Modula-2
|
| 775 |
+
'm2iso+p1': (
|
| 776 |
+
iso_lexemes_to_reject,
|
| 777 |
+
),
|
| 778 |
+
# Lexemes to reject for XDS Modula-2
|
| 779 |
+
'm2iso+xds': (
|
| 780 |
+
iso_lexemes_to_reject,
|
| 781 |
+
),
|
| 782 |
+
}
|
| 783 |
+
|
| 784 |
+
# Reserved Words Database
|
| 785 |
+
reserved_words_db = {
|
| 786 |
+
# Reserved words for unknown dialect
|
| 787 |
+
'unknown': (
|
| 788 |
+
common_reserved_words,
|
| 789 |
+
pim_additional_reserved_words,
|
| 790 |
+
iso_additional_reserved_words,
|
| 791 |
+
m2r10_additional_reserved_words,
|
| 792 |
+
),
|
| 793 |
+
|
| 794 |
+
# Reserved words for PIM Modula-2
|
| 795 |
+
'm2pim': (
|
| 796 |
+
common_reserved_words,
|
| 797 |
+
pim_additional_reserved_words,
|
| 798 |
+
),
|
| 799 |
+
|
| 800 |
+
# Reserved words for Modula-2 R10
|
| 801 |
+
'm2iso': (
|
| 802 |
+
common_reserved_words,
|
| 803 |
+
iso_additional_reserved_words,
|
| 804 |
+
),
|
| 805 |
+
|
| 806 |
+
# Reserved words for ISO Modula-2
|
| 807 |
+
'm2r10': (
|
| 808 |
+
common_reserved_words,
|
| 809 |
+
m2r10_additional_reserved_words,
|
| 810 |
+
),
|
| 811 |
+
|
| 812 |
+
# Reserved words for Objective Modula-2
|
| 813 |
+
'objm2': (
|
| 814 |
+
common_reserved_words,
|
| 815 |
+
m2r10_additional_reserved_words,
|
| 816 |
+
objm2_additional_reserved_words,
|
| 817 |
+
),
|
| 818 |
+
|
| 819 |
+
# Reserved words for Aglet Modula-2 Extensions
|
| 820 |
+
'm2iso+aglet': (
|
| 821 |
+
common_reserved_words,
|
| 822 |
+
iso_additional_reserved_words,
|
| 823 |
+
aglet_additional_reserved_words,
|
| 824 |
+
),
|
| 825 |
+
|
| 826 |
+
# Reserved words for GNU Modula-2 Extensions
|
| 827 |
+
'm2pim+gm2': (
|
| 828 |
+
common_reserved_words,
|
| 829 |
+
pim_additional_reserved_words,
|
| 830 |
+
gm2_additional_reserved_words,
|
| 831 |
+
),
|
| 832 |
+
|
| 833 |
+
# Reserved words for p1 Modula-2 Extensions
|
| 834 |
+
'm2iso+p1': (
|
| 835 |
+
common_reserved_words,
|
| 836 |
+
iso_additional_reserved_words,
|
| 837 |
+
p1_additional_reserved_words,
|
| 838 |
+
),
|
| 839 |
+
|
| 840 |
+
# Reserved words for XDS Modula-2 Extensions
|
| 841 |
+
'm2iso+xds': (
|
| 842 |
+
common_reserved_words,
|
| 843 |
+
iso_additional_reserved_words,
|
| 844 |
+
xds_additional_reserved_words,
|
| 845 |
+
),
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
# Builtins Database
|
| 849 |
+
builtins_db = {
|
| 850 |
+
# Builtins for unknown dialect
|
| 851 |
+
'unknown': (
|
| 852 |
+
common_builtins,
|
| 853 |
+
pim_additional_builtins,
|
| 854 |
+
iso_additional_builtins,
|
| 855 |
+
m2r10_additional_builtins,
|
| 856 |
+
),
|
| 857 |
+
|
| 858 |
+
# Builtins for PIM Modula-2
|
| 859 |
+
'm2pim': (
|
| 860 |
+
common_builtins,
|
| 861 |
+
pim_additional_builtins,
|
| 862 |
+
),
|
| 863 |
+
|
| 864 |
+
# Builtins for ISO Modula-2
|
| 865 |
+
'm2iso': (
|
| 866 |
+
common_builtins,
|
| 867 |
+
iso_additional_builtins,
|
| 868 |
+
),
|
| 869 |
+
|
| 870 |
+
# Builtins for ISO Modula-2
|
| 871 |
+
'm2r10': (
|
| 872 |
+
common_builtins,
|
| 873 |
+
m2r10_additional_builtins,
|
| 874 |
+
),
|
| 875 |
+
|
| 876 |
+
# Builtins for Objective Modula-2
|
| 877 |
+
'objm2': (
|
| 878 |
+
common_builtins,
|
| 879 |
+
m2r10_additional_builtins,
|
| 880 |
+
objm2_additional_builtins,
|
| 881 |
+
),
|
| 882 |
+
|
| 883 |
+
# Builtins for Aglet Modula-2 Extensions
|
| 884 |
+
'm2iso+aglet': (
|
| 885 |
+
common_builtins,
|
| 886 |
+
iso_additional_builtins,
|
| 887 |
+
aglet_additional_builtins,
|
| 888 |
+
),
|
| 889 |
+
|
| 890 |
+
# Builtins for GNU Modula-2 Extensions
|
| 891 |
+
'm2pim+gm2': (
|
| 892 |
+
common_builtins,
|
| 893 |
+
pim_additional_builtins,
|
| 894 |
+
gm2_additional_builtins,
|
| 895 |
+
),
|
| 896 |
+
|
| 897 |
+
# Builtins for p1 Modula-2 Extensions
|
| 898 |
+
'm2iso+p1': (
|
| 899 |
+
common_builtins,
|
| 900 |
+
iso_additional_builtins,
|
| 901 |
+
p1_additional_builtins,
|
| 902 |
+
),
|
| 903 |
+
|
| 904 |
+
# Builtins for XDS Modula-2 Extensions
|
| 905 |
+
'm2iso+xds': (
|
| 906 |
+
common_builtins,
|
| 907 |
+
iso_additional_builtins,
|
| 908 |
+
xds_additional_builtins,
|
| 909 |
+
),
|
| 910 |
+
}
|
| 911 |
+
|
| 912 |
+
# Pseudo-Module Builtins Database
|
| 913 |
+
pseudo_builtins_db = {
|
| 914 |
+
# Builtins for unknown dialect
|
| 915 |
+
'unknown': (
|
| 916 |
+
common_pseudo_builtins,
|
| 917 |
+
pim_additional_pseudo_builtins,
|
| 918 |
+
iso_additional_pseudo_builtins,
|
| 919 |
+
m2r10_additional_pseudo_builtins,
|
| 920 |
+
),
|
| 921 |
+
|
| 922 |
+
# Builtins for PIM Modula-2
|
| 923 |
+
'm2pim': (
|
| 924 |
+
common_pseudo_builtins,
|
| 925 |
+
pim_additional_pseudo_builtins,
|
| 926 |
+
),
|
| 927 |
+
|
| 928 |
+
# Builtins for ISO Modula-2
|
| 929 |
+
'm2iso': (
|
| 930 |
+
common_pseudo_builtins,
|
| 931 |
+
iso_additional_pseudo_builtins,
|
| 932 |
+
),
|
| 933 |
+
|
| 934 |
+
# Builtins for ISO Modula-2
|
| 935 |
+
'm2r10': (
|
| 936 |
+
common_pseudo_builtins,
|
| 937 |
+
m2r10_additional_pseudo_builtins,
|
| 938 |
+
),
|
| 939 |
+
|
| 940 |
+
# Builtins for Objective Modula-2
|
| 941 |
+
'objm2': (
|
| 942 |
+
common_pseudo_builtins,
|
| 943 |
+
m2r10_additional_pseudo_builtins,
|
| 944 |
+
objm2_additional_pseudo_builtins,
|
| 945 |
+
),
|
| 946 |
+
|
| 947 |
+
# Builtins for Aglet Modula-2 Extensions
|
| 948 |
+
'm2iso+aglet': (
|
| 949 |
+
common_pseudo_builtins,
|
| 950 |
+
iso_additional_pseudo_builtins,
|
| 951 |
+
aglet_additional_pseudo_builtins,
|
| 952 |
+
),
|
| 953 |
+
|
| 954 |
+
# Builtins for GNU Modula-2 Extensions
|
| 955 |
+
'm2pim+gm2': (
|
| 956 |
+
common_pseudo_builtins,
|
| 957 |
+
pim_additional_pseudo_builtins,
|
| 958 |
+
gm2_additional_pseudo_builtins,
|
| 959 |
+
),
|
| 960 |
+
|
| 961 |
+
# Builtins for p1 Modula-2 Extensions
|
| 962 |
+
'm2iso+p1': (
|
| 963 |
+
common_pseudo_builtins,
|
| 964 |
+
iso_additional_pseudo_builtins,
|
| 965 |
+
p1_additional_pseudo_builtins,
|
| 966 |
+
),
|
| 967 |
+
|
| 968 |
+
# Builtins for XDS Modula-2 Extensions
|
| 969 |
+
'm2iso+xds': (
|
| 970 |
+
common_pseudo_builtins,
|
| 971 |
+
iso_additional_pseudo_builtins,
|
| 972 |
+
xds_additional_pseudo_builtins,
|
| 973 |
+
),
|
| 974 |
+
}
|
| 975 |
+
|
| 976 |
+
# Standard Library ADTs Database
|
| 977 |
+
stdlib_adts_db = {
|
| 978 |
+
# Empty entry for unknown dialect
|
| 979 |
+
'unknown': (
|
| 980 |
+
# LEAVE THIS EMPTY
|
| 981 |
+
),
|
| 982 |
+
# Standard Library ADTs for PIM Modula-2
|
| 983 |
+
'm2pim': (
|
| 984 |
+
# No first class library types
|
| 985 |
+
),
|
| 986 |
+
|
| 987 |
+
# Standard Library ADTs for ISO Modula-2
|
| 988 |
+
'm2iso': (
|
| 989 |
+
# No first class library types
|
| 990 |
+
),
|
| 991 |
+
|
| 992 |
+
# Standard Library ADTs for Modula-2 R10
|
| 993 |
+
'm2r10': (
|
| 994 |
+
m2r10_stdlib_adt_identifiers,
|
| 995 |
+
),
|
| 996 |
+
|
| 997 |
+
# Standard Library ADTs for Objective Modula-2
|
| 998 |
+
'objm2': (
|
| 999 |
+
m2r10_stdlib_adt_identifiers,
|
| 1000 |
+
),
|
| 1001 |
+
|
| 1002 |
+
# Standard Library ADTs for Aglet Modula-2
|
| 1003 |
+
'm2iso+aglet': (
|
| 1004 |
+
# No first class library types
|
| 1005 |
+
),
|
| 1006 |
+
|
| 1007 |
+
# Standard Library ADTs for GNU Modula-2
|
| 1008 |
+
'm2pim+gm2': (
|
| 1009 |
+
# No first class library types
|
| 1010 |
+
),
|
| 1011 |
+
|
| 1012 |
+
# Standard Library ADTs for p1 Modula-2
|
| 1013 |
+
'm2iso+p1': (
|
| 1014 |
+
# No first class library types
|
| 1015 |
+
),
|
| 1016 |
+
|
| 1017 |
+
# Standard Library ADTs for XDS Modula-2
|
| 1018 |
+
'm2iso+xds': (
|
| 1019 |
+
# No first class library types
|
| 1020 |
+
),
|
| 1021 |
+
}
|
| 1022 |
+
|
| 1023 |
+
# Standard Library Modules Database
|
| 1024 |
+
stdlib_modules_db = {
|
| 1025 |
+
# Empty entry for unknown dialect
|
| 1026 |
+
'unknown': (
|
| 1027 |
+
# LEAVE THIS EMPTY
|
| 1028 |
+
),
|
| 1029 |
+
# Standard Library Modules for PIM Modula-2
|
| 1030 |
+
'm2pim': (
|
| 1031 |
+
pim_stdlib_module_identifiers,
|
| 1032 |
+
),
|
| 1033 |
+
|
| 1034 |
+
# Standard Library Modules for ISO Modula-2
|
| 1035 |
+
'm2iso': (
|
| 1036 |
+
iso_stdlib_module_identifiers,
|
| 1037 |
+
),
|
| 1038 |
+
|
| 1039 |
+
# Standard Library Modules for Modula-2 R10
|
| 1040 |
+
'm2r10': (
|
| 1041 |
+
m2r10_stdlib_blueprint_identifiers,
|
| 1042 |
+
m2r10_stdlib_module_identifiers,
|
| 1043 |
+
m2r10_stdlib_adt_identifiers,
|
| 1044 |
+
),
|
| 1045 |
+
|
| 1046 |
+
# Standard Library Modules for Objective Modula-2
|
| 1047 |
+
'objm2': (
|
| 1048 |
+
m2r10_stdlib_blueprint_identifiers,
|
| 1049 |
+
m2r10_stdlib_module_identifiers,
|
| 1050 |
+
),
|
| 1051 |
+
|
| 1052 |
+
# Standard Library Modules for Aglet Modula-2
|
| 1053 |
+
'm2iso+aglet': (
|
| 1054 |
+
iso_stdlib_module_identifiers,
|
| 1055 |
+
),
|
| 1056 |
+
|
| 1057 |
+
# Standard Library Modules for GNU Modula-2
|
| 1058 |
+
'm2pim+gm2': (
|
| 1059 |
+
pim_stdlib_module_identifiers,
|
| 1060 |
+
),
|
| 1061 |
+
|
| 1062 |
+
# Standard Library Modules for p1 Modula-2
|
| 1063 |
+
'm2iso+p1': (
|
| 1064 |
+
iso_stdlib_module_identifiers,
|
| 1065 |
+
),
|
| 1066 |
+
|
| 1067 |
+
# Standard Library Modules for XDS Modula-2
|
| 1068 |
+
'm2iso+xds': (
|
| 1069 |
+
iso_stdlib_module_identifiers,
|
| 1070 |
+
),
|
| 1071 |
+
}
|
| 1072 |
+
|
| 1073 |
+
# Standard Library Types Database
|
| 1074 |
+
stdlib_types_db = {
|
| 1075 |
+
# Empty entry for unknown dialect
|
| 1076 |
+
'unknown': (
|
| 1077 |
+
# LEAVE THIS EMPTY
|
| 1078 |
+
),
|
| 1079 |
+
# Standard Library Types for PIM Modula-2
|
| 1080 |
+
'm2pim': (
|
| 1081 |
+
pim_stdlib_type_identifiers,
|
| 1082 |
+
),
|
| 1083 |
+
|
| 1084 |
+
# Standard Library Types for ISO Modula-2
|
| 1085 |
+
'm2iso': (
|
| 1086 |
+
iso_stdlib_type_identifiers,
|
| 1087 |
+
),
|
| 1088 |
+
|
| 1089 |
+
# Standard Library Types for Modula-2 R10
|
| 1090 |
+
'm2r10': (
|
| 1091 |
+
m2r10_stdlib_type_identifiers,
|
| 1092 |
+
),
|
| 1093 |
+
|
| 1094 |
+
# Standard Library Types for Objective Modula-2
|
| 1095 |
+
'objm2': (
|
| 1096 |
+
m2r10_stdlib_type_identifiers,
|
| 1097 |
+
),
|
| 1098 |
+
|
| 1099 |
+
# Standard Library Types for Aglet Modula-2
|
| 1100 |
+
'm2iso+aglet': (
|
| 1101 |
+
iso_stdlib_type_identifiers,
|
| 1102 |
+
),
|
| 1103 |
+
|
| 1104 |
+
# Standard Library Types for GNU Modula-2
|
| 1105 |
+
'm2pim+gm2': (
|
| 1106 |
+
pim_stdlib_type_identifiers,
|
| 1107 |
+
),
|
| 1108 |
+
|
| 1109 |
+
# Standard Library Types for p1 Modula-2
|
| 1110 |
+
'm2iso+p1': (
|
| 1111 |
+
iso_stdlib_type_identifiers,
|
| 1112 |
+
),
|
| 1113 |
+
|
| 1114 |
+
# Standard Library Types for XDS Modula-2
|
| 1115 |
+
'm2iso+xds': (
|
| 1116 |
+
iso_stdlib_type_identifiers,
|
| 1117 |
+
),
|
| 1118 |
+
}
|
| 1119 |
+
|
| 1120 |
+
# Standard Library Procedures Database
|
| 1121 |
+
stdlib_procedures_db = {
|
| 1122 |
+
# Empty entry for unknown dialect
|
| 1123 |
+
'unknown': (
|
| 1124 |
+
# LEAVE THIS EMPTY
|
| 1125 |
+
),
|
| 1126 |
+
# Standard Library Procedures for PIM Modula-2
|
| 1127 |
+
'm2pim': (
|
| 1128 |
+
pim_stdlib_proc_identifiers,
|
| 1129 |
+
),
|
| 1130 |
+
|
| 1131 |
+
# Standard Library Procedures for ISO Modula-2
|
| 1132 |
+
'm2iso': (
|
| 1133 |
+
iso_stdlib_proc_identifiers,
|
| 1134 |
+
),
|
| 1135 |
+
|
| 1136 |
+
# Standard Library Procedures for Modula-2 R10
|
| 1137 |
+
'm2r10': (
|
| 1138 |
+
m2r10_stdlib_proc_identifiers,
|
| 1139 |
+
),
|
| 1140 |
+
|
| 1141 |
+
# Standard Library Procedures for Objective Modula-2
|
| 1142 |
+
'objm2': (
|
| 1143 |
+
m2r10_stdlib_proc_identifiers,
|
| 1144 |
+
),
|
| 1145 |
+
|
| 1146 |
+
# Standard Library Procedures for Aglet Modula-2
|
| 1147 |
+
'm2iso+aglet': (
|
| 1148 |
+
iso_stdlib_proc_identifiers,
|
| 1149 |
+
),
|
| 1150 |
+
|
| 1151 |
+
# Standard Library Procedures for GNU Modula-2
|
| 1152 |
+
'm2pim+gm2': (
|
| 1153 |
+
pim_stdlib_proc_identifiers,
|
| 1154 |
+
),
|
| 1155 |
+
|
| 1156 |
+
# Standard Library Procedures for p1 Modula-2
|
| 1157 |
+
'm2iso+p1': (
|
| 1158 |
+
iso_stdlib_proc_identifiers,
|
| 1159 |
+
),
|
| 1160 |
+
|
| 1161 |
+
# Standard Library Procedures for XDS Modula-2
|
| 1162 |
+
'm2iso+xds': (
|
| 1163 |
+
iso_stdlib_proc_identifiers,
|
| 1164 |
+
),
|
| 1165 |
+
}
|
| 1166 |
+
|
| 1167 |
+
# Standard Library Variables Database
|
| 1168 |
+
stdlib_variables_db = {
|
| 1169 |
+
# Empty entry for unknown dialect
|
| 1170 |
+
'unknown': (
|
| 1171 |
+
# LEAVE THIS EMPTY
|
| 1172 |
+
),
|
| 1173 |
+
# Standard Library Variables for PIM Modula-2
|
| 1174 |
+
'm2pim': (
|
| 1175 |
+
pim_stdlib_var_identifiers,
|
| 1176 |
+
),
|
| 1177 |
+
|
| 1178 |
+
# Standard Library Variables for ISO Modula-2
|
| 1179 |
+
'm2iso': (
|
| 1180 |
+
iso_stdlib_var_identifiers,
|
| 1181 |
+
),
|
| 1182 |
+
|
| 1183 |
+
# Standard Library Variables for Modula-2 R10
|
| 1184 |
+
'm2r10': (
|
| 1185 |
+
m2r10_stdlib_var_identifiers,
|
| 1186 |
+
),
|
| 1187 |
+
|
| 1188 |
+
# Standard Library Variables for Objective Modula-2
|
| 1189 |
+
'objm2': (
|
| 1190 |
+
m2r10_stdlib_var_identifiers,
|
| 1191 |
+
),
|
| 1192 |
+
|
| 1193 |
+
# Standard Library Variables for Aglet Modula-2
|
| 1194 |
+
'm2iso+aglet': (
|
| 1195 |
+
iso_stdlib_var_identifiers,
|
| 1196 |
+
),
|
| 1197 |
+
|
| 1198 |
+
# Standard Library Variables for GNU Modula-2
|
| 1199 |
+
'm2pim+gm2': (
|
| 1200 |
+
pim_stdlib_var_identifiers,
|
| 1201 |
+
),
|
| 1202 |
+
|
| 1203 |
+
# Standard Library Variables for p1 Modula-2
|
| 1204 |
+
'm2iso+p1': (
|
| 1205 |
+
iso_stdlib_var_identifiers,
|
| 1206 |
+
),
|
| 1207 |
+
|
| 1208 |
+
# Standard Library Variables for XDS Modula-2
|
| 1209 |
+
'm2iso+xds': (
|
| 1210 |
+
iso_stdlib_var_identifiers,
|
| 1211 |
+
),
|
| 1212 |
+
}
|
| 1213 |
+
|
| 1214 |
+
# Standard Library Constants Database
|
| 1215 |
+
stdlib_constants_db = {
|
| 1216 |
+
# Empty entry for unknown dialect
|
| 1217 |
+
'unknown': (
|
| 1218 |
+
# LEAVE THIS EMPTY
|
| 1219 |
+
),
|
| 1220 |
+
# Standard Library Constants for PIM Modula-2
|
| 1221 |
+
'm2pim': (
|
| 1222 |
+
pim_stdlib_const_identifiers,
|
| 1223 |
+
),
|
| 1224 |
+
|
| 1225 |
+
# Standard Library Constants for ISO Modula-2
|
| 1226 |
+
'm2iso': (
|
| 1227 |
+
iso_stdlib_const_identifiers,
|
| 1228 |
+
),
|
| 1229 |
+
|
| 1230 |
+
# Standard Library Constants for Modula-2 R10
|
| 1231 |
+
'm2r10': (
|
| 1232 |
+
m2r10_stdlib_const_identifiers,
|
| 1233 |
+
),
|
| 1234 |
+
|
| 1235 |
+
# Standard Library Constants for Objective Modula-2
|
| 1236 |
+
'objm2': (
|
| 1237 |
+
m2r10_stdlib_const_identifiers,
|
| 1238 |
+
),
|
| 1239 |
+
|
| 1240 |
+
# Standard Library Constants for Aglet Modula-2
|
| 1241 |
+
'm2iso+aglet': (
|
| 1242 |
+
iso_stdlib_const_identifiers,
|
| 1243 |
+
),
|
| 1244 |
+
|
| 1245 |
+
# Standard Library Constants for GNU Modula-2
|
| 1246 |
+
'm2pim+gm2': (
|
| 1247 |
+
pim_stdlib_const_identifiers,
|
| 1248 |
+
),
|
| 1249 |
+
|
| 1250 |
+
# Standard Library Constants for p1 Modula-2
|
| 1251 |
+
'm2iso+p1': (
|
| 1252 |
+
iso_stdlib_const_identifiers,
|
| 1253 |
+
),
|
| 1254 |
+
|
| 1255 |
+
# Standard Library Constants for XDS Modula-2
|
| 1256 |
+
'm2iso+xds': (
|
| 1257 |
+
iso_stdlib_const_identifiers,
|
| 1258 |
+
),
|
| 1259 |
+
}
|
| 1260 |
+
|
| 1261 |
+
# M e t h o d s
|
| 1262 |
+
|
| 1263 |
+
# initialise a lexer instance
|
| 1264 |
+
def __init__(self, **options):
|
| 1265 |
+
#
|
| 1266 |
+
# check dialect options
|
| 1267 |
+
#
|
| 1268 |
+
dialects = get_list_opt(options, 'dialect', [])
|
| 1269 |
+
#
|
| 1270 |
+
for dialect_option in dialects:
|
| 1271 |
+
if dialect_option in self.dialects[1:-1]:
|
| 1272 |
+
# valid dialect option found
|
| 1273 |
+
self.set_dialect(dialect_option)
|
| 1274 |
+
break
|
| 1275 |
+
#
|
| 1276 |
+
# Fallback Mode (DEFAULT)
|
| 1277 |
+
else:
|
| 1278 |
+
# no valid dialect option
|
| 1279 |
+
self.set_dialect('unknown')
|
| 1280 |
+
#
|
| 1281 |
+
self.dialect_set_by_tag = False
|
| 1282 |
+
#
|
| 1283 |
+
# check style options
|
| 1284 |
+
#
|
| 1285 |
+
styles = get_list_opt(options, 'style', [])
|
| 1286 |
+
#
|
| 1287 |
+
# use lowercase mode for Algol style
|
| 1288 |
+
if 'algol' in styles or 'algol_nu' in styles:
|
| 1289 |
+
self.algol_publication_mode = True
|
| 1290 |
+
else:
|
| 1291 |
+
self.algol_publication_mode = False
|
| 1292 |
+
#
|
| 1293 |
+
# Check option flags
|
| 1294 |
+
#
|
| 1295 |
+
self.treat_stdlib_adts_as_builtins = get_bool_opt(
|
| 1296 |
+
options, 'treat_stdlib_adts_as_builtins', True)
|
| 1297 |
+
#
|
| 1298 |
+
# call superclass initialiser
|
| 1299 |
+
RegexLexer.__init__(self, **options)
|
| 1300 |
+
|
| 1301 |
+
# Set lexer to a specified dialect
|
| 1302 |
+
def set_dialect(self, dialect_id):
|
| 1303 |
+
#
|
| 1304 |
+
# if __debug__:
|
| 1305 |
+
# print 'entered set_dialect with arg: ', dialect_id
|
| 1306 |
+
#
|
| 1307 |
+
# check dialect name against known dialects
|
| 1308 |
+
if dialect_id not in self.dialects:
|
| 1309 |
+
dialect = 'unknown' # default
|
| 1310 |
+
else:
|
| 1311 |
+
dialect = dialect_id
|
| 1312 |
+
#
|
| 1313 |
+
# compose lexemes to reject set
|
| 1314 |
+
lexemes_to_reject_set = set()
|
| 1315 |
+
# add each list of reject lexemes for this dialect
|
| 1316 |
+
for list in self.lexemes_to_reject_db[dialect]:
|
| 1317 |
+
lexemes_to_reject_set.update(set(list))
|
| 1318 |
+
#
|
| 1319 |
+
# compose reserved words set
|
| 1320 |
+
reswords_set = set()
|
| 1321 |
+
# add each list of reserved words for this dialect
|
| 1322 |
+
for list in self.reserved_words_db[dialect]:
|
| 1323 |
+
reswords_set.update(set(list))
|
| 1324 |
+
#
|
| 1325 |
+
# compose builtins set
|
| 1326 |
+
builtins_set = set()
|
| 1327 |
+
# add each list of builtins for this dialect excluding reserved words
|
| 1328 |
+
for list in self.builtins_db[dialect]:
|
| 1329 |
+
builtins_set.update(set(list).difference(reswords_set))
|
| 1330 |
+
#
|
| 1331 |
+
# compose pseudo-builtins set
|
| 1332 |
+
pseudo_builtins_set = set()
|
| 1333 |
+
# add each list of builtins for this dialect excluding reserved words
|
| 1334 |
+
for list in self.pseudo_builtins_db[dialect]:
|
| 1335 |
+
pseudo_builtins_set.update(set(list).difference(reswords_set))
|
| 1336 |
+
#
|
| 1337 |
+
# compose ADTs set
|
| 1338 |
+
adts_set = set()
|
| 1339 |
+
# add each list of ADTs for this dialect excluding reserved words
|
| 1340 |
+
for list in self.stdlib_adts_db[dialect]:
|
| 1341 |
+
adts_set.update(set(list).difference(reswords_set))
|
| 1342 |
+
#
|
| 1343 |
+
# compose modules set
|
| 1344 |
+
modules_set = set()
|
| 1345 |
+
# add each list of builtins for this dialect excluding builtins
|
| 1346 |
+
for list in self.stdlib_modules_db[dialect]:
|
| 1347 |
+
modules_set.update(set(list).difference(builtins_set))
|
| 1348 |
+
#
|
| 1349 |
+
# compose types set
|
| 1350 |
+
types_set = set()
|
| 1351 |
+
# add each list of types for this dialect excluding builtins
|
| 1352 |
+
for list in self.stdlib_types_db[dialect]:
|
| 1353 |
+
types_set.update(set(list).difference(builtins_set))
|
| 1354 |
+
#
|
| 1355 |
+
# compose procedures set
|
| 1356 |
+
procedures_set = set()
|
| 1357 |
+
# add each list of procedures for this dialect excluding builtins
|
| 1358 |
+
for list in self.stdlib_procedures_db[dialect]:
|
| 1359 |
+
procedures_set.update(set(list).difference(builtins_set))
|
| 1360 |
+
#
|
| 1361 |
+
# compose variables set
|
| 1362 |
+
variables_set = set()
|
| 1363 |
+
# add each list of variables for this dialect excluding builtins
|
| 1364 |
+
for list in self.stdlib_variables_db[dialect]:
|
| 1365 |
+
variables_set.update(set(list).difference(builtins_set))
|
| 1366 |
+
#
|
| 1367 |
+
# compose constants set
|
| 1368 |
+
constants_set = set()
|
| 1369 |
+
# add each list of constants for this dialect excluding builtins
|
| 1370 |
+
for list in self.stdlib_constants_db[dialect]:
|
| 1371 |
+
constants_set.update(set(list).difference(builtins_set))
|
| 1372 |
+
#
|
| 1373 |
+
# update lexer state
|
| 1374 |
+
self.dialect = dialect
|
| 1375 |
+
self.lexemes_to_reject = lexemes_to_reject_set
|
| 1376 |
+
self.reserved_words = reswords_set
|
| 1377 |
+
self.builtins = builtins_set
|
| 1378 |
+
self.pseudo_builtins = pseudo_builtins_set
|
| 1379 |
+
self.adts = adts_set
|
| 1380 |
+
self.modules = modules_set
|
| 1381 |
+
self.types = types_set
|
| 1382 |
+
self.procedures = procedures_set
|
| 1383 |
+
self.variables = variables_set
|
| 1384 |
+
self.constants = constants_set
|
| 1385 |
+
#
|
| 1386 |
+
# if __debug__:
|
| 1387 |
+
# print 'exiting set_dialect'
|
| 1388 |
+
# print ' self.dialect: ', self.dialect
|
| 1389 |
+
# print ' self.lexemes_to_reject: ', self.lexemes_to_reject
|
| 1390 |
+
# print ' self.reserved_words: ', self.reserved_words
|
| 1391 |
+
# print ' self.builtins: ', self.builtins
|
| 1392 |
+
# print ' self.pseudo_builtins: ', self.pseudo_builtins
|
| 1393 |
+
# print ' self.adts: ', self.adts
|
| 1394 |
+
# print ' self.modules: ', self.modules
|
| 1395 |
+
# print ' self.types: ', self.types
|
| 1396 |
+
# print ' self.procedures: ', self.procedures
|
| 1397 |
+
# print ' self.variables: ', self.variables
|
| 1398 |
+
# print ' self.types: ', self.types
|
| 1399 |
+
# print ' self.constants: ', self.constants
|
| 1400 |
+
|
| 1401 |
+
# Extracts a dialect name from a dialect tag comment string and checks
|
| 1402 |
+
# the extracted name against known dialects. If a match is found, the
|
| 1403 |
+
# matching name is returned, otherwise dialect id 'unknown' is returned
|
| 1404 |
+
def get_dialect_from_dialect_tag(self, dialect_tag):
|
| 1405 |
+
#
|
| 1406 |
+
# if __debug__:
|
| 1407 |
+
# print 'entered get_dialect_from_dialect_tag with arg: ', dialect_tag
|
| 1408 |
+
#
|
| 1409 |
+
# constants
|
| 1410 |
+
left_tag_delim = '(*!'
|
| 1411 |
+
right_tag_delim = '*)'
|
| 1412 |
+
left_tag_delim_len = len(left_tag_delim)
|
| 1413 |
+
right_tag_delim_len = len(right_tag_delim)
|
| 1414 |
+
indicator_start = left_tag_delim_len
|
| 1415 |
+
indicator_end = -(right_tag_delim_len)
|
| 1416 |
+
#
|
| 1417 |
+
# check comment string for dialect indicator
|
| 1418 |
+
if len(dialect_tag) > (left_tag_delim_len + right_tag_delim_len) \
|
| 1419 |
+
and dialect_tag.startswith(left_tag_delim) \
|
| 1420 |
+
and dialect_tag.endswith(right_tag_delim):
|
| 1421 |
+
#
|
| 1422 |
+
# if __debug__:
|
| 1423 |
+
# print 'dialect tag found'
|
| 1424 |
+
#
|
| 1425 |
+
# extract dialect indicator
|
| 1426 |
+
indicator = dialect_tag[indicator_start:indicator_end]
|
| 1427 |
+
#
|
| 1428 |
+
# if __debug__:
|
| 1429 |
+
# print 'extracted: ', indicator
|
| 1430 |
+
#
|
| 1431 |
+
# check against known dialects
|
| 1432 |
+
for index in range(1, len(self.dialects)):
|
| 1433 |
+
#
|
| 1434 |
+
# if __debug__:
|
| 1435 |
+
# print 'dialects[', index, ']: ', self.dialects[index]
|
| 1436 |
+
#
|
| 1437 |
+
if indicator == self.dialects[index]:
|
| 1438 |
+
#
|
| 1439 |
+
# if __debug__:
|
| 1440 |
+
# print 'matching dialect found'
|
| 1441 |
+
#
|
| 1442 |
+
# indicator matches known dialect
|
| 1443 |
+
return indicator
|
| 1444 |
+
else:
|
| 1445 |
+
# indicator does not match any dialect
|
| 1446 |
+
return 'unknown' # default
|
| 1447 |
+
else:
|
| 1448 |
+
# invalid indicator string
|
| 1449 |
+
return 'unknown' # default
|
| 1450 |
+
|
| 1451 |
+
# intercept the token stream, modify token attributes and return them
|
| 1452 |
+
def get_tokens_unprocessed(self, text):
|
| 1453 |
+
for index, token, value in RegexLexer.get_tokens_unprocessed(self, text):
|
| 1454 |
+
#
|
| 1455 |
+
# check for dialect tag if dialect has not been set by tag
|
| 1456 |
+
if not self.dialect_set_by_tag and token == Comment.Special:
|
| 1457 |
+
indicated_dialect = self.get_dialect_from_dialect_tag(value)
|
| 1458 |
+
if indicated_dialect != 'unknown':
|
| 1459 |
+
# token is a dialect indicator
|
| 1460 |
+
# reset reserved words and builtins
|
| 1461 |
+
self.set_dialect(indicated_dialect)
|
| 1462 |
+
self.dialect_set_by_tag = True
|
| 1463 |
+
#
|
| 1464 |
+
# check for reserved words, predefined and stdlib identifiers
|
| 1465 |
+
if token is Name:
|
| 1466 |
+
if value in self.reserved_words:
|
| 1467 |
+
token = Keyword.Reserved
|
| 1468 |
+
if self.algol_publication_mode:
|
| 1469 |
+
value = value.lower()
|
| 1470 |
+
#
|
| 1471 |
+
elif value in self.builtins:
|
| 1472 |
+
token = Name.Builtin
|
| 1473 |
+
if self.algol_publication_mode:
|
| 1474 |
+
value = value.lower()
|
| 1475 |
+
#
|
| 1476 |
+
elif value in self.pseudo_builtins:
|
| 1477 |
+
token = Name.Builtin.Pseudo
|
| 1478 |
+
if self.algol_publication_mode:
|
| 1479 |
+
value = value.lower()
|
| 1480 |
+
#
|
| 1481 |
+
elif value in self.adts:
|
| 1482 |
+
if not self.treat_stdlib_adts_as_builtins:
|
| 1483 |
+
token = Name.Namespace
|
| 1484 |
+
else:
|
| 1485 |
+
token = Name.Builtin.Pseudo
|
| 1486 |
+
if self.algol_publication_mode:
|
| 1487 |
+
value = value.lower()
|
| 1488 |
+
#
|
| 1489 |
+
elif value in self.modules:
|
| 1490 |
+
token = Name.Namespace
|
| 1491 |
+
#
|
| 1492 |
+
elif value in self.types:
|
| 1493 |
+
token = Name.Class
|
| 1494 |
+
#
|
| 1495 |
+
elif value in self.procedures:
|
| 1496 |
+
token = Name.Function
|
| 1497 |
+
#
|
| 1498 |
+
elif value in self.variables:
|
| 1499 |
+
token = Name.Variable
|
| 1500 |
+
#
|
| 1501 |
+
elif value in self.constants:
|
| 1502 |
+
token = Name.Constant
|
| 1503 |
+
#
|
| 1504 |
+
elif token in Number:
|
| 1505 |
+
#
|
| 1506 |
+
# mark prefix number literals as error for PIM and ISO dialects
|
| 1507 |
+
if self.dialect not in ('unknown', 'm2r10', 'objm2'):
|
| 1508 |
+
if "'" in value or value[0:2] in ('0b', '0x', '0u'):
|
| 1509 |
+
token = Error
|
| 1510 |
+
#
|
| 1511 |
+
elif self.dialect in ('m2r10', 'objm2'):
|
| 1512 |
+
# mark base-8 number literals as errors for M2 R10 and ObjM2
|
| 1513 |
+
if token is Number.Oct:
|
| 1514 |
+
token = Error
|
| 1515 |
+
# mark suffix base-16 literals as errors for M2 R10 and ObjM2
|
| 1516 |
+
elif token is Number.Hex and 'H' in value:
|
| 1517 |
+
token = Error
|
| 1518 |
+
# mark real numbers with E as errors for M2 R10 and ObjM2
|
| 1519 |
+
elif token is Number.Float and 'E' in value:
|
| 1520 |
+
token = Error
|
| 1521 |
+
#
|
| 1522 |
+
elif token in Comment:
|
| 1523 |
+
#
|
| 1524 |
+
# mark single line comment as error for PIM and ISO dialects
|
| 1525 |
+
if token is Comment.Single:
|
| 1526 |
+
if self.dialect not in ('unknown', 'm2r10', 'objm2'):
|
| 1527 |
+
token = Error
|
| 1528 |
+
#
|
| 1529 |
+
if token is Comment.Preproc:
|
| 1530 |
+
# mark ISO pragma as error for PIM dialects
|
| 1531 |
+
if value.startswith('<*') and \
|
| 1532 |
+
self.dialect.startswith('m2pim'):
|
| 1533 |
+
token = Error
|
| 1534 |
+
# mark PIM pragma as comment for other dialects
|
| 1535 |
+
elif value.startswith('(*$') and \
|
| 1536 |
+
self.dialect != 'unknown' and \
|
| 1537 |
+
not self.dialect.startswith('m2pim'):
|
| 1538 |
+
token = Comment.Multiline
|
| 1539 |
+
#
|
| 1540 |
+
else: # token is neither Name nor Comment
|
| 1541 |
+
#
|
| 1542 |
+
# mark lexemes matching the dialect's error token set as errors
|
| 1543 |
+
if value in self.lexemes_to_reject:
|
| 1544 |
+
token = Error
|
| 1545 |
+
#
|
| 1546 |
+
# substitute lexemes when in Algol mode
|
| 1547 |
+
if self.algol_publication_mode:
|
| 1548 |
+
if value == '#':
|
| 1549 |
+
value = '≠'
|
| 1550 |
+
elif value == '<=':
|
| 1551 |
+
value = '≤'
|
| 1552 |
+
elif value == '>=':
|
| 1553 |
+
value = '≥'
|
| 1554 |
+
elif value == '==':
|
| 1555 |
+
value = '≡'
|
| 1556 |
+
elif value == '*.':
|
| 1557 |
+
value = '•'
|
| 1558 |
+
|
| 1559 |
+
# return result
|
| 1560 |
+
yield index, token, value
|
| 1561 |
+
|
| 1562 |
+
def analyse_text(text):
|
| 1563 |
+
"""It's Pascal-like, but does not use FUNCTION -- uses PROCEDURE
|
| 1564 |
+
instead."""
|
| 1565 |
+
|
| 1566 |
+
# Check if this looks like Pascal, if not, bail out early
|
| 1567 |
+
if not ('(*' in text and '*)' in text and ':=' in text):
|
| 1568 |
+
return
|
| 1569 |
+
|
| 1570 |
+
result = 0
|
| 1571 |
+
# Procedure is in Modula2
|
| 1572 |
+
if re.search(r'\bPROCEDURE\b', text):
|
| 1573 |
+
result += 0.6
|
| 1574 |
+
|
| 1575 |
+
# FUNCTION is only valid in Pascal, but not in Modula2
|
| 1576 |
+
if re.search(r'\bFUNCTION\b', text):
|
| 1577 |
+
result = 0.0
|
| 1578 |
+
|
| 1579 |
+
return result
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/mojo.py
ADDED
|
@@ -0,0 +1,707 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.mojo
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Mojo and related languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import keyword
|
| 12 |
+
|
| 13 |
+
from pygments import unistring as uni
|
| 14 |
+
from pygments.lexer import (
|
| 15 |
+
RegexLexer,
|
| 16 |
+
bygroups,
|
| 17 |
+
combined,
|
| 18 |
+
default,
|
| 19 |
+
include,
|
| 20 |
+
this,
|
| 21 |
+
using,
|
| 22 |
+
words,
|
| 23 |
+
)
|
| 24 |
+
from pygments.token import (
|
| 25 |
+
Comment,
|
| 26 |
+
# Error,
|
| 27 |
+
Keyword,
|
| 28 |
+
Name,
|
| 29 |
+
Number,
|
| 30 |
+
Operator,
|
| 31 |
+
Punctuation,
|
| 32 |
+
String,
|
| 33 |
+
Text,
|
| 34 |
+
Whitespace,
|
| 35 |
+
)
|
| 36 |
+
from pygments.util import shebang_matches
|
| 37 |
+
|
| 38 |
+
__all__ = ["MojoLexer"]
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
class MojoLexer(RegexLexer):
|
| 42 |
+
"""
|
| 43 |
+
For Mojo source code (version 24.2.1).
|
| 44 |
+
"""
|
| 45 |
+
|
| 46 |
+
name = "Mojo"
|
| 47 |
+
url = "https://docs.modular.com/mojo/"
|
| 48 |
+
aliases = ["mojo", "🔥"]
|
| 49 |
+
filenames = [
|
| 50 |
+
"*.mojo",
|
| 51 |
+
"*.🔥",
|
| 52 |
+
]
|
| 53 |
+
mimetypes = [
|
| 54 |
+
"text/x-mojo",
|
| 55 |
+
"application/x-mojo",
|
| 56 |
+
]
|
| 57 |
+
version_added = "2.18"
|
| 58 |
+
|
| 59 |
+
uni_name = f"[{uni.xid_start}][{uni.xid_continue}]*"
|
| 60 |
+
|
| 61 |
+
def innerstring_rules(ttype):
|
| 62 |
+
return [
|
| 63 |
+
# the old style '%s' % (...) string formatting (still valid in Py3)
|
| 64 |
+
(
|
| 65 |
+
r"%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?"
|
| 66 |
+
"[hlL]?[E-GXc-giorsaux%]",
|
| 67 |
+
String.Interpol,
|
| 68 |
+
),
|
| 69 |
+
# the new style '{}'.format(...) string formatting
|
| 70 |
+
(
|
| 71 |
+
r"\{"
|
| 72 |
+
r"((\w+)((\.\w+)|(\[[^\]]+\]))*)?" # field name
|
| 73 |
+
r"(\![sra])?" # conversion
|
| 74 |
+
r"(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?"
|
| 75 |
+
r"\}",
|
| 76 |
+
String.Interpol,
|
| 77 |
+
),
|
| 78 |
+
# backslashes, quotes and formatting signs must be parsed one at a time
|
| 79 |
+
(r'[^\\\'"%{\n]+', ttype),
|
| 80 |
+
(r'[\'"\\]', ttype),
|
| 81 |
+
# unhandled string formatting sign
|
| 82 |
+
(r"%|(\{{1,2})", ttype),
|
| 83 |
+
# newlines are an error (use "nl" state)
|
| 84 |
+
]
|
| 85 |
+
|
| 86 |
+
def fstring_rules(ttype):
|
| 87 |
+
return [
|
| 88 |
+
# Assuming that a '}' is the closing brace after format specifier.
|
| 89 |
+
# Sadly, this means that we won't detect syntax error. But it's
|
| 90 |
+
# more important to parse correct syntax correctly, than to
|
| 91 |
+
# highlight invalid syntax.
|
| 92 |
+
(r"\}", String.Interpol),
|
| 93 |
+
(r"\{", String.Interpol, "expr-inside-fstring"),
|
| 94 |
+
# backslashes, quotes and formatting signs must be parsed one at a time
|
| 95 |
+
(r'[^\\\'"{}\n]+', ttype),
|
| 96 |
+
(r'[\'"\\]', ttype),
|
| 97 |
+
# newlines are an error (use "nl" state)
|
| 98 |
+
]
|
| 99 |
+
|
| 100 |
+
tokens = {
|
| 101 |
+
"root": [
|
| 102 |
+
(r"\s+", Whitespace),
|
| 103 |
+
(
|
| 104 |
+
r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
|
| 105 |
+
bygroups(Whitespace, String.Affix, String.Doc),
|
| 106 |
+
),
|
| 107 |
+
(
|
| 108 |
+
r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
|
| 109 |
+
bygroups(Whitespace, String.Affix, String.Doc),
|
| 110 |
+
),
|
| 111 |
+
(r"\A#!.+$", Comment.Hashbang),
|
| 112 |
+
(r"#.*$", Comment.Single),
|
| 113 |
+
(r"\\\n", Whitespace),
|
| 114 |
+
(r"\\", Whitespace),
|
| 115 |
+
include("keywords"),
|
| 116 |
+
include("soft-keywords"),
|
| 117 |
+
# In the original PR, all the below here used ((?:\s|\\\s)+) to
|
| 118 |
+
# designate whitespace, but I can't find any example of this being
|
| 119 |
+
# needed in the example file, so we're replacing it with `\s+`.
|
| 120 |
+
(
|
| 121 |
+
r"(alias)(\s+)",
|
| 122 |
+
bygroups(Keyword, Whitespace),
|
| 123 |
+
"varname", # TODO varname the right fit?
|
| 124 |
+
),
|
| 125 |
+
(r"(var)(\s+)", bygroups(Keyword, Whitespace), "varname"),
|
| 126 |
+
(r"(def)(\s+)", bygroups(Keyword, Whitespace), "funcname"),
|
| 127 |
+
(r"(fn)(\s+)", bygroups(Keyword, Whitespace), "funcname"),
|
| 128 |
+
(
|
| 129 |
+
r"(class)(\s+)",
|
| 130 |
+
bygroups(Keyword, Whitespace),
|
| 131 |
+
"classname",
|
| 132 |
+
), # not implemented yet
|
| 133 |
+
(r"(struct)(\s+)", bygroups(Keyword, Whitespace), "structname"),
|
| 134 |
+
(r"(trait)(\s+)", bygroups(Keyword, Whitespace), "structname"),
|
| 135 |
+
(r"(from)(\s+)", bygroups(Keyword.Namespace, Whitespace), "fromimport"),
|
| 136 |
+
(r"(import)(\s+)", bygroups(Keyword.Namespace, Whitespace), "import"),
|
| 137 |
+
include("expr"),
|
| 138 |
+
],
|
| 139 |
+
"expr": [
|
| 140 |
+
# raw f-strings
|
| 141 |
+
(
|
| 142 |
+
'(?i)(rf|fr)(""")',
|
| 143 |
+
bygroups(String.Affix, String.Double),
|
| 144 |
+
combined("rfstringescape", "tdqf"),
|
| 145 |
+
),
|
| 146 |
+
(
|
| 147 |
+
"(?i)(rf|fr)(''')",
|
| 148 |
+
bygroups(String.Affix, String.Single),
|
| 149 |
+
combined("rfstringescape", "tsqf"),
|
| 150 |
+
),
|
| 151 |
+
(
|
| 152 |
+
'(?i)(rf|fr)(")',
|
| 153 |
+
bygroups(String.Affix, String.Double),
|
| 154 |
+
combined("rfstringescape", "dqf"),
|
| 155 |
+
),
|
| 156 |
+
(
|
| 157 |
+
"(?i)(rf|fr)(')",
|
| 158 |
+
bygroups(String.Affix, String.Single),
|
| 159 |
+
combined("rfstringescape", "sqf"),
|
| 160 |
+
),
|
| 161 |
+
# non-raw f-strings
|
| 162 |
+
(
|
| 163 |
+
'([fF])(""")',
|
| 164 |
+
bygroups(String.Affix, String.Double),
|
| 165 |
+
combined("fstringescape", "tdqf"),
|
| 166 |
+
),
|
| 167 |
+
(
|
| 168 |
+
"([fF])(''')",
|
| 169 |
+
bygroups(String.Affix, String.Single),
|
| 170 |
+
combined("fstringescape", "tsqf"),
|
| 171 |
+
),
|
| 172 |
+
(
|
| 173 |
+
'([fF])(")',
|
| 174 |
+
bygroups(String.Affix, String.Double),
|
| 175 |
+
combined("fstringescape", "dqf"),
|
| 176 |
+
),
|
| 177 |
+
(
|
| 178 |
+
"([fF])(')",
|
| 179 |
+
bygroups(String.Affix, String.Single),
|
| 180 |
+
combined("fstringescape", "sqf"),
|
| 181 |
+
),
|
| 182 |
+
# raw bytes and strings
|
| 183 |
+
('(?i)(rb|br|r)(""")', bygroups(String.Affix, String.Double), "tdqs"),
|
| 184 |
+
("(?i)(rb|br|r)(''')", bygroups(String.Affix, String.Single), "tsqs"),
|
| 185 |
+
('(?i)(rb|br|r)(")', bygroups(String.Affix, String.Double), "dqs"),
|
| 186 |
+
("(?i)(rb|br|r)(')", bygroups(String.Affix, String.Single), "sqs"),
|
| 187 |
+
# non-raw strings
|
| 188 |
+
(
|
| 189 |
+
'([uU]?)(""")',
|
| 190 |
+
bygroups(String.Affix, String.Double),
|
| 191 |
+
combined("stringescape", "tdqs"),
|
| 192 |
+
),
|
| 193 |
+
(
|
| 194 |
+
"([uU]?)(''')",
|
| 195 |
+
bygroups(String.Affix, String.Single),
|
| 196 |
+
combined("stringescape", "tsqs"),
|
| 197 |
+
),
|
| 198 |
+
(
|
| 199 |
+
'([uU]?)(")',
|
| 200 |
+
bygroups(String.Affix, String.Double),
|
| 201 |
+
combined("stringescape", "dqs"),
|
| 202 |
+
),
|
| 203 |
+
(
|
| 204 |
+
"([uU]?)(')",
|
| 205 |
+
bygroups(String.Affix, String.Single),
|
| 206 |
+
combined("stringescape", "sqs"),
|
| 207 |
+
),
|
| 208 |
+
# non-raw bytes
|
| 209 |
+
(
|
| 210 |
+
'([bB])(""")',
|
| 211 |
+
bygroups(String.Affix, String.Double),
|
| 212 |
+
combined("bytesescape", "tdqs"),
|
| 213 |
+
),
|
| 214 |
+
(
|
| 215 |
+
"([bB])(''')",
|
| 216 |
+
bygroups(String.Affix, String.Single),
|
| 217 |
+
combined("bytesescape", "tsqs"),
|
| 218 |
+
),
|
| 219 |
+
(
|
| 220 |
+
'([bB])(")',
|
| 221 |
+
bygroups(String.Affix, String.Double),
|
| 222 |
+
combined("bytesescape", "dqs"),
|
| 223 |
+
),
|
| 224 |
+
(
|
| 225 |
+
"([bB])(')",
|
| 226 |
+
bygroups(String.Affix, String.Single),
|
| 227 |
+
combined("bytesescape", "sqs"),
|
| 228 |
+
),
|
| 229 |
+
(r"[^\S\n]+", Text),
|
| 230 |
+
include("numbers"),
|
| 231 |
+
(r"!=|==|<<|>>|:=|[-~+/*%=<>&^|.]", Operator),
|
| 232 |
+
(r"([]{}:\(\),;[])+", Punctuation),
|
| 233 |
+
(r"(in|is|and|or|not)\b", Operator.Word),
|
| 234 |
+
include("expr-keywords"),
|
| 235 |
+
include("builtins"),
|
| 236 |
+
include("magicfuncs"),
|
| 237 |
+
include("magicvars"),
|
| 238 |
+
include("name"),
|
| 239 |
+
],
|
| 240 |
+
"expr-inside-fstring": [
|
| 241 |
+
(r"[{([]", Punctuation, "expr-inside-fstring-inner"),
|
| 242 |
+
# without format specifier
|
| 243 |
+
(
|
| 244 |
+
r"(=\s*)?" # debug (https://bugs.python.org/issue36817)
|
| 245 |
+
r"(\![sraf])?" # conversion
|
| 246 |
+
r"\}",
|
| 247 |
+
String.Interpol,
|
| 248 |
+
"#pop",
|
| 249 |
+
),
|
| 250 |
+
# with format specifier
|
| 251 |
+
# we'll catch the remaining '}' in the outer scope
|
| 252 |
+
(
|
| 253 |
+
r"(=\s*)?" # debug (https://bugs.python.org/issue36817)
|
| 254 |
+
r"(\![sraf])?" # conversion
|
| 255 |
+
r":",
|
| 256 |
+
String.Interpol,
|
| 257 |
+
"#pop",
|
| 258 |
+
),
|
| 259 |
+
(r"\s+", Whitespace), # allow new lines
|
| 260 |
+
include("expr"),
|
| 261 |
+
],
|
| 262 |
+
"expr-inside-fstring-inner": [
|
| 263 |
+
(r"[{([]", Punctuation, "expr-inside-fstring-inner"),
|
| 264 |
+
(r"[])}]", Punctuation, "#pop"),
|
| 265 |
+
(r"\s+", Whitespace), # allow new lines
|
| 266 |
+
include("expr"),
|
| 267 |
+
],
|
| 268 |
+
"expr-keywords": [
|
| 269 |
+
# Based on https://docs.python.org/3/reference/expressions.html
|
| 270 |
+
(
|
| 271 |
+
words(
|
| 272 |
+
(
|
| 273 |
+
"async for", # TODO https://docs.modular.com/mojo/roadmap#no-async-for-or-async-with
|
| 274 |
+
"async with", # TODO https://docs.modular.com/mojo/roadmap#no-async-for-or-async-with
|
| 275 |
+
"await",
|
| 276 |
+
"else",
|
| 277 |
+
"for",
|
| 278 |
+
"if",
|
| 279 |
+
"lambda",
|
| 280 |
+
"yield",
|
| 281 |
+
"yield from",
|
| 282 |
+
),
|
| 283 |
+
suffix=r"\b",
|
| 284 |
+
),
|
| 285 |
+
Keyword,
|
| 286 |
+
),
|
| 287 |
+
(words(("True", "False", "None"), suffix=r"\b"), Keyword.Constant),
|
| 288 |
+
],
|
| 289 |
+
"keywords": [
|
| 290 |
+
(
|
| 291 |
+
words(
|
| 292 |
+
(
|
| 293 |
+
"assert",
|
| 294 |
+
"async",
|
| 295 |
+
"await",
|
| 296 |
+
"borrowed",
|
| 297 |
+
"break",
|
| 298 |
+
"continue",
|
| 299 |
+
"del",
|
| 300 |
+
"elif",
|
| 301 |
+
"else",
|
| 302 |
+
"except",
|
| 303 |
+
"finally",
|
| 304 |
+
"for",
|
| 305 |
+
"global",
|
| 306 |
+
"if",
|
| 307 |
+
"lambda",
|
| 308 |
+
"pass",
|
| 309 |
+
"raise",
|
| 310 |
+
"nonlocal",
|
| 311 |
+
"return",
|
| 312 |
+
"try",
|
| 313 |
+
"while",
|
| 314 |
+
"yield",
|
| 315 |
+
"yield from",
|
| 316 |
+
"as",
|
| 317 |
+
"with",
|
| 318 |
+
),
|
| 319 |
+
suffix=r"\b",
|
| 320 |
+
),
|
| 321 |
+
Keyword,
|
| 322 |
+
),
|
| 323 |
+
(words(("True", "False", "None"), suffix=r"\b"), Keyword.Constant),
|
| 324 |
+
],
|
| 325 |
+
"soft-keywords": [
|
| 326 |
+
# `match`, `case` and `_` soft keywords
|
| 327 |
+
(
|
| 328 |
+
r"(^[ \t]*)" # at beginning of line + possible indentation
|
| 329 |
+
r"(match|case)\b" # a possible keyword
|
| 330 |
+
r"(?![ \t]*(?:" # not followed by...
|
| 331 |
+
r"[:,;=^&|@~)\]}]|(?:" + # characters and keywords that mean this isn't
|
| 332 |
+
# pattern matching (but None/True/False is ok)
|
| 333 |
+
r"|".join(k for k in keyword.kwlist if k[0].islower())
|
| 334 |
+
+ r")\b))",
|
| 335 |
+
bygroups(Whitespace, Keyword),
|
| 336 |
+
"soft-keywords-inner",
|
| 337 |
+
),
|
| 338 |
+
],
|
| 339 |
+
"soft-keywords-inner": [
|
| 340 |
+
# optional `_` keyword
|
| 341 |
+
(r"(\s+)([^\n_]*)(_\b)", bygroups(Whitespace, using(this), Keyword)),
|
| 342 |
+
default("#pop"),
|
| 343 |
+
],
|
| 344 |
+
"builtins": [
|
| 345 |
+
(
|
| 346 |
+
words(
|
| 347 |
+
(
|
| 348 |
+
"__import__",
|
| 349 |
+
"abs",
|
| 350 |
+
"aiter",
|
| 351 |
+
"all",
|
| 352 |
+
"any",
|
| 353 |
+
"bin",
|
| 354 |
+
"bool",
|
| 355 |
+
"bytearray",
|
| 356 |
+
"breakpoint",
|
| 357 |
+
"bytes",
|
| 358 |
+
"callable",
|
| 359 |
+
"chr",
|
| 360 |
+
"classmethod",
|
| 361 |
+
"compile",
|
| 362 |
+
"complex",
|
| 363 |
+
"delattr",
|
| 364 |
+
"dict",
|
| 365 |
+
"dir",
|
| 366 |
+
"divmod",
|
| 367 |
+
"enumerate",
|
| 368 |
+
"eval",
|
| 369 |
+
"filter",
|
| 370 |
+
"float",
|
| 371 |
+
"format",
|
| 372 |
+
"frozenset",
|
| 373 |
+
"getattr",
|
| 374 |
+
"globals",
|
| 375 |
+
"hasattr",
|
| 376 |
+
"hash",
|
| 377 |
+
"hex",
|
| 378 |
+
"id",
|
| 379 |
+
"input",
|
| 380 |
+
"int",
|
| 381 |
+
"isinstance",
|
| 382 |
+
"issubclass",
|
| 383 |
+
"iter",
|
| 384 |
+
"len",
|
| 385 |
+
"list",
|
| 386 |
+
"locals",
|
| 387 |
+
"map",
|
| 388 |
+
"max",
|
| 389 |
+
"memoryview",
|
| 390 |
+
"min",
|
| 391 |
+
"next",
|
| 392 |
+
"object",
|
| 393 |
+
"oct",
|
| 394 |
+
"open",
|
| 395 |
+
"ord",
|
| 396 |
+
"pow",
|
| 397 |
+
"print",
|
| 398 |
+
"property",
|
| 399 |
+
"range",
|
| 400 |
+
"repr",
|
| 401 |
+
"reversed",
|
| 402 |
+
"round",
|
| 403 |
+
"set",
|
| 404 |
+
"setattr",
|
| 405 |
+
"slice",
|
| 406 |
+
"sorted",
|
| 407 |
+
"staticmethod",
|
| 408 |
+
"str",
|
| 409 |
+
"sum",
|
| 410 |
+
"super",
|
| 411 |
+
"tuple",
|
| 412 |
+
"type",
|
| 413 |
+
"vars",
|
| 414 |
+
"zip",
|
| 415 |
+
# Mojo builtin types: https://docs.modular.com/mojo/stdlib/builtin/
|
| 416 |
+
"AnyType",
|
| 417 |
+
"Coroutine",
|
| 418 |
+
"DType",
|
| 419 |
+
"Error",
|
| 420 |
+
"Int",
|
| 421 |
+
"List",
|
| 422 |
+
"ListLiteral",
|
| 423 |
+
"Scalar",
|
| 424 |
+
"Int8",
|
| 425 |
+
"UInt8",
|
| 426 |
+
"Int16",
|
| 427 |
+
"UInt16",
|
| 428 |
+
"Int32",
|
| 429 |
+
"UInt32",
|
| 430 |
+
"Int64",
|
| 431 |
+
"UInt64",
|
| 432 |
+
"BFloat16",
|
| 433 |
+
"Float16",
|
| 434 |
+
"Float32",
|
| 435 |
+
"Float64",
|
| 436 |
+
"SIMD",
|
| 437 |
+
"String",
|
| 438 |
+
"Tensor",
|
| 439 |
+
"Tuple",
|
| 440 |
+
"Movable",
|
| 441 |
+
"Copyable",
|
| 442 |
+
"CollectionElement",
|
| 443 |
+
),
|
| 444 |
+
prefix=r"(?<!\.)",
|
| 445 |
+
suffix=r"\b",
|
| 446 |
+
),
|
| 447 |
+
Name.Builtin,
|
| 448 |
+
),
|
| 449 |
+
(r"(?<!\.)(self|Ellipsis|NotImplemented|cls)\b", Name.Builtin.Pseudo),
|
| 450 |
+
(
|
| 451 |
+
words(
|
| 452 |
+
("Error",),
|
| 453 |
+
prefix=r"(?<!\.)",
|
| 454 |
+
suffix=r"\b",
|
| 455 |
+
),
|
| 456 |
+
Name.Exception,
|
| 457 |
+
),
|
| 458 |
+
],
|
| 459 |
+
"magicfuncs": [
|
| 460 |
+
(
|
| 461 |
+
words(
|
| 462 |
+
(
|
| 463 |
+
"__abs__",
|
| 464 |
+
"__add__",
|
| 465 |
+
"__aenter__",
|
| 466 |
+
"__aexit__",
|
| 467 |
+
"__aiter__",
|
| 468 |
+
"__and__",
|
| 469 |
+
"__anext__",
|
| 470 |
+
"__await__",
|
| 471 |
+
"__bool__",
|
| 472 |
+
"__bytes__",
|
| 473 |
+
"__call__",
|
| 474 |
+
"__complex__",
|
| 475 |
+
"__contains__",
|
| 476 |
+
"__del__",
|
| 477 |
+
"__delattr__",
|
| 478 |
+
"__delete__",
|
| 479 |
+
"__delitem__",
|
| 480 |
+
"__dir__",
|
| 481 |
+
"__divmod__",
|
| 482 |
+
"__enter__",
|
| 483 |
+
"__eq__",
|
| 484 |
+
"__exit__",
|
| 485 |
+
"__float__",
|
| 486 |
+
"__floordiv__",
|
| 487 |
+
"__format__",
|
| 488 |
+
"__ge__",
|
| 489 |
+
"__get__",
|
| 490 |
+
"__getattr__",
|
| 491 |
+
"__getattribute__",
|
| 492 |
+
"__getitem__",
|
| 493 |
+
"__gt__",
|
| 494 |
+
"__hash__",
|
| 495 |
+
"__iadd__",
|
| 496 |
+
"__iand__",
|
| 497 |
+
"__ifloordiv__",
|
| 498 |
+
"__ilshift__",
|
| 499 |
+
"__imatmul__",
|
| 500 |
+
"__imod__",
|
| 501 |
+
"__imul__",
|
| 502 |
+
"__index__",
|
| 503 |
+
"__init__",
|
| 504 |
+
"__instancecheck__",
|
| 505 |
+
"__int__",
|
| 506 |
+
"__invert__",
|
| 507 |
+
"__ior__",
|
| 508 |
+
"__ipow__",
|
| 509 |
+
"__irshift__",
|
| 510 |
+
"__isub__",
|
| 511 |
+
"__iter__",
|
| 512 |
+
"__itruediv__",
|
| 513 |
+
"__ixor__",
|
| 514 |
+
"__le__",
|
| 515 |
+
"__len__",
|
| 516 |
+
"__length_hint__",
|
| 517 |
+
"__lshift__",
|
| 518 |
+
"__lt__",
|
| 519 |
+
"__matmul__",
|
| 520 |
+
"__missing__",
|
| 521 |
+
"__mod__",
|
| 522 |
+
"__mul__",
|
| 523 |
+
"__ne__",
|
| 524 |
+
"__neg__",
|
| 525 |
+
"__new__",
|
| 526 |
+
"__next__",
|
| 527 |
+
"__or__",
|
| 528 |
+
"__pos__",
|
| 529 |
+
"__pow__",
|
| 530 |
+
"__prepare__",
|
| 531 |
+
"__radd__",
|
| 532 |
+
"__rand__",
|
| 533 |
+
"__rdivmod__",
|
| 534 |
+
"__repr__",
|
| 535 |
+
"__reversed__",
|
| 536 |
+
"__rfloordiv__",
|
| 537 |
+
"__rlshift__",
|
| 538 |
+
"__rmatmul__",
|
| 539 |
+
"__rmod__",
|
| 540 |
+
"__rmul__",
|
| 541 |
+
"__ror__",
|
| 542 |
+
"__round__",
|
| 543 |
+
"__rpow__",
|
| 544 |
+
"__rrshift__",
|
| 545 |
+
"__rshift__",
|
| 546 |
+
"__rsub__",
|
| 547 |
+
"__rtruediv__",
|
| 548 |
+
"__rxor__",
|
| 549 |
+
"__set__",
|
| 550 |
+
"__setattr__",
|
| 551 |
+
"__setitem__",
|
| 552 |
+
"__str__",
|
| 553 |
+
"__sub__",
|
| 554 |
+
"__subclasscheck__",
|
| 555 |
+
"__truediv__",
|
| 556 |
+
"__xor__",
|
| 557 |
+
),
|
| 558 |
+
suffix=r"\b",
|
| 559 |
+
),
|
| 560 |
+
Name.Function.Magic,
|
| 561 |
+
),
|
| 562 |
+
],
|
| 563 |
+
"magicvars": [
|
| 564 |
+
(
|
| 565 |
+
words(
|
| 566 |
+
(
|
| 567 |
+
"__annotations__",
|
| 568 |
+
"__bases__",
|
| 569 |
+
"__class__",
|
| 570 |
+
"__closure__",
|
| 571 |
+
"__code__",
|
| 572 |
+
"__defaults__",
|
| 573 |
+
"__dict__",
|
| 574 |
+
"__doc__",
|
| 575 |
+
"__file__",
|
| 576 |
+
"__func__",
|
| 577 |
+
"__globals__",
|
| 578 |
+
"__kwdefaults__",
|
| 579 |
+
"__module__",
|
| 580 |
+
"__mro__",
|
| 581 |
+
"__name__",
|
| 582 |
+
"__objclass__",
|
| 583 |
+
"__qualname__",
|
| 584 |
+
"__self__",
|
| 585 |
+
"__slots__",
|
| 586 |
+
"__weakref__",
|
| 587 |
+
),
|
| 588 |
+
suffix=r"\b",
|
| 589 |
+
),
|
| 590 |
+
Name.Variable.Magic,
|
| 591 |
+
),
|
| 592 |
+
],
|
| 593 |
+
"numbers": [
|
| 594 |
+
(
|
| 595 |
+
r"(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)"
|
| 596 |
+
r"([eE][+-]?\d(?:_?\d)*)?",
|
| 597 |
+
Number.Float,
|
| 598 |
+
),
|
| 599 |
+
(r"\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?", Number.Float),
|
| 600 |
+
(r"0[oO](?:_?[0-7])+", Number.Oct),
|
| 601 |
+
(r"0[bB](?:_?[01])+", Number.Bin),
|
| 602 |
+
(r"0[xX](?:_?[a-fA-F0-9])+", Number.Hex),
|
| 603 |
+
(r"\d(?:_?\d)*", Number.Integer),
|
| 604 |
+
],
|
| 605 |
+
"name": [
|
| 606 |
+
(r"@" + uni_name, Name.Decorator),
|
| 607 |
+
(r"@", Operator), # new matrix multiplication operator
|
| 608 |
+
(uni_name, Name),
|
| 609 |
+
],
|
| 610 |
+
"varname": [
|
| 611 |
+
(uni_name, Name.Variable, "#pop"),
|
| 612 |
+
],
|
| 613 |
+
"funcname": [
|
| 614 |
+
include("magicfuncs"),
|
| 615 |
+
(uni_name, Name.Function, "#pop"),
|
| 616 |
+
default("#pop"),
|
| 617 |
+
],
|
| 618 |
+
"classname": [
|
| 619 |
+
(uni_name, Name.Class, "#pop"),
|
| 620 |
+
],
|
| 621 |
+
"structname": [
|
| 622 |
+
(uni_name, Name.Struct, "#pop"),
|
| 623 |
+
],
|
| 624 |
+
"import": [
|
| 625 |
+
(r"(\s+)(as)(\s+)", bygroups(Whitespace, Keyword, Whitespace)),
|
| 626 |
+
(r"\.", Name.Namespace),
|
| 627 |
+
(uni_name, Name.Namespace),
|
| 628 |
+
(r"(\s*)(,)(\s*)", bygroups(Whitespace, Operator, Whitespace)),
|
| 629 |
+
default("#pop"), # all else: go back
|
| 630 |
+
],
|
| 631 |
+
"fromimport": [
|
| 632 |
+
(r"(\s+)(import)\b", bygroups(Whitespace, Keyword.Namespace), "#pop"),
|
| 633 |
+
(r"\.", Name.Namespace),
|
| 634 |
+
# if None occurs here, it's "raise x from None", since None can
|
| 635 |
+
# never be a module name
|
| 636 |
+
(r"None\b", Keyword.Constant, "#pop"),
|
| 637 |
+
(uni_name, Name.Namespace),
|
| 638 |
+
default("#pop"),
|
| 639 |
+
],
|
| 640 |
+
"rfstringescape": [
|
| 641 |
+
(r"\{\{", String.Escape),
|
| 642 |
+
(r"\}\}", String.Escape),
|
| 643 |
+
],
|
| 644 |
+
"fstringescape": [
|
| 645 |
+
include("rfstringescape"),
|
| 646 |
+
include("stringescape"),
|
| 647 |
+
],
|
| 648 |
+
"bytesescape": [
|
| 649 |
+
(r'\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
| 650 |
+
],
|
| 651 |
+
"stringescape": [
|
| 652 |
+
(r"\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})", String.Escape),
|
| 653 |
+
include("bytesescape"),
|
| 654 |
+
],
|
| 655 |
+
"fstrings-single": fstring_rules(String.Single),
|
| 656 |
+
"fstrings-double": fstring_rules(String.Double),
|
| 657 |
+
"strings-single": innerstring_rules(String.Single),
|
| 658 |
+
"strings-double": innerstring_rules(String.Double),
|
| 659 |
+
"dqf": [
|
| 660 |
+
(r'"', String.Double, "#pop"),
|
| 661 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 662 |
+
include("fstrings-double"),
|
| 663 |
+
],
|
| 664 |
+
"sqf": [
|
| 665 |
+
(r"'", String.Single, "#pop"),
|
| 666 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 667 |
+
include("fstrings-single"),
|
| 668 |
+
],
|
| 669 |
+
"dqs": [
|
| 670 |
+
(r'"', String.Double, "#pop"),
|
| 671 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 672 |
+
include("strings-double"),
|
| 673 |
+
],
|
| 674 |
+
"sqs": [
|
| 675 |
+
(r"'", String.Single, "#pop"),
|
| 676 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 677 |
+
include("strings-single"),
|
| 678 |
+
],
|
| 679 |
+
"tdqf": [
|
| 680 |
+
(r'"""', String.Double, "#pop"),
|
| 681 |
+
include("fstrings-double"),
|
| 682 |
+
(r"\n", String.Double),
|
| 683 |
+
],
|
| 684 |
+
"tsqf": [
|
| 685 |
+
(r"'''", String.Single, "#pop"),
|
| 686 |
+
include("fstrings-single"),
|
| 687 |
+
(r"\n", String.Single),
|
| 688 |
+
],
|
| 689 |
+
"tdqs": [
|
| 690 |
+
(r'"""', String.Double, "#pop"),
|
| 691 |
+
include("strings-double"),
|
| 692 |
+
(r"\n", String.Double),
|
| 693 |
+
],
|
| 694 |
+
"tsqs": [
|
| 695 |
+
(r"'''", String.Single, "#pop"),
|
| 696 |
+
include("strings-single"),
|
| 697 |
+
(r"\n", String.Single),
|
| 698 |
+
],
|
| 699 |
+
}
|
| 700 |
+
|
| 701 |
+
def analyse_text(text):
|
| 702 |
+
# TODO supported?
|
| 703 |
+
if shebang_matches(text, r"mojo?"):
|
| 704 |
+
return 1.0
|
| 705 |
+
if "import " in text[:1000]:
|
| 706 |
+
return 0.9
|
| 707 |
+
return 0
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/monte.py
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.monte
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the Monte programming language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \
|
| 12 |
+
Punctuation, String, Whitespace
|
| 13 |
+
from pygments.lexer import RegexLexer, include, words
|
| 14 |
+
|
| 15 |
+
__all__ = ['MonteLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# `var` handled separately
|
| 19 |
+
# `interface` handled separately
|
| 20 |
+
_declarations = ['bind', 'def', 'fn', 'object']
|
| 21 |
+
_methods = ['method', 'to']
|
| 22 |
+
_keywords = [
|
| 23 |
+
'as', 'break', 'catch', 'continue', 'else', 'escape', 'exit', 'exports',
|
| 24 |
+
'extends', 'finally', 'for', 'guards', 'if', 'implements', 'import',
|
| 25 |
+
'in', 'match', 'meta', 'pass', 'return', 'switch', 'try', 'via', 'when',
|
| 26 |
+
'while',
|
| 27 |
+
]
|
| 28 |
+
_operators = [
|
| 29 |
+
# Unary
|
| 30 |
+
'~', '!',
|
| 31 |
+
# Binary
|
| 32 |
+
'+', '-', '*', '/', '%', '**', '&', '|', '^', '<<', '>>',
|
| 33 |
+
# Binary augmented
|
| 34 |
+
'+=', '-=', '*=', '/=', '%=', '**=', '&=', '|=', '^=', '<<=', '>>=',
|
| 35 |
+
# Comparison
|
| 36 |
+
'==', '!=', '<', '<=', '>', '>=', '<=>',
|
| 37 |
+
# Patterns and assignment
|
| 38 |
+
':=', '?', '=~', '!~', '=>',
|
| 39 |
+
# Calls and sends
|
| 40 |
+
'.', '<-', '->',
|
| 41 |
+
]
|
| 42 |
+
_escape_pattern = (
|
| 43 |
+
r'(?:\\x[0-9a-fA-F]{2}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|'
|
| 44 |
+
r'\\["\'\\bftnr])')
|
| 45 |
+
# _char = _escape_chars + [('.', String.Char)]
|
| 46 |
+
_identifier = r'[_a-zA-Z]\w*'
|
| 47 |
+
|
| 48 |
+
_constants = [
|
| 49 |
+
# Void constants
|
| 50 |
+
'null',
|
| 51 |
+
# Bool constants
|
| 52 |
+
'false', 'true',
|
| 53 |
+
# Double constants
|
| 54 |
+
'Infinity', 'NaN',
|
| 55 |
+
# Special objects
|
| 56 |
+
'M', 'Ref', 'throw', 'traceln',
|
| 57 |
+
]
|
| 58 |
+
|
| 59 |
+
_guards = [
|
| 60 |
+
'Any', 'Binding', 'Bool', 'Bytes', 'Char', 'DeepFrozen', 'Double',
|
| 61 |
+
'Empty', 'Int', 'List', 'Map', 'Near', 'NullOk', 'Same', 'Selfless',
|
| 62 |
+
'Set', 'Str', 'SubrangeGuard', 'Transparent', 'Void',
|
| 63 |
+
]
|
| 64 |
+
|
| 65 |
+
_safeScope = [
|
| 66 |
+
'_accumulateList', '_accumulateMap', '_auditedBy', '_bind',
|
| 67 |
+
'_booleanFlow', '_comparer', '_equalizer', '_iterForever', '_loop',
|
| 68 |
+
'_makeBytes', '_makeDouble', '_makeFinalSlot', '_makeInt', '_makeList',
|
| 69 |
+
'_makeMap', '_makeMessageDesc', '_makeOrderedSpace', '_makeParamDesc',
|
| 70 |
+
'_makeProtocolDesc', '_makeSourceSpan', '_makeString', '_makeVarSlot',
|
| 71 |
+
'_makeVerbFacet', '_mapExtract', '_matchSame', '_quasiMatcher',
|
| 72 |
+
'_slotToBinding', '_splitList', '_suchThat', '_switchFailed',
|
| 73 |
+
'_validateFor', 'b__quasiParser', 'eval', 'import', 'm__quasiParser',
|
| 74 |
+
'makeBrandPair', 'makeLazySlot', 'safeScope', 'simple__quasiParser',
|
| 75 |
+
]
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class MonteLexer(RegexLexer):
|
| 79 |
+
"""
|
| 80 |
+
Lexer for the Monte programming language.
|
| 81 |
+
"""
|
| 82 |
+
name = 'Monte'
|
| 83 |
+
url = 'https://monte.readthedocs.io/'
|
| 84 |
+
aliases = ['monte']
|
| 85 |
+
filenames = ['*.mt']
|
| 86 |
+
version_added = '2.2'
|
| 87 |
+
|
| 88 |
+
tokens = {
|
| 89 |
+
'root': [
|
| 90 |
+
# Comments
|
| 91 |
+
(r'#[^\n]*\n', Comment),
|
| 92 |
+
|
| 93 |
+
# Docstrings
|
| 94 |
+
# Apologies for the non-greedy matcher here.
|
| 95 |
+
(r'/\*\*.*?\*/', String.Doc),
|
| 96 |
+
|
| 97 |
+
# `var` declarations
|
| 98 |
+
(r'\bvar\b', Keyword.Declaration, 'var'),
|
| 99 |
+
|
| 100 |
+
# `interface` declarations
|
| 101 |
+
(r'\binterface\b', Keyword.Declaration, 'interface'),
|
| 102 |
+
|
| 103 |
+
# method declarations
|
| 104 |
+
(words(_methods, prefix='\\b', suffix='\\b'),
|
| 105 |
+
Keyword, 'method'),
|
| 106 |
+
|
| 107 |
+
# All other declarations
|
| 108 |
+
(words(_declarations, prefix='\\b', suffix='\\b'),
|
| 109 |
+
Keyword.Declaration),
|
| 110 |
+
|
| 111 |
+
# Keywords
|
| 112 |
+
(words(_keywords, prefix='\\b', suffix='\\b'), Keyword),
|
| 113 |
+
|
| 114 |
+
# Literals
|
| 115 |
+
('[+-]?0x[_0-9a-fA-F]+', Number.Hex),
|
| 116 |
+
(r'[+-]?[_0-9]+\.[_0-9]*([eE][+-]?[_0-9]+)?', Number.Float),
|
| 117 |
+
('[+-]?[_0-9]+', Number.Integer),
|
| 118 |
+
("'", String.Double, 'char'),
|
| 119 |
+
('"', String.Double, 'string'),
|
| 120 |
+
|
| 121 |
+
# Quasiliterals
|
| 122 |
+
('`', String.Backtick, 'ql'),
|
| 123 |
+
|
| 124 |
+
# Operators
|
| 125 |
+
(words(_operators), Operator),
|
| 126 |
+
|
| 127 |
+
# Verb operators
|
| 128 |
+
(_identifier + '=', Operator.Word),
|
| 129 |
+
|
| 130 |
+
# Safe scope constants
|
| 131 |
+
(words(_constants, prefix='\\b', suffix='\\b'),
|
| 132 |
+
Keyword.Pseudo),
|
| 133 |
+
|
| 134 |
+
# Safe scope guards
|
| 135 |
+
(words(_guards, prefix='\\b', suffix='\\b'), Keyword.Type),
|
| 136 |
+
|
| 137 |
+
# All other safe scope names
|
| 138 |
+
(words(_safeScope, prefix='\\b', suffix='\\b'),
|
| 139 |
+
Name.Builtin),
|
| 140 |
+
|
| 141 |
+
# Identifiers
|
| 142 |
+
(_identifier, Name),
|
| 143 |
+
|
| 144 |
+
# Punctuation
|
| 145 |
+
(r'\(|\)|\{|\}|\[|\]|:|,', Punctuation),
|
| 146 |
+
|
| 147 |
+
# Whitespace
|
| 148 |
+
(' +', Whitespace),
|
| 149 |
+
|
| 150 |
+
# Definite lexer errors
|
| 151 |
+
('=', Error),
|
| 152 |
+
],
|
| 153 |
+
'char': [
|
| 154 |
+
# It is definitely an error to have a char of width == 0.
|
| 155 |
+
("'", Error, 'root'),
|
| 156 |
+
(_escape_pattern, String.Escape, 'charEnd'),
|
| 157 |
+
('.', String.Char, 'charEnd'),
|
| 158 |
+
],
|
| 159 |
+
'charEnd': [
|
| 160 |
+
("'", String.Char, '#pop:2'),
|
| 161 |
+
# It is definitely an error to have a char of width > 1.
|
| 162 |
+
('.', Error),
|
| 163 |
+
],
|
| 164 |
+
# The state of things coming into an interface.
|
| 165 |
+
'interface': [
|
| 166 |
+
(' +', Whitespace),
|
| 167 |
+
(_identifier, Name.Class, '#pop'),
|
| 168 |
+
include('root'),
|
| 169 |
+
],
|
| 170 |
+
# The state of things coming into a method.
|
| 171 |
+
'method': [
|
| 172 |
+
(' +', Whitespace),
|
| 173 |
+
(_identifier, Name.Function, '#pop'),
|
| 174 |
+
include('root'),
|
| 175 |
+
],
|
| 176 |
+
'string': [
|
| 177 |
+
('"', String.Double, 'root'),
|
| 178 |
+
(_escape_pattern, String.Escape),
|
| 179 |
+
(r'\n', String.Double),
|
| 180 |
+
('.', String.Double),
|
| 181 |
+
],
|
| 182 |
+
'ql': [
|
| 183 |
+
('`', String.Backtick, 'root'),
|
| 184 |
+
(r'\$' + _escape_pattern, String.Escape),
|
| 185 |
+
(r'\$\$', String.Escape),
|
| 186 |
+
(r'@@', String.Escape),
|
| 187 |
+
(r'\$\{', String.Interpol, 'qlNest'),
|
| 188 |
+
(r'@\{', String.Interpol, 'qlNest'),
|
| 189 |
+
(r'\$' + _identifier, Name),
|
| 190 |
+
('@' + _identifier, Name),
|
| 191 |
+
('.', String.Backtick),
|
| 192 |
+
],
|
| 193 |
+
'qlNest': [
|
| 194 |
+
(r'\}', String.Interpol, '#pop'),
|
| 195 |
+
include('root'),
|
| 196 |
+
],
|
| 197 |
+
# The state of things immediately following `var`.
|
| 198 |
+
'var': [
|
| 199 |
+
(' +', Whitespace),
|
| 200 |
+
(_identifier, Name.Variable, '#pop'),
|
| 201 |
+
include('root'),
|
| 202 |
+
],
|
| 203 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/mosel.py
ADDED
|
@@ -0,0 +1,447 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.mosel
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the mosel language.
|
| 6 |
+
http://www.fico.com/en/products/fico-xpress-optimization
|
| 7 |
+
|
| 8 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 9 |
+
:license: BSD, see LICENSE for details.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
from pygments.lexer import RegexLexer, words
|
| 13 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 14 |
+
Number, Punctuation
|
| 15 |
+
|
| 16 |
+
__all__ = ['MoselLexer']
|
| 17 |
+
|
| 18 |
+
FUNCTIONS = (
|
| 19 |
+
# core functions
|
| 20 |
+
'_',
|
| 21 |
+
'abs',
|
| 22 |
+
'arctan',
|
| 23 |
+
'asproc',
|
| 24 |
+
'assert',
|
| 25 |
+
'bitflip',
|
| 26 |
+
'bitneg',
|
| 27 |
+
'bitset',
|
| 28 |
+
'bitshift',
|
| 29 |
+
'bittest',
|
| 30 |
+
'bitval',
|
| 31 |
+
'ceil',
|
| 32 |
+
'cos',
|
| 33 |
+
'create',
|
| 34 |
+
'currentdate',
|
| 35 |
+
'currenttime',
|
| 36 |
+
'cutelt',
|
| 37 |
+
'cutfirst',
|
| 38 |
+
'cuthead',
|
| 39 |
+
'cutlast',
|
| 40 |
+
'cuttail',
|
| 41 |
+
'datablock',
|
| 42 |
+
'delcell',
|
| 43 |
+
'exists',
|
| 44 |
+
'exit',
|
| 45 |
+
'exp',
|
| 46 |
+
'exportprob',
|
| 47 |
+
'fclose',
|
| 48 |
+
'fflush',
|
| 49 |
+
'finalize',
|
| 50 |
+
'findfirst',
|
| 51 |
+
'findlast',
|
| 52 |
+
'floor',
|
| 53 |
+
'fopen',
|
| 54 |
+
'fselect',
|
| 55 |
+
'fskipline',
|
| 56 |
+
'fwrite',
|
| 57 |
+
'fwrite_',
|
| 58 |
+
'fwriteln',
|
| 59 |
+
'fwriteln_',
|
| 60 |
+
'getact',
|
| 61 |
+
'getcoeff',
|
| 62 |
+
'getcoeffs',
|
| 63 |
+
'getdual',
|
| 64 |
+
'getelt',
|
| 65 |
+
'getfid',
|
| 66 |
+
'getfirst',
|
| 67 |
+
'getfname',
|
| 68 |
+
'gethead',
|
| 69 |
+
'getlast',
|
| 70 |
+
'getobjval',
|
| 71 |
+
'getparam',
|
| 72 |
+
'getrcost',
|
| 73 |
+
'getreadcnt',
|
| 74 |
+
'getreverse',
|
| 75 |
+
'getsize',
|
| 76 |
+
'getslack',
|
| 77 |
+
'getsol',
|
| 78 |
+
'gettail',
|
| 79 |
+
'gettype',
|
| 80 |
+
'getvars',
|
| 81 |
+
'isdynamic',
|
| 82 |
+
'iseof',
|
| 83 |
+
'isfinite',
|
| 84 |
+
'ishidden',
|
| 85 |
+
'isinf',
|
| 86 |
+
'isnan',
|
| 87 |
+
'isodd',
|
| 88 |
+
'ln',
|
| 89 |
+
'localsetparam',
|
| 90 |
+
'log',
|
| 91 |
+
'makesos1',
|
| 92 |
+
'makesos2',
|
| 93 |
+
'maxlist',
|
| 94 |
+
'memoryuse',
|
| 95 |
+
'minlist',
|
| 96 |
+
'newmuid',
|
| 97 |
+
'publish',
|
| 98 |
+
'random',
|
| 99 |
+
'read',
|
| 100 |
+
'readln',
|
| 101 |
+
'reset',
|
| 102 |
+
'restoreparam',
|
| 103 |
+
'reverse',
|
| 104 |
+
'round',
|
| 105 |
+
'setcoeff',
|
| 106 |
+
'sethidden',
|
| 107 |
+
'setioerr',
|
| 108 |
+
'setmatherr',
|
| 109 |
+
'setname',
|
| 110 |
+
'setparam',
|
| 111 |
+
'setrandseed',
|
| 112 |
+
'setrange',
|
| 113 |
+
'settype',
|
| 114 |
+
'sin',
|
| 115 |
+
'splithead',
|
| 116 |
+
'splittail',
|
| 117 |
+
'sqrt',
|
| 118 |
+
'strfmt',
|
| 119 |
+
'substr',
|
| 120 |
+
'timestamp',
|
| 121 |
+
'unpublish',
|
| 122 |
+
'versionnum',
|
| 123 |
+
'versionstr',
|
| 124 |
+
'write',
|
| 125 |
+
'write_',
|
| 126 |
+
'writeln',
|
| 127 |
+
'writeln_',
|
| 128 |
+
|
| 129 |
+
# mosel exam mmxprs | sed -n -e "s/ [pf][a-z]* \([a-zA-Z0-9_]*\).*/'\1',/p" | sort -u
|
| 130 |
+
'addcut',
|
| 131 |
+
'addcuts',
|
| 132 |
+
'addmipsol',
|
| 133 |
+
'basisstability',
|
| 134 |
+
'calcsolinfo',
|
| 135 |
+
'clearmipdir',
|
| 136 |
+
'clearmodcut',
|
| 137 |
+
'command',
|
| 138 |
+
'copysoltoinit',
|
| 139 |
+
'crossoverlpsol',
|
| 140 |
+
'defdelayedrows',
|
| 141 |
+
'defsecurevecs',
|
| 142 |
+
'delcuts',
|
| 143 |
+
'dropcuts',
|
| 144 |
+
'estimatemarginals',
|
| 145 |
+
'fixglobal',
|
| 146 |
+
'flushmsgq',
|
| 147 |
+
'getbstat',
|
| 148 |
+
'getcnlist',
|
| 149 |
+
'getcplist',
|
| 150 |
+
'getdualray',
|
| 151 |
+
'getiis',
|
| 152 |
+
'getiissense',
|
| 153 |
+
'getiistype',
|
| 154 |
+
'getinfcause',
|
| 155 |
+
'getinfeas',
|
| 156 |
+
'getlb',
|
| 157 |
+
'getlct',
|
| 158 |
+
'getleft',
|
| 159 |
+
'getloadedlinctrs',
|
| 160 |
+
'getloadedmpvars',
|
| 161 |
+
'getname',
|
| 162 |
+
'getprimalray',
|
| 163 |
+
'getprobstat',
|
| 164 |
+
'getrange',
|
| 165 |
+
'getright',
|
| 166 |
+
'getsensrng',
|
| 167 |
+
'getsize',
|
| 168 |
+
'getsol',
|
| 169 |
+
'gettype',
|
| 170 |
+
'getub',
|
| 171 |
+
'getvars',
|
| 172 |
+
'gety',
|
| 173 |
+
'hasfeature',
|
| 174 |
+
'implies',
|
| 175 |
+
'indicator',
|
| 176 |
+
'initglobal',
|
| 177 |
+
'ishidden',
|
| 178 |
+
'isiisvalid',
|
| 179 |
+
'isintegral',
|
| 180 |
+
'loadbasis',
|
| 181 |
+
'loadcuts',
|
| 182 |
+
'loadlpsol',
|
| 183 |
+
'loadmipsol',
|
| 184 |
+
'loadprob',
|
| 185 |
+
'maximise',
|
| 186 |
+
'maximize',
|
| 187 |
+
'minimise',
|
| 188 |
+
'minimize',
|
| 189 |
+
'postsolve',
|
| 190 |
+
'readbasis',
|
| 191 |
+
'readdirs',
|
| 192 |
+
'readsol',
|
| 193 |
+
'refinemipsol',
|
| 194 |
+
'rejectintsol',
|
| 195 |
+
'repairinfeas',
|
| 196 |
+
'repairinfeas_deprec',
|
| 197 |
+
'resetbasis',
|
| 198 |
+
'resetiis',
|
| 199 |
+
'resetsol',
|
| 200 |
+
'savebasis',
|
| 201 |
+
'savemipsol',
|
| 202 |
+
'savesol',
|
| 203 |
+
'savestate',
|
| 204 |
+
'selectsol',
|
| 205 |
+
'setarchconsistency',
|
| 206 |
+
'setbstat',
|
| 207 |
+
'setcallback',
|
| 208 |
+
'setcbcutoff',
|
| 209 |
+
'setgndata',
|
| 210 |
+
'sethidden',
|
| 211 |
+
'setlb',
|
| 212 |
+
'setmipdir',
|
| 213 |
+
'setmodcut',
|
| 214 |
+
'setsol',
|
| 215 |
+
'setub',
|
| 216 |
+
'setucbdata',
|
| 217 |
+
'stopoptimise',
|
| 218 |
+
'stopoptimize',
|
| 219 |
+
'storecut',
|
| 220 |
+
'storecuts',
|
| 221 |
+
'unloadprob',
|
| 222 |
+
'uselastbarsol',
|
| 223 |
+
'writebasis',
|
| 224 |
+
'writedirs',
|
| 225 |
+
'writeprob',
|
| 226 |
+
'writesol',
|
| 227 |
+
'xor',
|
| 228 |
+
'xprs_addctr',
|
| 229 |
+
'xprs_addindic',
|
| 230 |
+
|
| 231 |
+
# mosel exam mmsystem | sed -n -e "s/ [pf][a-z]* \([a-zA-Z0-9_]*\).*/'\1',/p" | sort -u
|
| 232 |
+
'addmonths',
|
| 233 |
+
'copytext',
|
| 234 |
+
'cuttext',
|
| 235 |
+
'deltext',
|
| 236 |
+
'endswith',
|
| 237 |
+
'erase',
|
| 238 |
+
'expandpath',
|
| 239 |
+
'fcopy',
|
| 240 |
+
'fdelete',
|
| 241 |
+
'findfiles',
|
| 242 |
+
'findtext',
|
| 243 |
+
'fmove',
|
| 244 |
+
'formattext',
|
| 245 |
+
'getasnumber',
|
| 246 |
+
'getchar',
|
| 247 |
+
'getcwd',
|
| 248 |
+
'getdate',
|
| 249 |
+
'getday',
|
| 250 |
+
'getdaynum',
|
| 251 |
+
'getdays',
|
| 252 |
+
'getdirsep',
|
| 253 |
+
'getdsoparam',
|
| 254 |
+
'getendparse',
|
| 255 |
+
'getenv',
|
| 256 |
+
'getfsize',
|
| 257 |
+
'getfstat',
|
| 258 |
+
'getftime',
|
| 259 |
+
'gethour',
|
| 260 |
+
'getminute',
|
| 261 |
+
'getmonth',
|
| 262 |
+
'getmsec',
|
| 263 |
+
'getoserrmsg',
|
| 264 |
+
'getoserror',
|
| 265 |
+
'getpathsep',
|
| 266 |
+
'getqtype',
|
| 267 |
+
'getsecond',
|
| 268 |
+
'getsepchar',
|
| 269 |
+
'getsize',
|
| 270 |
+
'getstart',
|
| 271 |
+
'getsucc',
|
| 272 |
+
'getsysinfo',
|
| 273 |
+
'getsysstat',
|
| 274 |
+
'gettime',
|
| 275 |
+
'gettmpdir',
|
| 276 |
+
'gettrim',
|
| 277 |
+
'getweekday',
|
| 278 |
+
'getyear',
|
| 279 |
+
'inserttext',
|
| 280 |
+
'isvalid',
|
| 281 |
+
'jointext',
|
| 282 |
+
'makedir',
|
| 283 |
+
'makepath',
|
| 284 |
+
'newtar',
|
| 285 |
+
'newzip',
|
| 286 |
+
'nextfield',
|
| 287 |
+
'openpipe',
|
| 288 |
+
'parseextn',
|
| 289 |
+
'parseint',
|
| 290 |
+
'parsereal',
|
| 291 |
+
'parsetext',
|
| 292 |
+
'pastetext',
|
| 293 |
+
'pathmatch',
|
| 294 |
+
'pathsplit',
|
| 295 |
+
'qsort',
|
| 296 |
+
'quote',
|
| 297 |
+
'readtextline',
|
| 298 |
+
'regmatch',
|
| 299 |
+
'regreplace',
|
| 300 |
+
'removedir',
|
| 301 |
+
'removefiles',
|
| 302 |
+
'setchar',
|
| 303 |
+
'setdate',
|
| 304 |
+
'setday',
|
| 305 |
+
'setdsoparam',
|
| 306 |
+
'setendparse',
|
| 307 |
+
'setenv',
|
| 308 |
+
'sethour',
|
| 309 |
+
'setminute',
|
| 310 |
+
'setmonth',
|
| 311 |
+
'setmsec',
|
| 312 |
+
'setoserror',
|
| 313 |
+
'setqtype',
|
| 314 |
+
'setsecond',
|
| 315 |
+
'setsepchar',
|
| 316 |
+
'setstart',
|
| 317 |
+
'setsucc',
|
| 318 |
+
'settime',
|
| 319 |
+
'settrim',
|
| 320 |
+
'setyear',
|
| 321 |
+
'sleep',
|
| 322 |
+
'splittext',
|
| 323 |
+
'startswith',
|
| 324 |
+
'system',
|
| 325 |
+
'tarlist',
|
| 326 |
+
'textfmt',
|
| 327 |
+
'tolower',
|
| 328 |
+
'toupper',
|
| 329 |
+
'trim',
|
| 330 |
+
'untar',
|
| 331 |
+
'unzip',
|
| 332 |
+
'ziplist',
|
| 333 |
+
|
| 334 |
+
# mosel exam mmjobs | sed -n -e "s/ [pf][a-z]* \([a-zA-Z0-9_]*\).*/'\1',/p" | sort -u
|
| 335 |
+
'canceltimer',
|
| 336 |
+
'clearaliases',
|
| 337 |
+
'compile',
|
| 338 |
+
'connect',
|
| 339 |
+
'detach',
|
| 340 |
+
'disconnect',
|
| 341 |
+
'dropnextevent',
|
| 342 |
+
'findxsrvs',
|
| 343 |
+
'getaliases',
|
| 344 |
+
'getannidents',
|
| 345 |
+
'getannotations',
|
| 346 |
+
'getbanner',
|
| 347 |
+
'getclass',
|
| 348 |
+
'getdsoprop',
|
| 349 |
+
'getdsopropnum',
|
| 350 |
+
'getexitcode',
|
| 351 |
+
'getfromgid',
|
| 352 |
+
'getfromid',
|
| 353 |
+
'getfromuid',
|
| 354 |
+
'getgid',
|
| 355 |
+
'gethostalias',
|
| 356 |
+
'getid',
|
| 357 |
+
'getmodprop',
|
| 358 |
+
'getmodpropnum',
|
| 359 |
+
'getnextevent',
|
| 360 |
+
'getnode',
|
| 361 |
+
'getrmtid',
|
| 362 |
+
'getstatus',
|
| 363 |
+
'getsysinfo',
|
| 364 |
+
'gettimer',
|
| 365 |
+
'getuid',
|
| 366 |
+
'getvalue',
|
| 367 |
+
'isqueueempty',
|
| 368 |
+
'load',
|
| 369 |
+
'nullevent',
|
| 370 |
+
'peeknextevent',
|
| 371 |
+
'resetmodpar',
|
| 372 |
+
'run',
|
| 373 |
+
'send',
|
| 374 |
+
'setcontrol',
|
| 375 |
+
'setdefstream',
|
| 376 |
+
'setgid',
|
| 377 |
+
'sethostalias',
|
| 378 |
+
'setmodpar',
|
| 379 |
+
'settimer',
|
| 380 |
+
'setuid',
|
| 381 |
+
'setworkdir',
|
| 382 |
+
'stop',
|
| 383 |
+
'unload',
|
| 384 |
+
'wait',
|
| 385 |
+
'waitexpired',
|
| 386 |
+
'waitfor',
|
| 387 |
+
'waitforend',
|
| 388 |
+
)
|
| 389 |
+
|
| 390 |
+
|
| 391 |
+
class MoselLexer(RegexLexer):
|
| 392 |
+
"""
|
| 393 |
+
For the Mosel optimization language.
|
| 394 |
+
"""
|
| 395 |
+
name = 'Mosel'
|
| 396 |
+
aliases = ['mosel']
|
| 397 |
+
filenames = ['*.mos']
|
| 398 |
+
url = 'https://www.fico.com/fico-xpress-optimization/docs/latest/mosel/mosel_lang/dhtml/moselreflang.html'
|
| 399 |
+
version_added = '2.6'
|
| 400 |
+
|
| 401 |
+
tokens = {
|
| 402 |
+
'root': [
|
| 403 |
+
(r'\n', Text),
|
| 404 |
+
(r'\s+', Text.Whitespace),
|
| 405 |
+
(r'!.*?\n', Comment.Single),
|
| 406 |
+
(r'\(!(.|\n)*?!\)', Comment.Multiline),
|
| 407 |
+
(words((
|
| 408 |
+
'and', 'as', 'break', 'case', 'count', 'declarations', 'do',
|
| 409 |
+
'dynamic', 'elif', 'else', 'end-', 'end', 'evaluation', 'false',
|
| 410 |
+
'forall', 'forward', 'from', 'function', 'hashmap', 'if',
|
| 411 |
+
'imports', 'include', 'initialisations', 'initializations', 'inter',
|
| 412 |
+
'max', 'min', 'model', 'namespace', 'next', 'not', 'nsgroup',
|
| 413 |
+
'nssearch', 'of', 'options', 'or', 'package', 'parameters',
|
| 414 |
+
'procedure', 'public', 'prod', 'record', 'repeat', 'requirements',
|
| 415 |
+
'return', 'sum', 'then', 'to', 'true', 'union', 'until', 'uses',
|
| 416 |
+
'version', 'while', 'with'), prefix=r'\b', suffix=r'\b'),
|
| 417 |
+
Keyword.Builtin),
|
| 418 |
+
(words((
|
| 419 |
+
'range', 'array', 'set', 'list', 'mpvar', 'mpproblem', 'linctr',
|
| 420 |
+
'nlctr', 'integer', 'string', 'real', 'boolean', 'text', 'time',
|
| 421 |
+
'date', 'datetime', 'returned', 'Model', 'Mosel', 'counter',
|
| 422 |
+
'xmldoc', 'is_sos1', 'is_sos2', 'is_integer', 'is_binary',
|
| 423 |
+
'is_continuous', 'is_free', 'is_semcont', 'is_semint',
|
| 424 |
+
'is_partint'), prefix=r'\b', suffix=r'\b'),
|
| 425 |
+
Keyword.Type),
|
| 426 |
+
(r'(\+|\-|\*|/|=|<=|>=|\||\^|<|>|<>|\.\.|\.|:=|::|:|in|mod|div)',
|
| 427 |
+
Operator),
|
| 428 |
+
(r'[()\[\]{},;]+', Punctuation),
|
| 429 |
+
(words(FUNCTIONS, prefix=r'\b', suffix=r'\b'), Name.Function),
|
| 430 |
+
(r'(\d+\.(?!\.)\d*|\.(?!.)\d+)([eE][+-]?\d+)?', Number.Float),
|
| 431 |
+
(r'\d+([eE][+-]?\d+)?', Number.Integer),
|
| 432 |
+
(r'[+-]?Infinity', Number.Integer),
|
| 433 |
+
(r'0[xX][0-9a-fA-F]+', Number),
|
| 434 |
+
(r'"', String.Double, 'double_quote'),
|
| 435 |
+
(r'\'', String.Single, 'single_quote'),
|
| 436 |
+
(r'(\w+|(\.(?!\.)))', Text),
|
| 437 |
+
],
|
| 438 |
+
'single_quote': [
|
| 439 |
+
(r'\'', String.Single, '#pop'),
|
| 440 |
+
(r'[^\']+', String.Single),
|
| 441 |
+
],
|
| 442 |
+
'double_quote': [
|
| 443 |
+
(r'(\\"|\\[0-7]{1,3}\D|\\[abfnrtv]|\\\\)', String.Escape),
|
| 444 |
+
(r'\"', String.Double, '#pop'),
|
| 445 |
+
(r'[^"\\]+', String.Double),
|
| 446 |
+
],
|
| 447 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ncl.py
ADDED
|
@@ -0,0 +1,894 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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lexers.ncl
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for NCAR Command Language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include, words
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation
|
| 16 |
+
|
| 17 |
+
__all__ = ['NCLLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class NCLLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
Lexer for NCL code.
|
| 23 |
+
"""
|
| 24 |
+
name = 'NCL'
|
| 25 |
+
aliases = ['ncl']
|
| 26 |
+
filenames = ['*.ncl']
|
| 27 |
+
mimetypes = ['text/ncl']
|
| 28 |
+
url = 'https://www.ncl.ucar.edu'
|
| 29 |
+
version_added = '2.2'
|
| 30 |
+
|
| 31 |
+
flags = re.MULTILINE
|
| 32 |
+
|
| 33 |
+
tokens = {
|
| 34 |
+
'root': [
|
| 35 |
+
(r';.*\n', Comment),
|
| 36 |
+
include('strings'),
|
| 37 |
+
include('core'),
|
| 38 |
+
(r'[a-zA-Z_]\w*', Name),
|
| 39 |
+
include('nums'),
|
| 40 |
+
(r'[\s]+', Text),
|
| 41 |
+
],
|
| 42 |
+
'core': [
|
| 43 |
+
# Statements
|
| 44 |
+
(words((
|
| 45 |
+
'begin', 'break', 'continue', 'create', 'defaultapp', 'do',
|
| 46 |
+
'else', 'end', 'external', 'exit', 'True', 'False', 'file', 'function',
|
| 47 |
+
'getvalues', 'graphic', 'group', 'if', 'list', 'load', 'local',
|
| 48 |
+
'new', '_Missing', 'Missing', 'noparent', 'procedure',
|
| 49 |
+
'quit', 'QUIT', 'Quit', 'record', 'return', 'setvalues', 'stop',
|
| 50 |
+
'then', 'while'), prefix=r'\b', suffix=r'\s*\b'),
|
| 51 |
+
Keyword),
|
| 52 |
+
|
| 53 |
+
# Data Types
|
| 54 |
+
(words((
|
| 55 |
+
'ubyte', 'uint', 'uint64', 'ulong', 'string', 'byte',
|
| 56 |
+
'character', 'double', 'float', 'integer', 'int64', 'logical',
|
| 57 |
+
'long', 'short', 'ushort', 'enumeric', 'numeric', 'snumeric'),
|
| 58 |
+
prefix=r'\b', suffix=r'\s*\b'),
|
| 59 |
+
Keyword.Type),
|
| 60 |
+
|
| 61 |
+
# Operators
|
| 62 |
+
(r'[\%^*+\-/<>]', Operator),
|
| 63 |
+
|
| 64 |
+
# punctuation:
|
| 65 |
+
(r'[\[\]():@$!&|.,\\{}]', Punctuation),
|
| 66 |
+
(r'[=:]', Punctuation),
|
| 67 |
+
|
| 68 |
+
# Intrinsics
|
| 69 |
+
(words((
|
| 70 |
+
'abs', 'acos', 'addfile', 'addfiles', 'all', 'angmom_atm', 'any',
|
| 71 |
+
'area_conserve_remap', 'area_hi2lores', 'area_poly_sphere',
|
| 72 |
+
'asciiread', 'asciiwrite', 'asin', 'atan', 'atan2', 'attsetvalues',
|
| 73 |
+
'avg', 'betainc', 'bin_avg', 'bin_sum', 'bw_bandpass_filter',
|
| 74 |
+
'cancor', 'cbinread', 'cbinwrite', 'cd_calendar', 'cd_inv_calendar',
|
| 75 |
+
'cdfbin_p', 'cdfbin_pr', 'cdfbin_s', 'cdfbin_xn', 'cdfchi_p',
|
| 76 |
+
'cdfchi_x', 'cdfgam_p', 'cdfgam_x', 'cdfnor_p', 'cdfnor_x',
|
| 77 |
+
'cdft_p', 'cdft_t', 'ceil', 'center_finite_diff',
|
| 78 |
+
'center_finite_diff_n', 'cfftb', 'cfftf', 'cfftf_frq_reorder',
|
| 79 |
+
'charactertodouble', 'charactertofloat', 'charactertointeger',
|
| 80 |
+
'charactertolong', 'charactertoshort', 'charactertostring',
|
| 81 |
+
'chartodouble', 'chartofloat', 'chartoint', 'chartointeger',
|
| 82 |
+
'chartolong', 'chartoshort', 'chartostring', 'chiinv', 'clear',
|
| 83 |
+
'color_index_to_rgba', 'conform', 'conform_dims', 'cos', 'cosh',
|
| 84 |
+
'count_unique_values', 'covcorm', 'covcorm_xy', 'craybinnumrec',
|
| 85 |
+
'craybinrecread', 'create_graphic', 'csa1', 'csa1d', 'csa1s',
|
| 86 |
+
'csa1x', 'csa1xd', 'csa1xs', 'csa2', 'csa2d', 'csa2l', 'csa2ld',
|
| 87 |
+
'csa2ls', 'csa2lx', 'csa2lxd', 'csa2lxs', 'csa2s', 'csa2x',
|
| 88 |
+
'csa2xd', 'csa2xs', 'csa3', 'csa3d', 'csa3l', 'csa3ld', 'csa3ls',
|
| 89 |
+
'csa3lx', 'csa3lxd', 'csa3lxs', 'csa3s', 'csa3x', 'csa3xd',
|
| 90 |
+
'csa3xs', 'csc2s', 'csgetp', 'css2c', 'cssetp', 'cssgrid', 'csstri',
|
| 91 |
+
'csvoro', 'cumsum', 'cz2ccm', 'datatondc', 'day_of_week',
|
| 92 |
+
'day_of_year', 'days_in_month', 'default_fillvalue', 'delete',
|
| 93 |
+
'depth_to_pres', 'destroy', 'determinant', 'dewtemp_trh',
|
| 94 |
+
'dgeevx_lapack', 'dim_acumrun_n', 'dim_avg', 'dim_avg_n',
|
| 95 |
+
'dim_avg_wgt', 'dim_avg_wgt_n', 'dim_cumsum', 'dim_cumsum_n',
|
| 96 |
+
'dim_gamfit_n', 'dim_gbits', 'dim_max', 'dim_max_n', 'dim_median',
|
| 97 |
+
'dim_median_n', 'dim_min', 'dim_min_n', 'dim_num', 'dim_num_n',
|
| 98 |
+
'dim_numrun_n', 'dim_pqsort', 'dim_pqsort_n', 'dim_product',
|
| 99 |
+
'dim_product_n', 'dim_rmsd', 'dim_rmsd_n', 'dim_rmvmean',
|
| 100 |
+
'dim_rmvmean_n', 'dim_rmvmed', 'dim_rmvmed_n', 'dim_spi_n',
|
| 101 |
+
'dim_standardize', 'dim_standardize_n', 'dim_stat4', 'dim_stat4_n',
|
| 102 |
+
'dim_stddev', 'dim_stddev_n', 'dim_sum', 'dim_sum_n', 'dim_sum_wgt',
|
| 103 |
+
'dim_sum_wgt_n', 'dim_variance', 'dim_variance_n', 'dimsizes',
|
| 104 |
+
'doubletobyte', 'doubletochar', 'doubletocharacter',
|
| 105 |
+
'doubletofloat', 'doubletoint', 'doubletointeger', 'doubletolong',
|
| 106 |
+
'doubletoshort', 'dpres_hybrid_ccm', 'dpres_plevel', 'draw',
|
| 107 |
+
'draw_color_palette', 'dsgetp', 'dsgrid2', 'dsgrid2d', 'dsgrid2s',
|
| 108 |
+
'dsgrid3', 'dsgrid3d', 'dsgrid3s', 'dspnt2', 'dspnt2d', 'dspnt2s',
|
| 109 |
+
'dspnt3', 'dspnt3d', 'dspnt3s', 'dssetp', 'dtrend', 'dtrend_msg',
|
| 110 |
+
'dtrend_msg_n', 'dtrend_n', 'dtrend_quadratic',
|
| 111 |
+
'dtrend_quadratic_msg_n', 'dv2uvf', 'dv2uvg', 'dz_height',
|
| 112 |
+
'echo_off', 'echo_on', 'eof2data', 'eof_varimax', 'eofcor',
|
| 113 |
+
'eofcor_pcmsg', 'eofcor_ts', 'eofcov', 'eofcov_pcmsg', 'eofcov_ts',
|
| 114 |
+
'eofunc', 'eofunc_ts', 'eofunc_varimax', 'equiv_sample_size', 'erf',
|
| 115 |
+
'erfc', 'esacr', 'esacv', 'esccr', 'esccv', 'escorc', 'escorc_n',
|
| 116 |
+
'escovc', 'exit', 'exp', 'exp_tapersh', 'exp_tapersh_wgts',
|
| 117 |
+
'exp_tapershC', 'ezfftb', 'ezfftb_n', 'ezfftf', 'ezfftf_n',
|
| 118 |
+
'f2fosh', 'f2foshv', 'f2fsh', 'f2fshv', 'f2gsh', 'f2gshv', 'fabs',
|
| 119 |
+
'fbindirread', 'fbindirwrite', 'fbinnumrec', 'fbinread',
|
| 120 |
+
'fbinrecread', 'fbinrecwrite', 'fbinwrite', 'fft2db', 'fft2df',
|
| 121 |
+
'fftshift', 'fileattdef', 'filechunkdimdef', 'filedimdef',
|
| 122 |
+
'fileexists', 'filegrpdef', 'filevarattdef', 'filevarchunkdef',
|
| 123 |
+
'filevarcompressleveldef', 'filevardef', 'filevardimsizes',
|
| 124 |
+
'filwgts_lancos', 'filwgts_lanczos', 'filwgts_normal',
|
| 125 |
+
'floattobyte', 'floattochar', 'floattocharacter', 'floattoint',
|
| 126 |
+
'floattointeger', 'floattolong', 'floattoshort', 'floor',
|
| 127 |
+
'fluxEddy', 'fo2fsh', 'fo2fshv', 'fourier_info', 'frame', 'fspan',
|
| 128 |
+
'ftcurv', 'ftcurvd', 'ftcurvi', 'ftcurvp', 'ftcurvpi', 'ftcurvps',
|
| 129 |
+
'ftcurvs', 'ftest', 'ftgetp', 'ftkurv', 'ftkurvd', 'ftkurvp',
|
| 130 |
+
'ftkurvpd', 'ftsetp', 'ftsurf', 'g2fsh', 'g2fshv', 'g2gsh',
|
| 131 |
+
'g2gshv', 'gamma', 'gammainc', 'gaus', 'gaus_lobat',
|
| 132 |
+
'gaus_lobat_wgt', 'gc_aangle', 'gc_clkwise', 'gc_dangle',
|
| 133 |
+
'gc_inout', 'gc_latlon', 'gc_onarc', 'gc_pnt2gc', 'gc_qarea',
|
| 134 |
+
'gc_tarea', 'generate_2d_array', 'get_color_index',
|
| 135 |
+
'get_color_rgba', 'get_cpu_time', 'get_isolines', 'get_ncl_version',
|
| 136 |
+
'get_script_name', 'get_script_prefix_name', 'get_sphere_radius',
|
| 137 |
+
'get_unique_values', 'getbitsone', 'getenv', 'getfiledimsizes',
|
| 138 |
+
'getfilegrpnames', 'getfilepath', 'getfilevaratts',
|
| 139 |
+
'getfilevarchunkdimsizes', 'getfilevardims', 'getfilevardimsizes',
|
| 140 |
+
'getfilevarnames', 'getfilevartypes', 'getvaratts', 'getvardims',
|
| 141 |
+
'gradsf', 'gradsg', 'greg2jul', 'grid2triple', 'hlsrgb', 'hsvrgb',
|
| 142 |
+
'hydro', 'hyi2hyo', 'idsfft', 'igradsf', 'igradsg', 'ilapsf',
|
| 143 |
+
'ilapsg', 'ilapvf', 'ilapvg', 'ind', 'ind_resolve', 'int2p',
|
| 144 |
+
'int2p_n', 'integertobyte', 'integertochar', 'integertocharacter',
|
| 145 |
+
'integertoshort', 'inttobyte', 'inttochar', 'inttoshort',
|
| 146 |
+
'inverse_matrix', 'isatt', 'isbigendian', 'isbyte', 'ischar',
|
| 147 |
+
'iscoord', 'isdefined', 'isdim', 'isdimnamed', 'isdouble',
|
| 148 |
+
'isenumeric', 'isfile', 'isfilepresent', 'isfilevar',
|
| 149 |
+
'isfilevaratt', 'isfilevarcoord', 'isfilevardim', 'isfloat',
|
| 150 |
+
'isfunc', 'isgraphic', 'isint', 'isint64', 'isinteger',
|
| 151 |
+
'isleapyear', 'islogical', 'islong', 'ismissing', 'isnan_ieee',
|
| 152 |
+
'isnumeric', 'ispan', 'isproc', 'isshort', 'issnumeric', 'isstring',
|
| 153 |
+
'isubyte', 'isuint', 'isuint64', 'isulong', 'isunlimited',
|
| 154 |
+
'isunsigned', 'isushort', 'isvar', 'jul2greg', 'kmeans_as136',
|
| 155 |
+
'kolsm2_n', 'kron_product', 'lapsf', 'lapsg', 'lapvf', 'lapvg',
|
| 156 |
+
'latlon2utm', 'lclvl', 'lderuvf', 'lderuvg', 'linint1', 'linint1_n',
|
| 157 |
+
'linint2', 'linint2_points', 'linmsg', 'linmsg_n', 'linrood_latwgt',
|
| 158 |
+
'linrood_wgt', 'list_files', 'list_filevars', 'list_hlus',
|
| 159 |
+
'list_procfuncs', 'list_vars', 'ListAppend', 'ListCount',
|
| 160 |
+
'ListGetType', 'ListIndex', 'ListIndexFromName', 'ListPop',
|
| 161 |
+
'ListPush', 'ListSetType', 'loadscript', 'local_max', 'local_min',
|
| 162 |
+
'log', 'log10', 'longtobyte', 'longtochar', 'longtocharacter',
|
| 163 |
+
'longtoint', 'longtointeger', 'longtoshort', 'lspoly', 'lspoly_n',
|
| 164 |
+
'mask', 'max', 'maxind', 'min', 'minind', 'mixed_layer_depth',
|
| 165 |
+
'mixhum_ptd', 'mixhum_ptrh', 'mjo_cross_coh2pha',
|
| 166 |
+
'mjo_cross_segment', 'moc_globe_atl', 'monthday', 'natgrid',
|
| 167 |
+
'natgridd', 'natgrids', 'ncargpath', 'ncargversion', 'ndctodata',
|
| 168 |
+
'ndtooned', 'new', 'NewList', 'ngezlogo', 'nggcog', 'nggetp',
|
| 169 |
+
'nglogo', 'ngsetp', 'NhlAddAnnotation', 'NhlAddData',
|
| 170 |
+
'NhlAddOverlay', 'NhlAddPrimitive', 'NhlAppGetDefaultParentId',
|
| 171 |
+
'NhlChangeWorkstation', 'NhlClassName', 'NhlClearWorkstation',
|
| 172 |
+
'NhlDataPolygon', 'NhlDataPolyline', 'NhlDataPolymarker',
|
| 173 |
+
'NhlDataToNDC', 'NhlDestroy', 'NhlDraw', 'NhlFrame', 'NhlFreeColor',
|
| 174 |
+
'NhlGetBB', 'NhlGetClassResources', 'NhlGetErrorObjectId',
|
| 175 |
+
'NhlGetNamedColorIndex', 'NhlGetParentId',
|
| 176 |
+
'NhlGetParentWorkstation', 'NhlGetWorkspaceObjectId',
|
| 177 |
+
'NhlIsAllocatedColor', 'NhlIsApp', 'NhlIsDataComm', 'NhlIsDataItem',
|
| 178 |
+
'NhlIsDataSpec', 'NhlIsTransform', 'NhlIsView', 'NhlIsWorkstation',
|
| 179 |
+
'NhlName', 'NhlNDCPolygon', 'NhlNDCPolyline', 'NhlNDCPolymarker',
|
| 180 |
+
'NhlNDCToData', 'NhlNewColor', 'NhlNewDashPattern', 'NhlNewMarker',
|
| 181 |
+
'NhlPalGetDefined', 'NhlRemoveAnnotation', 'NhlRemoveData',
|
| 182 |
+
'NhlRemoveOverlay', 'NhlRemovePrimitive', 'NhlSetColor',
|
| 183 |
+
'NhlSetDashPattern', 'NhlSetMarker', 'NhlUpdateData',
|
| 184 |
+
'NhlUpdateWorkstation', 'nice_mnmxintvl', 'nngetaspectd',
|
| 185 |
+
'nngetaspects', 'nngetp', 'nngetsloped', 'nngetslopes', 'nngetwts',
|
| 186 |
+
'nngetwtsd', 'nnpnt', 'nnpntd', 'nnpntend', 'nnpntendd',
|
| 187 |
+
'nnpntinit', 'nnpntinitd', 'nnpntinits', 'nnpnts', 'nnsetp', 'num',
|
| 188 |
+
'obj_anal_ic', 'omega_ccm', 'onedtond', 'overlay', 'paleo_outline',
|
| 189 |
+
'pdfxy_bin', 'poisson_grid_fill', 'pop_remap', 'potmp_insitu_ocn',
|
| 190 |
+
'prcwater_dp', 'pres2hybrid', 'pres_hybrid_ccm', 'pres_sigma',
|
| 191 |
+
'print', 'print_table', 'printFileVarSummary', 'printVarSummary',
|
| 192 |
+
'product', 'pslec', 'pslhor', 'pslhyp', 'qsort', 'rand',
|
| 193 |
+
'random_chi', 'random_gamma', 'random_normal', 'random_setallseed',
|
| 194 |
+
'random_uniform', 'rcm2points', 'rcm2rgrid', 'rdsstoi',
|
| 195 |
+
'read_colormap_file', 'reg_multlin', 'regcoef', 'regCoef_n',
|
| 196 |
+
'regline', 'relhum', 'replace_ieeenan', 'reshape', 'reshape_ind',
|
| 197 |
+
'rgba_to_color_index', 'rgbhls', 'rgbhsv', 'rgbyiq', 'rgrid2rcm',
|
| 198 |
+
'rhomb_trunc', 'rip_cape_2d', 'rip_cape_3d', 'round', 'rtest',
|
| 199 |
+
'runave', 'runave_n', 'set_default_fillvalue', 'set_sphere_radius',
|
| 200 |
+
'setfileoption', 'sfvp2uvf', 'sfvp2uvg', 'shaec', 'shagc',
|
| 201 |
+
'shgetnp', 'shgetp', 'shgrid', 'shorttobyte', 'shorttochar',
|
| 202 |
+
'shorttocharacter', 'show_ascii', 'shsec', 'shsetp', 'shsgc',
|
| 203 |
+
'shsgc_R42', 'sigma2hybrid', 'simpeq', 'simpne', 'sin',
|
| 204 |
+
'sindex_yrmo', 'sinh', 'sizeof', 'sleep', 'smth9', 'snindex_yrmo',
|
| 205 |
+
'solve_linsys', 'span_color_indexes', 'span_color_rgba',
|
| 206 |
+
'sparse_matrix_mult', 'spcorr', 'spcorr_n', 'specx_anal',
|
| 207 |
+
'specxy_anal', 'spei', 'sprintf', 'sprinti', 'sqrt', 'sqsort',
|
| 208 |
+
'srand', 'stat2', 'stat4', 'stat_medrng', 'stat_trim',
|
| 209 |
+
'status_exit', 'stdatmus_p2tdz', 'stdatmus_z2tdp', 'stddev',
|
| 210 |
+
'str_capital', 'str_concat', 'str_fields_count', 'str_get_cols',
|
| 211 |
+
'str_get_dq', 'str_get_field', 'str_get_nl', 'str_get_sq',
|
| 212 |
+
'str_get_tab', 'str_index_of_substr', 'str_insert', 'str_is_blank',
|
| 213 |
+
'str_join', 'str_left_strip', 'str_lower', 'str_match',
|
| 214 |
+
'str_match_ic', 'str_match_ic_regex', 'str_match_ind',
|
| 215 |
+
'str_match_ind_ic', 'str_match_ind_ic_regex', 'str_match_ind_regex',
|
| 216 |
+
'str_match_regex', 'str_right_strip', 'str_split',
|
| 217 |
+
'str_split_by_length', 'str_split_csv', 'str_squeeze', 'str_strip',
|
| 218 |
+
'str_sub_str', 'str_switch', 'str_upper', 'stringtochar',
|
| 219 |
+
'stringtocharacter', 'stringtodouble', 'stringtofloat',
|
| 220 |
+
'stringtoint', 'stringtointeger', 'stringtolong', 'stringtoshort',
|
| 221 |
+
'strlen', 'student_t', 'sum', 'svd_lapack', 'svdcov', 'svdcov_sv',
|
| 222 |
+
'svdstd', 'svdstd_sv', 'system', 'systemfunc', 'tan', 'tanh',
|
| 223 |
+
'taper', 'taper_n', 'tdclrs', 'tdctri', 'tdcudp', 'tdcurv',
|
| 224 |
+
'tddtri', 'tdez2d', 'tdez3d', 'tdgetp', 'tdgrds', 'tdgrid',
|
| 225 |
+
'tdgtrs', 'tdinit', 'tditri', 'tdlbla', 'tdlblp', 'tdlbls',
|
| 226 |
+
'tdline', 'tdlndp', 'tdlnpa', 'tdlpdp', 'tdmtri', 'tdotri',
|
| 227 |
+
'tdpara', 'tdplch', 'tdprpa', 'tdprpi', 'tdprpt', 'tdsetp',
|
| 228 |
+
'tdsort', 'tdstri', 'tdstrs', 'tdttri', 'thornthwaite', 'tobyte',
|
| 229 |
+
'tochar', 'todouble', 'tofloat', 'toint', 'toint64', 'tointeger',
|
| 230 |
+
'tolong', 'toshort', 'tosigned', 'tostring', 'tostring_with_format',
|
| 231 |
+
'totype', 'toubyte', 'touint', 'touint64', 'toulong', 'tounsigned',
|
| 232 |
+
'toushort', 'trend_manken', 'tri_trunc', 'triple2grid',
|
| 233 |
+
'triple2grid2d', 'trop_wmo', 'ttest', 'typeof', 'undef',
|
| 234 |
+
'unique_string', 'update', 'ushorttoint', 'ut_calendar',
|
| 235 |
+
'ut_inv_calendar', 'utm2latlon', 'uv2dv_cfd', 'uv2dvf', 'uv2dvg',
|
| 236 |
+
'uv2sfvpf', 'uv2sfvpg', 'uv2vr_cfd', 'uv2vrdvf', 'uv2vrdvg',
|
| 237 |
+
'uv2vrf', 'uv2vrg', 'v5d_close', 'v5d_create', 'v5d_setLowLev',
|
| 238 |
+
'v5d_setUnits', 'v5d_write', 'v5d_write_var', 'variance', 'vhaec',
|
| 239 |
+
'vhagc', 'vhsec', 'vhsgc', 'vibeta', 'vinth2p', 'vinth2p_ecmwf',
|
| 240 |
+
'vinth2p_ecmwf_nodes', 'vinth2p_nodes', 'vintp2p_ecmwf', 'vr2uvf',
|
| 241 |
+
'vr2uvg', 'vrdv2uvf', 'vrdv2uvg', 'wavelet', 'wavelet_default',
|
| 242 |
+
'weibull', 'wgt_area_smooth', 'wgt_areaave', 'wgt_areaave2',
|
| 243 |
+
'wgt_arearmse', 'wgt_arearmse2', 'wgt_areasum2', 'wgt_runave',
|
| 244 |
+
'wgt_runave_n', 'wgt_vert_avg_beta', 'wgt_volave', 'wgt_volave_ccm',
|
| 245 |
+
'wgt_volrmse', 'wgt_volrmse_ccm', 'where', 'wk_smooth121', 'wmbarb',
|
| 246 |
+
'wmbarbmap', 'wmdrft', 'wmgetp', 'wmlabs', 'wmsetp', 'wmstnm',
|
| 247 |
+
'wmvect', 'wmvectmap', 'wmvlbl', 'wrf_avo', 'wrf_cape_2d',
|
| 248 |
+
'wrf_cape_3d', 'wrf_dbz', 'wrf_eth', 'wrf_helicity', 'wrf_ij_to_ll',
|
| 249 |
+
'wrf_interp_1d', 'wrf_interp_2d_xy', 'wrf_interp_3d_z',
|
| 250 |
+
'wrf_latlon_to_ij', 'wrf_ll_to_ij', 'wrf_omega', 'wrf_pvo',
|
| 251 |
+
'wrf_rh', 'wrf_slp', 'wrf_smooth_2d', 'wrf_td', 'wrf_tk',
|
| 252 |
+
'wrf_updraft_helicity', 'wrf_uvmet', 'wrf_virtual_temp',
|
| 253 |
+
'wrf_wetbulb', 'wrf_wps_close_int', 'wrf_wps_open_int',
|
| 254 |
+
'wrf_wps_rddata_int', 'wrf_wps_rdhead_int', 'wrf_wps_read_int',
|
| 255 |
+
'wrf_wps_write_int', 'write_matrix', 'write_table', 'yiqrgb',
|
| 256 |
+
'z2geouv', 'zonal_mpsi', 'addfiles_GetVar', 'advect_variable',
|
| 257 |
+
'area_conserve_remap_Wrap', 'area_hi2lores_Wrap',
|
| 258 |
+
'array_append_record', 'assignFillValue', 'byte2flt',
|
| 259 |
+
'byte2flt_hdf', 'calcDayAnomTLL', 'calcMonAnomLLLT',
|
| 260 |
+
'calcMonAnomLLT', 'calcMonAnomTLL', 'calcMonAnomTLLL',
|
| 261 |
+
'calculate_monthly_values', 'cd_convert', 'changeCase',
|
| 262 |
+
'changeCaseChar', 'clmDayTLL', 'clmDayTLLL', 'clmMon2clmDay',
|
| 263 |
+
'clmMonLLLT', 'clmMonLLT', 'clmMonTLL', 'clmMonTLLL', 'closest_val',
|
| 264 |
+
'copy_VarAtts', 'copy_VarCoords', 'copy_VarCoords_1',
|
| 265 |
+
'copy_VarCoords_2', 'copy_VarMeta', 'copyatt', 'crossp3',
|
| 266 |
+
'cshstringtolist', 'cssgrid_Wrap', 'dble2flt', 'decimalPlaces',
|
| 267 |
+
'delete_VarAtts', 'dim_avg_n_Wrap', 'dim_avg_wgt_n_Wrap',
|
| 268 |
+
'dim_avg_wgt_Wrap', 'dim_avg_Wrap', 'dim_cumsum_n_Wrap',
|
| 269 |
+
'dim_cumsum_Wrap', 'dim_max_n_Wrap', 'dim_min_n_Wrap',
|
| 270 |
+
'dim_rmsd_n_Wrap', 'dim_rmsd_Wrap', 'dim_rmvmean_n_Wrap',
|
| 271 |
+
'dim_rmvmean_Wrap', 'dim_rmvmed_n_Wrap', 'dim_rmvmed_Wrap',
|
| 272 |
+
'dim_standardize_n_Wrap', 'dim_standardize_Wrap',
|
| 273 |
+
'dim_stddev_n_Wrap', 'dim_stddev_Wrap', 'dim_sum_n_Wrap',
|
| 274 |
+
'dim_sum_wgt_n_Wrap', 'dim_sum_wgt_Wrap', 'dim_sum_Wrap',
|
| 275 |
+
'dim_variance_n_Wrap', 'dim_variance_Wrap', 'dpres_plevel_Wrap',
|
| 276 |
+
'dtrend_leftdim', 'dv2uvF_Wrap', 'dv2uvG_Wrap', 'eof_north',
|
| 277 |
+
'eofcor_Wrap', 'eofcov_Wrap', 'eofunc_north', 'eofunc_ts_Wrap',
|
| 278 |
+
'eofunc_varimax_reorder', 'eofunc_varimax_Wrap', 'eofunc_Wrap',
|
| 279 |
+
'epsZero', 'f2fosh_Wrap', 'f2foshv_Wrap', 'f2fsh_Wrap',
|
| 280 |
+
'f2fshv_Wrap', 'f2gsh_Wrap', 'f2gshv_Wrap', 'fbindirSwap',
|
| 281 |
+
'fbinseqSwap1', 'fbinseqSwap2', 'flt2dble', 'flt2string',
|
| 282 |
+
'fo2fsh_Wrap', 'fo2fshv_Wrap', 'g2fsh_Wrap', 'g2fshv_Wrap',
|
| 283 |
+
'g2gsh_Wrap', 'g2gshv_Wrap', 'generate_resample_indices',
|
| 284 |
+
'generate_sample_indices', 'generate_unique_indices',
|
| 285 |
+
'genNormalDist', 'get1Dindex', 'get1Dindex_Collapse',
|
| 286 |
+
'get1Dindex_Exclude', 'get_file_suffix', 'GetFillColor',
|
| 287 |
+
'GetFillColorIndex', 'getFillValue', 'getind_latlon2d',
|
| 288 |
+
'getVarDimNames', 'getVarFillValue', 'grib_stime2itime',
|
| 289 |
+
'hyi2hyo_Wrap', 'ilapsF_Wrap', 'ilapsG_Wrap', 'ind_nearest_coord',
|
| 290 |
+
'indStrSubset', 'int2dble', 'int2flt', 'int2p_n_Wrap', 'int2p_Wrap',
|
| 291 |
+
'isMonotonic', 'isStrSubset', 'latGau', 'latGauWgt', 'latGlobeF',
|
| 292 |
+
'latGlobeFo', 'latRegWgt', 'linint1_n_Wrap', 'linint1_Wrap',
|
| 293 |
+
'linint2_points_Wrap', 'linint2_Wrap', 'local_max_1d',
|
| 294 |
+
'local_min_1d', 'lonFlip', 'lonGlobeF', 'lonGlobeFo', 'lonPivot',
|
| 295 |
+
'merge_levels_sfc', 'mod', 'month_to_annual',
|
| 296 |
+
'month_to_annual_weighted', 'month_to_season', 'month_to_season12',
|
| 297 |
+
'month_to_seasonN', 'monthly_total_to_daily_mean', 'nameDim',
|
| 298 |
+
'natgrid_Wrap', 'NewCosWeight', 'niceLatLon2D', 'NormCosWgtGlobe',
|
| 299 |
+
'numAsciiCol', 'numAsciiRow', 'numeric2int',
|
| 300 |
+
'obj_anal_ic_deprecated', 'obj_anal_ic_Wrap', 'omega_ccm_driver',
|
| 301 |
+
'omega_to_w', 'oneDtostring', 'pack_values', 'pattern_cor', 'pdfx',
|
| 302 |
+
'pdfxy', 'pdfxy_conform', 'pot_temp', 'pot_vort_hybrid',
|
| 303 |
+
'pot_vort_isobaric', 'pres2hybrid_Wrap', 'print_clock',
|
| 304 |
+
'printMinMax', 'quadroots', 'rcm2points_Wrap', 'rcm2rgrid_Wrap',
|
| 305 |
+
'readAsciiHead', 'readAsciiTable', 'reg_multlin_stats',
|
| 306 |
+
'region_ind', 'regline_stats', 'relhum_ttd', 'replaceSingleChar',
|
| 307 |
+
'RGBtoCmap', 'rgrid2rcm_Wrap', 'rho_mwjf', 'rm_single_dims',
|
| 308 |
+
'rmAnnCycle1D', 'rmInsufData', 'rmMonAnnCycLLLT', 'rmMonAnnCycLLT',
|
| 309 |
+
'rmMonAnnCycTLL', 'runave_n_Wrap', 'runave_Wrap', 'short2flt',
|
| 310 |
+
'short2flt_hdf', 'shsgc_R42_Wrap', 'sign_f90', 'sign_matlab',
|
| 311 |
+
'smth9_Wrap', 'smthClmDayTLL', 'smthClmDayTLLL', 'SqrtCosWeight',
|
| 312 |
+
'stat_dispersion', 'static_stability', 'stdMonLLLT', 'stdMonLLT',
|
| 313 |
+
'stdMonTLL', 'stdMonTLLL', 'symMinMaxPlt', 'table_attach_columns',
|
| 314 |
+
'table_attach_rows', 'time_to_newtime', 'transpose',
|
| 315 |
+
'triple2grid_Wrap', 'ut_convert', 'uv2dvF_Wrap', 'uv2dvG_Wrap',
|
| 316 |
+
'uv2vrF_Wrap', 'uv2vrG_Wrap', 'vr2uvF_Wrap', 'vr2uvG_Wrap',
|
| 317 |
+
'w_to_omega', 'wallClockElapseTime', 'wave_number_spc',
|
| 318 |
+
'wgt_areaave_Wrap', 'wgt_runave_leftdim', 'wgt_runave_n_Wrap',
|
| 319 |
+
'wgt_runave_Wrap', 'wgt_vertical_n', 'wind_component',
|
| 320 |
+
'wind_direction', 'yyyyddd_to_yyyymmdd', 'yyyymm_time',
|
| 321 |
+
'yyyymm_to_yyyyfrac', 'yyyymmdd_time', 'yyyymmdd_to_yyyyddd',
|
| 322 |
+
'yyyymmdd_to_yyyyfrac', 'yyyymmddhh_time', 'yyyymmddhh_to_yyyyfrac',
|
| 323 |
+
'zonal_mpsi_Wrap', 'zonalAve', 'calendar_decode2', 'cd_string',
|
| 324 |
+
'kf_filter', 'run_cor', 'time_axis_labels', 'ut_string',
|
| 325 |
+
'wrf_contour', 'wrf_map', 'wrf_map_overlay', 'wrf_map_overlays',
|
| 326 |
+
'wrf_map_resources', 'wrf_map_zoom', 'wrf_overlay', 'wrf_overlays',
|
| 327 |
+
'wrf_user_getvar', 'wrf_user_ij_to_ll', 'wrf_user_intrp2d',
|
| 328 |
+
'wrf_user_intrp3d', 'wrf_user_latlon_to_ij', 'wrf_user_list_times',
|
| 329 |
+
'wrf_user_ll_to_ij', 'wrf_user_unstagger', 'wrf_user_vert_interp',
|
| 330 |
+
'wrf_vector', 'gsn_add_annotation', 'gsn_add_polygon',
|
| 331 |
+
'gsn_add_polyline', 'gsn_add_polymarker',
|
| 332 |
+
'gsn_add_shapefile_polygons', 'gsn_add_shapefile_polylines',
|
| 333 |
+
'gsn_add_shapefile_polymarkers', 'gsn_add_text', 'gsn_attach_plots',
|
| 334 |
+
'gsn_blank_plot', 'gsn_contour', 'gsn_contour_map',
|
| 335 |
+
'gsn_contour_shade', 'gsn_coordinates', 'gsn_create_labelbar',
|
| 336 |
+
'gsn_create_legend', 'gsn_create_text',
|
| 337 |
+
'gsn_csm_attach_zonal_means', 'gsn_csm_blank_plot',
|
| 338 |
+
'gsn_csm_contour', 'gsn_csm_contour_map', 'gsn_csm_contour_map_ce',
|
| 339 |
+
'gsn_csm_contour_map_overlay', 'gsn_csm_contour_map_polar',
|
| 340 |
+
'gsn_csm_hov', 'gsn_csm_lat_time', 'gsn_csm_map', 'gsn_csm_map_ce',
|
| 341 |
+
'gsn_csm_map_polar', 'gsn_csm_pres_hgt',
|
| 342 |
+
'gsn_csm_pres_hgt_streamline', 'gsn_csm_pres_hgt_vector',
|
| 343 |
+
'gsn_csm_streamline', 'gsn_csm_streamline_contour_map',
|
| 344 |
+
'gsn_csm_streamline_contour_map_ce',
|
| 345 |
+
'gsn_csm_streamline_contour_map_polar', 'gsn_csm_streamline_map',
|
| 346 |
+
'gsn_csm_streamline_map_ce', 'gsn_csm_streamline_map_polar',
|
| 347 |
+
'gsn_csm_streamline_scalar', 'gsn_csm_streamline_scalar_map',
|
| 348 |
+
'gsn_csm_streamline_scalar_map_ce',
|
| 349 |
+
'gsn_csm_streamline_scalar_map_polar', 'gsn_csm_time_lat',
|
| 350 |
+
'gsn_csm_vector', 'gsn_csm_vector_map', 'gsn_csm_vector_map_ce',
|
| 351 |
+
'gsn_csm_vector_map_polar', 'gsn_csm_vector_scalar',
|
| 352 |
+
'gsn_csm_vector_scalar_map', 'gsn_csm_vector_scalar_map_ce',
|
| 353 |
+
'gsn_csm_vector_scalar_map_polar', 'gsn_csm_x2y', 'gsn_csm_x2y2',
|
| 354 |
+
'gsn_csm_xy', 'gsn_csm_xy2', 'gsn_csm_xy3', 'gsn_csm_y',
|
| 355 |
+
'gsn_define_colormap', 'gsn_draw_colormap', 'gsn_draw_named_colors',
|
| 356 |
+
'gsn_histogram', 'gsn_labelbar_ndc', 'gsn_legend_ndc', 'gsn_map',
|
| 357 |
+
'gsn_merge_colormaps', 'gsn_open_wks', 'gsn_panel', 'gsn_polygon',
|
| 358 |
+
'gsn_polygon_ndc', 'gsn_polyline', 'gsn_polyline_ndc',
|
| 359 |
+
'gsn_polymarker', 'gsn_polymarker_ndc', 'gsn_retrieve_colormap',
|
| 360 |
+
'gsn_reverse_colormap', 'gsn_streamline', 'gsn_streamline_map',
|
| 361 |
+
'gsn_streamline_scalar', 'gsn_streamline_scalar_map', 'gsn_table',
|
| 362 |
+
'gsn_text', 'gsn_text_ndc', 'gsn_vector', 'gsn_vector_map',
|
| 363 |
+
'gsn_vector_scalar', 'gsn_vector_scalar_map', 'gsn_xy', 'gsn_y',
|
| 364 |
+
'hsv2rgb', 'maximize_output', 'namedcolor2rgb', 'namedcolor2rgba',
|
| 365 |
+
'reset_device_coordinates', 'span_named_colors'), prefix=r'\b'),
|
| 366 |
+
Name.Builtin),
|
| 367 |
+
|
| 368 |
+
# Resources
|
| 369 |
+
(words((
|
| 370 |
+
'amDataXF', 'amDataYF', 'amJust', 'amOn', 'amOrthogonalPosF',
|
| 371 |
+
'amParallelPosF', 'amResizeNotify', 'amSide', 'amTrackData',
|
| 372 |
+
'amViewId', 'amZone', 'appDefaultParent', 'appFileSuffix',
|
| 373 |
+
'appResources', 'appSysDir', 'appUsrDir', 'caCopyArrays',
|
| 374 |
+
'caXArray', 'caXCast', 'caXMaxV', 'caXMinV', 'caXMissingV',
|
| 375 |
+
'caYArray', 'caYCast', 'caYMaxV', 'caYMinV', 'caYMissingV',
|
| 376 |
+
'cnCellFillEdgeColor', 'cnCellFillMissingValEdgeColor',
|
| 377 |
+
'cnConpackParams', 'cnConstFEnableFill', 'cnConstFLabelAngleF',
|
| 378 |
+
'cnConstFLabelBackgroundColor', 'cnConstFLabelConstantSpacingF',
|
| 379 |
+
'cnConstFLabelFont', 'cnConstFLabelFontAspectF',
|
| 380 |
+
'cnConstFLabelFontColor', 'cnConstFLabelFontHeightF',
|
| 381 |
+
'cnConstFLabelFontQuality', 'cnConstFLabelFontThicknessF',
|
| 382 |
+
'cnConstFLabelFormat', 'cnConstFLabelFuncCode', 'cnConstFLabelJust',
|
| 383 |
+
'cnConstFLabelOn', 'cnConstFLabelOrthogonalPosF',
|
| 384 |
+
'cnConstFLabelParallelPosF', 'cnConstFLabelPerimColor',
|
| 385 |
+
'cnConstFLabelPerimOn', 'cnConstFLabelPerimSpaceF',
|
| 386 |
+
'cnConstFLabelPerimThicknessF', 'cnConstFLabelSide',
|
| 387 |
+
'cnConstFLabelString', 'cnConstFLabelTextDirection',
|
| 388 |
+
'cnConstFLabelZone', 'cnConstFUseInfoLabelRes',
|
| 389 |
+
'cnExplicitLabelBarLabelsOn', 'cnExplicitLegendLabelsOn',
|
| 390 |
+
'cnExplicitLineLabelsOn', 'cnFillBackgroundColor', 'cnFillColor',
|
| 391 |
+
'cnFillColors', 'cnFillDotSizeF', 'cnFillDrawOrder', 'cnFillMode',
|
| 392 |
+
'cnFillOn', 'cnFillOpacityF', 'cnFillPalette', 'cnFillPattern',
|
| 393 |
+
'cnFillPatterns', 'cnFillScaleF', 'cnFillScales', 'cnFixFillBleed',
|
| 394 |
+
'cnGridBoundFillColor', 'cnGridBoundFillPattern',
|
| 395 |
+
'cnGridBoundFillScaleF', 'cnGridBoundPerimColor',
|
| 396 |
+
'cnGridBoundPerimDashPattern', 'cnGridBoundPerimOn',
|
| 397 |
+
'cnGridBoundPerimThicknessF', 'cnHighLabelAngleF',
|
| 398 |
+
'cnHighLabelBackgroundColor', 'cnHighLabelConstantSpacingF',
|
| 399 |
+
'cnHighLabelCount', 'cnHighLabelFont', 'cnHighLabelFontAspectF',
|
| 400 |
+
'cnHighLabelFontColor', 'cnHighLabelFontHeightF',
|
| 401 |
+
'cnHighLabelFontQuality', 'cnHighLabelFontThicknessF',
|
| 402 |
+
'cnHighLabelFormat', 'cnHighLabelFuncCode', 'cnHighLabelPerimColor',
|
| 403 |
+
'cnHighLabelPerimOn', 'cnHighLabelPerimSpaceF',
|
| 404 |
+
'cnHighLabelPerimThicknessF', 'cnHighLabelString', 'cnHighLabelsOn',
|
| 405 |
+
'cnHighLowLabelOverlapMode', 'cnHighUseLineLabelRes',
|
| 406 |
+
'cnInfoLabelAngleF', 'cnInfoLabelBackgroundColor',
|
| 407 |
+
'cnInfoLabelConstantSpacingF', 'cnInfoLabelFont',
|
| 408 |
+
'cnInfoLabelFontAspectF', 'cnInfoLabelFontColor',
|
| 409 |
+
'cnInfoLabelFontHeightF', 'cnInfoLabelFontQuality',
|
| 410 |
+
'cnInfoLabelFontThicknessF', 'cnInfoLabelFormat',
|
| 411 |
+
'cnInfoLabelFuncCode', 'cnInfoLabelJust', 'cnInfoLabelOn',
|
| 412 |
+
'cnInfoLabelOrthogonalPosF', 'cnInfoLabelParallelPosF',
|
| 413 |
+
'cnInfoLabelPerimColor', 'cnInfoLabelPerimOn',
|
| 414 |
+
'cnInfoLabelPerimSpaceF', 'cnInfoLabelPerimThicknessF',
|
| 415 |
+
'cnInfoLabelSide', 'cnInfoLabelString', 'cnInfoLabelTextDirection',
|
| 416 |
+
'cnInfoLabelZone', 'cnLabelBarEndLabelsOn', 'cnLabelBarEndStyle',
|
| 417 |
+
'cnLabelDrawOrder', 'cnLabelMasking', 'cnLabelScaleFactorF',
|
| 418 |
+
'cnLabelScaleValueF', 'cnLabelScalingMode', 'cnLegendLevelFlags',
|
| 419 |
+
'cnLevelCount', 'cnLevelFlag', 'cnLevelFlags', 'cnLevelSelectionMode',
|
| 420 |
+
'cnLevelSpacingF', 'cnLevels', 'cnLineColor', 'cnLineColors',
|
| 421 |
+
'cnLineDashPattern', 'cnLineDashPatterns', 'cnLineDashSegLenF',
|
| 422 |
+
'cnLineDrawOrder', 'cnLineLabelAngleF', 'cnLineLabelBackgroundColor',
|
| 423 |
+
'cnLineLabelConstantSpacingF', 'cnLineLabelCount',
|
| 424 |
+
'cnLineLabelDensityF', 'cnLineLabelFont', 'cnLineLabelFontAspectF',
|
| 425 |
+
'cnLineLabelFontColor', 'cnLineLabelFontColors',
|
| 426 |
+
'cnLineLabelFontHeightF', 'cnLineLabelFontQuality',
|
| 427 |
+
'cnLineLabelFontThicknessF', 'cnLineLabelFormat',
|
| 428 |
+
'cnLineLabelFuncCode', 'cnLineLabelInterval', 'cnLineLabelPerimColor',
|
| 429 |
+
'cnLineLabelPerimOn', 'cnLineLabelPerimSpaceF',
|
| 430 |
+
'cnLineLabelPerimThicknessF', 'cnLineLabelPlacementMode',
|
| 431 |
+
'cnLineLabelStrings', 'cnLineLabelsOn', 'cnLinePalette',
|
| 432 |
+
'cnLineThicknessF', 'cnLineThicknesses', 'cnLinesOn',
|
| 433 |
+
'cnLowLabelAngleF', 'cnLowLabelBackgroundColor',
|
| 434 |
+
'cnLowLabelConstantSpacingF', 'cnLowLabelCount', 'cnLowLabelFont',
|
| 435 |
+
'cnLowLabelFontAspectF', 'cnLowLabelFontColor',
|
| 436 |
+
'cnLowLabelFontHeightF', 'cnLowLabelFontQuality',
|
| 437 |
+
'cnLowLabelFontThicknessF', 'cnLowLabelFormat', 'cnLowLabelFuncCode',
|
| 438 |
+
'cnLowLabelPerimColor', 'cnLowLabelPerimOn', 'cnLowLabelPerimSpaceF',
|
| 439 |
+
'cnLowLabelPerimThicknessF', 'cnLowLabelString', 'cnLowLabelsOn',
|
| 440 |
+
'cnLowUseHighLabelRes', 'cnMaxDataValueFormat', 'cnMaxLevelCount',
|
| 441 |
+
'cnMaxLevelValF', 'cnMaxPointDistanceF', 'cnMinLevelValF',
|
| 442 |
+
'cnMissingValFillColor', 'cnMissingValFillPattern',
|
| 443 |
+
'cnMissingValFillScaleF', 'cnMissingValPerimColor',
|
| 444 |
+
'cnMissingValPerimDashPattern', 'cnMissingValPerimGridBoundOn',
|
| 445 |
+
'cnMissingValPerimOn', 'cnMissingValPerimThicknessF',
|
| 446 |
+
'cnMonoFillColor', 'cnMonoFillPattern', 'cnMonoFillScale',
|
| 447 |
+
'cnMonoLevelFlag', 'cnMonoLineColor', 'cnMonoLineDashPattern',
|
| 448 |
+
'cnMonoLineLabelFontColor', 'cnMonoLineThickness', 'cnNoDataLabelOn',
|
| 449 |
+
'cnNoDataLabelString', 'cnOutOfRangeFillColor',
|
| 450 |
+
'cnOutOfRangeFillPattern', 'cnOutOfRangeFillScaleF',
|
| 451 |
+
'cnOutOfRangePerimColor', 'cnOutOfRangePerimDashPattern',
|
| 452 |
+
'cnOutOfRangePerimOn', 'cnOutOfRangePerimThicknessF',
|
| 453 |
+
'cnRasterCellSizeF', 'cnRasterMinCellSizeF', 'cnRasterModeOn',
|
| 454 |
+
'cnRasterSampleFactorF', 'cnRasterSmoothingOn', 'cnScalarFieldData',
|
| 455 |
+
'cnSmoothingDistanceF', 'cnSmoothingOn', 'cnSmoothingTensionF',
|
| 456 |
+
'cnSpanFillPalette', 'cnSpanLinePalette', 'ctCopyTables',
|
| 457 |
+
'ctXElementSize', 'ctXMaxV', 'ctXMinV', 'ctXMissingV', 'ctXTable',
|
| 458 |
+
'ctXTableLengths', 'ctXTableType', 'ctYElementSize', 'ctYMaxV',
|
| 459 |
+
'ctYMinV', 'ctYMissingV', 'ctYTable', 'ctYTableLengths',
|
| 460 |
+
'ctYTableType', 'dcDelayCompute', 'errBuffer',
|
| 461 |
+
'errFileName', 'errFilePtr', 'errLevel', 'errPrint', 'errUnitNumber',
|
| 462 |
+
'gsClipOn', 'gsColors', 'gsEdgeColor', 'gsEdgeDashPattern',
|
| 463 |
+
'gsEdgeDashSegLenF', 'gsEdgeThicknessF', 'gsEdgesOn',
|
| 464 |
+
'gsFillBackgroundColor', 'gsFillColor', 'gsFillDotSizeF',
|
| 465 |
+
'gsFillIndex', 'gsFillLineThicknessF', 'gsFillOpacityF',
|
| 466 |
+
'gsFillScaleF', 'gsFont', 'gsFontAspectF', 'gsFontColor',
|
| 467 |
+
'gsFontHeightF', 'gsFontOpacityF', 'gsFontQuality',
|
| 468 |
+
'gsFontThicknessF', 'gsLineColor', 'gsLineDashPattern',
|
| 469 |
+
'gsLineDashSegLenF', 'gsLineLabelConstantSpacingF', 'gsLineLabelFont',
|
| 470 |
+
'gsLineLabelFontAspectF', 'gsLineLabelFontColor',
|
| 471 |
+
'gsLineLabelFontHeightF', 'gsLineLabelFontQuality',
|
| 472 |
+
'gsLineLabelFontThicknessF', 'gsLineLabelFuncCode',
|
| 473 |
+
'gsLineLabelString', 'gsLineOpacityF', 'gsLineThicknessF',
|
| 474 |
+
'gsMarkerColor', 'gsMarkerIndex', 'gsMarkerOpacityF', 'gsMarkerSizeF',
|
| 475 |
+
'gsMarkerThicknessF', 'gsSegments', 'gsTextAngleF',
|
| 476 |
+
'gsTextConstantSpacingF', 'gsTextDirection', 'gsTextFuncCode',
|
| 477 |
+
'gsTextJustification', 'gsnAboveYRefLineBarColors',
|
| 478 |
+
'gsnAboveYRefLineBarFillScales', 'gsnAboveYRefLineBarPatterns',
|
| 479 |
+
'gsnAboveYRefLineColor', 'gsnAddCyclic', 'gsnAttachBorderOn',
|
| 480 |
+
'gsnAttachPlotsXAxis', 'gsnBelowYRefLineBarColors',
|
| 481 |
+
'gsnBelowYRefLineBarFillScales', 'gsnBelowYRefLineBarPatterns',
|
| 482 |
+
'gsnBelowYRefLineColor', 'gsnBoxMargin', 'gsnCenterString',
|
| 483 |
+
'gsnCenterStringFontColor', 'gsnCenterStringFontHeightF',
|
| 484 |
+
'gsnCenterStringFuncCode', 'gsnCenterStringOrthogonalPosF',
|
| 485 |
+
'gsnCenterStringParallelPosF', 'gsnContourLineThicknessesScale',
|
| 486 |
+
'gsnContourNegLineDashPattern', 'gsnContourPosLineDashPattern',
|
| 487 |
+
'gsnContourZeroLineThicknessF', 'gsnDebugWriteFileName', 'gsnDraw',
|
| 488 |
+
'gsnFrame', 'gsnHistogramBarWidthPercent', 'gsnHistogramBinIntervals',
|
| 489 |
+
'gsnHistogramBinMissing', 'gsnHistogramBinWidth',
|
| 490 |
+
'gsnHistogramClassIntervals', 'gsnHistogramCompare',
|
| 491 |
+
'gsnHistogramComputePercentages',
|
| 492 |
+
'gsnHistogramComputePercentagesNoMissing',
|
| 493 |
+
'gsnHistogramDiscreteBinValues', 'gsnHistogramDiscreteClassValues',
|
| 494 |
+
'gsnHistogramHorizontal', 'gsnHistogramMinMaxBinsOn',
|
| 495 |
+
'gsnHistogramNumberOfBins', 'gsnHistogramPercentSign',
|
| 496 |
+
'gsnHistogramSelectNiceIntervals', 'gsnLeftString',
|
| 497 |
+
'gsnLeftStringFontColor', 'gsnLeftStringFontHeightF',
|
| 498 |
+
'gsnLeftStringFuncCode', 'gsnLeftStringOrthogonalPosF',
|
| 499 |
+
'gsnLeftStringParallelPosF', 'gsnMajorLatSpacing',
|
| 500 |
+
'gsnMajorLonSpacing', 'gsnMaskLambertConformal',
|
| 501 |
+
'gsnMaskLambertConformalOutlineOn', 'gsnMaximize',
|
| 502 |
+
'gsnMinorLatSpacing', 'gsnMinorLonSpacing', 'gsnPanelBottom',
|
| 503 |
+
'gsnPanelCenter', 'gsnPanelDebug', 'gsnPanelFigureStrings',
|
| 504 |
+
'gsnPanelFigureStringsBackgroundFillColor',
|
| 505 |
+
'gsnPanelFigureStringsFontHeightF', 'gsnPanelFigureStringsJust',
|
| 506 |
+
'gsnPanelFigureStringsPerimOn', 'gsnPanelLabelBar', 'gsnPanelLeft',
|
| 507 |
+
'gsnPanelMainFont', 'gsnPanelMainFontColor',
|
| 508 |
+
'gsnPanelMainFontHeightF', 'gsnPanelMainString', 'gsnPanelRight',
|
| 509 |
+
'gsnPanelRowSpec', 'gsnPanelScalePlotIndex', 'gsnPanelTop',
|
| 510 |
+
'gsnPanelXF', 'gsnPanelXWhiteSpacePercent', 'gsnPanelYF',
|
| 511 |
+
'gsnPanelYWhiteSpacePercent', 'gsnPaperHeight', 'gsnPaperMargin',
|
| 512 |
+
'gsnPaperOrientation', 'gsnPaperWidth', 'gsnPolar',
|
| 513 |
+
'gsnPolarLabelDistance', 'gsnPolarLabelFont',
|
| 514 |
+
'gsnPolarLabelFontHeightF', 'gsnPolarLabelSpacing', 'gsnPolarTime',
|
| 515 |
+
'gsnPolarUT', 'gsnRightString', 'gsnRightStringFontColor',
|
| 516 |
+
'gsnRightStringFontHeightF', 'gsnRightStringFuncCode',
|
| 517 |
+
'gsnRightStringOrthogonalPosF', 'gsnRightStringParallelPosF',
|
| 518 |
+
'gsnScalarContour', 'gsnScale', 'gsnShape', 'gsnSpreadColorEnd',
|
| 519 |
+
'gsnSpreadColorStart', 'gsnSpreadColors', 'gsnStringFont',
|
| 520 |
+
'gsnStringFontColor', 'gsnStringFontHeightF', 'gsnStringFuncCode',
|
| 521 |
+
'gsnTickMarksOn', 'gsnXAxisIrregular2Linear', 'gsnXAxisIrregular2Log',
|
| 522 |
+
'gsnXRefLine', 'gsnXRefLineColor', 'gsnXRefLineDashPattern',
|
| 523 |
+
'gsnXRefLineThicknessF', 'gsnXYAboveFillColors', 'gsnXYBarChart',
|
| 524 |
+
'gsnXYBarChartBarWidth', 'gsnXYBarChartColors',
|
| 525 |
+
'gsnXYBarChartColors2', 'gsnXYBarChartFillDotSizeF',
|
| 526 |
+
'gsnXYBarChartFillLineThicknessF', 'gsnXYBarChartFillOpacityF',
|
| 527 |
+
'gsnXYBarChartFillScaleF', 'gsnXYBarChartOutlineOnly',
|
| 528 |
+
'gsnXYBarChartOutlineThicknessF', 'gsnXYBarChartPatterns',
|
| 529 |
+
'gsnXYBarChartPatterns2', 'gsnXYBelowFillColors', 'gsnXYFillColors',
|
| 530 |
+
'gsnXYFillOpacities', 'gsnXYLeftFillColors', 'gsnXYRightFillColors',
|
| 531 |
+
'gsnYAxisIrregular2Linear', 'gsnYAxisIrregular2Log', 'gsnYRefLine',
|
| 532 |
+
'gsnYRefLineColor', 'gsnYRefLineColors', 'gsnYRefLineDashPattern',
|
| 533 |
+
'gsnYRefLineDashPatterns', 'gsnYRefLineThicknessF',
|
| 534 |
+
'gsnYRefLineThicknesses', 'gsnZonalMean', 'gsnZonalMeanXMaxF',
|
| 535 |
+
'gsnZonalMeanXMinF', 'gsnZonalMeanYRefLine', 'lbAutoManage',
|
| 536 |
+
'lbBottomMarginF', 'lbBoxCount', 'lbBoxEndCapStyle', 'lbBoxFractions',
|
| 537 |
+
'lbBoxLineColor', 'lbBoxLineDashPattern', 'lbBoxLineDashSegLenF',
|
| 538 |
+
'lbBoxLineThicknessF', 'lbBoxLinesOn', 'lbBoxMajorExtentF',
|
| 539 |
+
'lbBoxMinorExtentF', 'lbBoxSeparatorLinesOn', 'lbBoxSizing',
|
| 540 |
+
'lbFillBackground', 'lbFillColor', 'lbFillColors', 'lbFillDotSizeF',
|
| 541 |
+
'lbFillLineThicknessF', 'lbFillPattern', 'lbFillPatterns',
|
| 542 |
+
'lbFillScaleF', 'lbFillScales', 'lbJustification', 'lbLabelAlignment',
|
| 543 |
+
'lbLabelAngleF', 'lbLabelAutoStride', 'lbLabelBarOn',
|
| 544 |
+
'lbLabelConstantSpacingF', 'lbLabelDirection', 'lbLabelFont',
|
| 545 |
+
'lbLabelFontAspectF', 'lbLabelFontColor', 'lbLabelFontHeightF',
|
| 546 |
+
'lbLabelFontQuality', 'lbLabelFontThicknessF', 'lbLabelFuncCode',
|
| 547 |
+
'lbLabelJust', 'lbLabelOffsetF', 'lbLabelPosition', 'lbLabelStride',
|
| 548 |
+
'lbLabelStrings', 'lbLabelsOn', 'lbLeftMarginF', 'lbMaxLabelLenF',
|
| 549 |
+
'lbMinLabelSpacingF', 'lbMonoFillColor', 'lbMonoFillPattern',
|
| 550 |
+
'lbMonoFillScale', 'lbOrientation', 'lbPerimColor',
|
| 551 |
+
'lbPerimDashPattern', 'lbPerimDashSegLenF', 'lbPerimFill',
|
| 552 |
+
'lbPerimFillColor', 'lbPerimOn', 'lbPerimThicknessF',
|
| 553 |
+
'lbRasterFillOn', 'lbRightMarginF', 'lbTitleAngleF',
|
| 554 |
+
'lbTitleConstantSpacingF', 'lbTitleDirection', 'lbTitleExtentF',
|
| 555 |
+
'lbTitleFont', 'lbTitleFontAspectF', 'lbTitleFontColor',
|
| 556 |
+
'lbTitleFontHeightF', 'lbTitleFontQuality', 'lbTitleFontThicknessF',
|
| 557 |
+
'lbTitleFuncCode', 'lbTitleJust', 'lbTitleOffsetF', 'lbTitleOn',
|
| 558 |
+
'lbTitlePosition', 'lbTitleString', 'lbTopMarginF', 'lgAutoManage',
|
| 559 |
+
'lgBottomMarginF', 'lgBoxBackground', 'lgBoxLineColor',
|
| 560 |
+
'lgBoxLineDashPattern', 'lgBoxLineDashSegLenF', 'lgBoxLineThicknessF',
|
| 561 |
+
'lgBoxLinesOn', 'lgBoxMajorExtentF', 'lgBoxMinorExtentF',
|
| 562 |
+
'lgDashIndex', 'lgDashIndexes', 'lgItemCount', 'lgItemOrder',
|
| 563 |
+
'lgItemPlacement', 'lgItemPositions', 'lgItemType', 'lgItemTypes',
|
| 564 |
+
'lgJustification', 'lgLabelAlignment', 'lgLabelAngleF',
|
| 565 |
+
'lgLabelAutoStride', 'lgLabelConstantSpacingF', 'lgLabelDirection',
|
| 566 |
+
'lgLabelFont', 'lgLabelFontAspectF', 'lgLabelFontColor',
|
| 567 |
+
'lgLabelFontHeightF', 'lgLabelFontQuality', 'lgLabelFontThicknessF',
|
| 568 |
+
'lgLabelFuncCode', 'lgLabelJust', 'lgLabelOffsetF', 'lgLabelPosition',
|
| 569 |
+
'lgLabelStride', 'lgLabelStrings', 'lgLabelsOn', 'lgLeftMarginF',
|
| 570 |
+
'lgLegendOn', 'lgLineColor', 'lgLineColors', 'lgLineDashSegLenF',
|
| 571 |
+
'lgLineDashSegLens', 'lgLineLabelConstantSpacingF', 'lgLineLabelFont',
|
| 572 |
+
'lgLineLabelFontAspectF', 'lgLineLabelFontColor',
|
| 573 |
+
'lgLineLabelFontColors', 'lgLineLabelFontHeightF',
|
| 574 |
+
'lgLineLabelFontHeights', 'lgLineLabelFontQuality',
|
| 575 |
+
'lgLineLabelFontThicknessF', 'lgLineLabelFuncCode',
|
| 576 |
+
'lgLineLabelStrings', 'lgLineLabelsOn', 'lgLineThicknessF',
|
| 577 |
+
'lgLineThicknesses', 'lgMarkerColor', 'lgMarkerColors',
|
| 578 |
+
'lgMarkerIndex', 'lgMarkerIndexes', 'lgMarkerSizeF', 'lgMarkerSizes',
|
| 579 |
+
'lgMarkerThicknessF', 'lgMarkerThicknesses', 'lgMonoDashIndex',
|
| 580 |
+
'lgMonoItemType', 'lgMonoLineColor', 'lgMonoLineDashSegLen',
|
| 581 |
+
'lgMonoLineLabelFontColor', 'lgMonoLineLabelFontHeight',
|
| 582 |
+
'lgMonoLineThickness', 'lgMonoMarkerColor', 'lgMonoMarkerIndex',
|
| 583 |
+
'lgMonoMarkerSize', 'lgMonoMarkerThickness', 'lgOrientation',
|
| 584 |
+
'lgPerimColor', 'lgPerimDashPattern', 'lgPerimDashSegLenF',
|
| 585 |
+
'lgPerimFill', 'lgPerimFillColor', 'lgPerimOn', 'lgPerimThicknessF',
|
| 586 |
+
'lgRightMarginF', 'lgTitleAngleF', 'lgTitleConstantSpacingF',
|
| 587 |
+
'lgTitleDirection', 'lgTitleExtentF', 'lgTitleFont',
|
| 588 |
+
'lgTitleFontAspectF', 'lgTitleFontColor', 'lgTitleFontHeightF',
|
| 589 |
+
'lgTitleFontQuality', 'lgTitleFontThicknessF', 'lgTitleFuncCode',
|
| 590 |
+
'lgTitleJust', 'lgTitleOffsetF', 'lgTitleOn', 'lgTitlePosition',
|
| 591 |
+
'lgTitleString', 'lgTopMarginF', 'mpAreaGroupCount',
|
| 592 |
+
'mpAreaMaskingOn', 'mpAreaNames', 'mpAreaTypes', 'mpBottomAngleF',
|
| 593 |
+
'mpBottomMapPosF', 'mpBottomNDCF', 'mpBottomNPCF',
|
| 594 |
+
'mpBottomPointLatF', 'mpBottomPointLonF', 'mpBottomWindowF',
|
| 595 |
+
'mpCenterLatF', 'mpCenterLonF', 'mpCenterRotF', 'mpCountyLineColor',
|
| 596 |
+
'mpCountyLineDashPattern', 'mpCountyLineDashSegLenF',
|
| 597 |
+
'mpCountyLineThicknessF', 'mpDataBaseVersion', 'mpDataResolution',
|
| 598 |
+
'mpDataSetName', 'mpDefaultFillColor', 'mpDefaultFillPattern',
|
| 599 |
+
'mpDefaultFillScaleF', 'mpDynamicAreaGroups', 'mpEllipticalBoundary',
|
| 600 |
+
'mpFillAreaSpecifiers', 'mpFillBoundarySets', 'mpFillColor',
|
| 601 |
+
'mpFillColors', 'mpFillColors-default', 'mpFillDotSizeF',
|
| 602 |
+
'mpFillDrawOrder', 'mpFillOn', 'mpFillPatternBackground',
|
| 603 |
+
'mpFillPattern', 'mpFillPatterns', 'mpFillPatterns-default',
|
| 604 |
+
'mpFillScaleF', 'mpFillScales', 'mpFillScales-default',
|
| 605 |
+
'mpFixedAreaGroups', 'mpGeophysicalLineColor',
|
| 606 |
+
'mpGeophysicalLineDashPattern', 'mpGeophysicalLineDashSegLenF',
|
| 607 |
+
'mpGeophysicalLineThicknessF', 'mpGreatCircleLinesOn',
|
| 608 |
+
'mpGridAndLimbDrawOrder', 'mpGridAndLimbOn', 'mpGridLatSpacingF',
|
| 609 |
+
'mpGridLineColor', 'mpGridLineDashPattern', 'mpGridLineDashSegLenF',
|
| 610 |
+
'mpGridLineThicknessF', 'mpGridLonSpacingF', 'mpGridMaskMode',
|
| 611 |
+
'mpGridMaxLatF', 'mpGridPolarLonSpacingF', 'mpGridSpacingF',
|
| 612 |
+
'mpInlandWaterFillColor', 'mpInlandWaterFillPattern',
|
| 613 |
+
'mpInlandWaterFillScaleF', 'mpLabelDrawOrder', 'mpLabelFontColor',
|
| 614 |
+
'mpLabelFontHeightF', 'mpLabelsOn', 'mpLambertMeridianF',
|
| 615 |
+
'mpLambertParallel1F', 'mpLambertParallel2F', 'mpLandFillColor',
|
| 616 |
+
'mpLandFillPattern', 'mpLandFillScaleF', 'mpLeftAngleF',
|
| 617 |
+
'mpLeftCornerLatF', 'mpLeftCornerLonF', 'mpLeftMapPosF',
|
| 618 |
+
'mpLeftNDCF', 'mpLeftNPCF', 'mpLeftPointLatF',
|
| 619 |
+
'mpLeftPointLonF', 'mpLeftWindowF', 'mpLimbLineColor',
|
| 620 |
+
'mpLimbLineDashPattern', 'mpLimbLineDashSegLenF',
|
| 621 |
+
'mpLimbLineThicknessF', 'mpLimitMode', 'mpMaskAreaSpecifiers',
|
| 622 |
+
'mpMaskOutlineSpecifiers', 'mpMaxLatF', 'mpMaxLonF',
|
| 623 |
+
'mpMinLatF', 'mpMinLonF', 'mpMonoFillColor', 'mpMonoFillPattern',
|
| 624 |
+
'mpMonoFillScale', 'mpNationalLineColor', 'mpNationalLineDashPattern',
|
| 625 |
+
'mpNationalLineThicknessF', 'mpOceanFillColor', 'mpOceanFillPattern',
|
| 626 |
+
'mpOceanFillScaleF', 'mpOutlineBoundarySets', 'mpOutlineDrawOrder',
|
| 627 |
+
'mpOutlineMaskingOn', 'mpOutlineOn', 'mpOutlineSpecifiers',
|
| 628 |
+
'mpPerimDrawOrder', 'mpPerimLineColor', 'mpPerimLineDashPattern',
|
| 629 |
+
'mpPerimLineDashSegLenF', 'mpPerimLineThicknessF', 'mpPerimOn',
|
| 630 |
+
'mpPolyMode', 'mpProjection', 'mpProvincialLineColor',
|
| 631 |
+
'mpProvincialLineDashPattern', 'mpProvincialLineDashSegLenF',
|
| 632 |
+
'mpProvincialLineThicknessF', 'mpRelativeCenterLat',
|
| 633 |
+
'mpRelativeCenterLon', 'mpRightAngleF', 'mpRightCornerLatF',
|
| 634 |
+
'mpRightCornerLonF', 'mpRightMapPosF', 'mpRightNDCF',
|
| 635 |
+
'mpRightNPCF', 'mpRightPointLatF', 'mpRightPointLonF',
|
| 636 |
+
'mpRightWindowF', 'mpSatelliteAngle1F', 'mpSatelliteAngle2F',
|
| 637 |
+
'mpSatelliteDistF', 'mpShapeMode', 'mpSpecifiedFillColors',
|
| 638 |
+
'mpSpecifiedFillDirectIndexing', 'mpSpecifiedFillPatterns',
|
| 639 |
+
'mpSpecifiedFillPriority', 'mpSpecifiedFillScales',
|
| 640 |
+
'mpTopAngleF', 'mpTopMapPosF', 'mpTopNDCF', 'mpTopNPCF',
|
| 641 |
+
'mpTopPointLatF', 'mpTopPointLonF', 'mpTopWindowF',
|
| 642 |
+
'mpUSStateLineColor', 'mpUSStateLineDashPattern',
|
| 643 |
+
'mpUSStateLineDashSegLenF', 'mpUSStateLineThicknessF',
|
| 644 |
+
'pmAnnoManagers', 'pmAnnoViews', 'pmLabelBarDisplayMode',
|
| 645 |
+
'pmLabelBarHeightF', 'pmLabelBarKeepAspect', 'pmLabelBarOrthogonalPosF',
|
| 646 |
+
'pmLabelBarParallelPosF', 'pmLabelBarSide', 'pmLabelBarWidthF',
|
| 647 |
+
'pmLabelBarZone', 'pmLegendDisplayMode', 'pmLegendHeightF',
|
| 648 |
+
'pmLegendKeepAspect', 'pmLegendOrthogonalPosF',
|
| 649 |
+
'pmLegendParallelPosF', 'pmLegendSide', 'pmLegendWidthF',
|
| 650 |
+
'pmLegendZone', 'pmOverlaySequenceIds', 'pmTickMarkDisplayMode',
|
| 651 |
+
'pmTickMarkZone', 'pmTitleDisplayMode', 'pmTitleZone',
|
| 652 |
+
'prGraphicStyle', 'prPolyType', 'prXArray', 'prYArray',
|
| 653 |
+
'sfCopyData', 'sfDataArray', 'sfDataMaxV', 'sfDataMinV',
|
| 654 |
+
'sfElementNodes', 'sfExchangeDimensions', 'sfFirstNodeIndex',
|
| 655 |
+
'sfMissingValueV', 'sfXArray', 'sfXCActualEndF', 'sfXCActualStartF',
|
| 656 |
+
'sfXCEndIndex', 'sfXCEndSubsetV', 'sfXCEndV', 'sfXCStartIndex',
|
| 657 |
+
'sfXCStartSubsetV', 'sfXCStartV', 'sfXCStride', 'sfXCellBounds',
|
| 658 |
+
'sfYArray', 'sfYCActualEndF', 'sfYCActualStartF', 'sfYCEndIndex',
|
| 659 |
+
'sfYCEndSubsetV', 'sfYCEndV', 'sfYCStartIndex', 'sfYCStartSubsetV',
|
| 660 |
+
'sfYCStartV', 'sfYCStride', 'sfYCellBounds', 'stArrowLengthF',
|
| 661 |
+
'stArrowStride', 'stCrossoverCheckCount',
|
| 662 |
+
'stExplicitLabelBarLabelsOn', 'stLabelBarEndLabelsOn',
|
| 663 |
+
'stLabelFormat', 'stLengthCheckCount', 'stLevelColors',
|
| 664 |
+
'stLevelCount', 'stLevelPalette', 'stLevelSelectionMode',
|
| 665 |
+
'stLevelSpacingF', 'stLevels', 'stLineColor', 'stLineOpacityF',
|
| 666 |
+
'stLineStartStride', 'stLineThicknessF', 'stMapDirection',
|
| 667 |
+
'stMaxLevelCount', 'stMaxLevelValF', 'stMinArrowSpacingF',
|
| 668 |
+
'stMinDistanceF', 'stMinLevelValF', 'stMinLineSpacingF',
|
| 669 |
+
'stMinStepFactorF', 'stMonoLineColor', 'stNoDataLabelOn',
|
| 670 |
+
'stNoDataLabelString', 'stScalarFieldData', 'stScalarMissingValColor',
|
| 671 |
+
'stSpanLevelPalette', 'stStepSizeF', 'stStreamlineDrawOrder',
|
| 672 |
+
'stUseScalarArray', 'stVectorFieldData', 'stZeroFLabelAngleF',
|
| 673 |
+
'stZeroFLabelBackgroundColor', 'stZeroFLabelConstantSpacingF',
|
| 674 |
+
'stZeroFLabelFont', 'stZeroFLabelFontAspectF',
|
| 675 |
+
'stZeroFLabelFontColor', 'stZeroFLabelFontHeightF',
|
| 676 |
+
'stZeroFLabelFontQuality', 'stZeroFLabelFontThicknessF',
|
| 677 |
+
'stZeroFLabelFuncCode', 'stZeroFLabelJust', 'stZeroFLabelOn',
|
| 678 |
+
'stZeroFLabelOrthogonalPosF', 'stZeroFLabelParallelPosF',
|
| 679 |
+
'stZeroFLabelPerimColor', 'stZeroFLabelPerimOn',
|
| 680 |
+
'stZeroFLabelPerimSpaceF', 'stZeroFLabelPerimThicknessF',
|
| 681 |
+
'stZeroFLabelSide', 'stZeroFLabelString', 'stZeroFLabelTextDirection',
|
| 682 |
+
'stZeroFLabelZone', 'tfDoNDCOverlay', 'tfPlotManagerOn',
|
| 683 |
+
'tfPolyDrawList', 'tfPolyDrawOrder', 'tiDeltaF', 'tiMainAngleF',
|
| 684 |
+
'tiMainConstantSpacingF', 'tiMainDirection', 'tiMainFont',
|
| 685 |
+
'tiMainFontAspectF', 'tiMainFontColor', 'tiMainFontHeightF',
|
| 686 |
+
'tiMainFontQuality', 'tiMainFontThicknessF', 'tiMainFuncCode',
|
| 687 |
+
'tiMainJust', 'tiMainOffsetXF', 'tiMainOffsetYF', 'tiMainOn',
|
| 688 |
+
'tiMainPosition', 'tiMainSide', 'tiMainString', 'tiUseMainAttributes',
|
| 689 |
+
'tiXAxisAngleF', 'tiXAxisConstantSpacingF', 'tiXAxisDirection',
|
| 690 |
+
'tiXAxisFont', 'tiXAxisFontAspectF', 'tiXAxisFontColor',
|
| 691 |
+
'tiXAxisFontHeightF', 'tiXAxisFontQuality', 'tiXAxisFontThicknessF',
|
| 692 |
+
'tiXAxisFuncCode', 'tiXAxisJust', 'tiXAxisOffsetXF',
|
| 693 |
+
'tiXAxisOffsetYF', 'tiXAxisOn', 'tiXAxisPosition', 'tiXAxisSide',
|
| 694 |
+
'tiXAxisString', 'tiYAxisAngleF', 'tiYAxisConstantSpacingF',
|
| 695 |
+
'tiYAxisDirection', 'tiYAxisFont', 'tiYAxisFontAspectF',
|
| 696 |
+
'tiYAxisFontColor', 'tiYAxisFontHeightF', 'tiYAxisFontQuality',
|
| 697 |
+
'tiYAxisFontThicknessF', 'tiYAxisFuncCode', 'tiYAxisJust',
|
| 698 |
+
'tiYAxisOffsetXF', 'tiYAxisOffsetYF', 'tiYAxisOn', 'tiYAxisPosition',
|
| 699 |
+
'tiYAxisSide', 'tiYAxisString', 'tmBorderLineColor',
|
| 700 |
+
'tmBorderThicknessF', 'tmEqualizeXYSizes', 'tmLabelAutoStride',
|
| 701 |
+
'tmSciNoteCutoff', 'tmXBAutoPrecision', 'tmXBBorderOn',
|
| 702 |
+
'tmXBDataLeftF', 'tmXBDataRightF', 'tmXBFormat', 'tmXBIrrTensionF',
|
| 703 |
+
'tmXBIrregularPoints', 'tmXBLabelAngleF', 'tmXBLabelConstantSpacingF',
|
| 704 |
+
'tmXBLabelDeltaF', 'tmXBLabelDirection', 'tmXBLabelFont',
|
| 705 |
+
'tmXBLabelFontAspectF', 'tmXBLabelFontColor', 'tmXBLabelFontHeightF',
|
| 706 |
+
'tmXBLabelFontQuality', 'tmXBLabelFontThicknessF',
|
| 707 |
+
'tmXBLabelFuncCode', 'tmXBLabelJust', 'tmXBLabelStride', 'tmXBLabels',
|
| 708 |
+
'tmXBLabelsOn', 'tmXBMajorLengthF', 'tmXBMajorLineColor',
|
| 709 |
+
'tmXBMajorOutwardLengthF', 'tmXBMajorThicknessF', 'tmXBMaxLabelLenF',
|
| 710 |
+
'tmXBMaxTicks', 'tmXBMinLabelSpacingF', 'tmXBMinorLengthF',
|
| 711 |
+
'tmXBMinorLineColor', 'tmXBMinorOn', 'tmXBMinorOutwardLengthF',
|
| 712 |
+
'tmXBMinorPerMajor', 'tmXBMinorThicknessF', 'tmXBMinorValues',
|
| 713 |
+
'tmXBMode', 'tmXBOn', 'tmXBPrecision', 'tmXBStyle', 'tmXBTickEndF',
|
| 714 |
+
'tmXBTickSpacingF', 'tmXBTickStartF', 'tmXBValues', 'tmXMajorGrid',
|
| 715 |
+
'tmXMajorGridLineColor', 'tmXMajorGridLineDashPattern',
|
| 716 |
+
'tmXMajorGridThicknessF', 'tmXMinorGrid', 'tmXMinorGridLineColor',
|
| 717 |
+
'tmXMinorGridLineDashPattern', 'tmXMinorGridThicknessF',
|
| 718 |
+
'tmXTAutoPrecision', 'tmXTBorderOn', 'tmXTDataLeftF',
|
| 719 |
+
'tmXTDataRightF', 'tmXTFormat', 'tmXTIrrTensionF',
|
| 720 |
+
'tmXTIrregularPoints', 'tmXTLabelAngleF', 'tmXTLabelConstantSpacingF',
|
| 721 |
+
'tmXTLabelDeltaF', 'tmXTLabelDirection', 'tmXTLabelFont',
|
| 722 |
+
'tmXTLabelFontAspectF', 'tmXTLabelFontColor', 'tmXTLabelFontHeightF',
|
| 723 |
+
'tmXTLabelFontQuality', 'tmXTLabelFontThicknessF',
|
| 724 |
+
'tmXTLabelFuncCode', 'tmXTLabelJust', 'tmXTLabelStride', 'tmXTLabels',
|
| 725 |
+
'tmXTLabelsOn', 'tmXTMajorLengthF', 'tmXTMajorLineColor',
|
| 726 |
+
'tmXTMajorOutwardLengthF', 'tmXTMajorThicknessF', 'tmXTMaxLabelLenF',
|
| 727 |
+
'tmXTMaxTicks', 'tmXTMinLabelSpacingF', 'tmXTMinorLengthF',
|
| 728 |
+
'tmXTMinorLineColor', 'tmXTMinorOn', 'tmXTMinorOutwardLengthF',
|
| 729 |
+
'tmXTMinorPerMajor', 'tmXTMinorThicknessF', 'tmXTMinorValues',
|
| 730 |
+
'tmXTMode', 'tmXTOn', 'tmXTPrecision', 'tmXTStyle', 'tmXTTickEndF',
|
| 731 |
+
'tmXTTickSpacingF', 'tmXTTickStartF', 'tmXTValues', 'tmXUseBottom',
|
| 732 |
+
'tmYLAutoPrecision', 'tmYLBorderOn', 'tmYLDataBottomF',
|
| 733 |
+
'tmYLDataTopF', 'tmYLFormat', 'tmYLIrrTensionF',
|
| 734 |
+
'tmYLIrregularPoints', 'tmYLLabelAngleF', 'tmYLLabelConstantSpacingF',
|
| 735 |
+
'tmYLLabelDeltaF', 'tmYLLabelDirection', 'tmYLLabelFont',
|
| 736 |
+
'tmYLLabelFontAspectF', 'tmYLLabelFontColor', 'tmYLLabelFontHeightF',
|
| 737 |
+
'tmYLLabelFontQuality', 'tmYLLabelFontThicknessF',
|
| 738 |
+
'tmYLLabelFuncCode', 'tmYLLabelJust', 'tmYLLabelStride', 'tmYLLabels',
|
| 739 |
+
'tmYLLabelsOn', 'tmYLMajorLengthF', 'tmYLMajorLineColor',
|
| 740 |
+
'tmYLMajorOutwardLengthF', 'tmYLMajorThicknessF', 'tmYLMaxLabelLenF',
|
| 741 |
+
'tmYLMaxTicks', 'tmYLMinLabelSpacingF', 'tmYLMinorLengthF',
|
| 742 |
+
'tmYLMinorLineColor', 'tmYLMinorOn', 'tmYLMinorOutwardLengthF',
|
| 743 |
+
'tmYLMinorPerMajor', 'tmYLMinorThicknessF', 'tmYLMinorValues',
|
| 744 |
+
'tmYLMode', 'tmYLOn', 'tmYLPrecision', 'tmYLStyle', 'tmYLTickEndF',
|
| 745 |
+
'tmYLTickSpacingF', 'tmYLTickStartF', 'tmYLValues', 'tmYMajorGrid',
|
| 746 |
+
'tmYMajorGridLineColor', 'tmYMajorGridLineDashPattern',
|
| 747 |
+
'tmYMajorGridThicknessF', 'tmYMinorGrid', 'tmYMinorGridLineColor',
|
| 748 |
+
'tmYMinorGridLineDashPattern', 'tmYMinorGridThicknessF',
|
| 749 |
+
'tmYRAutoPrecision', 'tmYRBorderOn', 'tmYRDataBottomF',
|
| 750 |
+
'tmYRDataTopF', 'tmYRFormat', 'tmYRIrrTensionF',
|
| 751 |
+
'tmYRIrregularPoints', 'tmYRLabelAngleF', 'tmYRLabelConstantSpacingF',
|
| 752 |
+
'tmYRLabelDeltaF', 'tmYRLabelDirection', 'tmYRLabelFont',
|
| 753 |
+
'tmYRLabelFontAspectF', 'tmYRLabelFontColor', 'tmYRLabelFontHeightF',
|
| 754 |
+
'tmYRLabelFontQuality', 'tmYRLabelFontThicknessF',
|
| 755 |
+
'tmYRLabelFuncCode', 'tmYRLabelJust', 'tmYRLabelStride', 'tmYRLabels',
|
| 756 |
+
'tmYRLabelsOn', 'tmYRMajorLengthF', 'tmYRMajorLineColor',
|
| 757 |
+
'tmYRMajorOutwardLengthF', 'tmYRMajorThicknessF', 'tmYRMaxLabelLenF',
|
| 758 |
+
'tmYRMaxTicks', 'tmYRMinLabelSpacingF', 'tmYRMinorLengthF',
|
| 759 |
+
'tmYRMinorLineColor', 'tmYRMinorOn', 'tmYRMinorOutwardLengthF',
|
| 760 |
+
'tmYRMinorPerMajor', 'tmYRMinorThicknessF', 'tmYRMinorValues',
|
| 761 |
+
'tmYRMode', 'tmYROn', 'tmYRPrecision', 'tmYRStyle', 'tmYRTickEndF',
|
| 762 |
+
'tmYRTickSpacingF', 'tmYRTickStartF', 'tmYRValues', 'tmYUseLeft',
|
| 763 |
+
'trGridType', 'trLineInterpolationOn',
|
| 764 |
+
'trXAxisType', 'trXCoordPoints', 'trXInterPoints', 'trXLog',
|
| 765 |
+
'trXMaxF', 'trXMinF', 'trXReverse', 'trXSamples', 'trXTensionF',
|
| 766 |
+
'trYAxisType', 'trYCoordPoints', 'trYInterPoints', 'trYLog',
|
| 767 |
+
'trYMaxF', 'trYMinF', 'trYReverse', 'trYSamples', 'trYTensionF',
|
| 768 |
+
'txAngleF', 'txBackgroundFillColor', 'txConstantSpacingF', 'txDirection',
|
| 769 |
+
'txFont', 'HLU-Fonts', 'txFontAspectF', 'txFontColor',
|
| 770 |
+
'txFontHeightF', 'txFontOpacityF', 'txFontQuality',
|
| 771 |
+
'txFontThicknessF', 'txFuncCode', 'txJust', 'txPerimColor',
|
| 772 |
+
'txPerimDashLengthF', 'txPerimDashPattern', 'txPerimOn',
|
| 773 |
+
'txPerimSpaceF', 'txPerimThicknessF', 'txPosXF', 'txPosYF',
|
| 774 |
+
'txString', 'vcExplicitLabelBarLabelsOn', 'vcFillArrowEdgeColor',
|
| 775 |
+
'vcFillArrowEdgeThicknessF', 'vcFillArrowFillColor',
|
| 776 |
+
'vcFillArrowHeadInteriorXF', 'vcFillArrowHeadMinFracXF',
|
| 777 |
+
'vcFillArrowHeadMinFracYF', 'vcFillArrowHeadXF', 'vcFillArrowHeadYF',
|
| 778 |
+
'vcFillArrowMinFracWidthF', 'vcFillArrowWidthF', 'vcFillArrowsOn',
|
| 779 |
+
'vcFillOverEdge', 'vcGlyphOpacityF', 'vcGlyphStyle',
|
| 780 |
+
'vcLabelBarEndLabelsOn', 'vcLabelFontColor', 'vcLabelFontHeightF',
|
| 781 |
+
'vcLabelsOn', 'vcLabelsUseVectorColor', 'vcLevelColors',
|
| 782 |
+
'vcLevelCount', 'vcLevelPalette', 'vcLevelSelectionMode',
|
| 783 |
+
'vcLevelSpacingF', 'vcLevels', 'vcLineArrowColor',
|
| 784 |
+
'vcLineArrowHeadMaxSizeF', 'vcLineArrowHeadMinSizeF',
|
| 785 |
+
'vcLineArrowThicknessF', 'vcMagnitudeFormat',
|
| 786 |
+
'vcMagnitudeScaleFactorF', 'vcMagnitudeScaleValueF',
|
| 787 |
+
'vcMagnitudeScalingMode', 'vcMapDirection', 'vcMaxLevelCount',
|
| 788 |
+
'vcMaxLevelValF', 'vcMaxMagnitudeF', 'vcMinAnnoAngleF',
|
| 789 |
+
'vcMinAnnoArrowAngleF', 'vcMinAnnoArrowEdgeColor',
|
| 790 |
+
'vcMinAnnoArrowFillColor', 'vcMinAnnoArrowLineColor',
|
| 791 |
+
'vcMinAnnoArrowMinOffsetF', 'vcMinAnnoArrowSpaceF',
|
| 792 |
+
'vcMinAnnoArrowUseVecColor', 'vcMinAnnoBackgroundColor',
|
| 793 |
+
'vcMinAnnoConstantSpacingF', 'vcMinAnnoExplicitMagnitudeF',
|
| 794 |
+
'vcMinAnnoFont', 'vcMinAnnoFontAspectF', 'vcMinAnnoFontColor',
|
| 795 |
+
'vcMinAnnoFontHeightF', 'vcMinAnnoFontQuality',
|
| 796 |
+
'vcMinAnnoFontThicknessF', 'vcMinAnnoFuncCode', 'vcMinAnnoJust',
|
| 797 |
+
'vcMinAnnoOn', 'vcMinAnnoOrientation', 'vcMinAnnoOrthogonalPosF',
|
| 798 |
+
'vcMinAnnoParallelPosF', 'vcMinAnnoPerimColor', 'vcMinAnnoPerimOn',
|
| 799 |
+
'vcMinAnnoPerimSpaceF', 'vcMinAnnoPerimThicknessF', 'vcMinAnnoSide',
|
| 800 |
+
'vcMinAnnoString1', 'vcMinAnnoString1On', 'vcMinAnnoString2',
|
| 801 |
+
'vcMinAnnoString2On', 'vcMinAnnoTextDirection', 'vcMinAnnoZone',
|
| 802 |
+
'vcMinDistanceF', 'vcMinFracLengthF', 'vcMinLevelValF',
|
| 803 |
+
'vcMinMagnitudeF', 'vcMonoFillArrowEdgeColor',
|
| 804 |
+
'vcMonoFillArrowFillColor', 'vcMonoLineArrowColor',
|
| 805 |
+
'vcMonoWindBarbColor', 'vcNoDataLabelOn', 'vcNoDataLabelString',
|
| 806 |
+
'vcPositionMode', 'vcRefAnnoAngleF', 'vcRefAnnoArrowAngleF',
|
| 807 |
+
'vcRefAnnoArrowEdgeColor', 'vcRefAnnoArrowFillColor',
|
| 808 |
+
'vcRefAnnoArrowLineColor', 'vcRefAnnoArrowMinOffsetF',
|
| 809 |
+
'vcRefAnnoArrowSpaceF', 'vcRefAnnoArrowUseVecColor',
|
| 810 |
+
'vcRefAnnoBackgroundColor', 'vcRefAnnoConstantSpacingF',
|
| 811 |
+
'vcRefAnnoExplicitMagnitudeF', 'vcRefAnnoFont',
|
| 812 |
+
'vcRefAnnoFontAspectF', 'vcRefAnnoFontColor', 'vcRefAnnoFontHeightF',
|
| 813 |
+
'vcRefAnnoFontQuality', 'vcRefAnnoFontThicknessF',
|
| 814 |
+
'vcRefAnnoFuncCode', 'vcRefAnnoJust', 'vcRefAnnoOn',
|
| 815 |
+
'vcRefAnnoOrientation', 'vcRefAnnoOrthogonalPosF',
|
| 816 |
+
'vcRefAnnoParallelPosF', 'vcRefAnnoPerimColor', 'vcRefAnnoPerimOn',
|
| 817 |
+
'vcRefAnnoPerimSpaceF', 'vcRefAnnoPerimThicknessF', 'vcRefAnnoSide',
|
| 818 |
+
'vcRefAnnoString1', 'vcRefAnnoString1On', 'vcRefAnnoString2',
|
| 819 |
+
'vcRefAnnoString2On', 'vcRefAnnoTextDirection', 'vcRefAnnoZone',
|
| 820 |
+
'vcRefLengthF', 'vcRefMagnitudeF', 'vcScalarFieldData',
|
| 821 |
+
'vcScalarMissingValColor', 'vcScalarValueFormat',
|
| 822 |
+
'vcScalarValueScaleFactorF', 'vcScalarValueScaleValueF',
|
| 823 |
+
'vcScalarValueScalingMode', 'vcSpanLevelPalette', 'vcUseRefAnnoRes',
|
| 824 |
+
'vcUseScalarArray', 'vcVectorDrawOrder', 'vcVectorFieldData',
|
| 825 |
+
'vcWindBarbCalmCircleSizeF', 'vcWindBarbColor',
|
| 826 |
+
'vcWindBarbLineThicknessF', 'vcWindBarbScaleFactorF',
|
| 827 |
+
'vcWindBarbTickAngleF', 'vcWindBarbTickLengthF',
|
| 828 |
+
'vcWindBarbTickSpacingF', 'vcZeroFLabelAngleF',
|
| 829 |
+
'vcZeroFLabelBackgroundColor', 'vcZeroFLabelConstantSpacingF',
|
| 830 |
+
'vcZeroFLabelFont', 'vcZeroFLabelFontAspectF',
|
| 831 |
+
'vcZeroFLabelFontColor', 'vcZeroFLabelFontHeightF',
|
| 832 |
+
'vcZeroFLabelFontQuality', 'vcZeroFLabelFontThicknessF',
|
| 833 |
+
'vcZeroFLabelFuncCode', 'vcZeroFLabelJust', 'vcZeroFLabelOn',
|
| 834 |
+
'vcZeroFLabelOrthogonalPosF', 'vcZeroFLabelParallelPosF',
|
| 835 |
+
'vcZeroFLabelPerimColor', 'vcZeroFLabelPerimOn',
|
| 836 |
+
'vcZeroFLabelPerimSpaceF', 'vcZeroFLabelPerimThicknessF',
|
| 837 |
+
'vcZeroFLabelSide', 'vcZeroFLabelString', 'vcZeroFLabelTextDirection',
|
| 838 |
+
'vcZeroFLabelZone', 'vfCopyData', 'vfDataArray',
|
| 839 |
+
'vfExchangeDimensions', 'vfExchangeUVData', 'vfMagMaxV', 'vfMagMinV',
|
| 840 |
+
'vfMissingUValueV', 'vfMissingVValueV', 'vfPolarData',
|
| 841 |
+
'vfSingleMissingValue', 'vfUDataArray', 'vfUMaxV', 'vfUMinV',
|
| 842 |
+
'vfVDataArray', 'vfVMaxV', 'vfVMinV', 'vfXArray', 'vfXCActualEndF',
|
| 843 |
+
'vfXCActualStartF', 'vfXCEndIndex', 'vfXCEndSubsetV', 'vfXCEndV',
|
| 844 |
+
'vfXCStartIndex', 'vfXCStartSubsetV', 'vfXCStartV', 'vfXCStride',
|
| 845 |
+
'vfYArray', 'vfYCActualEndF', 'vfYCActualStartF', 'vfYCEndIndex',
|
| 846 |
+
'vfYCEndSubsetV', 'vfYCEndV', 'vfYCStartIndex', 'vfYCStartSubsetV',
|
| 847 |
+
'vfYCStartV', 'vfYCStride', 'vpAnnoManagerId', 'vpClipOn',
|
| 848 |
+
'vpHeightF', 'vpKeepAspect', 'vpOn', 'vpUseSegments', 'vpWidthF',
|
| 849 |
+
'vpXF', 'vpYF', 'wkAntiAlias', 'wkBackgroundColor', 'wkBackgroundOpacityF',
|
| 850 |
+
'wkColorMapLen', 'wkColorMap', 'wkColorModel', 'wkDashTableLength',
|
| 851 |
+
'wkDefGraphicStyleId', 'wkDeviceLowerX', 'wkDeviceLowerY',
|
| 852 |
+
'wkDeviceUpperX', 'wkDeviceUpperY', 'wkFileName', 'wkFillTableLength',
|
| 853 |
+
'wkForegroundColor', 'wkFormat', 'wkFullBackground', 'wkGksWorkId',
|
| 854 |
+
'wkHeight', 'wkMarkerTableLength', 'wkMetaName', 'wkOrientation',
|
| 855 |
+
'wkPDFFileName', 'wkPDFFormat', 'wkPDFResolution', 'wkPSFileName',
|
| 856 |
+
'wkPSFormat', 'wkPSResolution', 'wkPaperHeightF', 'wkPaperSize',
|
| 857 |
+
'wkPaperWidthF', 'wkPause', 'wkTopLevelViews', 'wkViews',
|
| 858 |
+
'wkVisualType', 'wkWidth', 'wkWindowId', 'wkXColorMode', 'wsCurrentSize',
|
| 859 |
+
'wsMaximumSize', 'wsThresholdSize', 'xyComputeXMax',
|
| 860 |
+
'xyComputeXMin', 'xyComputeYMax', 'xyComputeYMin', 'xyCoordData',
|
| 861 |
+
'xyCoordDataSpec', 'xyCurveDrawOrder', 'xyDashPattern',
|
| 862 |
+
'xyDashPatterns', 'xyExplicitLabels', 'xyExplicitLegendLabels',
|
| 863 |
+
'xyLabelMode', 'xyLineColor', 'xyLineColors', 'xyLineDashSegLenF',
|
| 864 |
+
'xyLineLabelConstantSpacingF', 'xyLineLabelFont',
|
| 865 |
+
'xyLineLabelFontAspectF', 'xyLineLabelFontColor',
|
| 866 |
+
'xyLineLabelFontColors', 'xyLineLabelFontHeightF',
|
| 867 |
+
'xyLineLabelFontQuality', 'xyLineLabelFontThicknessF',
|
| 868 |
+
'xyLineLabelFuncCode', 'xyLineThicknessF', 'xyLineThicknesses',
|
| 869 |
+
'xyMarkLineMode', 'xyMarkLineModes', 'xyMarker', 'xyMarkerColor',
|
| 870 |
+
'xyMarkerColors', 'xyMarkerSizeF', 'xyMarkerSizes',
|
| 871 |
+
'xyMarkerThicknessF', 'xyMarkerThicknesses', 'xyMarkers',
|
| 872 |
+
'xyMonoDashPattern', 'xyMonoLineColor', 'xyMonoLineLabelFontColor',
|
| 873 |
+
'xyMonoLineThickness', 'xyMonoMarkLineMode', 'xyMonoMarker',
|
| 874 |
+
'xyMonoMarkerColor', 'xyMonoMarkerSize', 'xyMonoMarkerThickness',
|
| 875 |
+
'xyXIrrTensionF', 'xyXIrregularPoints', 'xyXStyle', 'xyYIrrTensionF',
|
| 876 |
+
'xyYIrregularPoints', 'xyYStyle'), prefix=r'\b'),
|
| 877 |
+
Name.Builtin),
|
| 878 |
+
|
| 879 |
+
# Booleans
|
| 880 |
+
(r'\.(True|False)\.', Name.Builtin),
|
| 881 |
+
# Comparing Operators
|
| 882 |
+
(r'\.(eq|ne|lt|le|gt|ge|not|and|or|xor)\.', Operator.Word),
|
| 883 |
+
],
|
| 884 |
+
|
| 885 |
+
'strings': [
|
| 886 |
+
(r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
|
| 887 |
+
],
|
| 888 |
+
|
| 889 |
+
'nums': [
|
| 890 |
+
(r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer),
|
| 891 |
+
(r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
|
| 892 |
+
(r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float),
|
| 893 |
+
],
|
| 894 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/nimrod.py
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.nimrod
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the Nim language (formerly known as Nimrod).
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include, default, bygroups
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation, Error
|
| 16 |
+
|
| 17 |
+
__all__ = ['NimrodLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class NimrodLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
For Nim source code.
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
name = 'Nimrod'
|
| 26 |
+
url = 'http://nim-lang.org/'
|
| 27 |
+
aliases = ['nimrod', 'nim']
|
| 28 |
+
filenames = ['*.nim', '*.nimrod']
|
| 29 |
+
mimetypes = ['text/x-nim']
|
| 30 |
+
version_added = '1.5'
|
| 31 |
+
|
| 32 |
+
flags = re.MULTILINE | re.IGNORECASE
|
| 33 |
+
|
| 34 |
+
def underscorize(words):
|
| 35 |
+
newWords = []
|
| 36 |
+
new = []
|
| 37 |
+
for word in words:
|
| 38 |
+
for ch in word:
|
| 39 |
+
new.append(ch)
|
| 40 |
+
new.append("_?")
|
| 41 |
+
newWords.append(''.join(new))
|
| 42 |
+
new = []
|
| 43 |
+
return "|".join(newWords)
|
| 44 |
+
|
| 45 |
+
keywords = [
|
| 46 |
+
'addr', 'and', 'as', 'asm', 'bind', 'block', 'break', 'case',
|
| 47 |
+
'cast', 'concept', 'const', 'continue', 'converter', 'defer', 'discard',
|
| 48 |
+
'distinct', 'div', 'do', 'elif', 'else', 'end', 'enum', 'except',
|
| 49 |
+
'export', 'finally', 'for', 'if', 'in', 'yield', 'interface',
|
| 50 |
+
'is', 'isnot', 'iterator', 'let', 'mixin', 'mod',
|
| 51 |
+
'not', 'notin', 'object', 'of', 'or', 'out', 'ptr', 'raise',
|
| 52 |
+
'ref', 'return', 'shl', 'shr', 'static', 'try',
|
| 53 |
+
'tuple', 'type', 'using', 'when', 'while', 'xor'
|
| 54 |
+
]
|
| 55 |
+
|
| 56 |
+
keywordsPseudo = [
|
| 57 |
+
'nil', 'true', 'false'
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
opWords = [
|
| 61 |
+
'and', 'or', 'not', 'xor', 'shl', 'shr', 'div', 'mod', 'in',
|
| 62 |
+
'notin', 'is', 'isnot'
|
| 63 |
+
]
|
| 64 |
+
|
| 65 |
+
types = [
|
| 66 |
+
'int', 'int8', 'int16', 'int32', 'int64', 'float', 'float32', 'float64',
|
| 67 |
+
'bool', 'char', 'range', 'array', 'seq', 'set', 'string'
|
| 68 |
+
]
|
| 69 |
+
|
| 70 |
+
tokens = {
|
| 71 |
+
'root': [
|
| 72 |
+
# Comments
|
| 73 |
+
(r'##\[', String.Doc, 'doccomment'),
|
| 74 |
+
(r'##.*$', String.Doc),
|
| 75 |
+
(r'#\[', Comment.Multiline, 'comment'),
|
| 76 |
+
(r'#.*$', Comment),
|
| 77 |
+
|
| 78 |
+
# Pragmas
|
| 79 |
+
(r'\{\.', String.Other, 'pragma'),
|
| 80 |
+
|
| 81 |
+
# Operators
|
| 82 |
+
(r'[*=><+\-/@$~&%!?|\\\[\]]', Operator),
|
| 83 |
+
(r'\.\.|\.|,|\[\.|\.\]|\{\.|\.\}|\(\.|\.\)|\{|\}|\(|\)|:|\^|`|;',
|
| 84 |
+
Punctuation),
|
| 85 |
+
|
| 86 |
+
# Case statement branch
|
| 87 |
+
(r'(\n\s*)(of)(\s)', bygroups(Text.Whitespace, Keyword,
|
| 88 |
+
Text.Whitespace), 'casebranch'),
|
| 89 |
+
|
| 90 |
+
# Strings
|
| 91 |
+
(r'(?:[\w]+)"', String, 'rdqs'),
|
| 92 |
+
(r'"""', String.Double, 'tdqs'),
|
| 93 |
+
('"', String, 'dqs'),
|
| 94 |
+
|
| 95 |
+
# Char
|
| 96 |
+
("'", String.Char, 'chars'),
|
| 97 |
+
|
| 98 |
+
# Keywords
|
| 99 |
+
(rf'({underscorize(opWords)})\b', Operator.Word),
|
| 100 |
+
(r'(proc|func|method|macro|template)(\s)(?![(\[\]])',
|
| 101 |
+
bygroups(Keyword, Text.Whitespace), 'funcname'),
|
| 102 |
+
(rf'({underscorize(keywords)})\b', Keyword),
|
| 103 |
+
(r'({})\b'.format(underscorize(['from', 'import', 'include', 'export'])),
|
| 104 |
+
Keyword.Namespace),
|
| 105 |
+
(r'(v_?a_?r)\b', Keyword.Declaration),
|
| 106 |
+
(rf'({underscorize(types)})\b', Name.Builtin),
|
| 107 |
+
(rf'({underscorize(keywordsPseudo)})\b', Keyword.Pseudo),
|
| 108 |
+
|
| 109 |
+
# Identifiers
|
| 110 |
+
(r'\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*', Name),
|
| 111 |
+
|
| 112 |
+
# Numbers
|
| 113 |
+
(r'[0-9][0-9_]*(?=([e.]|\'f(32|64)))',
|
| 114 |
+
Number.Float, ('float-suffix', 'float-number')),
|
| 115 |
+
(r'0x[a-f0-9][a-f0-9_]*', Number.Hex, 'int-suffix'),
|
| 116 |
+
(r'0b[01][01_]*', Number.Bin, 'int-suffix'),
|
| 117 |
+
(r'0o[0-7][0-7_]*', Number.Oct, 'int-suffix'),
|
| 118 |
+
(r'[0-9][0-9_]*', Number.Integer, 'int-suffix'),
|
| 119 |
+
|
| 120 |
+
# Whitespace
|
| 121 |
+
(r'\s+', Text.Whitespace),
|
| 122 |
+
(r'.+$', Error),
|
| 123 |
+
],
|
| 124 |
+
'chars': [
|
| 125 |
+
(r'\\([\\abcefnrtvl"\']|x[a-f0-9]{2}|[0-9]{1,3})', String.Escape),
|
| 126 |
+
(r"'", String.Char, '#pop'),
|
| 127 |
+
(r".", String.Char)
|
| 128 |
+
],
|
| 129 |
+
'strings': [
|
| 130 |
+
(r'(?<!\$)\$(\d+|#|\w+)+', String.Interpol),
|
| 131 |
+
(r'[^\\\'"$\n]+', String),
|
| 132 |
+
# quotes, dollars and backslashes must be parsed one at a time
|
| 133 |
+
(r'[\'"\\]', String),
|
| 134 |
+
# unhandled string formatting sign
|
| 135 |
+
(r'\$', String)
|
| 136 |
+
# newlines are an error (use "nl" state)
|
| 137 |
+
],
|
| 138 |
+
'doccomment': [
|
| 139 |
+
(r'[^\]#]+', String.Doc),
|
| 140 |
+
(r'##\[', String.Doc, '#push'),
|
| 141 |
+
(r'\]##', String.Doc, '#pop'),
|
| 142 |
+
(r'[\]#]', String.Doc),
|
| 143 |
+
],
|
| 144 |
+
'comment': [
|
| 145 |
+
(r'[^\]#]+', Comment.Multiline),
|
| 146 |
+
(r'#\[', Comment.Multiline, '#push'),
|
| 147 |
+
(r'\]#', Comment.Multiline, '#pop'),
|
| 148 |
+
(r'[\]#]', Comment.Multiline),
|
| 149 |
+
],
|
| 150 |
+
'dqs': [
|
| 151 |
+
(r'\\([\\abcefnrtvl"\']|\n|x[a-f0-9]{2}|[0-9]{1,3})',
|
| 152 |
+
String.Escape),
|
| 153 |
+
(r'"', String, '#pop'),
|
| 154 |
+
include('strings')
|
| 155 |
+
],
|
| 156 |
+
'rdqs': [
|
| 157 |
+
(r'"(?!")', String, '#pop'),
|
| 158 |
+
(r'""', String.Escape),
|
| 159 |
+
include('strings')
|
| 160 |
+
],
|
| 161 |
+
'tdqs': [
|
| 162 |
+
(r'"""', String.Double, '#pop'),
|
| 163 |
+
include('strings'),
|
| 164 |
+
(r'\n', String.Double)
|
| 165 |
+
],
|
| 166 |
+
'funcname': [
|
| 167 |
+
(r'((?![\d_])\w)(((?!_)\w)|(_(?!_)\w))*', Name.Function, '#pop'),
|
| 168 |
+
(r'`.+`', Name.Function, '#pop')
|
| 169 |
+
],
|
| 170 |
+
'nl': [
|
| 171 |
+
(r'\n', String)
|
| 172 |
+
],
|
| 173 |
+
'float-number': [
|
| 174 |
+
(r'\.(?!\.)[0-9_]*[f]*', Number.Float),
|
| 175 |
+
(r'e[+-]?[0-9][0-9_]*', Number.Float),
|
| 176 |
+
default('#pop')
|
| 177 |
+
],
|
| 178 |
+
'float-suffix': [
|
| 179 |
+
(r'\'f(32|64)', Number.Float),
|
| 180 |
+
default('#pop')
|
| 181 |
+
],
|
| 182 |
+
'int-suffix': [
|
| 183 |
+
(r'\'i(32|64)', Number.Integer.Long),
|
| 184 |
+
(r'\'i(8|16)', Number.Integer),
|
| 185 |
+
default('#pop')
|
| 186 |
+
],
|
| 187 |
+
'casebranch': [
|
| 188 |
+
(r',', Punctuation),
|
| 189 |
+
(r'[\n ]+', Text.Whitespace),
|
| 190 |
+
(r':', Operator, '#pop'),
|
| 191 |
+
(r'\w+|[^:]', Name.Label),
|
| 192 |
+
],
|
| 193 |
+
'pragma': [
|
| 194 |
+
(r'[:,]', Text),
|
| 195 |
+
(r'[\n ]+', Text.Whitespace),
|
| 196 |
+
(r'\.\}', String.Other, '#pop'),
|
| 197 |
+
(r'\w+|\W+|[^.}]', String.Other),
|
| 198 |
+
],
|
| 199 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/nit.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.nit
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the Nit language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, words
|
| 12 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 13 |
+
Number, Punctuation
|
| 14 |
+
|
| 15 |
+
__all__ = ['NitLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class NitLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For nit source.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
name = 'Nit'
|
| 24 |
+
url = 'http://nitlanguage.org'
|
| 25 |
+
aliases = ['nit']
|
| 26 |
+
filenames = ['*.nit']
|
| 27 |
+
version_added = '2.0'
|
| 28 |
+
tokens = {
|
| 29 |
+
'root': [
|
| 30 |
+
(r'#.*?$', Comment.Single),
|
| 31 |
+
(words((
|
| 32 |
+
'package', 'module', 'import', 'class', 'abstract', 'interface',
|
| 33 |
+
'universal', 'enum', 'end', 'fun', 'type', 'init', 'redef',
|
| 34 |
+
'isa', 'do', 'readable', 'writable', 'var', 'intern', 'extern',
|
| 35 |
+
'public', 'protected', 'private', 'intrude', 'if', 'then',
|
| 36 |
+
'else', 'while', 'loop', 'for', 'in', 'and', 'or', 'not',
|
| 37 |
+
'implies', 'return', 'continue', 'break', 'abort', 'assert',
|
| 38 |
+
'new', 'is', 'once', 'super', 'self', 'true', 'false', 'nullable',
|
| 39 |
+
'null', 'as', 'isset', 'label', '__debug__'), suffix=r'(?=[\r\n\t( ])'),
|
| 40 |
+
Keyword),
|
| 41 |
+
(r'[A-Z]\w*', Name.Class),
|
| 42 |
+
(r'"""(([^\'\\]|\\.)|\\r|\\n)*((\{\{?)?(""?\{\{?)*""""*)', String), # Simple long string
|
| 43 |
+
(r'\'\'\'(((\\.|[^\'\\])|\\r|\\n)|\'((\\.|[^\'\\])|\\r|\\n)|'
|
| 44 |
+
r'\'\'((\\.|[^\'\\])|\\r|\\n))*\'\'\'', String), # Simple long string alt
|
| 45 |
+
(r'"""(([^\'\\]|\\.)|\\r|\\n)*((""?)?(\{\{?""?)*\{\{\{\{*)', String), # Start long string
|
| 46 |
+
(r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(""?)?(\{\{?""?)*\{\{\{\{*', String), # Mid long string
|
| 47 |
+
(r'\}\}\}(((\\.|[^\'\\])|\\r|\\n))*(\{\{?)?(""?\{\{?)*""""*', String), # End long string
|
| 48 |
+
(r'"(\\.|([^"}{\\]))*"', String), # Simple String
|
| 49 |
+
(r'"(\\.|([^"}{\\]))*\{', String), # Start string
|
| 50 |
+
(r'\}(\\.|([^"}{\\]))*\{', String), # Mid String
|
| 51 |
+
(r'\}(\\.|([^"}{\\]))*"', String), # End String
|
| 52 |
+
(r'(\'[^\'\\]\')|(\'\\.\')', String.Char),
|
| 53 |
+
(r'[0-9]+', Number.Integer),
|
| 54 |
+
(r'[0-9]*.[0-9]+', Number.Float),
|
| 55 |
+
(r'0(x|X)[0-9A-Fa-f]+', Number.Hex),
|
| 56 |
+
(r'[a-z]\w*', Name),
|
| 57 |
+
(r'_\w+', Name.Variable.Instance),
|
| 58 |
+
(r'==|!=|<==>|>=|>>|>|<=|<<|<|\+|-|=|/|\*|%|\+=|-=|!|@', Operator),
|
| 59 |
+
(r'\(|\)|\[|\]|,|\.\.\.|\.\.|\.|::|:', Punctuation),
|
| 60 |
+
(r'`\{[^`]*`\}', Text), # Extern blocks won't be Lexed by Nit
|
| 61 |
+
(r'[\r\n\t ]+', Text),
|
| 62 |
+
],
|
| 63 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/nix.py
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.nix
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the NixOS Nix language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation, Literal
|
| 16 |
+
|
| 17 |
+
__all__ = ['NixLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class NixLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
For the Nix language.
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
name = 'Nix'
|
| 26 |
+
url = 'http://nixos.org/nix/'
|
| 27 |
+
aliases = ['nixos', 'nix']
|
| 28 |
+
filenames = ['*.nix']
|
| 29 |
+
mimetypes = ['text/x-nix']
|
| 30 |
+
version_added = '2.0'
|
| 31 |
+
|
| 32 |
+
keywords = ['rec', 'with', 'let', 'in', 'inherit', 'assert', 'if',
|
| 33 |
+
'else', 'then', '...']
|
| 34 |
+
builtins = ['import', 'abort', 'baseNameOf', 'dirOf', 'isNull', 'builtins',
|
| 35 |
+
'map', 'removeAttrs', 'throw', 'toString', 'derivation']
|
| 36 |
+
operators = ['++', '+', '?', '.', '!', '//', '==', '/',
|
| 37 |
+
'!=', '&&', '||', '->', '=', '<', '>', '*', '-']
|
| 38 |
+
|
| 39 |
+
punctuations = ["(", ")", "[", "]", ";", "{", "}", ":", ",", "@"]
|
| 40 |
+
|
| 41 |
+
tokens = {
|
| 42 |
+
'root': [
|
| 43 |
+
# comments starting with #
|
| 44 |
+
(r'#.*$', Comment.Single),
|
| 45 |
+
|
| 46 |
+
# multiline comments
|
| 47 |
+
(r'/\*', Comment.Multiline, 'comment'),
|
| 48 |
+
|
| 49 |
+
# whitespace
|
| 50 |
+
(r'\s+', Text),
|
| 51 |
+
|
| 52 |
+
# keywords
|
| 53 |
+
('({})'.format('|'.join(re.escape(entry) + '\\b' for entry in keywords)), Keyword),
|
| 54 |
+
|
| 55 |
+
# highlight the builtins
|
| 56 |
+
('({})'.format('|'.join(re.escape(entry) + '\\b' for entry in builtins)),
|
| 57 |
+
Name.Builtin),
|
| 58 |
+
|
| 59 |
+
(r'\b(true|false|null)\b', Name.Constant),
|
| 60 |
+
|
| 61 |
+
# floats
|
| 62 |
+
(r'-?(\d+\.\d*|\.\d+)([eE][-+]?\d+)?', Number.Float),
|
| 63 |
+
|
| 64 |
+
# integers
|
| 65 |
+
(r'-?[0-9]+', Number.Integer),
|
| 66 |
+
|
| 67 |
+
# paths
|
| 68 |
+
(r'[\w.+-]*(\/[\w.+-]+)+', Literal),
|
| 69 |
+
(r'~(\/[\w.+-]+)+', Literal),
|
| 70 |
+
(r'\<[\w.+-]+(\/[\w.+-]+)*\>', Literal),
|
| 71 |
+
|
| 72 |
+
# operators
|
| 73 |
+
('({})'.format('|'.join(re.escape(entry) for entry in operators)),
|
| 74 |
+
Operator),
|
| 75 |
+
|
| 76 |
+
# word operators
|
| 77 |
+
(r'\b(or|and)\b', Operator.Word),
|
| 78 |
+
|
| 79 |
+
(r'\{', Punctuation, 'block'),
|
| 80 |
+
|
| 81 |
+
# punctuations
|
| 82 |
+
('({})'.format('|'.join(re.escape(entry) for entry in punctuations)), Punctuation),
|
| 83 |
+
|
| 84 |
+
# strings
|
| 85 |
+
(r'"', String.Double, 'doublequote'),
|
| 86 |
+
(r"''", String.Multiline, 'multiline'),
|
| 87 |
+
|
| 88 |
+
# urls
|
| 89 |
+
(r'[a-zA-Z][a-zA-Z0-9\+\-\.]*\:[\w%/?:@&=+$,\\.!~*\'-]+', Literal),
|
| 90 |
+
|
| 91 |
+
# names of variables
|
| 92 |
+
(r'[\w-]+(?=\s*=)', String.Symbol),
|
| 93 |
+
(r'[a-zA-Z_][\w\'-]*', Text),
|
| 94 |
+
|
| 95 |
+
(r"\$\{", String.Interpol, 'antiquote'),
|
| 96 |
+
],
|
| 97 |
+
'comment': [
|
| 98 |
+
(r'[^/*]+', Comment.Multiline),
|
| 99 |
+
(r'/\*', Comment.Multiline, '#push'),
|
| 100 |
+
(r'\*/', Comment.Multiline, '#pop'),
|
| 101 |
+
(r'[*/]', Comment.Multiline),
|
| 102 |
+
],
|
| 103 |
+
'multiline': [
|
| 104 |
+
(r"''(\$|'|\\n|\\r|\\t|\\)", String.Escape),
|
| 105 |
+
(r"''", String.Multiline, '#pop'),
|
| 106 |
+
(r'\$\{', String.Interpol, 'antiquote'),
|
| 107 |
+
(r"[^'\$]+", String.Multiline),
|
| 108 |
+
(r"\$[^\{']", String.Multiline),
|
| 109 |
+
(r"'[^']", String.Multiline),
|
| 110 |
+
(r"\$(?=')", String.Multiline),
|
| 111 |
+
],
|
| 112 |
+
'doublequote': [
|
| 113 |
+
(r'\\(\\|"|\$|n)', String.Escape),
|
| 114 |
+
(r'"', String.Double, '#pop'),
|
| 115 |
+
(r'\$\{', String.Interpol, 'antiquote'),
|
| 116 |
+
(r'[^"\\\$]+', String.Double),
|
| 117 |
+
(r'\$[^\{"]', String.Double),
|
| 118 |
+
(r'\$(?=")', String.Double),
|
| 119 |
+
(r'\\', String.Double),
|
| 120 |
+
],
|
| 121 |
+
'antiquote': [
|
| 122 |
+
(r"\}", String.Interpol, '#pop'),
|
| 123 |
+
# TODO: we should probably escape also here ''${ \${
|
| 124 |
+
(r"\$\{", String.Interpol, '#push'),
|
| 125 |
+
include('root'),
|
| 126 |
+
],
|
| 127 |
+
'block': [
|
| 128 |
+
(r"\}", Punctuation, '#pop'),
|
| 129 |
+
include('root'),
|
| 130 |
+
],
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
def analyse_text(text):
|
| 134 |
+
rv = 0.0
|
| 135 |
+
# TODO: let/in
|
| 136 |
+
if re.search(r'import.+?<[^>]+>', text):
|
| 137 |
+
rv += 0.4
|
| 138 |
+
if re.search(r'mkDerivation\s+(\(|\{|rec)', text):
|
| 139 |
+
rv += 0.4
|
| 140 |
+
if re.search(r'=\s+mkIf\s+', text):
|
| 141 |
+
rv += 0.4
|
| 142 |
+
if re.search(r'\{[a-zA-Z,\s]+\}:', text):
|
| 143 |
+
rv += 0.1
|
| 144 |
+
return rv
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/numbair.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.numbair
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for other Numba Intermediate Representation.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, include, bygroups, words
|
| 12 |
+
from pygments.token import Whitespace, Name, String, Punctuation, Keyword, \
|
| 13 |
+
Operator, Number
|
| 14 |
+
|
| 15 |
+
__all__ = ["NumbaIRLexer"]
|
| 16 |
+
|
| 17 |
+
class NumbaIRLexer(RegexLexer):
|
| 18 |
+
"""
|
| 19 |
+
Lexer for Numba IR
|
| 20 |
+
"""
|
| 21 |
+
name = 'Numba_IR'
|
| 22 |
+
url = "https://numba.readthedocs.io/en/stable/developer/architecture.html#stage-2-generate-the-numba-ir"
|
| 23 |
+
aliases = ['numba_ir', 'numbair']
|
| 24 |
+
filenames = ['*.numba_ir']
|
| 25 |
+
mimetypes = ['text/x-numba_ir', 'text/x-numbair']
|
| 26 |
+
version_added = '2.19'
|
| 27 |
+
|
| 28 |
+
identifier = r'\$[a-zA-Z0-9._]+'
|
| 29 |
+
fun_or_var = r'([a-zA-Z_]+[a-zA-Z0-9]*)'
|
| 30 |
+
|
| 31 |
+
tokens = {
|
| 32 |
+
'root' : [
|
| 33 |
+
(r'(label)(\ [0-9]+)(:)$',
|
| 34 |
+
bygroups(Keyword, Name.Label, Punctuation)),
|
| 35 |
+
|
| 36 |
+
(r'=', Operator),
|
| 37 |
+
include('whitespace'),
|
| 38 |
+
include('keyword'),
|
| 39 |
+
|
| 40 |
+
(identifier, Name.Variable),
|
| 41 |
+
(fun_or_var + r'(\()',
|
| 42 |
+
bygroups(Name.Function, Punctuation)),
|
| 43 |
+
(fun_or_var + r'(\=)',
|
| 44 |
+
bygroups(Name.Attribute, Punctuation)),
|
| 45 |
+
(fun_or_var, Name.Constant),
|
| 46 |
+
(r'[0-9]+', Number),
|
| 47 |
+
|
| 48 |
+
# <built-in function some>
|
| 49 |
+
(r'<[^>\n]*>', String),
|
| 50 |
+
|
| 51 |
+
(r'[=<>{}\[\]()*.,!\':]|x\b', Punctuation)
|
| 52 |
+
],
|
| 53 |
+
|
| 54 |
+
'keyword':[
|
| 55 |
+
(words((
|
| 56 |
+
'del', 'jump', 'call', 'branch',
|
| 57 |
+
), suffix=' '), Keyword),
|
| 58 |
+
],
|
| 59 |
+
|
| 60 |
+
'whitespace': [
|
| 61 |
+
(r'(\n|\s)+', Whitespace),
|
| 62 |
+
],
|
| 63 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/oberon.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.oberon
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Oberon family languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include, words
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation
|
| 16 |
+
|
| 17 |
+
__all__ = ['ComponentPascalLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class ComponentPascalLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
For Component Pascal source code.
|
| 23 |
+
"""
|
| 24 |
+
name = 'Component Pascal'
|
| 25 |
+
aliases = ['componentpascal', 'cp']
|
| 26 |
+
filenames = ['*.cp', '*.cps']
|
| 27 |
+
mimetypes = ['text/x-component-pascal']
|
| 28 |
+
url = 'https://blackboxframework.org'
|
| 29 |
+
version_added = '2.1'
|
| 30 |
+
|
| 31 |
+
flags = re.MULTILINE | re.DOTALL
|
| 32 |
+
|
| 33 |
+
tokens = {
|
| 34 |
+
'root': [
|
| 35 |
+
include('whitespace'),
|
| 36 |
+
include('comments'),
|
| 37 |
+
include('punctuation'),
|
| 38 |
+
include('numliterals'),
|
| 39 |
+
include('strings'),
|
| 40 |
+
include('operators'),
|
| 41 |
+
include('builtins'),
|
| 42 |
+
include('identifiers'),
|
| 43 |
+
],
|
| 44 |
+
'whitespace': [
|
| 45 |
+
(r'\n+', Text), # blank lines
|
| 46 |
+
(r'\s+', Text), # whitespace
|
| 47 |
+
],
|
| 48 |
+
'comments': [
|
| 49 |
+
(r'\(\*([^$].*?)\*\)', Comment.Multiline),
|
| 50 |
+
# TODO: nested comments (* (* ... *) ... (* ... *) *) not supported!
|
| 51 |
+
],
|
| 52 |
+
'punctuation': [
|
| 53 |
+
(r'[()\[\]{},.:;|]', Punctuation),
|
| 54 |
+
],
|
| 55 |
+
'numliterals': [
|
| 56 |
+
(r'[0-9A-F]+X\b', Number.Hex), # char code
|
| 57 |
+
(r'[0-9A-F]+[HL]\b', Number.Hex), # hexadecimal number
|
| 58 |
+
(r'[0-9]+\.[0-9]+E[+-][0-9]+', Number.Float), # real number
|
| 59 |
+
(r'[0-9]+\.[0-9]+', Number.Float), # real number
|
| 60 |
+
(r'[0-9]+', Number.Integer), # decimal whole number
|
| 61 |
+
],
|
| 62 |
+
'strings': [
|
| 63 |
+
(r"'[^\n']*'", String), # single quoted string
|
| 64 |
+
(r'"[^\n"]*"', String), # double quoted string
|
| 65 |
+
],
|
| 66 |
+
'operators': [
|
| 67 |
+
# Arithmetic Operators
|
| 68 |
+
(r'[+-]', Operator),
|
| 69 |
+
(r'[*/]', Operator),
|
| 70 |
+
# Relational Operators
|
| 71 |
+
(r'[=#<>]', Operator),
|
| 72 |
+
# Dereferencing Operator
|
| 73 |
+
(r'\^', Operator),
|
| 74 |
+
# Logical AND Operator
|
| 75 |
+
(r'&', Operator),
|
| 76 |
+
# Logical NOT Operator
|
| 77 |
+
(r'~', Operator),
|
| 78 |
+
# Assignment Symbol
|
| 79 |
+
(r':=', Operator),
|
| 80 |
+
# Range Constructor
|
| 81 |
+
(r'\.\.', Operator),
|
| 82 |
+
(r'\$', Operator),
|
| 83 |
+
],
|
| 84 |
+
'identifiers': [
|
| 85 |
+
(r'([a-zA-Z_$][\w$]*)', Name),
|
| 86 |
+
],
|
| 87 |
+
'builtins': [
|
| 88 |
+
(words((
|
| 89 |
+
'ANYPTR', 'ANYREC', 'BOOLEAN', 'BYTE', 'CHAR', 'INTEGER', 'LONGINT',
|
| 90 |
+
'REAL', 'SET', 'SHORTCHAR', 'SHORTINT', 'SHORTREAL'
|
| 91 |
+
), suffix=r'\b'), Keyword.Type),
|
| 92 |
+
(words((
|
| 93 |
+
'ABS', 'ABSTRACT', 'ARRAY', 'ASH', 'ASSERT', 'BEGIN', 'BITS', 'BY',
|
| 94 |
+
'CAP', 'CASE', 'CHR', 'CLOSE', 'CONST', 'DEC', 'DIV', 'DO', 'ELSE',
|
| 95 |
+
'ELSIF', 'EMPTY', 'END', 'ENTIER', 'EXCL', 'EXIT', 'EXTENSIBLE', 'FOR',
|
| 96 |
+
'HALT', 'IF', 'IMPORT', 'IN', 'INC', 'INCL', 'IS', 'LEN', 'LIMITED',
|
| 97 |
+
'LONG', 'LOOP', 'MAX', 'MIN', 'MOD', 'MODULE', 'NEW', 'ODD', 'OF',
|
| 98 |
+
'OR', 'ORD', 'OUT', 'POINTER', 'PROCEDURE', 'RECORD', 'REPEAT', 'RETURN',
|
| 99 |
+
'SHORT', 'SHORTCHAR', 'SHORTINT', 'SIZE', 'THEN', 'TYPE', 'TO', 'UNTIL',
|
| 100 |
+
'VAR', 'WHILE', 'WITH'
|
| 101 |
+
), suffix=r'\b'), Keyword.Reserved),
|
| 102 |
+
(r'(TRUE|FALSE|NIL|INF)\b', Keyword.Constant),
|
| 103 |
+
]
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
def analyse_text(text):
|
| 107 |
+
"""The only other lexer using .cp is the C++ one, so we check if for
|
| 108 |
+
a few common Pascal keywords here. Those are unfortunately quite
|
| 109 |
+
common across various business languages as well."""
|
| 110 |
+
result = 0
|
| 111 |
+
if 'BEGIN' in text:
|
| 112 |
+
result += 0.01
|
| 113 |
+
if 'END' in text:
|
| 114 |
+
result += 0.01
|
| 115 |
+
if 'PROCEDURE' in text:
|
| 116 |
+
result += 0.01
|
| 117 |
+
if 'MODULE' in text:
|
| 118 |
+
result += 0.01
|
| 119 |
+
|
| 120 |
+
return result
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/objective.py
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.objective
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Objective-C family languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include, bygroups, using, this, words, \
|
| 14 |
+
inherit, default
|
| 15 |
+
from pygments.token import Text, Keyword, Name, String, Operator, \
|
| 16 |
+
Number, Punctuation, Literal, Comment, Whitespace
|
| 17 |
+
|
| 18 |
+
from pygments.lexers.c_cpp import CLexer, CppLexer
|
| 19 |
+
|
| 20 |
+
__all__ = ['ObjectiveCLexer', 'ObjectiveCppLexer', 'LogosLexer', 'SwiftLexer']
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def objective(baselexer):
|
| 24 |
+
"""
|
| 25 |
+
Generate a subclass of baselexer that accepts the Objective-C syntax
|
| 26 |
+
extensions.
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
# Have to be careful not to accidentally match JavaDoc/Doxygen syntax here,
|
| 30 |
+
# since that's quite common in ordinary C/C++ files. It's OK to match
|
| 31 |
+
# JavaDoc/Doxygen keywords that only apply to Objective-C, mind.
|
| 32 |
+
#
|
| 33 |
+
# The upshot of this is that we CANNOT match @class or @interface
|
| 34 |
+
_oc_keywords = re.compile(r'@(?:end|implementation|protocol)')
|
| 35 |
+
|
| 36 |
+
# Matches [ <ws>? identifier <ws> ( identifier <ws>? ] | identifier? : )
|
| 37 |
+
# (note the identifier is *optional* when there is a ':'!)
|
| 38 |
+
_oc_message = re.compile(r'\[\s*[a-zA-Z_]\w*\s+'
|
| 39 |
+
r'(?:[a-zA-Z_]\w*\s*\]|'
|
| 40 |
+
r'(?:[a-zA-Z_]\w*)?:)')
|
| 41 |
+
|
| 42 |
+
class GeneratedObjectiveCVariant(baselexer):
|
| 43 |
+
"""
|
| 44 |
+
Implements Objective-C syntax on top of an existing C family lexer.
|
| 45 |
+
"""
|
| 46 |
+
|
| 47 |
+
tokens = {
|
| 48 |
+
'statements': [
|
| 49 |
+
(r'@"', String, 'string'),
|
| 50 |
+
(r'@(YES|NO)', Number),
|
| 51 |
+
(r"@'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
|
| 52 |
+
(r'@(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
|
| 53 |
+
(r'@(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
| 54 |
+
(r'@0x[0-9a-fA-F]+[Ll]?', Number.Hex),
|
| 55 |
+
(r'@0[0-7]+[Ll]?', Number.Oct),
|
| 56 |
+
(r'@\d+[Ll]?', Number.Integer),
|
| 57 |
+
(r'@\(', Literal, 'literal_number'),
|
| 58 |
+
(r'@\[', Literal, 'literal_array'),
|
| 59 |
+
(r'@\{', Literal, 'literal_dictionary'),
|
| 60 |
+
(words((
|
| 61 |
+
'@selector', '@private', '@protected', '@public', '@encode',
|
| 62 |
+
'@synchronized', '@try', '@throw', '@catch', '@finally',
|
| 63 |
+
'@end', '@property', '@synthesize', '__bridge', '__bridge_transfer',
|
| 64 |
+
'__autoreleasing', '__block', '__weak', '__strong', 'weak', 'strong',
|
| 65 |
+
'copy', 'retain', 'assign', 'unsafe_unretained', 'atomic', 'nonatomic',
|
| 66 |
+
'readonly', 'readwrite', 'setter', 'getter', 'typeof', 'in',
|
| 67 |
+
'out', 'inout', 'release', 'class', '@dynamic', '@optional',
|
| 68 |
+
'@required', '@autoreleasepool', '@import'), suffix=r'\b'),
|
| 69 |
+
Keyword),
|
| 70 |
+
(words(('id', 'instancetype', 'Class', 'IMP', 'SEL', 'BOOL',
|
| 71 |
+
'IBOutlet', 'IBAction', 'unichar'), suffix=r'\b'),
|
| 72 |
+
Keyword.Type),
|
| 73 |
+
(r'@(true|false|YES|NO)\n', Name.Builtin),
|
| 74 |
+
(r'(YES|NO|nil|self|super)\b', Name.Builtin),
|
| 75 |
+
# Carbon types
|
| 76 |
+
(r'(Boolean|UInt8|SInt8|UInt16|SInt16|UInt32|SInt32)\b', Keyword.Type),
|
| 77 |
+
# Carbon built-ins
|
| 78 |
+
(r'(TRUE|FALSE)\b', Name.Builtin),
|
| 79 |
+
(r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text),
|
| 80 |
+
('#pop', 'oc_classname')),
|
| 81 |
+
(r'(@class|@protocol)(\s+)', bygroups(Keyword, Text),
|
| 82 |
+
('#pop', 'oc_forward_classname')),
|
| 83 |
+
# @ can also prefix other expressions like @{...} or @(...)
|
| 84 |
+
(r'@', Punctuation),
|
| 85 |
+
inherit,
|
| 86 |
+
],
|
| 87 |
+
'oc_classname': [
|
| 88 |
+
# interface definition that inherits
|
| 89 |
+
(r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)',
|
| 90 |
+
bygroups(Name.Class, Text, Name.Class, Text, Punctuation),
|
| 91 |
+
('#pop', 'oc_ivars')),
|
| 92 |
+
(r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?',
|
| 93 |
+
bygroups(Name.Class, Text, Name.Class), '#pop'),
|
| 94 |
+
# interface definition for a category
|
| 95 |
+
(r'([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)',
|
| 96 |
+
bygroups(Name.Class, Text, Name.Label, Text, Punctuation),
|
| 97 |
+
('#pop', 'oc_ivars')),
|
| 98 |
+
(r'([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))',
|
| 99 |
+
bygroups(Name.Class, Text, Name.Label), '#pop'),
|
| 100 |
+
# simple interface / implementation
|
| 101 |
+
(r'([a-zA-Z$_][\w$]*)(\s*)(\{)',
|
| 102 |
+
bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')),
|
| 103 |
+
(r'([a-zA-Z$_][\w$]*)', Name.Class, '#pop')
|
| 104 |
+
],
|
| 105 |
+
'oc_forward_classname': [
|
| 106 |
+
(r'([a-zA-Z$_][\w$]*)(\s*,\s*)',
|
| 107 |
+
bygroups(Name.Class, Text), 'oc_forward_classname'),
|
| 108 |
+
(r'([a-zA-Z$_][\w$]*)(\s*;?)',
|
| 109 |
+
bygroups(Name.Class, Text), '#pop')
|
| 110 |
+
],
|
| 111 |
+
'oc_ivars': [
|
| 112 |
+
include('whitespace'),
|
| 113 |
+
include('statements'),
|
| 114 |
+
(';', Punctuation),
|
| 115 |
+
(r'\{', Punctuation, '#push'),
|
| 116 |
+
(r'\}', Punctuation, '#pop'),
|
| 117 |
+
],
|
| 118 |
+
'root': [
|
| 119 |
+
# methods
|
| 120 |
+
(r'^([-+])(\s*)' # method marker
|
| 121 |
+
r'(\(.*?\))?(\s*)' # return type
|
| 122 |
+
r'([a-zA-Z$_][\w$]*:?)', # begin of method name
|
| 123 |
+
bygroups(Punctuation, Text, using(this),
|
| 124 |
+
Text, Name.Function),
|
| 125 |
+
'method'),
|
| 126 |
+
inherit,
|
| 127 |
+
],
|
| 128 |
+
'method': [
|
| 129 |
+
include('whitespace'),
|
| 130 |
+
# TODO unsure if ellipses are allowed elsewhere, see
|
| 131 |
+
# discussion in Issue 789
|
| 132 |
+
(r',', Punctuation),
|
| 133 |
+
(r'\.\.\.', Punctuation),
|
| 134 |
+
(r'(\(.*?\))(\s*)([a-zA-Z$_][\w$]*)',
|
| 135 |
+
bygroups(using(this), Text, Name.Variable)),
|
| 136 |
+
(r'[a-zA-Z$_][\w$]*:', Name.Function),
|
| 137 |
+
(';', Punctuation, '#pop'),
|
| 138 |
+
(r'\{', Punctuation, 'function'),
|
| 139 |
+
default('#pop'),
|
| 140 |
+
],
|
| 141 |
+
'literal_number': [
|
| 142 |
+
(r'\(', Punctuation, 'literal_number_inner'),
|
| 143 |
+
(r'\)', Literal, '#pop'),
|
| 144 |
+
include('statement'),
|
| 145 |
+
],
|
| 146 |
+
'literal_number_inner': [
|
| 147 |
+
(r'\(', Punctuation, '#push'),
|
| 148 |
+
(r'\)', Punctuation, '#pop'),
|
| 149 |
+
include('statement'),
|
| 150 |
+
],
|
| 151 |
+
'literal_array': [
|
| 152 |
+
(r'\[', Punctuation, 'literal_array_inner'),
|
| 153 |
+
(r'\]', Literal, '#pop'),
|
| 154 |
+
include('statement'),
|
| 155 |
+
],
|
| 156 |
+
'literal_array_inner': [
|
| 157 |
+
(r'\[', Punctuation, '#push'),
|
| 158 |
+
(r'\]', Punctuation, '#pop'),
|
| 159 |
+
include('statement'),
|
| 160 |
+
],
|
| 161 |
+
'literal_dictionary': [
|
| 162 |
+
(r'\}', Literal, '#pop'),
|
| 163 |
+
include('statement'),
|
| 164 |
+
],
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
def analyse_text(text):
|
| 168 |
+
if _oc_keywords.search(text):
|
| 169 |
+
return 1.0
|
| 170 |
+
elif '@"' in text: # strings
|
| 171 |
+
return 0.8
|
| 172 |
+
elif re.search('@[0-9]+', text):
|
| 173 |
+
return 0.7
|
| 174 |
+
elif _oc_message.search(text):
|
| 175 |
+
return 0.8
|
| 176 |
+
return 0
|
| 177 |
+
|
| 178 |
+
def get_tokens_unprocessed(self, text, stack=('root',)):
|
| 179 |
+
from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \
|
| 180 |
+
COCOA_PROTOCOLS, COCOA_PRIMITIVES
|
| 181 |
+
|
| 182 |
+
for index, token, value in \
|
| 183 |
+
baselexer.get_tokens_unprocessed(self, text, stack):
|
| 184 |
+
if token is Name or token is Name.Class:
|
| 185 |
+
if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \
|
| 186 |
+
or value in COCOA_PRIMITIVES:
|
| 187 |
+
token = Name.Builtin.Pseudo
|
| 188 |
+
|
| 189 |
+
yield index, token, value
|
| 190 |
+
|
| 191 |
+
return GeneratedObjectiveCVariant
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
class ObjectiveCLexer(objective(CLexer)):
|
| 195 |
+
"""
|
| 196 |
+
For Objective-C source code with preprocessor directives.
|
| 197 |
+
"""
|
| 198 |
+
|
| 199 |
+
name = 'Objective-C'
|
| 200 |
+
url = 'https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html'
|
| 201 |
+
aliases = ['objective-c', 'objectivec', 'obj-c', 'objc']
|
| 202 |
+
filenames = ['*.m', '*.h']
|
| 203 |
+
mimetypes = ['text/x-objective-c']
|
| 204 |
+
version_added = ''
|
| 205 |
+
priority = 0.05 # Lower than C
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
class ObjectiveCppLexer(objective(CppLexer)):
|
| 209 |
+
"""
|
| 210 |
+
For Objective-C++ source code with preprocessor directives.
|
| 211 |
+
"""
|
| 212 |
+
|
| 213 |
+
name = 'Objective-C++'
|
| 214 |
+
aliases = ['objective-c++', 'objectivec++', 'obj-c++', 'objc++']
|
| 215 |
+
filenames = ['*.mm', '*.hh']
|
| 216 |
+
mimetypes = ['text/x-objective-c++']
|
| 217 |
+
version_added = ''
|
| 218 |
+
priority = 0.05 # Lower than C++
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
class LogosLexer(ObjectiveCppLexer):
|
| 222 |
+
"""
|
| 223 |
+
For Logos + Objective-C source code with preprocessor directives.
|
| 224 |
+
"""
|
| 225 |
+
|
| 226 |
+
name = 'Logos'
|
| 227 |
+
aliases = ['logos']
|
| 228 |
+
filenames = ['*.x', '*.xi', '*.xm', '*.xmi']
|
| 229 |
+
mimetypes = ['text/x-logos']
|
| 230 |
+
version_added = '1.6'
|
| 231 |
+
priority = 0.25
|
| 232 |
+
|
| 233 |
+
tokens = {
|
| 234 |
+
'statements': [
|
| 235 |
+
(r'(%orig|%log)\b', Keyword),
|
| 236 |
+
(r'(%c)\b(\()(\s*)([a-zA-Z$_][\w$]*)(\s*)(\))',
|
| 237 |
+
bygroups(Keyword, Punctuation, Text, Name.Class, Text, Punctuation)),
|
| 238 |
+
(r'(%init)\b(\()',
|
| 239 |
+
bygroups(Keyword, Punctuation), 'logos_init_directive'),
|
| 240 |
+
(r'(%init)(?=\s*;)', bygroups(Keyword)),
|
| 241 |
+
(r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)',
|
| 242 |
+
bygroups(Keyword, Text, Name.Class), '#pop'),
|
| 243 |
+
(r'(%subclass)(\s+)', bygroups(Keyword, Text),
|
| 244 |
+
('#pop', 'logos_classname')),
|
| 245 |
+
inherit,
|
| 246 |
+
],
|
| 247 |
+
'logos_init_directive': [
|
| 248 |
+
(r'\s+', Text),
|
| 249 |
+
(',', Punctuation, ('logos_init_directive', '#pop')),
|
| 250 |
+
(r'([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)',
|
| 251 |
+
bygroups(Name.Class, Text, Punctuation, Text, Text)),
|
| 252 |
+
(r'([a-zA-Z$_][\w$]*)', Name.Class),
|
| 253 |
+
(r'\)', Punctuation, '#pop'),
|
| 254 |
+
],
|
| 255 |
+
'logos_classname': [
|
| 256 |
+
(r'([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?',
|
| 257 |
+
bygroups(Name.Class, Text, Name.Class), '#pop'),
|
| 258 |
+
(r'([a-zA-Z$_][\w$]*)', Name.Class, '#pop')
|
| 259 |
+
],
|
| 260 |
+
'root': [
|
| 261 |
+
(r'(%subclass)(\s+)', bygroups(Keyword, Text),
|
| 262 |
+
'logos_classname'),
|
| 263 |
+
(r'(%hook|%group)(\s+)([a-zA-Z$_][\w$]+)',
|
| 264 |
+
bygroups(Keyword, Text, Name.Class)),
|
| 265 |
+
(r'(%config)(\s*\(\s*)(\w+)(\s*=)(.*?)(\)\s*)',
|
| 266 |
+
bygroups(Keyword, Text, Name.Variable, Text, String, Text)),
|
| 267 |
+
(r'(%ctor)(\s*)(\{)', bygroups(Keyword, Text, Punctuation),
|
| 268 |
+
'function'),
|
| 269 |
+
(r'(%new)(\s*)(\()(.*?)(\))',
|
| 270 |
+
bygroups(Keyword, Text, Keyword, String, Keyword)),
|
| 271 |
+
(r'(\s*)(%end)(\s*)', bygroups(Text, Keyword, Text)),
|
| 272 |
+
inherit,
|
| 273 |
+
],
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
_logos_keywords = re.compile(r'%(?:hook|ctor|init|c\()')
|
| 277 |
+
|
| 278 |
+
def analyse_text(text):
|
| 279 |
+
if LogosLexer._logos_keywords.search(text):
|
| 280 |
+
return 1.0
|
| 281 |
+
return 0
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
class SwiftLexer(RegexLexer):
|
| 285 |
+
"""
|
| 286 |
+
For Swift source.
|
| 287 |
+
"""
|
| 288 |
+
name = 'Swift'
|
| 289 |
+
url = 'https://www.swift.org/'
|
| 290 |
+
filenames = ['*.swift']
|
| 291 |
+
aliases = ['swift']
|
| 292 |
+
mimetypes = ['text/x-swift']
|
| 293 |
+
version_added = '2.0'
|
| 294 |
+
|
| 295 |
+
tokens = {
|
| 296 |
+
'root': [
|
| 297 |
+
# Whitespace and Comments
|
| 298 |
+
(r'\n', Text),
|
| 299 |
+
(r'\s+', Whitespace),
|
| 300 |
+
(r'//', Comment.Single, 'comment-single'),
|
| 301 |
+
(r'/\*', Comment.Multiline, 'comment-multi'),
|
| 302 |
+
(r'#(if|elseif|else|endif|available)\b', Comment.Preproc, 'preproc'),
|
| 303 |
+
|
| 304 |
+
# Keywords
|
| 305 |
+
include('keywords'),
|
| 306 |
+
|
| 307 |
+
# Global Types
|
| 308 |
+
(words((
|
| 309 |
+
'Array', 'AutoreleasingUnsafeMutablePointer', 'BidirectionalReverseView',
|
| 310 |
+
'Bit', 'Bool', 'CFunctionPointer', 'COpaquePointer', 'CVaListPointer',
|
| 311 |
+
'Character', 'ClosedInterval', 'CollectionOfOne', 'ContiguousArray',
|
| 312 |
+
'Dictionary', 'DictionaryGenerator', 'DictionaryIndex', 'Double',
|
| 313 |
+
'EmptyCollection', 'EmptyGenerator', 'EnumerateGenerator',
|
| 314 |
+
'EnumerateSequence', 'FilterCollectionView',
|
| 315 |
+
'FilterCollectionViewIndex', 'FilterGenerator', 'FilterSequenceView',
|
| 316 |
+
'Float', 'Float80', 'FloatingPointClassification', 'GeneratorOf',
|
| 317 |
+
'GeneratorOfOne', 'GeneratorSequence', 'HalfOpenInterval', 'HeapBuffer',
|
| 318 |
+
'HeapBufferStorage', 'ImplicitlyUnwrappedOptional', 'IndexingGenerator',
|
| 319 |
+
'Int', 'Int16', 'Int32', 'Int64', 'Int8', 'LazyBidirectionalCollection',
|
| 320 |
+
'LazyForwardCollection', 'LazyRandomAccessCollection',
|
| 321 |
+
'LazySequence', 'MapCollectionView', 'MapSequenceGenerator',
|
| 322 |
+
'MapSequenceView', 'MirrorDisposition', 'ObjectIdentifier', 'OnHeap',
|
| 323 |
+
'Optional', 'PermutationGenerator', 'QuickLookObject',
|
| 324 |
+
'RandomAccessReverseView', 'Range', 'RangeGenerator', 'RawByte', 'Repeat',
|
| 325 |
+
'ReverseBidirectionalIndex', 'ReverseRandomAccessIndex', 'SequenceOf',
|
| 326 |
+
'SinkOf', 'Slice', 'StaticString', 'StrideThrough', 'StrideThroughGenerator',
|
| 327 |
+
'StrideTo', 'StrideToGenerator', 'String', 'UInt', 'UInt16', 'UInt32',
|
| 328 |
+
'UInt64', 'UInt8', 'UTF16', 'UTF32', 'UTF8', 'UnicodeDecodingResult',
|
| 329 |
+
'UnicodeScalar', 'Unmanaged', 'UnsafeBufferPointer',
|
| 330 |
+
'UnsafeBufferPointerGenerator', 'UnsafeMutableBufferPointer',
|
| 331 |
+
'UnsafeMutablePointer', 'UnsafePointer', 'Zip2', 'ZipGenerator2',
|
| 332 |
+
# Protocols
|
| 333 |
+
'AbsoluteValuable', 'AnyObject', 'ArrayLiteralConvertible',
|
| 334 |
+
'BidirectionalIndexType', 'BitwiseOperationsType',
|
| 335 |
+
'BooleanLiteralConvertible', 'BooleanType', 'CVarArgType',
|
| 336 |
+
'CollectionType', 'Comparable', 'DebugPrintable',
|
| 337 |
+
'DictionaryLiteralConvertible', 'Equatable',
|
| 338 |
+
'ExtendedGraphemeClusterLiteralConvertible',
|
| 339 |
+
'ExtensibleCollectionType', 'FloatLiteralConvertible',
|
| 340 |
+
'FloatingPointType', 'ForwardIndexType', 'GeneratorType', 'Hashable',
|
| 341 |
+
'IntegerArithmeticType', 'IntegerLiteralConvertible', 'IntegerType',
|
| 342 |
+
'IntervalType', 'MirrorType', 'MutableCollectionType', 'MutableSliceable',
|
| 343 |
+
'NilLiteralConvertible', 'OutputStreamType', 'Printable',
|
| 344 |
+
'RandomAccessIndexType', 'RangeReplaceableCollectionType',
|
| 345 |
+
'RawOptionSetType', 'RawRepresentable', 'Reflectable', 'SequenceType',
|
| 346 |
+
'SignedIntegerType', 'SignedNumberType', 'SinkType', 'Sliceable',
|
| 347 |
+
'Streamable', 'Strideable', 'StringInterpolationConvertible',
|
| 348 |
+
'StringLiteralConvertible', 'UnicodeCodecType',
|
| 349 |
+
'UnicodeScalarLiteralConvertible', 'UnsignedIntegerType',
|
| 350 |
+
'_ArrayBufferType', '_BidirectionalIndexType', '_CocoaStringType',
|
| 351 |
+
'_CollectionType', '_Comparable', '_ExtensibleCollectionType',
|
| 352 |
+
'_ForwardIndexType', '_Incrementable', '_IntegerArithmeticType',
|
| 353 |
+
'_IntegerType', '_ObjectiveCBridgeable', '_RandomAccessIndexType',
|
| 354 |
+
'_RawOptionSetType', '_SequenceType', '_Sequence_Type',
|
| 355 |
+
'_SignedIntegerType', '_SignedNumberType', '_Sliceable', '_Strideable',
|
| 356 |
+
'_SwiftNSArrayRequiredOverridesType', '_SwiftNSArrayType',
|
| 357 |
+
'_SwiftNSCopyingType', '_SwiftNSDictionaryRequiredOverridesType',
|
| 358 |
+
'_SwiftNSDictionaryType', '_SwiftNSEnumeratorType',
|
| 359 |
+
'_SwiftNSFastEnumerationType', '_SwiftNSStringRequiredOverridesType',
|
| 360 |
+
'_SwiftNSStringType', '_UnsignedIntegerType',
|
| 361 |
+
# Variables
|
| 362 |
+
'C_ARGC', 'C_ARGV', 'Process',
|
| 363 |
+
# Typealiases
|
| 364 |
+
'Any', 'AnyClass', 'BooleanLiteralType', 'CBool', 'CChar', 'CChar16',
|
| 365 |
+
'CChar32', 'CDouble', 'CFloat', 'CInt', 'CLong', 'CLongLong', 'CShort',
|
| 366 |
+
'CSignedChar', 'CUnsignedInt', 'CUnsignedLong', 'CUnsignedShort',
|
| 367 |
+
'CWideChar', 'ExtendedGraphemeClusterType', 'Float32', 'Float64',
|
| 368 |
+
'FloatLiteralType', 'IntMax', 'IntegerLiteralType', 'StringLiteralType',
|
| 369 |
+
'UIntMax', 'UWord', 'UnicodeScalarType', 'Void', 'Word',
|
| 370 |
+
# Foundation/Cocoa
|
| 371 |
+
'NSErrorPointer', 'NSObjectProtocol', 'Selector'), suffix=r'\b'),
|
| 372 |
+
Name.Builtin),
|
| 373 |
+
# Functions
|
| 374 |
+
(words((
|
| 375 |
+
'abs', 'advance', 'alignof', 'alignofValue', 'assert', 'assertionFailure',
|
| 376 |
+
'contains', 'count', 'countElements', 'debugPrint', 'debugPrintln',
|
| 377 |
+
'distance', 'dropFirst', 'dropLast', 'dump', 'enumerate', 'equal',
|
| 378 |
+
'extend', 'fatalError', 'filter', 'find', 'first', 'getVaList', 'indices',
|
| 379 |
+
'insert', 'isEmpty', 'join', 'last', 'lazy', 'lexicographicalCompare',
|
| 380 |
+
'map', 'max', 'maxElement', 'min', 'minElement', 'numericCast', 'overlaps',
|
| 381 |
+
'partition', 'precondition', 'preconditionFailure', 'prefix', 'print',
|
| 382 |
+
'println', 'reduce', 'reflect', 'removeAll', 'removeAtIndex', 'removeLast',
|
| 383 |
+
'removeRange', 'reverse', 'sizeof', 'sizeofValue', 'sort', 'sorted',
|
| 384 |
+
'splice', 'split', 'startsWith', 'stride', 'strideof', 'strideofValue',
|
| 385 |
+
'suffix', 'swap', 'toDebugString', 'toString', 'transcode',
|
| 386 |
+
'underestimateCount', 'unsafeAddressOf', 'unsafeBitCast', 'unsafeDowncast',
|
| 387 |
+
'withExtendedLifetime', 'withUnsafeMutablePointer',
|
| 388 |
+
'withUnsafeMutablePointers', 'withUnsafePointer', 'withUnsafePointers',
|
| 389 |
+
'withVaList'), suffix=r'\b'),
|
| 390 |
+
Name.Builtin.Pseudo),
|
| 391 |
+
|
| 392 |
+
# Implicit Block Variables
|
| 393 |
+
(r'\$\d+', Name.Variable),
|
| 394 |
+
|
| 395 |
+
# Binary Literal
|
| 396 |
+
(r'0b[01_]+', Number.Bin),
|
| 397 |
+
# Octal Literal
|
| 398 |
+
(r'0o[0-7_]+', Number.Oct),
|
| 399 |
+
# Hexadecimal Literal
|
| 400 |
+
(r'0x[0-9a-fA-F_]+', Number.Hex),
|
| 401 |
+
# Decimal Literal
|
| 402 |
+
(r'[0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|'
|
| 403 |
+
r'\.[0-9_]*|[eE][+\-]?[0-9_]+)', Number.Float),
|
| 404 |
+
(r'[0-9][0-9_]*', Number.Integer),
|
| 405 |
+
# String Literal
|
| 406 |
+
(r'"""', String, 'string-multi'),
|
| 407 |
+
(r'"', String, 'string'),
|
| 408 |
+
|
| 409 |
+
# Operators and Punctuation
|
| 410 |
+
(r'[(){}\[\].,:;=@#`?]|->|[<&?](?=\w)|(?<=\w)[>!?]', Punctuation),
|
| 411 |
+
(r'[/=\-+!*%<>&|^?~]+', Operator),
|
| 412 |
+
|
| 413 |
+
# Identifier
|
| 414 |
+
(r'[a-zA-Z_]\w*', Name)
|
| 415 |
+
],
|
| 416 |
+
'keywords': [
|
| 417 |
+
(words((
|
| 418 |
+
'as', 'async', 'await', 'break', 'case', 'catch', 'continue', 'default', 'defer',
|
| 419 |
+
'do', 'else', 'fallthrough', 'for', 'guard', 'if', 'in', 'is',
|
| 420 |
+
'repeat', 'return', '#selector', 'switch', 'throw', 'try',
|
| 421 |
+
'where', 'while'), suffix=r'\b'),
|
| 422 |
+
Keyword),
|
| 423 |
+
(r'@availability\([^)]+\)', Keyword.Reserved),
|
| 424 |
+
(words((
|
| 425 |
+
'associativity', 'convenience', 'dynamic', 'didSet', 'final',
|
| 426 |
+
'get', 'indirect', 'infix', 'inout', 'lazy', 'left', 'mutating',
|
| 427 |
+
'none', 'nonmutating', 'optional', 'override', 'postfix',
|
| 428 |
+
'precedence', 'prefix', 'Protocol', 'required', 'rethrows',
|
| 429 |
+
'right', 'set', 'throws', 'Type', 'unowned', 'weak', 'willSet',
|
| 430 |
+
'@availability', '@autoclosure', '@noreturn',
|
| 431 |
+
'@NSApplicationMain', '@NSCopying', '@NSManaged', '@objc',
|
| 432 |
+
'@UIApplicationMain', '@IBAction', '@IBDesignable',
|
| 433 |
+
'@IBInspectable', '@IBOutlet'), suffix=r'\b'),
|
| 434 |
+
Keyword.Reserved),
|
| 435 |
+
(r'(as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__'
|
| 436 |
+
r'|__FILE__|__FUNCTION__|__LINE__|_'
|
| 437 |
+
r'|#(?:file|line|column|function))\b', Keyword.Constant),
|
| 438 |
+
(r'import\b', Keyword.Declaration, 'module'),
|
| 439 |
+
(r'(class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)',
|
| 440 |
+
bygroups(Keyword.Declaration, Whitespace, Name.Class)),
|
| 441 |
+
(r'(func)(\s+)([a-zA-Z_]\w*)',
|
| 442 |
+
bygroups(Keyword.Declaration, Whitespace, Name.Function)),
|
| 443 |
+
(r'(var|let)(\s+)([a-zA-Z_]\w*)', bygroups(Keyword.Declaration,
|
| 444 |
+
Whitespace, Name.Variable)),
|
| 445 |
+
(words((
|
| 446 |
+
'actor', 'associatedtype', 'class', 'deinit', 'enum', 'extension', 'func', 'import',
|
| 447 |
+
'init', 'internal', 'let', 'operator', 'private', 'protocol', 'public',
|
| 448 |
+
'static', 'struct', 'subscript', 'typealias', 'var'), suffix=r'\b'),
|
| 449 |
+
Keyword.Declaration)
|
| 450 |
+
],
|
| 451 |
+
'comment': [
|
| 452 |
+
(r':param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):',
|
| 453 |
+
Comment.Special)
|
| 454 |
+
],
|
| 455 |
+
|
| 456 |
+
# Nested
|
| 457 |
+
'comment-single': [
|
| 458 |
+
(r'\n', Whitespace, '#pop'),
|
| 459 |
+
include('comment'),
|
| 460 |
+
(r'[^\n]+', Comment.Single)
|
| 461 |
+
],
|
| 462 |
+
'comment-multi': [
|
| 463 |
+
include('comment'),
|
| 464 |
+
(r'[^*/]+', Comment.Multiline),
|
| 465 |
+
(r'/\*', Comment.Multiline, '#push'),
|
| 466 |
+
(r'\*/', Comment.Multiline, '#pop'),
|
| 467 |
+
(r'[*/]+', Comment.Multiline)
|
| 468 |
+
],
|
| 469 |
+
'module': [
|
| 470 |
+
(r'\n', Whitespace, '#pop'),
|
| 471 |
+
(r'[a-zA-Z_]\w*', Name.Class),
|
| 472 |
+
include('root')
|
| 473 |
+
],
|
| 474 |
+
'preproc': [
|
| 475 |
+
(r'\n', Whitespace, '#pop'),
|
| 476 |
+
include('keywords'),
|
| 477 |
+
(r'[A-Za-z]\w*', Comment.Preproc),
|
| 478 |
+
include('root')
|
| 479 |
+
],
|
| 480 |
+
'string': [
|
| 481 |
+
(r'"', String, '#pop'),
|
| 482 |
+
include("string-common"),
|
| 483 |
+
],
|
| 484 |
+
'string-multi': [
|
| 485 |
+
(r'"""', String, '#pop'),
|
| 486 |
+
include("string-common"),
|
| 487 |
+
],
|
| 488 |
+
'string-common': [
|
| 489 |
+
(r'\\\(', String.Interpol, 'string-intp'),
|
| 490 |
+
(r"""\\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}"""
|
| 491 |
+
r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}""", String.Escape),
|
| 492 |
+
(r'[^\\"]+', String),
|
| 493 |
+
(r'\\', String)
|
| 494 |
+
],
|
| 495 |
+
'string-intp': [
|
| 496 |
+
(r'\(', String.Interpol, '#push'),
|
| 497 |
+
(r'\)', String.Interpol, '#pop'),
|
| 498 |
+
include('root')
|
| 499 |
+
]
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
def get_tokens_unprocessed(self, text):
|
| 503 |
+
from pygments.lexers._cocoa_builtins import COCOA_INTERFACES, \
|
| 504 |
+
COCOA_PROTOCOLS, COCOA_PRIMITIVES
|
| 505 |
+
|
| 506 |
+
for index, token, value in \
|
| 507 |
+
RegexLexer.get_tokens_unprocessed(self, text):
|
| 508 |
+
if token is Name or token is Name.Class:
|
| 509 |
+
if value in COCOA_INTERFACES or value in COCOA_PROTOCOLS \
|
| 510 |
+
or value in COCOA_PRIMITIVES:
|
| 511 |
+
token = Name.Builtin.Pseudo
|
| 512 |
+
|
| 513 |
+
yield index, token, value
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ooc.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.ooc
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the Ooc language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups, words
|
| 12 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 13 |
+
Number, Punctuation
|
| 14 |
+
|
| 15 |
+
__all__ = ['OocLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class OocLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For Ooc source code
|
| 21 |
+
"""
|
| 22 |
+
name = 'Ooc'
|
| 23 |
+
url = 'https://ooc-lang.github.io/'
|
| 24 |
+
aliases = ['ooc']
|
| 25 |
+
filenames = ['*.ooc']
|
| 26 |
+
mimetypes = ['text/x-ooc']
|
| 27 |
+
version_added = '1.2'
|
| 28 |
+
|
| 29 |
+
tokens = {
|
| 30 |
+
'root': [
|
| 31 |
+
(words((
|
| 32 |
+
'class', 'interface', 'implement', 'abstract', 'extends', 'from',
|
| 33 |
+
'this', 'super', 'new', 'const', 'final', 'static', 'import',
|
| 34 |
+
'use', 'extern', 'inline', 'proto', 'break', 'continue',
|
| 35 |
+
'fallthrough', 'operator', 'if', 'else', 'for', 'while', 'do',
|
| 36 |
+
'switch', 'case', 'as', 'in', 'version', 'return', 'true',
|
| 37 |
+
'false', 'null'), prefix=r'\b', suffix=r'\b'),
|
| 38 |
+
Keyword),
|
| 39 |
+
(r'include\b', Keyword, 'include'),
|
| 40 |
+
(r'(cover)([ \t]+)(from)([ \t]+)(\w+[*@]?)',
|
| 41 |
+
bygroups(Keyword, Text, Keyword, Text, Name.Class)),
|
| 42 |
+
(r'(func)((?:[ \t]|\\\n)+)(~[a-z_]\w*)',
|
| 43 |
+
bygroups(Keyword, Text, Name.Function)),
|
| 44 |
+
(r'\bfunc\b', Keyword),
|
| 45 |
+
# Note: %= not listed on https://ooc-lang.github.io/docs/lang/operators/
|
| 46 |
+
(r'//.*', Comment),
|
| 47 |
+
(r'(?s)/\*.*?\*/', Comment.Multiline),
|
| 48 |
+
(r'(==?|\+=?|-[=>]?|\*=?|/=?|:=|!=?|%=?|\?|>{1,3}=?|<{1,3}=?|\.\.|'
|
| 49 |
+
r'&&?|\|\|?|\^=?)', Operator),
|
| 50 |
+
(r'(\.)([ \t]*)([a-z]\w*)', bygroups(Operator, Text,
|
| 51 |
+
Name.Function)),
|
| 52 |
+
(r'[A-Z][A-Z0-9_]+', Name.Constant),
|
| 53 |
+
(r'[A-Z]\w*([@*]|\[[ \t]*\])?', Name.Class),
|
| 54 |
+
|
| 55 |
+
(r'([a-z]\w*(?:~[a-z]\w*)?)((?:[ \t]|\\\n)*)(?=\()',
|
| 56 |
+
bygroups(Name.Function, Text)),
|
| 57 |
+
(r'[a-z]\w*', Name.Variable),
|
| 58 |
+
|
| 59 |
+
# : introduces types
|
| 60 |
+
(r'[:(){}\[\];,]', Punctuation),
|
| 61 |
+
|
| 62 |
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
| 63 |
+
(r'0c[0-9]+', Number.Oct),
|
| 64 |
+
(r'0b[01]+', Number.Bin),
|
| 65 |
+
(r'[0-9_]\.[0-9_]*(?!\.)', Number.Float),
|
| 66 |
+
(r'[0-9_]+', Number.Decimal),
|
| 67 |
+
|
| 68 |
+
(r'"(?:\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\"])*"',
|
| 69 |
+
String.Double),
|
| 70 |
+
(r"'(?:\\.|\\[0-9]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
|
| 71 |
+
String.Char),
|
| 72 |
+
(r'@', Punctuation), # pointer dereference
|
| 73 |
+
(r'\.', Punctuation), # imports or chain operator
|
| 74 |
+
|
| 75 |
+
(r'\\[ \t\n]', Text),
|
| 76 |
+
(r'[ \t]+', Text),
|
| 77 |
+
],
|
| 78 |
+
'include': [
|
| 79 |
+
(r'[\w/]+', Name),
|
| 80 |
+
(r',', Punctuation),
|
| 81 |
+
(r'[ \t]', Text),
|
| 82 |
+
(r'[;\n]', Text, '#pop'),
|
| 83 |
+
],
|
| 84 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/openscad.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.openscad
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the OpenSCAD languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups, words, include
|
| 12 |
+
from pygments.token import Text, Comment, Punctuation, Operator, Keyword, Name, Number, Whitespace, Literal, String
|
| 13 |
+
|
| 14 |
+
__all__ = ['OpenScadLexer']
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class OpenScadLexer(RegexLexer):
|
| 18 |
+
"""For openSCAD code.
|
| 19 |
+
"""
|
| 20 |
+
name = "OpenSCAD"
|
| 21 |
+
url = "https://openscad.org/"
|
| 22 |
+
aliases = ["openscad"]
|
| 23 |
+
filenames = ["*.scad"]
|
| 24 |
+
mimetypes = ["application/x-openscad"]
|
| 25 |
+
version_added = '2.16'
|
| 26 |
+
|
| 27 |
+
tokens = {
|
| 28 |
+
"root": [
|
| 29 |
+
(r"[^\S\n]+", Whitespace),
|
| 30 |
+
(r'//', Comment.Single, 'comment-single'),
|
| 31 |
+
(r'/\*', Comment.Multiline, 'comment-multi'),
|
| 32 |
+
(r"[{}\[\]\(\),;:]", Punctuation),
|
| 33 |
+
(r"[*!#%\-+=?/]", Operator),
|
| 34 |
+
(r"<=|<|==|!=|>=|>|&&|\|\|", Operator),
|
| 35 |
+
(r"\$(f[asn]|t|vp[rtd]|children)", Operator),
|
| 36 |
+
(r"(undef|PI)\b", Keyword.Constant),
|
| 37 |
+
(
|
| 38 |
+
r"(use|include)((?:\s|\\\\s)+)",
|
| 39 |
+
bygroups(Keyword.Namespace, Text),
|
| 40 |
+
"includes",
|
| 41 |
+
),
|
| 42 |
+
(r"(module)(\s*)([^\s\(]+)",
|
| 43 |
+
bygroups(Keyword.Namespace, Whitespace, Name.Namespace)),
|
| 44 |
+
(r"(function)(\s*)([^\s\(]+)",
|
| 45 |
+
bygroups(Keyword.Declaration, Whitespace, Name.Function)),
|
| 46 |
+
(words(("true", "false"), prefix=r"\b", suffix=r"\b"), Literal),
|
| 47 |
+
(words((
|
| 48 |
+
"function", "module", "include", "use", "for",
|
| 49 |
+
"intersection_for", "if", "else", "return"
|
| 50 |
+
), prefix=r"\b", suffix=r"\b"), Keyword
|
| 51 |
+
),
|
| 52 |
+
(words((
|
| 53 |
+
"circle", "square", "polygon", "text", "sphere", "cube",
|
| 54 |
+
"cylinder", "polyhedron", "translate", "rotate", "scale",
|
| 55 |
+
"resize", "mirror", "multmatrix", "color", "offset", "hull",
|
| 56 |
+
"minkowski", "union", "difference", "intersection", "abs",
|
| 57 |
+
"sign", "sin", "cos", "tan", "acos", "asin", "atan", "atan2",
|
| 58 |
+
"floor", "round", "ceil", "ln", "log", "pow", "sqrt", "exp",
|
| 59 |
+
"rands", "min", "max", "concat", "lookup", "str", "chr",
|
| 60 |
+
"search", "version", "version_num", "norm", "cross",
|
| 61 |
+
"parent_module", "echo", "import", "import_dxf",
|
| 62 |
+
"dxf_linear_extrude", "linear_extrude", "rotate_extrude",
|
| 63 |
+
"surface", "projection", "render", "dxf_cross",
|
| 64 |
+
"dxf_dim", "let", "assign", "len"
|
| 65 |
+
), prefix=r"\b", suffix=r"\b"),
|
| 66 |
+
Name.Builtin
|
| 67 |
+
),
|
| 68 |
+
(r"\bchildren\b", Name.Builtin.Pseudo),
|
| 69 |
+
(r'""".*?"""', String.Double),
|
| 70 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
| 71 |
+
(r"-?\d+(\.\d+)?(e[+-]?\d+)?", Number),
|
| 72 |
+
(r"\w+", Name),
|
| 73 |
+
],
|
| 74 |
+
"includes": [
|
| 75 |
+
(
|
| 76 |
+
r"(<)([^>]*)(>)",
|
| 77 |
+
bygroups(Punctuation, Comment.PreprocFile, Punctuation),
|
| 78 |
+
),
|
| 79 |
+
],
|
| 80 |
+
'comment': [
|
| 81 |
+
(r':param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):',
|
| 82 |
+
Comment.Special)
|
| 83 |
+
],
|
| 84 |
+
'comment-single': [
|
| 85 |
+
(r'\n', Text, '#pop'),
|
| 86 |
+
include('comment'),
|
| 87 |
+
(r'[^\n]+', Comment.Single)
|
| 88 |
+
],
|
| 89 |
+
'comment-multi': [
|
| 90 |
+
include('comment'),
|
| 91 |
+
(r'[^*/]+', Comment.Multiline),
|
| 92 |
+
(r'/\*', Comment.Multiline, '#push'),
|
| 93 |
+
(r'\*/', Comment.Multiline, '#pop'),
|
| 94 |
+
(r'[*/]', Comment.Multiline)
|
| 95 |
+
],
|
| 96 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/other.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.other
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Just export lexer classes previously contained in this module.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
# ruff: noqa: F401
|
| 12 |
+
from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
|
| 13 |
+
from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \
|
| 14 |
+
TcshLexer
|
| 15 |
+
from pygments.lexers.robotframework import RobotFrameworkLexer
|
| 16 |
+
from pygments.lexers.testing import GherkinLexer
|
| 17 |
+
from pygments.lexers.esoteric import BrainfuckLexer, BefungeLexer, RedcodeLexer
|
| 18 |
+
from pygments.lexers.prolog import LogtalkLexer
|
| 19 |
+
from pygments.lexers.snobol import SnobolLexer
|
| 20 |
+
from pygments.lexers.rebol import RebolLexer
|
| 21 |
+
from pygments.lexers.configs import KconfigLexer, Cfengine3Lexer
|
| 22 |
+
from pygments.lexers.modeling import ModelicaLexer
|
| 23 |
+
from pygments.lexers.scripting import AppleScriptLexer, MOOCodeLexer, \
|
| 24 |
+
HybrisLexer
|
| 25 |
+
from pygments.lexers.graphics import PostScriptLexer, GnuplotLexer, \
|
| 26 |
+
AsymptoteLexer, PovrayLexer
|
| 27 |
+
from pygments.lexers.business import ABAPLexer, OpenEdgeLexer, \
|
| 28 |
+
GoodDataCLLexer, MaqlLexer
|
| 29 |
+
from pygments.lexers.automation import AutoItLexer, AutohotkeyLexer
|
| 30 |
+
from pygments.lexers.dsls import ProtoBufLexer, BroLexer, PuppetLexer, \
|
| 31 |
+
MscgenLexer, VGLLexer
|
| 32 |
+
from pygments.lexers.basic import CbmBasicV2Lexer
|
| 33 |
+
from pygments.lexers.pawn import SourcePawnLexer, PawnLexer
|
| 34 |
+
from pygments.lexers.ecl import ECLLexer
|
| 35 |
+
from pygments.lexers.urbi import UrbiscriptLexer
|
| 36 |
+
from pygments.lexers.smalltalk import SmalltalkLexer, NewspeakLexer
|
| 37 |
+
from pygments.lexers.installers import NSISLexer, RPMSpecLexer
|
| 38 |
+
from pygments.lexers.textedit import AwkLexer
|
| 39 |
+
from pygments.lexers.smv import NuSMVLexer
|
| 40 |
+
|
| 41 |
+
__all__ = []
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/parasail.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.parasail
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for ParaSail.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation, Literal
|
| 16 |
+
|
| 17 |
+
__all__ = ['ParaSailLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class ParaSailLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
For ParaSail source code.
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
name = 'ParaSail'
|
| 26 |
+
url = 'http://www.parasail-lang.org'
|
| 27 |
+
aliases = ['parasail']
|
| 28 |
+
filenames = ['*.psi', '*.psl']
|
| 29 |
+
mimetypes = ['text/x-parasail']
|
| 30 |
+
version_added = '2.1'
|
| 31 |
+
|
| 32 |
+
flags = re.MULTILINE
|
| 33 |
+
|
| 34 |
+
tokens = {
|
| 35 |
+
'root': [
|
| 36 |
+
(r'[^\S\n]+', Text),
|
| 37 |
+
(r'//.*?\n', Comment.Single),
|
| 38 |
+
(r'\b(and|or|xor)=', Operator.Word),
|
| 39 |
+
(r'\b(and(\s+then)?|or(\s+else)?|xor|rem|mod|'
|
| 40 |
+
r'(is|not)\s+null)\b',
|
| 41 |
+
Operator.Word),
|
| 42 |
+
# Keywords
|
| 43 |
+
(r'\b(abs|abstract|all|block|class|concurrent|const|continue|'
|
| 44 |
+
r'each|end|exit|extends|exports|forward|func|global|implements|'
|
| 45 |
+
r'import|in|interface|is|lambda|locked|new|not|null|of|op|'
|
| 46 |
+
r'optional|private|queued|ref|return|reverse|separate|some|'
|
| 47 |
+
r'type|until|var|with|'
|
| 48 |
+
# Control flow
|
| 49 |
+
r'if|then|else|elsif|case|for|while|loop)\b',
|
| 50 |
+
Keyword.Reserved),
|
| 51 |
+
(r'(abstract\s+)?(interface|class|op|func|type)',
|
| 52 |
+
Keyword.Declaration),
|
| 53 |
+
# Literals
|
| 54 |
+
(r'"[^"]*"', String),
|
| 55 |
+
(r'\\[\'ntrf"0]', String.Escape),
|
| 56 |
+
(r'#[a-zA-Z]\w*', Literal), # Enumeration
|
| 57 |
+
include('numbers'),
|
| 58 |
+
(r"'[^']'", String.Char),
|
| 59 |
+
(r'[a-zA-Z]\w*', Name),
|
| 60 |
+
# Operators and Punctuation
|
| 61 |
+
(r'(<==|==>|<=>|\*\*=|<\|=|<<=|>>=|==|!=|=\?|<=|>=|'
|
| 62 |
+
r'\*\*|<<|>>|=>|:=|\+=|-=|\*=|\|=|\||/=|\+|-|\*|/|'
|
| 63 |
+
r'\.\.|<\.\.|\.\.<|<\.\.<)',
|
| 64 |
+
Operator),
|
| 65 |
+
(r'(<|>|\[|\]|\(|\)|\||:|;|,|.|\{|\}|->)',
|
| 66 |
+
Punctuation),
|
| 67 |
+
(r'\n+', Text),
|
| 68 |
+
],
|
| 69 |
+
'numbers': [
|
| 70 |
+
(r'\d[0-9_]*#[0-9a-fA-F][0-9a-fA-F_]*#', Number.Hex), # any base
|
| 71 |
+
(r'0[xX][0-9a-fA-F][0-9a-fA-F_]*', Number.Hex), # C-like hex
|
| 72 |
+
(r'0[bB][01][01_]*', Number.Bin), # C-like bin
|
| 73 |
+
(r'\d[0-9_]*\.\d[0-9_]*[eE][+-]\d[0-9_]*', # float exp
|
| 74 |
+
Number.Float),
|
| 75 |
+
(r'\d[0-9_]*\.\d[0-9_]*', Number.Float), # float
|
| 76 |
+
(r'\d[0-9_]*', Number.Integer), # integer
|
| 77 |
+
],
|
| 78 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/parsers.py
ADDED
|
@@ -0,0 +1,798 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.parsers
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for parser generators.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, DelegatingLexer, \
|
| 14 |
+
include, bygroups, using
|
| 15 |
+
from pygments.token import Punctuation, Other, Text, Comment, Operator, \
|
| 16 |
+
Keyword, Name, String, Number, Whitespace
|
| 17 |
+
from pygments.lexers.jvm import JavaLexer
|
| 18 |
+
from pygments.lexers.c_cpp import CLexer, CppLexer
|
| 19 |
+
from pygments.lexers.objective import ObjectiveCLexer
|
| 20 |
+
from pygments.lexers.d import DLexer
|
| 21 |
+
from pygments.lexers.dotnet import CSharpLexer
|
| 22 |
+
from pygments.lexers.ruby import RubyLexer
|
| 23 |
+
from pygments.lexers.python import PythonLexer
|
| 24 |
+
from pygments.lexers.perl import PerlLexer
|
| 25 |
+
|
| 26 |
+
__all__ = ['RagelLexer', 'RagelEmbeddedLexer', 'RagelCLexer', 'RagelDLexer',
|
| 27 |
+
'RagelCppLexer', 'RagelObjectiveCLexer', 'RagelRubyLexer',
|
| 28 |
+
'RagelJavaLexer', 'AntlrLexer', 'AntlrPythonLexer',
|
| 29 |
+
'AntlrPerlLexer', 'AntlrRubyLexer', 'AntlrCppLexer',
|
| 30 |
+
'AntlrCSharpLexer', 'AntlrObjectiveCLexer',
|
| 31 |
+
'AntlrJavaLexer', 'AntlrActionScriptLexer',
|
| 32 |
+
'TreetopLexer', 'EbnfLexer']
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class RagelLexer(RegexLexer):
|
| 36 |
+
"""A pure `Ragel <www.colm.net/open-source/ragel>`_ lexer.
|
| 37 |
+
|
| 38 |
+
Use this for fragments of Ragel. For ``.rl`` files, use
|
| 39 |
+
:class:`RagelEmbeddedLexer` instead (or one of the language-specific
|
| 40 |
+
subclasses).
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
name = 'Ragel'
|
| 44 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 45 |
+
aliases = ['ragel']
|
| 46 |
+
filenames = []
|
| 47 |
+
version_added = '1.1'
|
| 48 |
+
|
| 49 |
+
tokens = {
|
| 50 |
+
'whitespace': [
|
| 51 |
+
(r'\s+', Whitespace)
|
| 52 |
+
],
|
| 53 |
+
'comments': [
|
| 54 |
+
(r'\#.*$', Comment),
|
| 55 |
+
],
|
| 56 |
+
'keywords': [
|
| 57 |
+
(r'(access|action|alphtype)\b', Keyword),
|
| 58 |
+
(r'(getkey|write|machine|include)\b', Keyword),
|
| 59 |
+
(r'(any|ascii|extend|alpha|digit|alnum|lower|upper)\b', Keyword),
|
| 60 |
+
(r'(xdigit|cntrl|graph|print|punct|space|zlen|empty)\b', Keyword)
|
| 61 |
+
],
|
| 62 |
+
'numbers': [
|
| 63 |
+
(r'0x[0-9A-Fa-f]+', Number.Hex),
|
| 64 |
+
(r'[+-]?[0-9]+', Number.Integer),
|
| 65 |
+
],
|
| 66 |
+
'literals': [
|
| 67 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
| 68 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
| 69 |
+
(r'\[(\\\\|\\[^\\]|[^\\\]])*\]', String), # square bracket literals
|
| 70 |
+
(r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', String.Regex), # regular expressions
|
| 71 |
+
],
|
| 72 |
+
'identifiers': [
|
| 73 |
+
(r'[a-zA-Z_]\w*', Name.Variable),
|
| 74 |
+
],
|
| 75 |
+
'operators': [
|
| 76 |
+
(r',', Operator), # Join
|
| 77 |
+
(r'\||&|--?', Operator), # Union, Intersection and Subtraction
|
| 78 |
+
(r'\.|<:|:>>?', Operator), # Concatention
|
| 79 |
+
(r':', Operator), # Label
|
| 80 |
+
(r'->', Operator), # Epsilon Transition
|
| 81 |
+
(r'(>|\$|%|<|@|<>)(/|eof\b)', Operator), # EOF Actions
|
| 82 |
+
(r'(>|\$|%|<|@|<>)(!|err\b)', Operator), # Global Error Actions
|
| 83 |
+
(r'(>|\$|%|<|@|<>)(\^|lerr\b)', Operator), # Local Error Actions
|
| 84 |
+
(r'(>|\$|%|<|@|<>)(~|to\b)', Operator), # To-State Actions
|
| 85 |
+
(r'(>|\$|%|<|@|<>)(\*|from\b)', Operator), # From-State Actions
|
| 86 |
+
(r'>|@|\$|%', Operator), # Transition Actions and Priorities
|
| 87 |
+
(r'\*|\?|\+|\{[0-9]*,[0-9]*\}', Operator), # Repetition
|
| 88 |
+
(r'!|\^', Operator), # Negation
|
| 89 |
+
(r'\(|\)', Operator), # Grouping
|
| 90 |
+
],
|
| 91 |
+
'root': [
|
| 92 |
+
include('literals'),
|
| 93 |
+
include('whitespace'),
|
| 94 |
+
include('comments'),
|
| 95 |
+
include('keywords'),
|
| 96 |
+
include('numbers'),
|
| 97 |
+
include('identifiers'),
|
| 98 |
+
include('operators'),
|
| 99 |
+
(r'\{', Punctuation, 'host'),
|
| 100 |
+
(r'=', Operator),
|
| 101 |
+
(r';', Punctuation),
|
| 102 |
+
],
|
| 103 |
+
'host': [
|
| 104 |
+
(r'(' + r'|'.join(( # keep host code in largest possible chunks
|
| 105 |
+
r'[^{}\'"/#]+', # exclude unsafe characters
|
| 106 |
+
r'[^\\]\\[{}]', # allow escaped { or }
|
| 107 |
+
|
| 108 |
+
# strings and comments may safely contain unsafe characters
|
| 109 |
+
r'"(\\\\|\\[^\\]|[^"\\])*"',
|
| 110 |
+
r"'(\\\\|\\[^\\]|[^'\\])*'",
|
| 111 |
+
r'//.*$\n?', # single line comment
|
| 112 |
+
r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
|
| 113 |
+
r'\#.*$\n?', # ruby comment
|
| 114 |
+
|
| 115 |
+
# regular expression: There's no reason for it to start
|
| 116 |
+
# with a * and this stops confusion with comments.
|
| 117 |
+
r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/',
|
| 118 |
+
|
| 119 |
+
# / is safe now that we've handled regex and javadoc comments
|
| 120 |
+
r'/',
|
| 121 |
+
)) + r')+', Other),
|
| 122 |
+
|
| 123 |
+
(r'\{', Punctuation, '#push'),
|
| 124 |
+
(r'\}', Punctuation, '#pop'),
|
| 125 |
+
],
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
class RagelEmbeddedLexer(RegexLexer):
|
| 130 |
+
"""
|
| 131 |
+
A lexer for Ragel embedded in a host language file.
|
| 132 |
+
|
| 133 |
+
This will only highlight Ragel statements. If you want host language
|
| 134 |
+
highlighting then call the language-specific Ragel lexer.
|
| 135 |
+
"""
|
| 136 |
+
|
| 137 |
+
name = 'Embedded Ragel'
|
| 138 |
+
aliases = ['ragel-em']
|
| 139 |
+
filenames = ['*.rl']
|
| 140 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 141 |
+
version_added = '1.1'
|
| 142 |
+
|
| 143 |
+
tokens = {
|
| 144 |
+
'root': [
|
| 145 |
+
(r'(' + r'|'.join(( # keep host code in largest possible chunks
|
| 146 |
+
r'[^%\'"/#]+', # exclude unsafe characters
|
| 147 |
+
r'%(?=[^%]|$)', # a single % sign is okay, just not 2 of them
|
| 148 |
+
|
| 149 |
+
# strings and comments may safely contain unsafe characters
|
| 150 |
+
r'"(\\\\|\\[^\\]|[^"\\])*"',
|
| 151 |
+
r"'(\\\\|\\[^\\]|[^'\\])*'",
|
| 152 |
+
r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
|
| 153 |
+
r'//.*$\n?', # single line comment
|
| 154 |
+
r'\#.*$\n?', # ruby/ragel comment
|
| 155 |
+
r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/', # regular expression
|
| 156 |
+
|
| 157 |
+
# / is safe now that we've handled regex and javadoc comments
|
| 158 |
+
r'/',
|
| 159 |
+
)) + r')+', Other),
|
| 160 |
+
|
| 161 |
+
# Single Line FSM.
|
| 162 |
+
# Please don't put a quoted newline in a single line FSM.
|
| 163 |
+
# That's just mean. It will break this.
|
| 164 |
+
(r'(%%)(?![{%])(.*)($|;)(\n?)', bygroups(Punctuation,
|
| 165 |
+
using(RagelLexer),
|
| 166 |
+
Punctuation, Text)),
|
| 167 |
+
|
| 168 |
+
# Multi Line FSM.
|
| 169 |
+
(r'(%%%%|%%)\{', Punctuation, 'multi-line-fsm'),
|
| 170 |
+
],
|
| 171 |
+
'multi-line-fsm': [
|
| 172 |
+
(r'(' + r'|'.join(( # keep ragel code in largest possible chunks.
|
| 173 |
+
r'(' + r'|'.join((
|
| 174 |
+
r'[^}\'"\[/#]', # exclude unsafe characters
|
| 175 |
+
r'\}(?=[^%]|$)', # } is okay as long as it's not followed by %
|
| 176 |
+
r'\}%(?=[^%]|$)', # ...well, one %'s okay, just not two...
|
| 177 |
+
r'[^\\]\\[{}]', # ...and } is okay if it's escaped
|
| 178 |
+
|
| 179 |
+
# allow / if it's preceded with one of these symbols
|
| 180 |
+
# (ragel EOF actions)
|
| 181 |
+
r'(>|\$|%|<|@|<>)/',
|
| 182 |
+
|
| 183 |
+
# specifically allow regex followed immediately by *
|
| 184 |
+
# so it doesn't get mistaken for a comment
|
| 185 |
+
r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/\*',
|
| 186 |
+
|
| 187 |
+
# allow / as long as it's not followed by another / or by a *
|
| 188 |
+
r'/(?=[^/*]|$)',
|
| 189 |
+
|
| 190 |
+
# We want to match as many of these as we can in one block.
|
| 191 |
+
# Not sure if we need the + sign here,
|
| 192 |
+
# does it help performance?
|
| 193 |
+
)) + r')+',
|
| 194 |
+
|
| 195 |
+
# strings and comments may safely contain unsafe characters
|
| 196 |
+
r'"(\\\\|\\[^\\]|[^"\\])*"',
|
| 197 |
+
r"'(\\\\|\\[^\\]|[^'\\])*'",
|
| 198 |
+
r"\[(\\\\|\\[^\\]|[^\]\\])*\]", # square bracket literal
|
| 199 |
+
r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
|
| 200 |
+
r'//.*$\n?', # single line comment
|
| 201 |
+
r'\#.*$\n?', # ruby/ragel comment
|
| 202 |
+
)) + r')+', using(RagelLexer)),
|
| 203 |
+
|
| 204 |
+
(r'\}%%', Punctuation, '#pop'),
|
| 205 |
+
]
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
def analyse_text(text):
|
| 209 |
+
return '@LANG: indep' in text
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
class RagelRubyLexer(DelegatingLexer):
|
| 213 |
+
"""
|
| 214 |
+
A lexer for Ragel in a Ruby host file.
|
| 215 |
+
"""
|
| 216 |
+
|
| 217 |
+
name = 'Ragel in Ruby Host'
|
| 218 |
+
aliases = ['ragel-ruby', 'ragel-rb']
|
| 219 |
+
filenames = ['*.rl']
|
| 220 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 221 |
+
version_added = '1.1'
|
| 222 |
+
|
| 223 |
+
def __init__(self, **options):
|
| 224 |
+
super().__init__(RubyLexer, RagelEmbeddedLexer, **options)
|
| 225 |
+
|
| 226 |
+
def analyse_text(text):
|
| 227 |
+
return '@LANG: ruby' in text
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
class RagelCLexer(DelegatingLexer):
|
| 231 |
+
"""
|
| 232 |
+
A lexer for Ragel in a C host file.
|
| 233 |
+
"""
|
| 234 |
+
|
| 235 |
+
name = 'Ragel in C Host'
|
| 236 |
+
aliases = ['ragel-c']
|
| 237 |
+
filenames = ['*.rl']
|
| 238 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 239 |
+
version_added = '1.1'
|
| 240 |
+
|
| 241 |
+
def __init__(self, **options):
|
| 242 |
+
super().__init__(CLexer, RagelEmbeddedLexer, **options)
|
| 243 |
+
|
| 244 |
+
def analyse_text(text):
|
| 245 |
+
return '@LANG: c' in text
|
| 246 |
+
|
| 247 |
+
|
| 248 |
+
class RagelDLexer(DelegatingLexer):
|
| 249 |
+
"""
|
| 250 |
+
A lexer for Ragel in a D host file.
|
| 251 |
+
"""
|
| 252 |
+
|
| 253 |
+
name = 'Ragel in D Host'
|
| 254 |
+
aliases = ['ragel-d']
|
| 255 |
+
filenames = ['*.rl']
|
| 256 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 257 |
+
version_added = '1.1'
|
| 258 |
+
|
| 259 |
+
def __init__(self, **options):
|
| 260 |
+
super().__init__(DLexer, RagelEmbeddedLexer, **options)
|
| 261 |
+
|
| 262 |
+
def analyse_text(text):
|
| 263 |
+
return '@LANG: d' in text
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
class RagelCppLexer(DelegatingLexer):
|
| 267 |
+
"""
|
| 268 |
+
A lexer for Ragel in a C++ host file.
|
| 269 |
+
"""
|
| 270 |
+
|
| 271 |
+
name = 'Ragel in CPP Host'
|
| 272 |
+
aliases = ['ragel-cpp']
|
| 273 |
+
filenames = ['*.rl']
|
| 274 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 275 |
+
version_added = '1.1'
|
| 276 |
+
|
| 277 |
+
def __init__(self, **options):
|
| 278 |
+
super().__init__(CppLexer, RagelEmbeddedLexer, **options)
|
| 279 |
+
|
| 280 |
+
def analyse_text(text):
|
| 281 |
+
return '@LANG: c++' in text
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
class RagelObjectiveCLexer(DelegatingLexer):
|
| 285 |
+
"""
|
| 286 |
+
A lexer for Ragel in an Objective C host file.
|
| 287 |
+
"""
|
| 288 |
+
|
| 289 |
+
name = 'Ragel in Objective C Host'
|
| 290 |
+
aliases = ['ragel-objc']
|
| 291 |
+
filenames = ['*.rl']
|
| 292 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 293 |
+
version_added = '1.1'
|
| 294 |
+
|
| 295 |
+
def __init__(self, **options):
|
| 296 |
+
super().__init__(ObjectiveCLexer, RagelEmbeddedLexer, **options)
|
| 297 |
+
|
| 298 |
+
def analyse_text(text):
|
| 299 |
+
return '@LANG: objc' in text
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
class RagelJavaLexer(DelegatingLexer):
|
| 303 |
+
"""
|
| 304 |
+
A lexer for Ragel in a Java host file.
|
| 305 |
+
"""
|
| 306 |
+
|
| 307 |
+
name = 'Ragel in Java Host'
|
| 308 |
+
aliases = ['ragel-java']
|
| 309 |
+
filenames = ['*.rl']
|
| 310 |
+
url = 'http://www.colm.net/open-source/ragel/'
|
| 311 |
+
version_added = '1.1'
|
| 312 |
+
|
| 313 |
+
def __init__(self, **options):
|
| 314 |
+
super().__init__(JavaLexer, RagelEmbeddedLexer, **options)
|
| 315 |
+
|
| 316 |
+
def analyse_text(text):
|
| 317 |
+
return '@LANG: java' in text
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
class AntlrLexer(RegexLexer):
|
| 321 |
+
"""
|
| 322 |
+
Generic ANTLR Lexer.
|
| 323 |
+
Should not be called directly, instead
|
| 324 |
+
use DelegatingLexer for your target language.
|
| 325 |
+
"""
|
| 326 |
+
|
| 327 |
+
name = 'ANTLR'
|
| 328 |
+
aliases = ['antlr']
|
| 329 |
+
filenames = []
|
| 330 |
+
url = 'https://www.antlr.org'
|
| 331 |
+
version_added = '1.1'
|
| 332 |
+
|
| 333 |
+
_id = r'[A-Za-z]\w*'
|
| 334 |
+
_TOKEN_REF = r'[A-Z]\w*'
|
| 335 |
+
_RULE_REF = r'[a-z]\w*'
|
| 336 |
+
_STRING_LITERAL = r'\'(?:\\\\|\\\'|[^\']*)\''
|
| 337 |
+
_INT = r'[0-9]+'
|
| 338 |
+
|
| 339 |
+
tokens = {
|
| 340 |
+
'whitespace': [
|
| 341 |
+
(r'\s+', Whitespace),
|
| 342 |
+
],
|
| 343 |
+
'comments': [
|
| 344 |
+
(r'//.*$', Comment),
|
| 345 |
+
(r'/\*(.|\n)*?\*/', Comment),
|
| 346 |
+
],
|
| 347 |
+
'root': [
|
| 348 |
+
include('whitespace'),
|
| 349 |
+
include('comments'),
|
| 350 |
+
|
| 351 |
+
(r'(lexer|parser|tree)?(\s*)(grammar\b)(\s*)(' + _id + ')(;)',
|
| 352 |
+
bygroups(Keyword, Whitespace, Keyword, Whitespace, Name.Class,
|
| 353 |
+
Punctuation)),
|
| 354 |
+
# optionsSpec
|
| 355 |
+
(r'options\b', Keyword, 'options'),
|
| 356 |
+
# tokensSpec
|
| 357 |
+
(r'tokens\b', Keyword, 'tokens'),
|
| 358 |
+
# attrScope
|
| 359 |
+
(r'(scope)(\s*)(' + _id + r')(\s*)(\{)',
|
| 360 |
+
bygroups(Keyword, Whitespace, Name.Variable, Whitespace,
|
| 361 |
+
Punctuation), 'action'),
|
| 362 |
+
# exception
|
| 363 |
+
(r'(catch|finally)\b', Keyword, 'exception'),
|
| 364 |
+
# action
|
| 365 |
+
(r'(@' + _id + r')(\s*)(::)?(\s*)(' + _id + r')(\s*)(\{)',
|
| 366 |
+
bygroups(Name.Label, Whitespace, Punctuation, Whitespace,
|
| 367 |
+
Name.Label, Whitespace, Punctuation), 'action'),
|
| 368 |
+
# rule
|
| 369 |
+
(r'((?:protected|private|public|fragment)\b)?(\s*)(' + _id + ')(!)?',
|
| 370 |
+
bygroups(Keyword, Whitespace, Name.Label, Punctuation),
|
| 371 |
+
('rule-alts', 'rule-prelims')),
|
| 372 |
+
],
|
| 373 |
+
'exception': [
|
| 374 |
+
(r'\n', Whitespace, '#pop'),
|
| 375 |
+
(r'\s', Whitespace),
|
| 376 |
+
include('comments'),
|
| 377 |
+
|
| 378 |
+
(r'\[', Punctuation, 'nested-arg-action'),
|
| 379 |
+
(r'\{', Punctuation, 'action'),
|
| 380 |
+
],
|
| 381 |
+
'rule-prelims': [
|
| 382 |
+
include('whitespace'),
|
| 383 |
+
include('comments'),
|
| 384 |
+
|
| 385 |
+
(r'returns\b', Keyword),
|
| 386 |
+
(r'\[', Punctuation, 'nested-arg-action'),
|
| 387 |
+
(r'\{', Punctuation, 'action'),
|
| 388 |
+
# throwsSpec
|
| 389 |
+
(r'(throws)(\s+)(' + _id + ')',
|
| 390 |
+
bygroups(Keyword, Whitespace, Name.Label)),
|
| 391 |
+
(r'(,)(\s*)(' + _id + ')',
|
| 392 |
+
bygroups(Punctuation, Whitespace, Name.Label)), # Additional throws
|
| 393 |
+
# optionsSpec
|
| 394 |
+
(r'options\b', Keyword, 'options'),
|
| 395 |
+
# ruleScopeSpec - scope followed by target language code or name of action
|
| 396 |
+
# TODO finish implementing other possibilities for scope
|
| 397 |
+
# L173 ANTLRv3.g from ANTLR book
|
| 398 |
+
(r'(scope)(\s+)(\{)', bygroups(Keyword, Whitespace, Punctuation),
|
| 399 |
+
'action'),
|
| 400 |
+
(r'(scope)(\s+)(' + _id + r')(\s*)(;)',
|
| 401 |
+
bygroups(Keyword, Whitespace, Name.Label, Whitespace, Punctuation)),
|
| 402 |
+
# ruleAction
|
| 403 |
+
(r'(@' + _id + r')(\s*)(\{)',
|
| 404 |
+
bygroups(Name.Label, Whitespace, Punctuation), 'action'),
|
| 405 |
+
# finished prelims, go to rule alts!
|
| 406 |
+
(r':', Punctuation, '#pop')
|
| 407 |
+
],
|
| 408 |
+
'rule-alts': [
|
| 409 |
+
include('whitespace'),
|
| 410 |
+
include('comments'),
|
| 411 |
+
|
| 412 |
+
# These might need to go in a separate 'block' state triggered by (
|
| 413 |
+
(r'options\b', Keyword, 'options'),
|
| 414 |
+
(r':', Punctuation),
|
| 415 |
+
|
| 416 |
+
# literals
|
| 417 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
| 418 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
| 419 |
+
(r'<<([^>]|>[^>])>>', String),
|
| 420 |
+
# identifiers
|
| 421 |
+
# Tokens start with capital letter.
|
| 422 |
+
(r'\$?[A-Z_]\w*', Name.Constant),
|
| 423 |
+
# Rules start with small letter.
|
| 424 |
+
(r'\$?[a-z_]\w*', Name.Variable),
|
| 425 |
+
# operators
|
| 426 |
+
(r'(\+|\||->|=>|=|\(|\)|\.\.|\.|\?|\*|\^|!|\#|~)', Operator),
|
| 427 |
+
(r',', Punctuation),
|
| 428 |
+
(r'\[', Punctuation, 'nested-arg-action'),
|
| 429 |
+
(r'\{', Punctuation, 'action'),
|
| 430 |
+
(r';', Punctuation, '#pop')
|
| 431 |
+
],
|
| 432 |
+
'tokens': [
|
| 433 |
+
include('whitespace'),
|
| 434 |
+
include('comments'),
|
| 435 |
+
(r'\{', Punctuation),
|
| 436 |
+
(r'(' + _TOKEN_REF + r')(\s*)(=)?(\s*)(' + _STRING_LITERAL
|
| 437 |
+
+ r')?(\s*)(;)',
|
| 438 |
+
bygroups(Name.Label, Whitespace, Punctuation, Whitespace,
|
| 439 |
+
String, Whitespace, Punctuation)),
|
| 440 |
+
(r'\}', Punctuation, '#pop'),
|
| 441 |
+
],
|
| 442 |
+
'options': [
|
| 443 |
+
include('whitespace'),
|
| 444 |
+
include('comments'),
|
| 445 |
+
(r'\{', Punctuation),
|
| 446 |
+
(r'(' + _id + r')(\s*)(=)(\s*)(' +
|
| 447 |
+
'|'.join((_id, _STRING_LITERAL, _INT, r'\*')) + r')(\s*)(;)',
|
| 448 |
+
bygroups(Name.Variable, Whitespace, Punctuation, Whitespace,
|
| 449 |
+
Text, Whitespace, Punctuation)),
|
| 450 |
+
(r'\}', Punctuation, '#pop'),
|
| 451 |
+
],
|
| 452 |
+
'action': [
|
| 453 |
+
(r'(' + r'|'.join(( # keep host code in largest possible chunks
|
| 454 |
+
r'[^${}\'"/\\]+', # exclude unsafe characters
|
| 455 |
+
|
| 456 |
+
# strings and comments may safely contain unsafe characters
|
| 457 |
+
r'"(\\\\|\\[^\\]|[^"\\])*"',
|
| 458 |
+
r"'(\\\\|\\[^\\]|[^'\\])*'",
|
| 459 |
+
r'//.*$\n?', # single line comment
|
| 460 |
+
r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
|
| 461 |
+
|
| 462 |
+
# regular expression: There's no reason for it to start
|
| 463 |
+
# with a * and this stops confusion with comments.
|
| 464 |
+
r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/',
|
| 465 |
+
|
| 466 |
+
# backslashes are okay, as long as we are not backslashing a %
|
| 467 |
+
r'\\(?!%)',
|
| 468 |
+
|
| 469 |
+
# Now that we've handled regex and javadoc comments
|
| 470 |
+
# it's safe to let / through.
|
| 471 |
+
r'/',
|
| 472 |
+
)) + r')+', Other),
|
| 473 |
+
(r'(\\)(%)', bygroups(Punctuation, Other)),
|
| 474 |
+
(r'(\$[a-zA-Z]+)(\.?)(text|value)?',
|
| 475 |
+
bygroups(Name.Variable, Punctuation, Name.Property)),
|
| 476 |
+
(r'\{', Punctuation, '#push'),
|
| 477 |
+
(r'\}', Punctuation, '#pop'),
|
| 478 |
+
],
|
| 479 |
+
'nested-arg-action': [
|
| 480 |
+
(r'(' + r'|'.join(( # keep host code in largest possible chunks.
|
| 481 |
+
r'[^$\[\]\'"/]+', # exclude unsafe characters
|
| 482 |
+
|
| 483 |
+
# strings and comments may safely contain unsafe characters
|
| 484 |
+
r'"(\\\\|\\[^\\]|[^"\\])*"',
|
| 485 |
+
r"'(\\\\|\\[^\\]|[^'\\])*'",
|
| 486 |
+
r'//.*$\n?', # single line comment
|
| 487 |
+
r'/\*(.|\n)*?\*/', # multi-line javadoc-style comment
|
| 488 |
+
|
| 489 |
+
# regular expression: There's no reason for it to start
|
| 490 |
+
# with a * and this stops confusion with comments.
|
| 491 |
+
r'/(?!\*)(\\\\|\\[^\\]|[^/\\])*/',
|
| 492 |
+
|
| 493 |
+
# Now that we've handled regex and javadoc comments
|
| 494 |
+
# it's safe to let / through.
|
| 495 |
+
r'/',
|
| 496 |
+
)) + r')+', Other),
|
| 497 |
+
|
| 498 |
+
|
| 499 |
+
(r'\[', Punctuation, '#push'),
|
| 500 |
+
(r'\]', Punctuation, '#pop'),
|
| 501 |
+
(r'(\$[a-zA-Z]+)(\.?)(text|value)?',
|
| 502 |
+
bygroups(Name.Variable, Punctuation, Name.Property)),
|
| 503 |
+
(r'(\\\\|\\\]|\\\[|[^\[\]])+', Other),
|
| 504 |
+
]
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
def analyse_text(text):
|
| 508 |
+
return re.search(r'^\s*grammar\s+[a-zA-Z0-9]+\s*;', text, re.M)
|
| 509 |
+
|
| 510 |
+
|
| 511 |
+
# http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets
|
| 512 |
+
|
| 513 |
+
class AntlrCppLexer(DelegatingLexer):
|
| 514 |
+
"""
|
| 515 |
+
ANTLR with C++ Target
|
| 516 |
+
"""
|
| 517 |
+
|
| 518 |
+
name = 'ANTLR With CPP Target'
|
| 519 |
+
aliases = ['antlr-cpp']
|
| 520 |
+
filenames = ['*.G', '*.g']
|
| 521 |
+
url = 'https://www.antlr.org'
|
| 522 |
+
version_added = '1.1'
|
| 523 |
+
|
| 524 |
+
def __init__(self, **options):
|
| 525 |
+
super().__init__(CppLexer, AntlrLexer, **options)
|
| 526 |
+
|
| 527 |
+
def analyse_text(text):
|
| 528 |
+
return AntlrLexer.analyse_text(text) and \
|
| 529 |
+
re.search(r'^\s*language\s*=\s*C\s*;', text, re.M)
|
| 530 |
+
|
| 531 |
+
|
| 532 |
+
class AntlrObjectiveCLexer(DelegatingLexer):
|
| 533 |
+
"""
|
| 534 |
+
ANTLR with Objective-C Target
|
| 535 |
+
"""
|
| 536 |
+
|
| 537 |
+
name = 'ANTLR With ObjectiveC Target'
|
| 538 |
+
aliases = ['antlr-objc']
|
| 539 |
+
filenames = ['*.G', '*.g']
|
| 540 |
+
url = 'https://www.antlr.org'
|
| 541 |
+
version_added = '1.1'
|
| 542 |
+
|
| 543 |
+
def __init__(self, **options):
|
| 544 |
+
super().__init__(ObjectiveCLexer, AntlrLexer, **options)
|
| 545 |
+
|
| 546 |
+
def analyse_text(text):
|
| 547 |
+
return AntlrLexer.analyse_text(text) and \
|
| 548 |
+
re.search(r'^\s*language\s*=\s*ObjC\s*;', text)
|
| 549 |
+
|
| 550 |
+
|
| 551 |
+
class AntlrCSharpLexer(DelegatingLexer):
|
| 552 |
+
"""
|
| 553 |
+
ANTLR with C# Target
|
| 554 |
+
"""
|
| 555 |
+
|
| 556 |
+
name = 'ANTLR With C# Target'
|
| 557 |
+
aliases = ['antlr-csharp', 'antlr-c#']
|
| 558 |
+
filenames = ['*.G', '*.g']
|
| 559 |
+
url = 'https://www.antlr.org'
|
| 560 |
+
version_added = '1.1'
|
| 561 |
+
|
| 562 |
+
def __init__(self, **options):
|
| 563 |
+
super().__init__(CSharpLexer, AntlrLexer, **options)
|
| 564 |
+
|
| 565 |
+
def analyse_text(text):
|
| 566 |
+
return AntlrLexer.analyse_text(text) and \
|
| 567 |
+
re.search(r'^\s*language\s*=\s*CSharp2\s*;', text, re.M)
|
| 568 |
+
|
| 569 |
+
|
| 570 |
+
class AntlrPythonLexer(DelegatingLexer):
|
| 571 |
+
"""
|
| 572 |
+
ANTLR with Python Target
|
| 573 |
+
"""
|
| 574 |
+
|
| 575 |
+
name = 'ANTLR With Python Target'
|
| 576 |
+
aliases = ['antlr-python']
|
| 577 |
+
filenames = ['*.G', '*.g']
|
| 578 |
+
url = 'https://www.antlr.org'
|
| 579 |
+
version_added = '1.1'
|
| 580 |
+
|
| 581 |
+
def __init__(self, **options):
|
| 582 |
+
super().__init__(PythonLexer, AntlrLexer, **options)
|
| 583 |
+
|
| 584 |
+
def analyse_text(text):
|
| 585 |
+
return AntlrLexer.analyse_text(text) and \
|
| 586 |
+
re.search(r'^\s*language\s*=\s*Python\s*;', text, re.M)
|
| 587 |
+
|
| 588 |
+
|
| 589 |
+
class AntlrJavaLexer(DelegatingLexer):
|
| 590 |
+
"""
|
| 591 |
+
ANTLR with Java Target
|
| 592 |
+
"""
|
| 593 |
+
|
| 594 |
+
name = 'ANTLR With Java Target'
|
| 595 |
+
aliases = ['antlr-java']
|
| 596 |
+
filenames = ['*.G', '*.g']
|
| 597 |
+
url = 'https://www.antlr.org'
|
| 598 |
+
version_added = '1.1'
|
| 599 |
+
|
| 600 |
+
def __init__(self, **options):
|
| 601 |
+
super().__init__(JavaLexer, AntlrLexer, **options)
|
| 602 |
+
|
| 603 |
+
def analyse_text(text):
|
| 604 |
+
# Antlr language is Java by default
|
| 605 |
+
return AntlrLexer.analyse_text(text) and 0.9
|
| 606 |
+
|
| 607 |
+
|
| 608 |
+
class AntlrRubyLexer(DelegatingLexer):
|
| 609 |
+
"""
|
| 610 |
+
ANTLR with Ruby Target
|
| 611 |
+
"""
|
| 612 |
+
|
| 613 |
+
name = 'ANTLR With Ruby Target'
|
| 614 |
+
aliases = ['antlr-ruby', 'antlr-rb']
|
| 615 |
+
filenames = ['*.G', '*.g']
|
| 616 |
+
url = 'https://www.antlr.org'
|
| 617 |
+
version_added = '1.1'
|
| 618 |
+
|
| 619 |
+
def __init__(self, **options):
|
| 620 |
+
super().__init__(RubyLexer, AntlrLexer, **options)
|
| 621 |
+
|
| 622 |
+
def analyse_text(text):
|
| 623 |
+
return AntlrLexer.analyse_text(text) and \
|
| 624 |
+
re.search(r'^\s*language\s*=\s*Ruby\s*;', text, re.M)
|
| 625 |
+
|
| 626 |
+
|
| 627 |
+
class AntlrPerlLexer(DelegatingLexer):
|
| 628 |
+
"""
|
| 629 |
+
ANTLR with Perl Target
|
| 630 |
+
"""
|
| 631 |
+
|
| 632 |
+
name = 'ANTLR With Perl Target'
|
| 633 |
+
aliases = ['antlr-perl']
|
| 634 |
+
filenames = ['*.G', '*.g']
|
| 635 |
+
url = 'https://www.antlr.org'
|
| 636 |
+
version_added = '1.1'
|
| 637 |
+
|
| 638 |
+
def __init__(self, **options):
|
| 639 |
+
super().__init__(PerlLexer, AntlrLexer, **options)
|
| 640 |
+
|
| 641 |
+
def analyse_text(text):
|
| 642 |
+
return AntlrLexer.analyse_text(text) and \
|
| 643 |
+
re.search(r'^\s*language\s*=\s*Perl5\s*;', text, re.M)
|
| 644 |
+
|
| 645 |
+
|
| 646 |
+
class AntlrActionScriptLexer(DelegatingLexer):
|
| 647 |
+
"""
|
| 648 |
+
ANTLR with ActionScript Target
|
| 649 |
+
"""
|
| 650 |
+
|
| 651 |
+
name = 'ANTLR With ActionScript Target'
|
| 652 |
+
aliases = ['antlr-actionscript', 'antlr-as']
|
| 653 |
+
filenames = ['*.G', '*.g']
|
| 654 |
+
url = 'https://www.antlr.org'
|
| 655 |
+
version_added = '1.1'
|
| 656 |
+
|
| 657 |
+
def __init__(self, **options):
|
| 658 |
+
from pygments.lexers.actionscript import ActionScriptLexer
|
| 659 |
+
super().__init__(ActionScriptLexer, AntlrLexer, **options)
|
| 660 |
+
|
| 661 |
+
def analyse_text(text):
|
| 662 |
+
return AntlrLexer.analyse_text(text) and \
|
| 663 |
+
re.search(r'^\s*language\s*=\s*ActionScript\s*;', text, re.M)
|
| 664 |
+
|
| 665 |
+
|
| 666 |
+
class TreetopBaseLexer(RegexLexer):
|
| 667 |
+
"""
|
| 668 |
+
A base lexer for `Treetop <http://treetop.rubyforge.org/>`_ grammars.
|
| 669 |
+
Not for direct use; use :class:`TreetopLexer` instead.
|
| 670 |
+
|
| 671 |
+
.. versionadded:: 1.6
|
| 672 |
+
"""
|
| 673 |
+
|
| 674 |
+
tokens = {
|
| 675 |
+
'root': [
|
| 676 |
+
include('space'),
|
| 677 |
+
(r'require[ \t]+[^\n\r]+[\n\r]', Other),
|
| 678 |
+
(r'module\b', Keyword.Namespace, 'module'),
|
| 679 |
+
(r'grammar\b', Keyword, 'grammar'),
|
| 680 |
+
],
|
| 681 |
+
'module': [
|
| 682 |
+
include('space'),
|
| 683 |
+
include('end'),
|
| 684 |
+
(r'module\b', Keyword, '#push'),
|
| 685 |
+
(r'grammar\b', Keyword, 'grammar'),
|
| 686 |
+
(r'[A-Z]\w*(?:::[A-Z]\w*)*', Name.Namespace),
|
| 687 |
+
],
|
| 688 |
+
'grammar': [
|
| 689 |
+
include('space'),
|
| 690 |
+
include('end'),
|
| 691 |
+
(r'rule\b', Keyword, 'rule'),
|
| 692 |
+
(r'include\b', Keyword, 'include'),
|
| 693 |
+
(r'[A-Z]\w*', Name),
|
| 694 |
+
],
|
| 695 |
+
'include': [
|
| 696 |
+
include('space'),
|
| 697 |
+
(r'[A-Z]\w*(?:::[A-Z]\w*)*', Name.Class, '#pop'),
|
| 698 |
+
],
|
| 699 |
+
'rule': [
|
| 700 |
+
include('space'),
|
| 701 |
+
include('end'),
|
| 702 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
| 703 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
| 704 |
+
(r'([A-Za-z_]\w*)(:)', bygroups(Name.Label, Punctuation)),
|
| 705 |
+
(r'[A-Za-z_]\w*', Name),
|
| 706 |
+
(r'[()]', Punctuation),
|
| 707 |
+
(r'[?+*/&!~]', Operator),
|
| 708 |
+
(r'\[(?:\\.|\[:\^?[a-z]+:\]|[^\\\]])+\]', String.Regex),
|
| 709 |
+
(r'([0-9]*)(\.\.)([0-9]*)',
|
| 710 |
+
bygroups(Number.Integer, Operator, Number.Integer)),
|
| 711 |
+
(r'(<)([^>]+)(>)', bygroups(Punctuation, Name.Class, Punctuation)),
|
| 712 |
+
(r'\{', Punctuation, 'inline_module'),
|
| 713 |
+
(r'\.', String.Regex),
|
| 714 |
+
],
|
| 715 |
+
'inline_module': [
|
| 716 |
+
(r'\{', Other, 'ruby'),
|
| 717 |
+
(r'\}', Punctuation, '#pop'),
|
| 718 |
+
(r'[^{}]+', Other),
|
| 719 |
+
],
|
| 720 |
+
'ruby': [
|
| 721 |
+
(r'\{', Other, '#push'),
|
| 722 |
+
(r'\}', Other, '#pop'),
|
| 723 |
+
(r'[^{}]+', Other),
|
| 724 |
+
],
|
| 725 |
+
'space': [
|
| 726 |
+
(r'[ \t\n\r]+', Whitespace),
|
| 727 |
+
(r'#[^\n]*', Comment.Single),
|
| 728 |
+
],
|
| 729 |
+
'end': [
|
| 730 |
+
(r'end\b', Keyword, '#pop'),
|
| 731 |
+
],
|
| 732 |
+
}
|
| 733 |
+
|
| 734 |
+
|
| 735 |
+
class TreetopLexer(DelegatingLexer):
|
| 736 |
+
"""
|
| 737 |
+
A lexer for Treetop grammars.
|
| 738 |
+
"""
|
| 739 |
+
|
| 740 |
+
name = 'Treetop'
|
| 741 |
+
aliases = ['treetop']
|
| 742 |
+
filenames = ['*.treetop', '*.tt']
|
| 743 |
+
url = 'https://cjheath.github.io/treetop'
|
| 744 |
+
version_added = '1.6'
|
| 745 |
+
|
| 746 |
+
def __init__(self, **options):
|
| 747 |
+
super().__init__(RubyLexer, TreetopBaseLexer, **options)
|
| 748 |
+
|
| 749 |
+
|
| 750 |
+
class EbnfLexer(RegexLexer):
|
| 751 |
+
"""
|
| 752 |
+
Lexer for `ISO/IEC 14977 EBNF
|
| 753 |
+
<https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form>`_
|
| 754 |
+
grammars.
|
| 755 |
+
"""
|
| 756 |
+
|
| 757 |
+
name = 'EBNF'
|
| 758 |
+
aliases = ['ebnf']
|
| 759 |
+
filenames = ['*.ebnf']
|
| 760 |
+
mimetypes = ['text/x-ebnf']
|
| 761 |
+
url = 'https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form'
|
| 762 |
+
version_added = '2.0'
|
| 763 |
+
|
| 764 |
+
tokens = {
|
| 765 |
+
'root': [
|
| 766 |
+
include('whitespace'),
|
| 767 |
+
include('comment_start'),
|
| 768 |
+
include('identifier'),
|
| 769 |
+
(r'=', Operator, 'production'),
|
| 770 |
+
],
|
| 771 |
+
'production': [
|
| 772 |
+
include('whitespace'),
|
| 773 |
+
include('comment_start'),
|
| 774 |
+
include('identifier'),
|
| 775 |
+
(r'"[^"]*"', String.Double),
|
| 776 |
+
(r"'[^']*'", String.Single),
|
| 777 |
+
(r'(\?[^?]*\?)', Name.Entity),
|
| 778 |
+
(r'[\[\]{}(),|]', Punctuation),
|
| 779 |
+
(r'-', Operator),
|
| 780 |
+
(r';', Punctuation, '#pop'),
|
| 781 |
+
(r'\.', Punctuation, '#pop'),
|
| 782 |
+
],
|
| 783 |
+
'whitespace': [
|
| 784 |
+
(r'\s+', Text),
|
| 785 |
+
],
|
| 786 |
+
'comment_start': [
|
| 787 |
+
(r'\(\*', Comment.Multiline, 'comment'),
|
| 788 |
+
],
|
| 789 |
+
'comment': [
|
| 790 |
+
(r'[^*)]', Comment.Multiline),
|
| 791 |
+
include('comment_start'),
|
| 792 |
+
(r'\*\)', Comment.Multiline, '#pop'),
|
| 793 |
+
(r'[*)]', Comment.Multiline),
|
| 794 |
+
],
|
| 795 |
+
'identifier': [
|
| 796 |
+
(r'([a-zA-Z][\w \-]*)', Keyword),
|
| 797 |
+
],
|
| 798 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pascal.py
ADDED
|
@@ -0,0 +1,644 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.pascal
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Pascal family languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import Lexer
|
| 14 |
+
from pygments.util import get_bool_opt, get_list_opt
|
| 15 |
+
from pygments.token import Comment, Operator, Keyword, Name, String, \
|
| 16 |
+
Number, Punctuation, Error, Whitespace
|
| 17 |
+
from pygments.scanner import Scanner
|
| 18 |
+
|
| 19 |
+
# compatibility import
|
| 20 |
+
from pygments.lexers.modula2 import Modula2Lexer # noqa: F401
|
| 21 |
+
|
| 22 |
+
__all__ = ['DelphiLexer', 'PortugolLexer']
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class PortugolLexer(Lexer):
|
| 26 |
+
"""For Portugol, a Pascal dialect with keywords in Portuguese."""
|
| 27 |
+
name = 'Portugol'
|
| 28 |
+
aliases = ['portugol']
|
| 29 |
+
filenames = ['*.alg', '*.portugol']
|
| 30 |
+
mimetypes = []
|
| 31 |
+
url = "https://www.apoioinformatica.inf.br/produtos/visualg/linguagem"
|
| 32 |
+
version_added = ''
|
| 33 |
+
|
| 34 |
+
def __init__(self, **options):
|
| 35 |
+
Lexer.__init__(self, **options)
|
| 36 |
+
self.lexer = DelphiLexer(**options, portugol=True)
|
| 37 |
+
|
| 38 |
+
def get_tokens_unprocessed(self, text):
|
| 39 |
+
return self.lexer.get_tokens_unprocessed(text)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class DelphiLexer(Lexer):
|
| 43 |
+
"""
|
| 44 |
+
For Delphi (Borland Object Pascal),
|
| 45 |
+
Turbo Pascal and Free Pascal source code.
|
| 46 |
+
|
| 47 |
+
Additional options accepted:
|
| 48 |
+
|
| 49 |
+
`turbopascal`
|
| 50 |
+
Highlight Turbo Pascal specific keywords (default: ``True``).
|
| 51 |
+
`delphi`
|
| 52 |
+
Highlight Borland Delphi specific keywords (default: ``True``).
|
| 53 |
+
`freepascal`
|
| 54 |
+
Highlight Free Pascal specific keywords (default: ``True``).
|
| 55 |
+
`units`
|
| 56 |
+
A list of units that should be considered builtin, supported are
|
| 57 |
+
``System``, ``SysUtils``, ``Classes`` and ``Math``.
|
| 58 |
+
Default is to consider all of them builtin.
|
| 59 |
+
"""
|
| 60 |
+
name = 'Delphi'
|
| 61 |
+
aliases = ['delphi', 'pas', 'pascal', 'objectpascal']
|
| 62 |
+
filenames = ['*.pas', '*.dpr']
|
| 63 |
+
mimetypes = ['text/x-pascal']
|
| 64 |
+
url = 'https://www.embarcadero.com/products/delphi'
|
| 65 |
+
version_added = ''
|
| 66 |
+
|
| 67 |
+
TURBO_PASCAL_KEYWORDS = (
|
| 68 |
+
'absolute', 'and', 'array', 'asm', 'begin', 'break', 'case',
|
| 69 |
+
'const', 'constructor', 'continue', 'destructor', 'div', 'do',
|
| 70 |
+
'downto', 'else', 'end', 'file', 'for', 'function', 'goto',
|
| 71 |
+
'if', 'implementation', 'in', 'inherited', 'inline', 'interface',
|
| 72 |
+
'label', 'mod', 'nil', 'not', 'object', 'of', 'on', 'operator',
|
| 73 |
+
'or', 'packed', 'procedure', 'program', 'record', 'reintroduce',
|
| 74 |
+
'repeat', 'self', 'set', 'shl', 'shr', 'string', 'then', 'to',
|
| 75 |
+
'type', 'unit', 'until', 'uses', 'var', 'while', 'with', 'xor'
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
DELPHI_KEYWORDS = (
|
| 79 |
+
'as', 'class', 'except', 'exports', 'finalization', 'finally',
|
| 80 |
+
'initialization', 'is', 'library', 'on', 'property', 'raise',
|
| 81 |
+
'threadvar', 'try'
|
| 82 |
+
)
|
| 83 |
+
|
| 84 |
+
FREE_PASCAL_KEYWORDS = (
|
| 85 |
+
'dispose', 'exit', 'false', 'new', 'true'
|
| 86 |
+
)
|
| 87 |
+
|
| 88 |
+
BLOCK_KEYWORDS = {
|
| 89 |
+
'begin', 'class', 'const', 'constructor', 'destructor', 'end',
|
| 90 |
+
'finalization', 'function', 'implementation', 'initialization',
|
| 91 |
+
'label', 'library', 'operator', 'procedure', 'program', 'property',
|
| 92 |
+
'record', 'threadvar', 'type', 'unit', 'uses', 'var'
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
FUNCTION_MODIFIERS = {
|
| 96 |
+
'alias', 'cdecl', 'export', 'inline', 'interrupt', 'nostackframe',
|
| 97 |
+
'pascal', 'register', 'safecall', 'softfloat', 'stdcall',
|
| 98 |
+
'varargs', 'name', 'dynamic', 'near', 'virtual', 'external',
|
| 99 |
+
'override', 'assembler'
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
# XXX: those aren't global. but currently we know no way for defining
|
| 103 |
+
# them just for the type context.
|
| 104 |
+
DIRECTIVES = {
|
| 105 |
+
'absolute', 'abstract', 'assembler', 'cppdecl', 'default', 'far',
|
| 106 |
+
'far16', 'forward', 'index', 'oldfpccall', 'private', 'protected',
|
| 107 |
+
'published', 'public'
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
BUILTIN_TYPES = {
|
| 111 |
+
'ansichar', 'ansistring', 'bool', 'boolean', 'byte', 'bytebool',
|
| 112 |
+
'cardinal', 'char', 'comp', 'currency', 'double', 'dword',
|
| 113 |
+
'extended', 'int64', 'integer', 'iunknown', 'longbool', 'longint',
|
| 114 |
+
'longword', 'pansichar', 'pansistring', 'pbool', 'pboolean',
|
| 115 |
+
'pbyte', 'pbytearray', 'pcardinal', 'pchar', 'pcomp', 'pcurrency',
|
| 116 |
+
'pdate', 'pdatetime', 'pdouble', 'pdword', 'pextended', 'phandle',
|
| 117 |
+
'pint64', 'pinteger', 'plongint', 'plongword', 'pointer',
|
| 118 |
+
'ppointer', 'pshortint', 'pshortstring', 'psingle', 'psmallint',
|
| 119 |
+
'pstring', 'pvariant', 'pwidechar', 'pwidestring', 'pword',
|
| 120 |
+
'pwordarray', 'pwordbool', 'real', 'real48', 'shortint',
|
| 121 |
+
'shortstring', 'single', 'smallint', 'string', 'tclass', 'tdate',
|
| 122 |
+
'tdatetime', 'textfile', 'thandle', 'tobject', 'ttime', 'variant',
|
| 123 |
+
'widechar', 'widestring', 'word', 'wordbool'
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
BUILTIN_UNITS = {
|
| 127 |
+
'System': (
|
| 128 |
+
'abs', 'acquireexceptionobject', 'addr', 'ansitoutf8',
|
| 129 |
+
'append', 'arctan', 'assert', 'assigned', 'assignfile',
|
| 130 |
+
'beginthread', 'blockread', 'blockwrite', 'break', 'chdir',
|
| 131 |
+
'chr', 'close', 'closefile', 'comptocurrency', 'comptodouble',
|
| 132 |
+
'concat', 'continue', 'copy', 'cos', 'dec', 'delete',
|
| 133 |
+
'dispose', 'doubletocomp', 'endthread', 'enummodules',
|
| 134 |
+
'enumresourcemodules', 'eof', 'eoln', 'erase', 'exceptaddr',
|
| 135 |
+
'exceptobject', 'exclude', 'exit', 'exp', 'filepos', 'filesize',
|
| 136 |
+
'fillchar', 'finalize', 'findclasshinstance', 'findhinstance',
|
| 137 |
+
'findresourcehinstance', 'flush', 'frac', 'freemem',
|
| 138 |
+
'get8087cw', 'getdir', 'getlasterror', 'getmem',
|
| 139 |
+
'getmemorymanager', 'getmodulefilename', 'getvariantmanager',
|
| 140 |
+
'halt', 'hi', 'high', 'inc', 'include', 'initialize', 'insert',
|
| 141 |
+
'int', 'ioresult', 'ismemorymanagerset', 'isvariantmanagerset',
|
| 142 |
+
'length', 'ln', 'lo', 'low', 'mkdir', 'move', 'new', 'odd',
|
| 143 |
+
'olestrtostring', 'olestrtostrvar', 'ord', 'paramcount',
|
| 144 |
+
'paramstr', 'pi', 'pos', 'pred', 'ptr', 'pucs4chars', 'random',
|
| 145 |
+
'randomize', 'read', 'readln', 'reallocmem',
|
| 146 |
+
'releaseexceptionobject', 'rename', 'reset', 'rewrite', 'rmdir',
|
| 147 |
+
'round', 'runerror', 'seek', 'seekeof', 'seekeoln',
|
| 148 |
+
'set8087cw', 'setlength', 'setlinebreakstyle',
|
| 149 |
+
'setmemorymanager', 'setstring', 'settextbuf',
|
| 150 |
+
'setvariantmanager', 'sin', 'sizeof', 'slice', 'sqr', 'sqrt',
|
| 151 |
+
'str', 'stringofchar', 'stringtoolestr', 'stringtowidechar',
|
| 152 |
+
'succ', 'swap', 'trunc', 'truncate', 'typeinfo',
|
| 153 |
+
'ucs4stringtowidestring', 'unicodetoutf8', 'uniquestring',
|
| 154 |
+
'upcase', 'utf8decode', 'utf8encode', 'utf8toansi',
|
| 155 |
+
'utf8tounicode', 'val', 'vararrayredim', 'varclear',
|
| 156 |
+
'widecharlentostring', 'widecharlentostrvar',
|
| 157 |
+
'widechartostring', 'widechartostrvar',
|
| 158 |
+
'widestringtoucs4string', 'write', 'writeln'
|
| 159 |
+
),
|
| 160 |
+
'SysUtils': (
|
| 161 |
+
'abort', 'addexitproc', 'addterminateproc', 'adjustlinebreaks',
|
| 162 |
+
'allocmem', 'ansicomparefilename', 'ansicomparestr',
|
| 163 |
+
'ansicomparetext', 'ansidequotedstr', 'ansiextractquotedstr',
|
| 164 |
+
'ansilastchar', 'ansilowercase', 'ansilowercasefilename',
|
| 165 |
+
'ansipos', 'ansiquotedstr', 'ansisamestr', 'ansisametext',
|
| 166 |
+
'ansistrcomp', 'ansistricomp', 'ansistrlastchar', 'ansistrlcomp',
|
| 167 |
+
'ansistrlicomp', 'ansistrlower', 'ansistrpos', 'ansistrrscan',
|
| 168 |
+
'ansistrscan', 'ansistrupper', 'ansiuppercase',
|
| 169 |
+
'ansiuppercasefilename', 'appendstr', 'assignstr', 'beep',
|
| 170 |
+
'booltostr', 'bytetocharindex', 'bytetocharlen', 'bytetype',
|
| 171 |
+
'callterminateprocs', 'changefileext', 'charlength',
|
| 172 |
+
'chartobyteindex', 'chartobytelen', 'comparemem', 'comparestr',
|
| 173 |
+
'comparetext', 'createdir', 'createguid', 'currentyear',
|
| 174 |
+
'currtostr', 'currtostrf', 'date', 'datetimetofiledate',
|
| 175 |
+
'datetimetostr', 'datetimetostring', 'datetimetosystemtime',
|
| 176 |
+
'datetimetotimestamp', 'datetostr', 'dayofweek', 'decodedate',
|
| 177 |
+
'decodedatefully', 'decodetime', 'deletefile', 'directoryexists',
|
| 178 |
+
'diskfree', 'disksize', 'disposestr', 'encodedate', 'encodetime',
|
| 179 |
+
'exceptionerrormessage', 'excludetrailingbackslash',
|
| 180 |
+
'excludetrailingpathdelimiter', 'expandfilename',
|
| 181 |
+
'expandfilenamecase', 'expanduncfilename', 'extractfiledir',
|
| 182 |
+
'extractfiledrive', 'extractfileext', 'extractfilename',
|
| 183 |
+
'extractfilepath', 'extractrelativepath', 'extractshortpathname',
|
| 184 |
+
'fileage', 'fileclose', 'filecreate', 'filedatetodatetime',
|
| 185 |
+
'fileexists', 'filegetattr', 'filegetdate', 'fileisreadonly',
|
| 186 |
+
'fileopen', 'fileread', 'filesearch', 'fileseek', 'filesetattr',
|
| 187 |
+
'filesetdate', 'filesetreadonly', 'filewrite', 'finalizepackage',
|
| 188 |
+
'findclose', 'findcmdlineswitch', 'findfirst', 'findnext',
|
| 189 |
+
'floattocurr', 'floattodatetime', 'floattodecimal', 'floattostr',
|
| 190 |
+
'floattostrf', 'floattotext', 'floattotextfmt', 'fmtloadstr',
|
| 191 |
+
'fmtstr', 'forcedirectories', 'format', 'formatbuf', 'formatcurr',
|
| 192 |
+
'formatdatetime', 'formatfloat', 'freeandnil', 'getcurrentdir',
|
| 193 |
+
'getenvironmentvariable', 'getfileversion', 'getformatsettings',
|
| 194 |
+
'getlocaleformatsettings', 'getmodulename', 'getpackagedescription',
|
| 195 |
+
'getpackageinfo', 'gettime', 'guidtostring', 'incamonth',
|
| 196 |
+
'includetrailingbackslash', 'includetrailingpathdelimiter',
|
| 197 |
+
'incmonth', 'initializepackage', 'interlockeddecrement',
|
| 198 |
+
'interlockedexchange', 'interlockedexchangeadd',
|
| 199 |
+
'interlockedincrement', 'inttohex', 'inttostr', 'isdelimiter',
|
| 200 |
+
'isequalguid', 'isleapyear', 'ispathdelimiter', 'isvalidident',
|
| 201 |
+
'languages', 'lastdelimiter', 'loadpackage', 'loadstr',
|
| 202 |
+
'lowercase', 'msecstotimestamp', 'newstr', 'nextcharindex', 'now',
|
| 203 |
+
'outofmemoryerror', 'quotedstr', 'raiselastoserror',
|
| 204 |
+
'raiselastwin32error', 'removedir', 'renamefile', 'replacedate',
|
| 205 |
+
'replacetime', 'safeloadlibrary', 'samefilename', 'sametext',
|
| 206 |
+
'setcurrentdir', 'showexception', 'sleep', 'stralloc', 'strbufsize',
|
| 207 |
+
'strbytetype', 'strcat', 'strcharlength', 'strcomp', 'strcopy',
|
| 208 |
+
'strdispose', 'strecopy', 'strend', 'strfmt', 'stricomp',
|
| 209 |
+
'stringreplace', 'stringtoguid', 'strlcat', 'strlcomp', 'strlcopy',
|
| 210 |
+
'strlen', 'strlfmt', 'strlicomp', 'strlower', 'strmove', 'strnew',
|
| 211 |
+
'strnextchar', 'strpas', 'strpcopy', 'strplcopy', 'strpos',
|
| 212 |
+
'strrscan', 'strscan', 'strtobool', 'strtobooldef', 'strtocurr',
|
| 213 |
+
'strtocurrdef', 'strtodate', 'strtodatedef', 'strtodatetime',
|
| 214 |
+
'strtodatetimedef', 'strtofloat', 'strtofloatdef', 'strtoint',
|
| 215 |
+
'strtoint64', 'strtoint64def', 'strtointdef', 'strtotime',
|
| 216 |
+
'strtotimedef', 'strupper', 'supports', 'syserrormessage',
|
| 217 |
+
'systemtimetodatetime', 'texttofloat', 'time', 'timestamptodatetime',
|
| 218 |
+
'timestamptomsecs', 'timetostr', 'trim', 'trimleft', 'trimright',
|
| 219 |
+
'tryencodedate', 'tryencodetime', 'tryfloattocurr', 'tryfloattodatetime',
|
| 220 |
+
'trystrtobool', 'trystrtocurr', 'trystrtodate', 'trystrtodatetime',
|
| 221 |
+
'trystrtofloat', 'trystrtoint', 'trystrtoint64', 'trystrtotime',
|
| 222 |
+
'unloadpackage', 'uppercase', 'widecomparestr', 'widecomparetext',
|
| 223 |
+
'widefmtstr', 'wideformat', 'wideformatbuf', 'widelowercase',
|
| 224 |
+
'widesamestr', 'widesametext', 'wideuppercase', 'win32check',
|
| 225 |
+
'wraptext'
|
| 226 |
+
),
|
| 227 |
+
'Classes': (
|
| 228 |
+
'activateclassgroup', 'allocatehwnd', 'bintohex', 'checksynchronize',
|
| 229 |
+
'collectionsequal', 'countgenerations', 'deallocatehwnd', 'equalrect',
|
| 230 |
+
'extractstrings', 'findclass', 'findglobalcomponent', 'getclass',
|
| 231 |
+
'groupdescendantswith', 'hextobin', 'identtoint',
|
| 232 |
+
'initinheritedcomponent', 'inttoident', 'invalidpoint',
|
| 233 |
+
'isuniqueglobalcomponentname', 'linestart', 'objectbinarytotext',
|
| 234 |
+
'objectresourcetotext', 'objecttexttobinary', 'objecttexttoresource',
|
| 235 |
+
'pointsequal', 'readcomponentres', 'readcomponentresex',
|
| 236 |
+
'readcomponentresfile', 'rect', 'registerclass', 'registerclassalias',
|
| 237 |
+
'registerclasses', 'registercomponents', 'registerintegerconsts',
|
| 238 |
+
'registernoicon', 'registernonactivex', 'smallpoint', 'startclassgroup',
|
| 239 |
+
'teststreamformat', 'unregisterclass', 'unregisterclasses',
|
| 240 |
+
'unregisterintegerconsts', 'unregistermoduleclasses',
|
| 241 |
+
'writecomponentresfile'
|
| 242 |
+
),
|
| 243 |
+
'Math': (
|
| 244 |
+
'arccos', 'arccosh', 'arccot', 'arccoth', 'arccsc', 'arccsch', 'arcsec',
|
| 245 |
+
'arcsech', 'arcsin', 'arcsinh', 'arctan2', 'arctanh', 'ceil',
|
| 246 |
+
'comparevalue', 'cosecant', 'cosh', 'cot', 'cotan', 'coth', 'csc',
|
| 247 |
+
'csch', 'cycletodeg', 'cycletograd', 'cycletorad', 'degtocycle',
|
| 248 |
+
'degtograd', 'degtorad', 'divmod', 'doubledecliningbalance',
|
| 249 |
+
'ensurerange', 'floor', 'frexp', 'futurevalue', 'getexceptionmask',
|
| 250 |
+
'getprecisionmode', 'getroundmode', 'gradtocycle', 'gradtodeg',
|
| 251 |
+
'gradtorad', 'hypot', 'inrange', 'interestpayment', 'interestrate',
|
| 252 |
+
'internalrateofreturn', 'intpower', 'isinfinite', 'isnan', 'iszero',
|
| 253 |
+
'ldexp', 'lnxp1', 'log10', 'log2', 'logn', 'max', 'maxintvalue',
|
| 254 |
+
'maxvalue', 'mean', 'meanandstddev', 'min', 'minintvalue', 'minvalue',
|
| 255 |
+
'momentskewkurtosis', 'netpresentvalue', 'norm', 'numberofperiods',
|
| 256 |
+
'payment', 'periodpayment', 'poly', 'popnstddev', 'popnvariance',
|
| 257 |
+
'power', 'presentvalue', 'radtocycle', 'radtodeg', 'radtograd',
|
| 258 |
+
'randg', 'randomrange', 'roundto', 'samevalue', 'sec', 'secant',
|
| 259 |
+
'sech', 'setexceptionmask', 'setprecisionmode', 'setroundmode',
|
| 260 |
+
'sign', 'simpleroundto', 'sincos', 'sinh', 'slndepreciation', 'stddev',
|
| 261 |
+
'sum', 'sumint', 'sumofsquares', 'sumsandsquares', 'syddepreciation',
|
| 262 |
+
'tan', 'tanh', 'totalvariance', 'variance'
|
| 263 |
+
)
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
ASM_REGISTERS = {
|
| 267 |
+
'ah', 'al', 'ax', 'bh', 'bl', 'bp', 'bx', 'ch', 'cl', 'cr0',
|
| 268 |
+
'cr1', 'cr2', 'cr3', 'cr4', 'cs', 'cx', 'dh', 'di', 'dl', 'dr0',
|
| 269 |
+
'dr1', 'dr2', 'dr3', 'dr4', 'dr5', 'dr6', 'dr7', 'ds', 'dx',
|
| 270 |
+
'eax', 'ebp', 'ebx', 'ecx', 'edi', 'edx', 'es', 'esi', 'esp',
|
| 271 |
+
'fs', 'gs', 'mm0', 'mm1', 'mm2', 'mm3', 'mm4', 'mm5', 'mm6',
|
| 272 |
+
'mm7', 'si', 'sp', 'ss', 'st0', 'st1', 'st2', 'st3', 'st4', 'st5',
|
| 273 |
+
'st6', 'st7', 'xmm0', 'xmm1', 'xmm2', 'xmm3', 'xmm4', 'xmm5',
|
| 274 |
+
'xmm6', 'xmm7'
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
ASM_INSTRUCTIONS = {
|
| 278 |
+
'aaa', 'aad', 'aam', 'aas', 'adc', 'add', 'and', 'arpl', 'bound',
|
| 279 |
+
'bsf', 'bsr', 'bswap', 'bt', 'btc', 'btr', 'bts', 'call', 'cbw',
|
| 280 |
+
'cdq', 'clc', 'cld', 'cli', 'clts', 'cmc', 'cmova', 'cmovae',
|
| 281 |
+
'cmovb', 'cmovbe', 'cmovc', 'cmovcxz', 'cmove', 'cmovg',
|
| 282 |
+
'cmovge', 'cmovl', 'cmovle', 'cmovna', 'cmovnae', 'cmovnb',
|
| 283 |
+
'cmovnbe', 'cmovnc', 'cmovne', 'cmovng', 'cmovnge', 'cmovnl',
|
| 284 |
+
'cmovnle', 'cmovno', 'cmovnp', 'cmovns', 'cmovnz', 'cmovo',
|
| 285 |
+
'cmovp', 'cmovpe', 'cmovpo', 'cmovs', 'cmovz', 'cmp', 'cmpsb',
|
| 286 |
+
'cmpsd', 'cmpsw', 'cmpxchg', 'cmpxchg486', 'cmpxchg8b', 'cpuid',
|
| 287 |
+
'cwd', 'cwde', 'daa', 'das', 'dec', 'div', 'emms', 'enter', 'hlt',
|
| 288 |
+
'ibts', 'icebp', 'idiv', 'imul', 'in', 'inc', 'insb', 'insd',
|
| 289 |
+
'insw', 'int', 'int01', 'int03', 'int1', 'int3', 'into', 'invd',
|
| 290 |
+
'invlpg', 'iret', 'iretd', 'iretw', 'ja', 'jae', 'jb', 'jbe',
|
| 291 |
+
'jc', 'jcxz', 'jcxz', 'je', 'jecxz', 'jg', 'jge', 'jl', 'jle',
|
| 292 |
+
'jmp', 'jna', 'jnae', 'jnb', 'jnbe', 'jnc', 'jne', 'jng', 'jnge',
|
| 293 |
+
'jnl', 'jnle', 'jno', 'jnp', 'jns', 'jnz', 'jo', 'jp', 'jpe',
|
| 294 |
+
'jpo', 'js', 'jz', 'lahf', 'lar', 'lcall', 'lds', 'lea', 'leave',
|
| 295 |
+
'les', 'lfs', 'lgdt', 'lgs', 'lidt', 'ljmp', 'lldt', 'lmsw',
|
| 296 |
+
'loadall', 'loadall286', 'lock', 'lodsb', 'lodsd', 'lodsw',
|
| 297 |
+
'loop', 'loope', 'loopne', 'loopnz', 'loopz', 'lsl', 'lss', 'ltr',
|
| 298 |
+
'mov', 'movd', 'movq', 'movsb', 'movsd', 'movsw', 'movsx',
|
| 299 |
+
'movzx', 'mul', 'neg', 'nop', 'not', 'or', 'out', 'outsb', 'outsd',
|
| 300 |
+
'outsw', 'pop', 'popa', 'popad', 'popaw', 'popf', 'popfd', 'popfw',
|
| 301 |
+
'push', 'pusha', 'pushad', 'pushaw', 'pushf', 'pushfd', 'pushfw',
|
| 302 |
+
'rcl', 'rcr', 'rdmsr', 'rdpmc', 'rdshr', 'rdtsc', 'rep', 'repe',
|
| 303 |
+
'repne', 'repnz', 'repz', 'ret', 'retf', 'retn', 'rol', 'ror',
|
| 304 |
+
'rsdc', 'rsldt', 'rsm', 'sahf', 'sal', 'salc', 'sar', 'sbb',
|
| 305 |
+
'scasb', 'scasd', 'scasw', 'seta', 'setae', 'setb', 'setbe',
|
| 306 |
+
'setc', 'setcxz', 'sete', 'setg', 'setge', 'setl', 'setle',
|
| 307 |
+
'setna', 'setnae', 'setnb', 'setnbe', 'setnc', 'setne', 'setng',
|
| 308 |
+
'setnge', 'setnl', 'setnle', 'setno', 'setnp', 'setns', 'setnz',
|
| 309 |
+
'seto', 'setp', 'setpe', 'setpo', 'sets', 'setz', 'sgdt', 'shl',
|
| 310 |
+
'shld', 'shr', 'shrd', 'sidt', 'sldt', 'smi', 'smint', 'smintold',
|
| 311 |
+
'smsw', 'stc', 'std', 'sti', 'stosb', 'stosd', 'stosw', 'str',
|
| 312 |
+
'sub', 'svdc', 'svldt', 'svts', 'syscall', 'sysenter', 'sysexit',
|
| 313 |
+
'sysret', 'test', 'ud1', 'ud2', 'umov', 'verr', 'verw', 'wait',
|
| 314 |
+
'wbinvd', 'wrmsr', 'wrshr', 'xadd', 'xbts', 'xchg', 'xlat',
|
| 315 |
+
'xlatb', 'xor'
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
PORTUGOL_KEYWORDS = (
|
| 319 |
+
'aleatorio',
|
| 320 |
+
'algoritmo',
|
| 321 |
+
'arquivo',
|
| 322 |
+
'ate',
|
| 323 |
+
'caso',
|
| 324 |
+
'cronometro',
|
| 325 |
+
'debug',
|
| 326 |
+
'e',
|
| 327 |
+
'eco',
|
| 328 |
+
'enquanto',
|
| 329 |
+
'entao',
|
| 330 |
+
'escolha',
|
| 331 |
+
'escreva',
|
| 332 |
+
'escreval',
|
| 333 |
+
'faca',
|
| 334 |
+
'falso',
|
| 335 |
+
'fimalgoritmo',
|
| 336 |
+
'fimenquanto',
|
| 337 |
+
'fimescolha',
|
| 338 |
+
'fimfuncao',
|
| 339 |
+
'fimpara',
|
| 340 |
+
'fimprocedimento',
|
| 341 |
+
'fimrepita',
|
| 342 |
+
'fimse',
|
| 343 |
+
'funcao',
|
| 344 |
+
'inicio',
|
| 345 |
+
'int',
|
| 346 |
+
'interrompa',
|
| 347 |
+
'leia',
|
| 348 |
+
'limpatela',
|
| 349 |
+
'mod',
|
| 350 |
+
'nao',
|
| 351 |
+
'ou',
|
| 352 |
+
'outrocaso',
|
| 353 |
+
'para',
|
| 354 |
+
'passo',
|
| 355 |
+
'pausa',
|
| 356 |
+
'procedimento',
|
| 357 |
+
'repita',
|
| 358 |
+
'retorne',
|
| 359 |
+
'se',
|
| 360 |
+
'senao',
|
| 361 |
+
'timer',
|
| 362 |
+
'var',
|
| 363 |
+
'vetor',
|
| 364 |
+
'verdadeiro',
|
| 365 |
+
'xou',
|
| 366 |
+
'div',
|
| 367 |
+
'mod',
|
| 368 |
+
'abs',
|
| 369 |
+
'arccos',
|
| 370 |
+
'arcsen',
|
| 371 |
+
'arctan',
|
| 372 |
+
'cos',
|
| 373 |
+
'cotan',
|
| 374 |
+
'Exp',
|
| 375 |
+
'grauprad',
|
| 376 |
+
'int',
|
| 377 |
+
'log',
|
| 378 |
+
'logn',
|
| 379 |
+
'pi',
|
| 380 |
+
'quad',
|
| 381 |
+
'radpgrau',
|
| 382 |
+
'raizq',
|
| 383 |
+
'rand',
|
| 384 |
+
'randi',
|
| 385 |
+
'sen',
|
| 386 |
+
'Tan',
|
| 387 |
+
'asc',
|
| 388 |
+
'carac',
|
| 389 |
+
'caracpnum',
|
| 390 |
+
'compr',
|
| 391 |
+
'copia',
|
| 392 |
+
'maiusc',
|
| 393 |
+
'minusc',
|
| 394 |
+
'numpcarac',
|
| 395 |
+
'pos',
|
| 396 |
+
)
|
| 397 |
+
|
| 398 |
+
PORTUGOL_BUILTIN_TYPES = {
|
| 399 |
+
'inteiro', 'real', 'caractere', 'logico'
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
def __init__(self, **options):
|
| 403 |
+
Lexer.__init__(self, **options)
|
| 404 |
+
self.keywords = set()
|
| 405 |
+
self.builtins = set()
|
| 406 |
+
if get_bool_opt(options, 'portugol', False):
|
| 407 |
+
self.keywords.update(self.PORTUGOL_KEYWORDS)
|
| 408 |
+
self.builtins.update(self.PORTUGOL_BUILTIN_TYPES)
|
| 409 |
+
self.is_portugol = True
|
| 410 |
+
else:
|
| 411 |
+
self.is_portugol = False
|
| 412 |
+
|
| 413 |
+
if get_bool_opt(options, 'turbopascal', True):
|
| 414 |
+
self.keywords.update(self.TURBO_PASCAL_KEYWORDS)
|
| 415 |
+
if get_bool_opt(options, 'delphi', True):
|
| 416 |
+
self.keywords.update(self.DELPHI_KEYWORDS)
|
| 417 |
+
if get_bool_opt(options, 'freepascal', True):
|
| 418 |
+
self.keywords.update(self.FREE_PASCAL_KEYWORDS)
|
| 419 |
+
for unit in get_list_opt(options, 'units', list(self.BUILTIN_UNITS)):
|
| 420 |
+
self.builtins.update(self.BUILTIN_UNITS[unit])
|
| 421 |
+
|
| 422 |
+
def get_tokens_unprocessed(self, text):
|
| 423 |
+
scanner = Scanner(text, re.DOTALL | re.MULTILINE | re.IGNORECASE)
|
| 424 |
+
stack = ['initial']
|
| 425 |
+
in_function_block = False
|
| 426 |
+
in_property_block = False
|
| 427 |
+
was_dot = False
|
| 428 |
+
next_token_is_function = False
|
| 429 |
+
next_token_is_property = False
|
| 430 |
+
collect_labels = False
|
| 431 |
+
block_labels = set()
|
| 432 |
+
brace_balance = [0, 0]
|
| 433 |
+
|
| 434 |
+
while not scanner.eos:
|
| 435 |
+
token = Error
|
| 436 |
+
|
| 437 |
+
if stack[-1] == 'initial':
|
| 438 |
+
if scanner.scan(r'\s+'):
|
| 439 |
+
token = Whitespace
|
| 440 |
+
elif not self.is_portugol and scanner.scan(r'\{.*?\}|\(\*.*?\*\)'):
|
| 441 |
+
if scanner.match.startswith('$'):
|
| 442 |
+
token = Comment.Preproc
|
| 443 |
+
else:
|
| 444 |
+
token = Comment.Multiline
|
| 445 |
+
elif scanner.scan(r'//.*?$'):
|
| 446 |
+
token = Comment.Single
|
| 447 |
+
elif self.is_portugol and scanner.scan(r'(<\-)|(>=)|(<=)|%|<|>|-|\+|\*|\=|(<>)|\/|\.|:|,'):
|
| 448 |
+
token = Operator
|
| 449 |
+
elif not self.is_portugol and scanner.scan(r'[-+*\/=<>:;,.@\^]'):
|
| 450 |
+
token = Operator
|
| 451 |
+
# stop label highlighting on next ";"
|
| 452 |
+
if collect_labels and scanner.match == ';':
|
| 453 |
+
collect_labels = False
|
| 454 |
+
elif scanner.scan(r'[\(\)\[\]]+'):
|
| 455 |
+
token = Punctuation
|
| 456 |
+
# abort function naming ``foo = Function(...)``
|
| 457 |
+
next_token_is_function = False
|
| 458 |
+
# if we are in a function block we count the open
|
| 459 |
+
# braces because ootherwise it's impossible to
|
| 460 |
+
# determine the end of the modifier context
|
| 461 |
+
if in_function_block or in_property_block:
|
| 462 |
+
if scanner.match == '(':
|
| 463 |
+
brace_balance[0] += 1
|
| 464 |
+
elif scanner.match == ')':
|
| 465 |
+
brace_balance[0] -= 1
|
| 466 |
+
elif scanner.match == '[':
|
| 467 |
+
brace_balance[1] += 1
|
| 468 |
+
elif scanner.match == ']':
|
| 469 |
+
brace_balance[1] -= 1
|
| 470 |
+
elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'):
|
| 471 |
+
lowercase_name = scanner.match.lower()
|
| 472 |
+
if lowercase_name == 'result':
|
| 473 |
+
token = Name.Builtin.Pseudo
|
| 474 |
+
elif lowercase_name in self.keywords:
|
| 475 |
+
token = Keyword
|
| 476 |
+
# if we are in a special block and a
|
| 477 |
+
# block ending keyword occurs (and the parenthesis
|
| 478 |
+
# is balanced) we end the current block context
|
| 479 |
+
if self.is_portugol:
|
| 480 |
+
if lowercase_name in ('funcao', 'procedimento'):
|
| 481 |
+
in_function_block = True
|
| 482 |
+
next_token_is_function = True
|
| 483 |
+
else:
|
| 484 |
+
if (in_function_block or in_property_block) and \
|
| 485 |
+
lowercase_name in self.BLOCK_KEYWORDS and \
|
| 486 |
+
brace_balance[0] <= 0 and \
|
| 487 |
+
brace_balance[1] <= 0:
|
| 488 |
+
in_function_block = False
|
| 489 |
+
in_property_block = False
|
| 490 |
+
brace_balance = [0, 0]
|
| 491 |
+
block_labels = set()
|
| 492 |
+
if lowercase_name in ('label', 'goto'):
|
| 493 |
+
collect_labels = True
|
| 494 |
+
elif lowercase_name == 'asm':
|
| 495 |
+
stack.append('asm')
|
| 496 |
+
elif lowercase_name == 'property':
|
| 497 |
+
in_property_block = True
|
| 498 |
+
next_token_is_property = True
|
| 499 |
+
elif lowercase_name in ('procedure', 'operator',
|
| 500 |
+
'function', 'constructor',
|
| 501 |
+
'destructor'):
|
| 502 |
+
in_function_block = True
|
| 503 |
+
next_token_is_function = True
|
| 504 |
+
# we are in a function block and the current name
|
| 505 |
+
# is in the set of registered modifiers. highlight
|
| 506 |
+
# it as pseudo keyword
|
| 507 |
+
elif not self.is_portugol and in_function_block and \
|
| 508 |
+
lowercase_name in self.FUNCTION_MODIFIERS:
|
| 509 |
+
token = Keyword.Pseudo
|
| 510 |
+
# if we are in a property highlight some more
|
| 511 |
+
# modifiers
|
| 512 |
+
elif not self.is_portugol and in_property_block and \
|
| 513 |
+
lowercase_name in ('read', 'write'):
|
| 514 |
+
token = Keyword.Pseudo
|
| 515 |
+
next_token_is_function = True
|
| 516 |
+
# if the last iteration set next_token_is_function
|
| 517 |
+
# to true we now want this name highlighted as
|
| 518 |
+
# function. so do that and reset the state
|
| 519 |
+
elif next_token_is_function:
|
| 520 |
+
# Look if the next token is a dot. If yes it's
|
| 521 |
+
# not a function, but a class name and the
|
| 522 |
+
# part after the dot a function name
|
| 523 |
+
if not self.is_portugol and scanner.test(r'\s*\.\s*'):
|
| 524 |
+
token = Name.Class
|
| 525 |
+
# it's not a dot, our job is done
|
| 526 |
+
else:
|
| 527 |
+
token = Name.Function
|
| 528 |
+
next_token_is_function = False
|
| 529 |
+
|
| 530 |
+
if self.is_portugol:
|
| 531 |
+
block_labels.add(scanner.match.lower())
|
| 532 |
+
|
| 533 |
+
# same for properties
|
| 534 |
+
elif not self.is_portugol and next_token_is_property:
|
| 535 |
+
token = Name.Property
|
| 536 |
+
next_token_is_property = False
|
| 537 |
+
# Highlight this token as label and add it
|
| 538 |
+
# to the list of known labels
|
| 539 |
+
elif not self.is_portugol and collect_labels:
|
| 540 |
+
token = Name.Label
|
| 541 |
+
block_labels.add(scanner.match.lower())
|
| 542 |
+
# name is in list of known labels
|
| 543 |
+
elif lowercase_name in block_labels:
|
| 544 |
+
token = Name.Label
|
| 545 |
+
elif self.is_portugol and lowercase_name in self.PORTUGOL_BUILTIN_TYPES:
|
| 546 |
+
token = Keyword.Type
|
| 547 |
+
elif not self.is_portugol and lowercase_name in self.BUILTIN_TYPES:
|
| 548 |
+
token = Keyword.Type
|
| 549 |
+
elif not self.is_portugol and lowercase_name in self.DIRECTIVES:
|
| 550 |
+
token = Keyword.Pseudo
|
| 551 |
+
# builtins are just builtins if the token
|
| 552 |
+
# before isn't a dot
|
| 553 |
+
elif not self.is_portugol and not was_dot and lowercase_name in self.builtins:
|
| 554 |
+
token = Name.Builtin
|
| 555 |
+
else:
|
| 556 |
+
token = Name
|
| 557 |
+
elif self.is_portugol and scanner.scan(r"\""):
|
| 558 |
+
token = String
|
| 559 |
+
stack.append('string')
|
| 560 |
+
elif not self.is_portugol and scanner.scan(r"'"):
|
| 561 |
+
token = String
|
| 562 |
+
stack.append('string')
|
| 563 |
+
elif not self.is_portugol and scanner.scan(r'\#(\d+|\$[0-9A-Fa-f]+)'):
|
| 564 |
+
token = String.Char
|
| 565 |
+
elif not self.is_portugol and scanner.scan(r'\$[0-9A-Fa-f]+'):
|
| 566 |
+
token = Number.Hex
|
| 567 |
+
elif scanner.scan(r'\d+(?![eE]|\.[^.])'):
|
| 568 |
+
token = Number.Integer
|
| 569 |
+
elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'):
|
| 570 |
+
token = Number.Float
|
| 571 |
+
else:
|
| 572 |
+
# if the stack depth is deeper than once, pop
|
| 573 |
+
if len(stack) > 1:
|
| 574 |
+
stack.pop()
|
| 575 |
+
scanner.get_char()
|
| 576 |
+
|
| 577 |
+
elif stack[-1] == 'string':
|
| 578 |
+
if self.is_portugol:
|
| 579 |
+
if scanner.scan(r"''"):
|
| 580 |
+
token = String.Escape
|
| 581 |
+
elif scanner.scan(r"\""):
|
| 582 |
+
token = String
|
| 583 |
+
stack.pop()
|
| 584 |
+
elif scanner.scan(r"[^\"]*"):
|
| 585 |
+
token = String
|
| 586 |
+
else:
|
| 587 |
+
scanner.get_char()
|
| 588 |
+
stack.pop()
|
| 589 |
+
else:
|
| 590 |
+
if scanner.scan(r"''"):
|
| 591 |
+
token = String.Escape
|
| 592 |
+
elif scanner.scan(r"'"):
|
| 593 |
+
token = String
|
| 594 |
+
stack.pop()
|
| 595 |
+
elif scanner.scan(r"[^']*"):
|
| 596 |
+
token = String
|
| 597 |
+
else:
|
| 598 |
+
scanner.get_char()
|
| 599 |
+
stack.pop()
|
| 600 |
+
elif not self.is_portugol and stack[-1] == 'asm':
|
| 601 |
+
if scanner.scan(r'\s+'):
|
| 602 |
+
token = Whitespace
|
| 603 |
+
elif scanner.scan(r'end'):
|
| 604 |
+
token = Keyword
|
| 605 |
+
stack.pop()
|
| 606 |
+
elif scanner.scan(r'\{.*?\}|\(\*.*?\*\)'):
|
| 607 |
+
if scanner.match.startswith('$'):
|
| 608 |
+
token = Comment.Preproc
|
| 609 |
+
else:
|
| 610 |
+
token = Comment.Multiline
|
| 611 |
+
elif scanner.scan(r'//.*?$'):
|
| 612 |
+
token = Comment.Single
|
| 613 |
+
elif scanner.scan(r"'"):
|
| 614 |
+
token = String
|
| 615 |
+
stack.append('string')
|
| 616 |
+
elif scanner.scan(r'@@[A-Za-z_][A-Za-z_0-9]*'):
|
| 617 |
+
token = Name.Label
|
| 618 |
+
elif scanner.scan(r'[A-Za-z_][A-Za-z_0-9]*'):
|
| 619 |
+
lowercase_name = scanner.match.lower()
|
| 620 |
+
if lowercase_name in self.ASM_INSTRUCTIONS:
|
| 621 |
+
token = Keyword
|
| 622 |
+
elif lowercase_name in self.ASM_REGISTERS:
|
| 623 |
+
token = Name.Builtin
|
| 624 |
+
else:
|
| 625 |
+
token = Name
|
| 626 |
+
elif scanner.scan(r'[-+*\/=<>:;,.@\^]+'):
|
| 627 |
+
token = Operator
|
| 628 |
+
elif scanner.scan(r'[\(\)\[\]]+'):
|
| 629 |
+
token = Punctuation
|
| 630 |
+
elif scanner.scan(r'\$[0-9A-Fa-f]+'):
|
| 631 |
+
token = Number.Hex
|
| 632 |
+
elif scanner.scan(r'\d+(?![eE]|\.[^.])'):
|
| 633 |
+
token = Number.Integer
|
| 634 |
+
elif scanner.scan(r'\d+(\.\d+([eE][+-]?\d+)?|[eE][+-]?\d+)'):
|
| 635 |
+
token = Number.Float
|
| 636 |
+
else:
|
| 637 |
+
scanner.get_char()
|
| 638 |
+
stack.pop()
|
| 639 |
+
|
| 640 |
+
# save the dot!!!11
|
| 641 |
+
if not self.is_portugol and scanner.match.strip():
|
| 642 |
+
was_dot = scanner.match == '.'
|
| 643 |
+
|
| 644 |
+
yield scanner.start_pos, token, scanner.match or ''
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pawn.py
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
+
|
| 5 |
+
Lexers for the Pawn languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer
|
| 12 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 13 |
+
Number, Punctuation
|
| 14 |
+
from pygments.util import get_bool_opt
|
| 15 |
+
|
| 16 |
+
__all__ = ['SourcePawnLexer', 'PawnLexer']
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class SourcePawnLexer(RegexLexer):
|
| 20 |
+
"""
|
| 21 |
+
For SourcePawn source code with preprocessor directives.
|
| 22 |
+
"""
|
| 23 |
+
name = 'SourcePawn'
|
| 24 |
+
aliases = ['sp']
|
| 25 |
+
filenames = ['*.sp']
|
| 26 |
+
mimetypes = ['text/x-sourcepawn']
|
| 27 |
+
url = 'https://github.com/alliedmodders/sourcepawn'
|
| 28 |
+
version_added = '1.6'
|
| 29 |
+
|
| 30 |
+
#: optional Comment or Whitespace
|
| 31 |
+
_ws = r'(?:\s|//.*?\n|/\*.*?\*/)+'
|
| 32 |
+
#: only one /* */ style comment
|
| 33 |
+
_ws1 = r'\s*(?:/[*].*?[*]/\s*)*'
|
| 34 |
+
|
| 35 |
+
tokens = {
|
| 36 |
+
'root': [
|
| 37 |
+
# preprocessor directives: without whitespace
|
| 38 |
+
(r'^#if\s+0', Comment.Preproc, 'if0'),
|
| 39 |
+
('^#', Comment.Preproc, 'macro'),
|
| 40 |
+
# or with whitespace
|
| 41 |
+
('^' + _ws1 + r'#if\s+0', Comment.Preproc, 'if0'),
|
| 42 |
+
('^' + _ws1 + '#', Comment.Preproc, 'macro'),
|
| 43 |
+
(r'\n', Text),
|
| 44 |
+
(r'\s+', Text),
|
| 45 |
+
(r'\\\n', Text), # line continuation
|
| 46 |
+
(r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
|
| 47 |
+
(r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
|
| 48 |
+
(r'[{}]', Punctuation),
|
| 49 |
+
(r'L?"', String, 'string'),
|
| 50 |
+
(r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
|
| 51 |
+
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
|
| 52 |
+
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
| 53 |
+
(r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
|
| 54 |
+
(r'0[0-7]+[LlUu]*', Number.Oct),
|
| 55 |
+
(r'\d+[LlUu]*', Number.Integer),
|
| 56 |
+
(r'[~!%^&*+=|?:<>/-]', Operator),
|
| 57 |
+
(r'[()\[\],.;]', Punctuation),
|
| 58 |
+
(r'(case|const|continue|native|'
|
| 59 |
+
r'default|else|enum|for|if|new|operator|'
|
| 60 |
+
r'public|return|sizeof|static|decl|struct|switch)\b', Keyword),
|
| 61 |
+
(r'(bool|Float)\b', Keyword.Type),
|
| 62 |
+
(r'(true|false)\b', Keyword.Constant),
|
| 63 |
+
(r'[a-zA-Z_]\w*', Name),
|
| 64 |
+
],
|
| 65 |
+
'string': [
|
| 66 |
+
(r'"', String, '#pop'),
|
| 67 |
+
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
| 68 |
+
(r'[^\\"\n]+', String), # all other characters
|
| 69 |
+
(r'\\\n', String), # line continuation
|
| 70 |
+
(r'\\', String), # stray backslash
|
| 71 |
+
],
|
| 72 |
+
'macro': [
|
| 73 |
+
(r'[^/\n]+', Comment.Preproc),
|
| 74 |
+
(r'/\*(.|\n)*?\*/', Comment.Multiline),
|
| 75 |
+
(r'//.*?\n', Comment.Single, '#pop'),
|
| 76 |
+
(r'/', Comment.Preproc),
|
| 77 |
+
(r'(?<=\\)\n', Comment.Preproc),
|
| 78 |
+
(r'\n', Comment.Preproc, '#pop'),
|
| 79 |
+
],
|
| 80 |
+
'if0': [
|
| 81 |
+
(r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
|
| 82 |
+
(r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
|
| 83 |
+
(r'.*?\n', Comment),
|
| 84 |
+
]
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
SM_TYPES = {'Action', 'bool', 'Float', 'Plugin', 'String', 'any',
|
| 88 |
+
'AdminFlag', 'OverrideType', 'OverrideRule', 'ImmunityType',
|
| 89 |
+
'GroupId', 'AdminId', 'AdmAccessMode', 'AdminCachePart',
|
| 90 |
+
'CookieAccess', 'CookieMenu', 'CookieMenuAction', 'NetFlow',
|
| 91 |
+
'ConVarBounds', 'QueryCookie', 'ReplySource',
|
| 92 |
+
'ConVarQueryResult', 'ConVarQueryFinished', 'Function',
|
| 93 |
+
'Action', 'Identity', 'PluginStatus', 'PluginInfo', 'DBResult',
|
| 94 |
+
'DBBindType', 'DBPriority', 'PropType', 'PropFieldType',
|
| 95 |
+
'MoveType', 'RenderMode', 'RenderFx', 'EventHookMode',
|
| 96 |
+
'EventHook', 'FileType', 'FileTimeMode', 'PathType',
|
| 97 |
+
'ParamType', 'ExecType', 'DialogType', 'Handle', 'KvDataTypes',
|
| 98 |
+
'NominateResult', 'MapChange', 'MenuStyle', 'MenuAction',
|
| 99 |
+
'MenuSource', 'RegexError', 'SDKCallType', 'SDKLibrary',
|
| 100 |
+
'SDKFuncConfSource', 'SDKType', 'SDKPassMethod', 'RayType',
|
| 101 |
+
'TraceEntityFilter', 'ListenOverride', 'SortOrder', 'SortType',
|
| 102 |
+
'SortFunc2D', 'APLRes', 'FeatureType', 'FeatureStatus',
|
| 103 |
+
'SMCResult', 'SMCError', 'TFClassType', 'TFTeam', 'TFCond',
|
| 104 |
+
'TFResourceType', 'Timer', 'TopMenuAction', 'TopMenuObjectType',
|
| 105 |
+
'TopMenuPosition', 'TopMenuObject', 'UserMsg'}
|
| 106 |
+
|
| 107 |
+
def __init__(self, **options):
|
| 108 |
+
self.smhighlighting = get_bool_opt(options,
|
| 109 |
+
'sourcemod', True)
|
| 110 |
+
|
| 111 |
+
self._functions = set()
|
| 112 |
+
if self.smhighlighting:
|
| 113 |
+
from pygments.lexers._sourcemod_builtins import FUNCTIONS
|
| 114 |
+
self._functions.update(FUNCTIONS)
|
| 115 |
+
RegexLexer.__init__(self, **options)
|
| 116 |
+
|
| 117 |
+
def get_tokens_unprocessed(self, text):
|
| 118 |
+
for index, token, value in \
|
| 119 |
+
RegexLexer.get_tokens_unprocessed(self, text):
|
| 120 |
+
if token is Name:
|
| 121 |
+
if self.smhighlighting:
|
| 122 |
+
if value in self.SM_TYPES:
|
| 123 |
+
token = Keyword.Type
|
| 124 |
+
elif value in self._functions:
|
| 125 |
+
token = Name.Builtin
|
| 126 |
+
yield index, token, value
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
class PawnLexer(RegexLexer):
|
| 130 |
+
"""
|
| 131 |
+
For Pawn source code.
|
| 132 |
+
"""
|
| 133 |
+
|
| 134 |
+
name = 'Pawn'
|
| 135 |
+
aliases = ['pawn']
|
| 136 |
+
filenames = ['*.p', '*.pwn', '*.inc']
|
| 137 |
+
mimetypes = ['text/x-pawn']
|
| 138 |
+
url = 'https://www.compuphase.com/pawn/pawn.htm'
|
| 139 |
+
version_added = '2.0'
|
| 140 |
+
|
| 141 |
+
#: optional Comment or Whitespace
|
| 142 |
+
_ws = r'(?:\s|//.*?\n|/[*][\w\W]*?[*]/)+'
|
| 143 |
+
#: only one /* */ style comment
|
| 144 |
+
_ws1 = r'\s*(?:/[*].*?[*]/\s*)*'
|
| 145 |
+
|
| 146 |
+
tokens = {
|
| 147 |
+
'root': [
|
| 148 |
+
# preprocessor directives: without whitespace
|
| 149 |
+
(r'^#if\s+0', Comment.Preproc, 'if0'),
|
| 150 |
+
('^#', Comment.Preproc, 'macro'),
|
| 151 |
+
# or with whitespace
|
| 152 |
+
('^' + _ws1 + r'#if\s+0', Comment.Preproc, 'if0'),
|
| 153 |
+
('^' + _ws1 + '#', Comment.Preproc, 'macro'),
|
| 154 |
+
(r'\n', Text),
|
| 155 |
+
(r'\s+', Text),
|
| 156 |
+
(r'\\\n', Text), # line continuation
|
| 157 |
+
(r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
|
| 158 |
+
(r'/(\\\n)?\*[\w\W]*?\*(\\\n)?/', Comment.Multiline),
|
| 159 |
+
(r'[{}]', Punctuation),
|
| 160 |
+
(r'L?"', String, 'string'),
|
| 161 |
+
(r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
|
| 162 |
+
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
|
| 163 |
+
(r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
|
| 164 |
+
(r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
|
| 165 |
+
(r'0[0-7]+[LlUu]*', Number.Oct),
|
| 166 |
+
(r'\d+[LlUu]*', Number.Integer),
|
| 167 |
+
(r'[~!%^&*+=|?:<>/-]', Operator),
|
| 168 |
+
(r'[()\[\],.;]', Punctuation),
|
| 169 |
+
(r'(switch|case|default|const|new|static|char|continue|break|'
|
| 170 |
+
r'if|else|for|while|do|operator|enum|'
|
| 171 |
+
r'public|return|sizeof|tagof|state|goto)\b', Keyword),
|
| 172 |
+
(r'(bool|Float)\b', Keyword.Type),
|
| 173 |
+
(r'(true|false)\b', Keyword.Constant),
|
| 174 |
+
(r'[a-zA-Z_]\w*', Name),
|
| 175 |
+
],
|
| 176 |
+
'string': [
|
| 177 |
+
(r'"', String, '#pop'),
|
| 178 |
+
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
| 179 |
+
(r'[^\\"\n]+', String), # all other characters
|
| 180 |
+
(r'\\\n', String), # line continuation
|
| 181 |
+
(r'\\', String), # stray backslash
|
| 182 |
+
],
|
| 183 |
+
'macro': [
|
| 184 |
+
(r'[^/\n]+', Comment.Preproc),
|
| 185 |
+
(r'/\*(.|\n)*?\*/', Comment.Multiline),
|
| 186 |
+
(r'//.*?\n', Comment.Single, '#pop'),
|
| 187 |
+
(r'/', Comment.Preproc),
|
| 188 |
+
(r'(?<=\\)\n', Comment.Preproc),
|
| 189 |
+
(r'\n', Comment.Preproc, '#pop'),
|
| 190 |
+
],
|
| 191 |
+
'if0': [
|
| 192 |
+
(r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
|
| 193 |
+
(r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
|
| 194 |
+
(r'.*?\n', Comment),
|
| 195 |
+
]
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
def analyse_text(text):
|
| 199 |
+
"""This is basically C. There is a keyword which doesn't exist in C
|
| 200 |
+
though and is nearly unique to this language."""
|
| 201 |
+
if 'tagof' in text:
|
| 202 |
+
return 0.01
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pddl.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.pddl
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the Planning Domain Definition Language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
from pygments.lexer import RegexLexer, words, include
|
| 13 |
+
from pygments.token import Punctuation, Keyword, Whitespace, Name, Comment, \
|
| 14 |
+
Operator, Number
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
__all__ = ['PddlLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class PddlLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
A PDDL lexer.
|
| 23 |
+
|
| 24 |
+
It should support up to PDDL 3.1.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
name = 'PDDL'
|
| 28 |
+
aliases = ['pddl']
|
| 29 |
+
filenames = ['*.pddl']
|
| 30 |
+
# there doesn't really seem to be a PDDL homepage.
|
| 31 |
+
url = 'https://en.wikipedia.org/wiki/Planning_Domain_Definition_Language'
|
| 32 |
+
version_added = '2.19'
|
| 33 |
+
|
| 34 |
+
tokens = {
|
| 35 |
+
'root': [
|
| 36 |
+
(r'\s+', Whitespace),
|
| 37 |
+
(r';.*$', Comment.Singleline),
|
| 38 |
+
include('keywords'),
|
| 39 |
+
include('builtins'),
|
| 40 |
+
(r'[()]', Punctuation),
|
| 41 |
+
(r'[=/*+><-]', Operator),
|
| 42 |
+
(r'[a-zA-Z][a-zA-Z0-9_-]*', Name),
|
| 43 |
+
(r'\?[a-zA-Z][a-zA-Z0-9_-]*', Name.Variable),
|
| 44 |
+
(r'[0-9]+\.[0-9]+', Number.Float),
|
| 45 |
+
(r'[0-9]+', Number.Integer),
|
| 46 |
+
],
|
| 47 |
+
'keywords': [
|
| 48 |
+
(words((
|
| 49 |
+
':requirements', ':types', ':constants',
|
| 50 |
+
':predicates', ':functions', ':action', ':agent',
|
| 51 |
+
':parameters', ':precondition', ':effect',
|
| 52 |
+
':durative-action', ':duration', ':condition',
|
| 53 |
+
':derived', ':domain', ':objects', ':init',
|
| 54 |
+
':goal', ':metric', ':length', ':serial', ':parallel',
|
| 55 |
+
# the following are requirements
|
| 56 |
+
':strips', ':typing', ':negative-preconditions',
|
| 57 |
+
':disjunctive-preconditions', ':equality',
|
| 58 |
+
':existential-preconditions', ':universal-preconditions',
|
| 59 |
+
':conditional-effects', ':fluents', ':numeric-fluents',
|
| 60 |
+
':object-fluents', ':adl', ':durative-actions',
|
| 61 |
+
':continuous-effects', ':derived-predicates',
|
| 62 |
+
':time-intial-literals', ':preferences',
|
| 63 |
+
':constraints', ':action-costs', ':multi-agent',
|
| 64 |
+
':unfactored-privacy', ':factored-privacy',
|
| 65 |
+
':non-deterministic'
|
| 66 |
+
), suffix=r'\b'), Keyword)
|
| 67 |
+
],
|
| 68 |
+
'builtins': [
|
| 69 |
+
(words((
|
| 70 |
+
'define', 'domain', 'object', 'either', 'and',
|
| 71 |
+
'forall', 'preference', 'imply', 'or', 'exists',
|
| 72 |
+
'not', 'when', 'assign', 'scale-up', 'scale-down',
|
| 73 |
+
'increase', 'decrease', 'at', 'over', 'start',
|
| 74 |
+
'end', 'all', 'problem', 'always', 'sometime',
|
| 75 |
+
'within', 'at-most-once', 'sometime-after',
|
| 76 |
+
'sometime-before', 'always-within', 'hold-during',
|
| 77 |
+
'hold-after', 'minimize', 'maximize',
|
| 78 |
+
'total-time', 'is-violated'), suffix=r'\b'),
|
| 79 |
+
Name.Builtin)
|
| 80 |
+
]
|
| 81 |
+
}
|
| 82 |
+
|
hai-mcp-pr7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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.perl
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Perl, Raku and related languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
|
| 14 |
+
using, this, default, words
|
| 15 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 16 |
+
Number, Punctuation, Whitespace
|
| 17 |
+
from pygments.util import shebang_matches
|
| 18 |
+
|
| 19 |
+
__all__ = ['PerlLexer', 'Perl6Lexer']
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class PerlLexer(RegexLexer):
|
| 23 |
+
"""
|
| 24 |
+
For Perl source code.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
name = 'Perl'
|
| 28 |
+
url = 'https://www.perl.org'
|
| 29 |
+
aliases = ['perl', 'pl']
|
| 30 |
+
filenames = ['*.pl', '*.pm', '*.t', '*.perl']
|
| 31 |
+
mimetypes = ['text/x-perl', 'application/x-perl']
|
| 32 |
+
version_added = ''
|
| 33 |
+
|
| 34 |
+
flags = re.DOTALL | re.MULTILINE
|
| 35 |
+
# TODO: give this to a perl guy who knows how to parse perl...
|
| 36 |
+
tokens = {
|
| 37 |
+
'balanced-regex': [
|
| 38 |
+
(r'/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*', String.Regex, '#pop'),
|
| 39 |
+
(r'!(\\\\|\\[^\\]|[^\\!])*![egimosx]*', String.Regex, '#pop'),
|
| 40 |
+
(r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'),
|
| 41 |
+
(r'\{(\\\\|\\[^\\]|[^\\}])*\}[egimosx]*', String.Regex, '#pop'),
|
| 42 |
+
(r'<(\\\\|\\[^\\]|[^\\>])*>[egimosx]*', String.Regex, '#pop'),
|
| 43 |
+
(r'\[(\\\\|\\[^\\]|[^\\\]])*\][egimosx]*', String.Regex, '#pop'),
|
| 44 |
+
(r'\((\\\\|\\[^\\]|[^\\)])*\)[egimosx]*', String.Regex, '#pop'),
|
| 45 |
+
(r'@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*', String.Regex, '#pop'),
|
| 46 |
+
(r'%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*', String.Regex, '#pop'),
|
| 47 |
+
(r'\$(\\\\|\\[^\\]|[^\\$])*\$[egimosx]*', String.Regex, '#pop'),
|
| 48 |
+
],
|
| 49 |
+
'root': [
|
| 50 |
+
(r'\A\#!.+?$', Comment.Hashbang),
|
| 51 |
+
(r'\#.*?$', Comment.Single),
|
| 52 |
+
(r'^=[a-zA-Z0-9]+\s+.*?\n=cut', Comment.Multiline),
|
| 53 |
+
(words((
|
| 54 |
+
'case', 'continue', 'do', 'else', 'elsif', 'for', 'foreach',
|
| 55 |
+
'if', 'last', 'my', 'next', 'our', 'redo', 'reset', 'then',
|
| 56 |
+
'unless', 'until', 'while', 'print', 'new', 'BEGIN',
|
| 57 |
+
'CHECK', 'INIT', 'END', 'return'), suffix=r'\b'),
|
| 58 |
+
Keyword),
|
| 59 |
+
(r'(format)(\s+)(\w+)(\s*)(=)(\s*\n)',
|
| 60 |
+
bygroups(Keyword, Whitespace, Name, Whitespace, Punctuation, Whitespace), 'format'),
|
| 61 |
+
(r'(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b', Operator.Word),
|
| 62 |
+
# common delimiters
|
| 63 |
+
(r's/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*',
|
| 64 |
+
String.Regex),
|
| 65 |
+
(r's!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*', String.Regex),
|
| 66 |
+
(r's\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*', String.Regex),
|
| 67 |
+
(r's@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*',
|
| 68 |
+
String.Regex),
|
| 69 |
+
(r's%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*',
|
| 70 |
+
String.Regex),
|
| 71 |
+
# balanced delimiters
|
| 72 |
+
(r's\{(\\\\|\\[^\\]|[^\\}])*\}\s*', String.Regex, 'balanced-regex'),
|
| 73 |
+
(r's<(\\\\|\\[^\\]|[^\\>])*>\s*', String.Regex, 'balanced-regex'),
|
| 74 |
+
(r's\[(\\\\|\\[^\\]|[^\\\]])*\]\s*', String.Regex,
|
| 75 |
+
'balanced-regex'),
|
| 76 |
+
(r's\((\\\\|\\[^\\]|[^\\)])*\)\s*', String.Regex,
|
| 77 |
+
'balanced-regex'),
|
| 78 |
+
|
| 79 |
+
(r'm?/(\\\\|\\[^\\]|[^\\/\n])*/[gcimosx]*', String.Regex),
|
| 80 |
+
(r'm(?=[/!\\{<\[(@%$])', String.Regex, 'balanced-regex'),
|
| 81 |
+
(r'((?<==~)|(?<=\())\s*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*',
|
| 82 |
+
String.Regex),
|
| 83 |
+
(r'\s+', Whitespace),
|
| 84 |
+
(words((
|
| 85 |
+
'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless', 'caller', 'chdir',
|
| 86 |
+
'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'connect',
|
| 87 |
+
'continue', 'cos', 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die',
|
| 88 |
+
'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent',
|
| 89 |
+
'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit', 'exp', 'fcntl',
|
| 90 |
+
'fileno', 'flock', 'fork', 'format', 'formline', 'getc', 'getgrent', 'getgrgid',
|
| 91 |
+
'getgrnam', 'gethostbyaddr', 'gethostbyname', 'gethostent', 'getlogin',
|
| 92 |
+
'getnetbyaddr', 'getnetbyname', 'getnetent', 'getpeername', 'getpgrp',
|
| 93 |
+
'getppid', 'getpriority', 'getprotobyname', 'getprotobynumber',
|
| 94 |
+
'getprotoent', 'getpwent', 'getpwnam', 'getpwuid', 'getservbyname',
|
| 95 |
+
'getservbyport', 'getservent', 'getsockname', 'getsockopt', 'glob', 'gmtime',
|
| 96 |
+
'goto', 'grep', 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill', 'last',
|
| 97 |
+
'lc', 'lcfirst', 'length', 'link', 'listen', 'local', 'localtime', 'log', 'lstat',
|
| 98 |
+
'map', 'mkdir', 'msgctl', 'msgget', 'msgrcv', 'msgsnd', 'my', 'next', 'oct', 'open',
|
| 99 |
+
'opendir', 'ord', 'our', 'pack', 'pipe', 'pop', 'pos', 'printf',
|
| 100 |
+
'prototype', 'push', 'quotemeta', 'rand', 'read', 'readdir',
|
| 101 |
+
'readline', 'readlink', 'readpipe', 'recv', 'redo', 'ref', 'rename',
|
| 102 |
+
'reverse', 'rewinddir', 'rindex', 'rmdir', 'scalar', 'seek', 'seekdir',
|
| 103 |
+
'select', 'semctl', 'semget', 'semop', 'send', 'setgrent', 'sethostent', 'setnetent',
|
| 104 |
+
'setpgrp', 'setpriority', 'setprotoent', 'setpwent', 'setservent',
|
| 105 |
+
'setsockopt', 'shift', 'shmctl', 'shmget', 'shmread', 'shmwrite', 'shutdown',
|
| 106 |
+
'sin', 'sleep', 'socket', 'socketpair', 'sort', 'splice', 'split', 'sprintf', 'sqrt',
|
| 107 |
+
'srand', 'stat', 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread',
|
| 108 |
+
'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied', 'time', 'times', 'tr',
|
| 109 |
+
'truncate', 'uc', 'ucfirst', 'umask', 'undef', 'unlink', 'unpack', 'unshift', 'untie',
|
| 110 |
+
'utime', 'values', 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write'), suffix=r'\b'),
|
| 111 |
+
Name.Builtin),
|
| 112 |
+
(r'((__(DATA|DIE|WARN)__)|(STD(IN|OUT|ERR)))\b', Name.Builtin.Pseudo),
|
| 113 |
+
(r'(<<)([\'"]?)([a-zA-Z_]\w*)(\2;?\n.*?\n)(\3)(\n)',
|
| 114 |
+
bygroups(String, String, String.Delimiter, String, String.Delimiter, Whitespace)),
|
| 115 |
+
(r'__END__', Comment.Preproc, 'end-part'),
|
| 116 |
+
(r'\$\^[ADEFHILMOPSTWX]', Name.Variable.Global),
|
| 117 |
+
(r"\$[\\\"\[\]'&`+*.,;=%~?@$!<>(^|/-](?!\w)", Name.Variable.Global),
|
| 118 |
+
(r'[$@%#]+', Name.Variable, 'varname'),
|
| 119 |
+
(r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
|
| 120 |
+
(r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
|
| 121 |
+
(r'0b[01]+(_[01]+)*', Number.Bin),
|
| 122 |
+
(r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?',
|
| 123 |
+
Number.Float),
|
| 124 |
+
(r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
|
| 125 |
+
(r'\d+(_\d+)*', Number.Integer),
|
| 126 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String),
|
| 127 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String),
|
| 128 |
+
(r'`(\\\\|\\[^\\]|[^`\\])*`', String.Backtick),
|
| 129 |
+
(r'<([^\s>]+)>', String.Regex),
|
| 130 |
+
(r'(q|qq|qw|qr|qx)\{', String.Other, 'cb-string'),
|
| 131 |
+
(r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'),
|
| 132 |
+
(r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'),
|
| 133 |
+
(r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'),
|
| 134 |
+
(r'(q|qq|qw|qr|qx)([\W_])(.|\n)*?\2', String.Other),
|
| 135 |
+
(r'(package)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)',
|
| 136 |
+
bygroups(Keyword, Whitespace, Name.Namespace)),
|
| 137 |
+
(r'(use|require|no)(\s+)([a-zA-Z_]\w*(?:::[a-zA-Z_]\w*)*)',
|
| 138 |
+
bygroups(Keyword, Whitespace, Name.Namespace)),
|
| 139 |
+
(r'(sub)(\s+)', bygroups(Keyword, Whitespace), 'funcname'),
|
| 140 |
+
(words((
|
| 141 |
+
'no', 'package', 'require', 'use'), suffix=r'\b'),
|
| 142 |
+
Keyword),
|
| 143 |
+
(r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|'
|
| 144 |
+
r'!~|&&?|\|\||\.{1,3})', Operator),
|
| 145 |
+
(r'[-+/*%=<>&^|!\\~]=?', Operator),
|
| 146 |
+
(r'[()\[\]:;,<>/?{}]', Punctuation), # yes, there's no shortage
|
| 147 |
+
# of punctuation in Perl!
|
| 148 |
+
(r'(?=\w)', Name, 'name'),
|
| 149 |
+
],
|
| 150 |
+
'format': [
|
| 151 |
+
(r'\.\n', String.Interpol, '#pop'),
|
| 152 |
+
(r'[^\n]*\n', String.Interpol),
|
| 153 |
+
],
|
| 154 |
+
'varname': [
|
| 155 |
+
(r'\s+', Whitespace),
|
| 156 |
+
(r'\{', Punctuation, '#pop'), # hash syntax?
|
| 157 |
+
(r'\)|,', Punctuation, '#pop'), # argument specifier
|
| 158 |
+
(r'\w+::', Name.Namespace),
|
| 159 |
+
(r'[\w:]+', Name.Variable, '#pop'),
|
| 160 |
+
],
|
| 161 |
+
'name': [
|
| 162 |
+
(r'[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*(::)?(?=\s*->)', Name.Namespace, '#pop'),
|
| 163 |
+
(r'[a-zA-Z_]\w*(::[a-zA-Z_]\w*)*::', Name.Namespace, '#pop'),
|
| 164 |
+
(r'[\w:]+', Name, '#pop'),
|
| 165 |
+
(r'[A-Z_]+(?=\W)', Name.Constant, '#pop'),
|
| 166 |
+
(r'(?=\W)', Text, '#pop'),
|
| 167 |
+
],
|
| 168 |
+
'funcname': [
|
| 169 |
+
(r'[a-zA-Z_]\w*[!?]?', Name.Function),
|
| 170 |
+
(r'\s+', Whitespace),
|
| 171 |
+
# argument declaration
|
| 172 |
+
(r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Whitespace)),
|
| 173 |
+
(r';', Punctuation, '#pop'),
|
| 174 |
+
(r'.*?\{', Punctuation, '#pop'),
|
| 175 |
+
],
|
| 176 |
+
'cb-string': [
|
| 177 |
+
(r'\\[{}\\]', String.Other),
|
| 178 |
+
(r'\\', String.Other),
|
| 179 |
+
(r'\{', String.Other, 'cb-string'),
|
| 180 |
+
(r'\}', String.Other, '#pop'),
|
| 181 |
+
(r'[^{}\\]+', String.Other)
|
| 182 |
+
],
|
| 183 |
+
'rb-string': [
|
| 184 |
+
(r'\\[()\\]', String.Other),
|
| 185 |
+
(r'\\', String.Other),
|
| 186 |
+
(r'\(', String.Other, 'rb-string'),
|
| 187 |
+
(r'\)', String.Other, '#pop'),
|
| 188 |
+
(r'[^()]+', String.Other)
|
| 189 |
+
],
|
| 190 |
+
'sb-string': [
|
| 191 |
+
(r'\\[\[\]\\]', String.Other),
|
| 192 |
+
(r'\\', String.Other),
|
| 193 |
+
(r'\[', String.Other, 'sb-string'),
|
| 194 |
+
(r'\]', String.Other, '#pop'),
|
| 195 |
+
(r'[^\[\]]+', String.Other)
|
| 196 |
+
],
|
| 197 |
+
'lt-string': [
|
| 198 |
+
(r'\\[<>\\]', String.Other),
|
| 199 |
+
(r'\\', String.Other),
|
| 200 |
+
(r'\<', String.Other, 'lt-string'),
|
| 201 |
+
(r'\>', String.Other, '#pop'),
|
| 202 |
+
(r'[^<>]+', String.Other)
|
| 203 |
+
],
|
| 204 |
+
'end-part': [
|
| 205 |
+
(r'.+', Comment.Preproc, '#pop')
|
| 206 |
+
]
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
def analyse_text(text):
|
| 210 |
+
if shebang_matches(text, r'perl'):
|
| 211 |
+
return True
|
| 212 |
+
|
| 213 |
+
result = 0
|
| 214 |
+
|
| 215 |
+
if re.search(r'(?:my|our)\s+[$@%(]', text):
|
| 216 |
+
result += 0.9
|
| 217 |
+
|
| 218 |
+
if ':=' in text:
|
| 219 |
+
# := is not valid Perl, but it appears in unicon, so we should
|
| 220 |
+
# become less confident if we think we found Perl with :=
|
| 221 |
+
result /= 2
|
| 222 |
+
|
| 223 |
+
return result
|
| 224 |
+
|
| 225 |
+
|
| 226 |
+
class Perl6Lexer(ExtendedRegexLexer):
|
| 227 |
+
"""
|
| 228 |
+
For Raku (a.k.a. Perl 6) source code.
|
| 229 |
+
"""
|
| 230 |
+
|
| 231 |
+
name = 'Perl6'
|
| 232 |
+
url = 'https://www.raku.org'
|
| 233 |
+
aliases = ['perl6', 'pl6', 'raku']
|
| 234 |
+
filenames = ['*.pl', '*.pm', '*.nqp', '*.p6', '*.6pl', '*.p6l', '*.pl6',
|
| 235 |
+
'*.6pm', '*.p6m', '*.pm6', '*.t', '*.raku', '*.rakumod',
|
| 236 |
+
'*.rakutest', '*.rakudoc']
|
| 237 |
+
mimetypes = ['text/x-perl6', 'application/x-perl6']
|
| 238 |
+
version_added = '2.0'
|
| 239 |
+
flags = re.MULTILINE | re.DOTALL
|
| 240 |
+
|
| 241 |
+
PERL6_IDENTIFIER_RANGE = r"['\w:-]"
|
| 242 |
+
|
| 243 |
+
PERL6_KEYWORDS = (
|
| 244 |
+
#Phasers
|
| 245 |
+
'BEGIN','CATCH','CHECK','CLOSE','CONTROL','DOC','END','ENTER','FIRST',
|
| 246 |
+
'INIT','KEEP','LAST','LEAVE','NEXT','POST','PRE','QUIT','UNDO',
|
| 247 |
+
#Keywords
|
| 248 |
+
'anon','augment','but','class','constant','default','does','else',
|
| 249 |
+
'elsif','enum','for','gather','given','grammar','has','if','import',
|
| 250 |
+
'is','let','loop','made','make','method','module','multi','my','need',
|
| 251 |
+
'orwith','our','proceed','proto','repeat','require','return',
|
| 252 |
+
'return-rw','returns','role','rule','state','sub','submethod','subset',
|
| 253 |
+
'succeed','supersede','token','try','unit','unless','until','use',
|
| 254 |
+
'when','while','with','without',
|
| 255 |
+
#Traits
|
| 256 |
+
'export','native','repr','required','rw','symbol',
|
| 257 |
+
)
|
| 258 |
+
|
| 259 |
+
PERL6_BUILTINS = (
|
| 260 |
+
'ACCEPTS','abs','abs2rel','absolute','accept','accessed','acos',
|
| 261 |
+
'acosec','acosech','acosh','acotan','acotanh','acquire','act','action',
|
| 262 |
+
'actions','add','add_attribute','add_enum_value','add_fallback',
|
| 263 |
+
'add_method','add_parent','add_private_method','add_role','add_trustee',
|
| 264 |
+
'adverb','after','all','allocate','allof','allowed','alternative-names',
|
| 265 |
+
'annotations','antipair','antipairs','any','anyof','app_lifetime',
|
| 266 |
+
'append','arch','archname','args','arity','Array','asec','asech','asin',
|
| 267 |
+
'asinh','ASSIGN-KEY','ASSIGN-POS','assuming','ast','at','atan','atan2',
|
| 268 |
+
'atanh','AT-KEY','atomic-assign','atomic-dec-fetch','atomic-fetch',
|
| 269 |
+
'atomic-fetch-add','atomic-fetch-dec','atomic-fetch-inc',
|
| 270 |
+
'atomic-fetch-sub','atomic-inc-fetch','AT-POS','attributes','auth',
|
| 271 |
+
'await','backtrace','Bag','BagHash','bail-out','base','basename',
|
| 272 |
+
'base-repeating','batch','BIND-KEY','BIND-POS','bind-stderr',
|
| 273 |
+
'bind-stdin','bind-stdout','bind-udp','bits','bless','block','Bool',
|
| 274 |
+
'bool-only','bounds','break','Bridge','broken','BUILD','build-date',
|
| 275 |
+
'bytes','cache','callframe','calling-package','CALL-ME','callsame',
|
| 276 |
+
'callwith','can','cancel','candidates','cando','can-ok','canonpath',
|
| 277 |
+
'caps','caption','Capture','cas','catdir','categorize','categorize-list',
|
| 278 |
+
'catfile','catpath','cause','ceiling','cglobal','changed','Channel',
|
| 279 |
+
'chars','chdir','child','child-name','child-typename','chmod','chomp',
|
| 280 |
+
'chop','chr','chrs','chunks','cis','classify','classify-list','cleanup',
|
| 281 |
+
'clone','close','closed','close-stdin','cmp-ok','code','codes','collate',
|
| 282 |
+
'column','comb','combinations','command','comment','compiler','Complex',
|
| 283 |
+
'compose','compose_type','composer','condition','config',
|
| 284 |
+
'configure_destroy','configure_type_checking','conj','connect',
|
| 285 |
+
'constraints','construct','contains','contents','copy','cos','cosec',
|
| 286 |
+
'cosech','cosh','cotan','cotanh','count','count-only','cpu-cores',
|
| 287 |
+
'cpu-usage','CREATE','create_type','cross','cue','curdir','curupdir','d',
|
| 288 |
+
'Date','DateTime','day','daycount','day-of-month','day-of-week',
|
| 289 |
+
'day-of-year','days-in-month','declaration','decode','decoder','deepmap',
|
| 290 |
+
'default','defined','DEFINITE','delayed','DELETE-KEY','DELETE-POS',
|
| 291 |
+
'denominator','desc','DESTROY','destroyers','devnull','diag',
|
| 292 |
+
'did-you-mean','die','dies-ok','dir','dirname','dir-sep','DISTROnames',
|
| 293 |
+
'do','does','does-ok','done','done-testing','duckmap','dynamic','e',
|
| 294 |
+
'eager','earlier','elems','emit','enclosing','encode','encoder',
|
| 295 |
+
'encoding','end','ends-with','enum_from_value','enum_value_list',
|
| 296 |
+
'enum_values','enums','eof','EVAL','eval-dies-ok','EVALFILE',
|
| 297 |
+
'eval-lives-ok','exception','excludes-max','excludes-min','EXISTS-KEY',
|
| 298 |
+
'EXISTS-POS','exit','exitcode','exp','expected','explicitly-manage',
|
| 299 |
+
'expmod','extension','f','fail','fails-like','fc','feature','file',
|
| 300 |
+
'filename','find_method','find_method_qualified','finish','first','flat',
|
| 301 |
+
'flatmap','flip','floor','flunk','flush','fmt','format','formatter',
|
| 302 |
+
'freeze','from','from-list','from-loop','from-posix','full',
|
| 303 |
+
'full-barrier','get','get_value','getc','gist','got','grab','grabpairs',
|
| 304 |
+
'grep','handle','handled','handles','hardware','has_accessor','Hash',
|
| 305 |
+
'head','headers','hh-mm-ss','hidden','hides','hour','how','hyper','id',
|
| 306 |
+
'illegal','im','in','indent','index','indices','indir','infinite',
|
| 307 |
+
'infix','infix:<+>','infix:<->','install_method_cache','Instant',
|
| 308 |
+
'instead','Int','int-bounds','interval','in-timezone','invalid-str',
|
| 309 |
+
'invert','invocant','IO','IO::Notification.watch-path','is_trusted',
|
| 310 |
+
'is_type','isa','is-absolute','isa-ok','is-approx','is-deeply',
|
| 311 |
+
'is-hidden','is-initial-thread','is-int','is-lazy','is-leap-year',
|
| 312 |
+
'isNaN','isnt','is-prime','is-relative','is-routine','is-setting',
|
| 313 |
+
'is-win','item','iterator','join','keep','kept','KERNELnames','key',
|
| 314 |
+
'keyof','keys','kill','kv','kxxv','l','lang','last','lastcall','later',
|
| 315 |
+
'lazy','lc','leading','level','like','line','lines','link','List',
|
| 316 |
+
'listen','live','lives-ok','local','lock','log','log10','lookup','lsb',
|
| 317 |
+
'made','MAIN','make','Map','match','max','maxpairs','merge','message',
|
| 318 |
+
'method','method_table','methods','migrate','min','minmax','minpairs',
|
| 319 |
+
'minute','misplaced','Mix','MixHash','mkdir','mode','modified','month',
|
| 320 |
+
'move','mro','msb','multi','multiness','my','name','named','named_names',
|
| 321 |
+
'narrow','nativecast','native-descriptor','nativesizeof','new','new_type',
|
| 322 |
+
'new-from-daycount','new-from-pairs','next','nextcallee','next-handle',
|
| 323 |
+
'nextsame','nextwith','NFC','NFD','NFKC','NFKD','nl-in','nl-out',
|
| 324 |
+
'nodemap','nok','none','norm','not','note','now','nude','Num',
|
| 325 |
+
'numerator','Numeric','of','offset','offset-in-hours','offset-in-minutes',
|
| 326 |
+
'ok','old','on-close','one','on-switch','open','opened','operation',
|
| 327 |
+
'optional','ord','ords','orig','os-error','osname','out-buffer','pack',
|
| 328 |
+
'package','package-kind','package-name','packages','pair','pairs',
|
| 329 |
+
'pairup','parameter','params','parent','parent-name','parents','parse',
|
| 330 |
+
'parse-base','parsefile','parse-names','parts','pass','path','path-sep',
|
| 331 |
+
'payload','peer-host','peer-port','periods','perl','permutations','phaser',
|
| 332 |
+
'pick','pickpairs','pid','placeholder','plan','plus','polar','poll',
|
| 333 |
+
'polymod','pop','pos','positional','posix','postfix','postmatch',
|
| 334 |
+
'precomp-ext','precomp-target','pred','prefix','prematch','prepend',
|
| 335 |
+
'print','printf','print-nl','print-to','private','private_method_table',
|
| 336 |
+
'proc','produce','Promise','prompt','protect','pull-one','push',
|
| 337 |
+
'push-all','push-at-least','push-exactly','push-until-lazy','put',
|
| 338 |
+
'qualifier-type','quit','r','race','radix','rand','range','Rat','raw',
|
| 339 |
+
're','read','readchars','readonly','ready','Real','reallocate','reals',
|
| 340 |
+
'reason','rebless','receive','recv','redispatcher','redo','reduce',
|
| 341 |
+
'rel2abs','relative','release','rename','repeated','replacement',
|
| 342 |
+
'report','reserved','resolve','restore','result','resume','rethrow',
|
| 343 |
+
'reverse','right','rindex','rmdir','role','roles_to_compose','rolish',
|
| 344 |
+
'roll','rootdir','roots','rotate','rotor','round','roundrobin',
|
| 345 |
+
'routine-type','run','rwx','s','samecase','samemark','samewith','say',
|
| 346 |
+
'schedule-on','scheduler','scope','sec','sech','second','seek','self',
|
| 347 |
+
'send','Set','set_hidden','set_name','set_package','set_rw','set_value',
|
| 348 |
+
'SetHash','set-instruments','setup_finalization','shape','share','shell',
|
| 349 |
+
'shift','sibling','sigil','sign','signal','signals','signature','sin',
|
| 350 |
+
'sinh','sink','sink-all','skip','skip-at-least','skip-at-least-pull-one',
|
| 351 |
+
'skip-one','skip-rest','sleep','sleep-timer','sleep-until','Slip','slurp',
|
| 352 |
+
'slurp-rest','slurpy','snap','snapper','so','socket-host','socket-port',
|
| 353 |
+
'sort','source','source-package','spawn','SPEC','splice','split',
|
| 354 |
+
'splitdir','splitpath','sprintf','spurt','sqrt','squish','srand','stable',
|
| 355 |
+
'start','started','starts-with','status','stderr','stdout','Str',
|
| 356 |
+
'sub_signature','subbuf','subbuf-rw','subname','subparse','subst',
|
| 357 |
+
'subst-mutate','substr','substr-eq','substr-rw','subtest','succ','sum',
|
| 358 |
+
'Supply','symlink','t','tail','take','take-rw','tan','tanh','tap',
|
| 359 |
+
'target','target-name','tc','tclc','tell','then','throttle','throw',
|
| 360 |
+
'throws-like','timezone','tmpdir','to','today','todo','toggle','to-posix',
|
| 361 |
+
'total','trailing','trans','tree','trim','trim-leading','trim-trailing',
|
| 362 |
+
'truncate','truncated-to','trusts','try_acquire','trying','twigil','type',
|
| 363 |
+
'type_captures','typename','uc','udp','uncaught_handler','unimatch',
|
| 364 |
+
'uniname','uninames','uniparse','uniprop','uniprops','unique','unival',
|
| 365 |
+
'univals','unlike','unlink','unlock','unpack','unpolar','unshift',
|
| 366 |
+
'unwrap','updir','USAGE','use-ok','utc','val','value','values','VAR',
|
| 367 |
+
'variable','verbose-config','version','VMnames','volume','vow','w','wait',
|
| 368 |
+
'warn','watch','watch-path','week','weekday-of-month','week-number',
|
| 369 |
+
'week-year','WHAT','when','WHERE','WHEREFORE','WHICH','WHO',
|
| 370 |
+
'whole-second','WHY','wordcase','words','workaround','wrap','write',
|
| 371 |
+
'write-to','x','yada','year','yield','yyyy-mm-dd','z','zip','zip-latest',
|
| 372 |
+
|
| 373 |
+
)
|
| 374 |
+
|
| 375 |
+
PERL6_BUILTIN_CLASSES = (
|
| 376 |
+
#Booleans
|
| 377 |
+
'False','True',
|
| 378 |
+
#Classes
|
| 379 |
+
'Any','Array','Associative','AST','atomicint','Attribute','Backtrace',
|
| 380 |
+
'Backtrace::Frame','Bag','Baggy','BagHash','Blob','Block','Bool','Buf',
|
| 381 |
+
'Callable','CallFrame','Cancellation','Capture','CArray','Channel','Code',
|
| 382 |
+
'compiler','Complex','ComplexStr','Cool','CurrentThreadScheduler',
|
| 383 |
+
'Cursor','Date','Dateish','DateTime','Distro','Duration','Encoding',
|
| 384 |
+
'Exception','Failure','FatRat','Grammar','Hash','HyperWhatever','Instant',
|
| 385 |
+
'Int','int16','int32','int64','int8','IntStr','IO','IO::ArgFiles',
|
| 386 |
+
'IO::CatHandle','IO::Handle','IO::Notification','IO::Path',
|
| 387 |
+
'IO::Path::Cygwin','IO::Path::QNX','IO::Path::Unix','IO::Path::Win32',
|
| 388 |
+
'IO::Pipe','IO::Socket','IO::Socket::Async','IO::Socket::INET','IO::Spec',
|
| 389 |
+
'IO::Spec::Cygwin','IO::Spec::QNX','IO::Spec::Unix','IO::Spec::Win32',
|
| 390 |
+
'IO::Special','Iterable','Iterator','Junction','Kernel','Label','List',
|
| 391 |
+
'Lock','Lock::Async','long','longlong','Macro','Map','Match',
|
| 392 |
+
'Metamodel::AttributeContainer','Metamodel::C3MRO','Metamodel::ClassHOW',
|
| 393 |
+
'Metamodel::EnumHOW','Metamodel::Finalization','Metamodel::MethodContainer',
|
| 394 |
+
'Metamodel::MROBasedMethodDispatch','Metamodel::MultipleInheritance',
|
| 395 |
+
'Metamodel::Naming','Metamodel::Primitives','Metamodel::PrivateMethodContainer',
|
| 396 |
+
'Metamodel::RoleContainer','Metamodel::Trusting','Method','Mix','MixHash',
|
| 397 |
+
'Mixy','Mu','NFC','NFD','NFKC','NFKD','Nil','Num','num32','num64',
|
| 398 |
+
'Numeric','NumStr','ObjAt','Order','Pair','Parameter','Perl','Pod::Block',
|
| 399 |
+
'Pod::Block::Code','Pod::Block::Comment','Pod::Block::Declarator',
|
| 400 |
+
'Pod::Block::Named','Pod::Block::Para','Pod::Block::Table','Pod::Heading',
|
| 401 |
+
'Pod::Item','Pointer','Positional','PositionalBindFailover','Proc',
|
| 402 |
+
'Proc::Async','Promise','Proxy','PseudoStash','QuantHash','Range','Rat',
|
| 403 |
+
'Rational','RatStr','Real','Regex','Routine','Scalar','Scheduler',
|
| 404 |
+
'Semaphore','Seq','Set','SetHash','Setty','Signature','size_t','Slip',
|
| 405 |
+
'Stash','Str','StrDistance','Stringy','Sub','Submethod','Supplier',
|
| 406 |
+
'Supplier::Preserving','Supply','Systemic','Tap','Telemetry',
|
| 407 |
+
'Telemetry::Instrument::Thread','Telemetry::Instrument::Usage',
|
| 408 |
+
'Telemetry::Period','Telemetry::Sampler','Thread','ThreadPoolScheduler',
|
| 409 |
+
'UInt','uint16','uint32','uint64','uint8','Uni','utf8','Variable',
|
| 410 |
+
'Version','VM','Whatever','WhateverCode','WrapHandle'
|
| 411 |
+
)
|
| 412 |
+
|
| 413 |
+
PERL6_OPERATORS = (
|
| 414 |
+
'X', 'Z', 'after', 'also', 'and', 'andthen', 'before', 'cmp', 'div',
|
| 415 |
+
'eq', 'eqv', 'extra', 'ff', 'fff', 'ge', 'gt', 'le', 'leg', 'lt', 'm',
|
| 416 |
+
'mm', 'mod', 'ne', 'or', 'orelse', 'rx', 's', 'tr', 'x', 'xor', 'xx',
|
| 417 |
+
'++', '--', '**', '!', '+', '-', '~', '?', '|', '||', '+^', '~^', '?^',
|
| 418 |
+
'^', '*', '/', '%', '%%', '+&', '+<', '+>', '~&', '~<', '~>', '?&',
|
| 419 |
+
'gcd', 'lcm', '+', '-', '+|', '+^', '~|', '~^', '?|', '?^',
|
| 420 |
+
'~', '&', '^', 'but', 'does', '<=>', '..', '..^', '^..', '^..^',
|
| 421 |
+
'!=', '==', '<', '<=', '>', '>=', '~~', '===', '!eqv',
|
| 422 |
+
'&&', '||', '^^', '//', 'min', 'max', '??', '!!', 'ff', 'fff', 'so',
|
| 423 |
+
'not', '<==', '==>', '<<==', '==>>','unicmp',
|
| 424 |
+
)
|
| 425 |
+
|
| 426 |
+
# Perl 6 has a *lot* of possible bracketing characters
|
| 427 |
+
# this list was lifted from STD.pm6 (https://github.com/perl6/std)
|
| 428 |
+
PERL6_BRACKETS = {
|
| 429 |
+
'\u0028': '\u0029', '\u003c': '\u003e', '\u005b': '\u005d',
|
| 430 |
+
'\u007b': '\u007d', '\u00ab': '\u00bb', '\u0f3a': '\u0f3b',
|
| 431 |
+
'\u0f3c': '\u0f3d', '\u169b': '\u169c', '\u2018': '\u2019',
|
| 432 |
+
'\u201a': '\u2019', '\u201b': '\u2019', '\u201c': '\u201d',
|
| 433 |
+
'\u201e': '\u201d', '\u201f': '\u201d', '\u2039': '\u203a',
|
| 434 |
+
'\u2045': '\u2046', '\u207d': '\u207e', '\u208d': '\u208e',
|
| 435 |
+
'\u2208': '\u220b', '\u2209': '\u220c', '\u220a': '\u220d',
|
| 436 |
+
'\u2215': '\u29f5', '\u223c': '\u223d', '\u2243': '\u22cd',
|
| 437 |
+
'\u2252': '\u2253', '\u2254': '\u2255', '\u2264': '\u2265',
|
| 438 |
+
'\u2266': '\u2267', '\u2268': '\u2269', '\u226a': '\u226b',
|
| 439 |
+
'\u226e': '\u226f', '\u2270': '\u2271', '\u2272': '\u2273',
|
| 440 |
+
'\u2274': '\u2275', '\u2276': '\u2277', '\u2278': '\u2279',
|
| 441 |
+
'\u227a': '\u227b', '\u227c': '\u227d', '\u227e': '\u227f',
|
| 442 |
+
'\u2280': '\u2281', '\u2282': '\u2283', '\u2284': '\u2285',
|
| 443 |
+
'\u2286': '\u2287', '\u2288': '\u2289', '\u228a': '\u228b',
|
| 444 |
+
'\u228f': '\u2290', '\u2291': '\u2292', '\u2298': '\u29b8',
|
| 445 |
+
'\u22a2': '\u22a3', '\u22a6': '\u2ade', '\u22a8': '\u2ae4',
|
| 446 |
+
'\u22a9': '\u2ae3', '\u22ab': '\u2ae5', '\u22b0': '\u22b1',
|
| 447 |
+
'\u22b2': '\u22b3', '\u22b4': '\u22b5', '\u22b6': '\u22b7',
|
| 448 |
+
'\u22c9': '\u22ca', '\u22cb': '\u22cc', '\u22d0': '\u22d1',
|
| 449 |
+
'\u22d6': '\u22d7', '\u22d8': '\u22d9', '\u22da': '\u22db',
|
| 450 |
+
'\u22dc': '\u22dd', '\u22de': '\u22df', '\u22e0': '\u22e1',
|
| 451 |
+
'\u22e2': '\u22e3', '\u22e4': '\u22e5', '\u22e6': '\u22e7',
|
| 452 |
+
'\u22e8': '\u22e9', '\u22ea': '\u22eb', '\u22ec': '\u22ed',
|
| 453 |
+
'\u22f0': '\u22f1', '\u22f2': '\u22fa', '\u22f3': '\u22fb',
|
| 454 |
+
'\u22f4': '\u22fc', '\u22f6': '\u22fd', '\u22f7': '\u22fe',
|
| 455 |
+
'\u2308': '\u2309', '\u230a': '\u230b', '\u2329': '\u232a',
|
| 456 |
+
'\u23b4': '\u23b5', '\u2768': '\u2769', '\u276a': '\u276b',
|
| 457 |
+
'\u276c': '\u276d', '\u276e': '\u276f', '\u2770': '\u2771',
|
| 458 |
+
'\u2772': '\u2773', '\u2774': '\u2775', '\u27c3': '\u27c4',
|
| 459 |
+
'\u27c5': '\u27c6', '\u27d5': '\u27d6', '\u27dd': '\u27de',
|
| 460 |
+
'\u27e2': '\u27e3', '\u27e4': '\u27e5', '\u27e6': '\u27e7',
|
| 461 |
+
'\u27e8': '\u27e9', '\u27ea': '\u27eb', '\u2983': '\u2984',
|
| 462 |
+
'\u2985': '\u2986', '\u2987': '\u2988', '\u2989': '\u298a',
|
| 463 |
+
'\u298b': '\u298c', '\u298d': '\u298e', '\u298f': '\u2990',
|
| 464 |
+
'\u2991': '\u2992', '\u2993': '\u2994', '\u2995': '\u2996',
|
| 465 |
+
'\u2997': '\u2998', '\u29c0': '\u29c1', '\u29c4': '\u29c5',
|
| 466 |
+
'\u29cf': '\u29d0', '\u29d1': '\u29d2', '\u29d4': '\u29d5',
|
| 467 |
+
'\u29d8': '\u29d9', '\u29da': '\u29db', '\u29f8': '\u29f9',
|
| 468 |
+
'\u29fc': '\u29fd', '\u2a2b': '\u2a2c', '\u2a2d': '\u2a2e',
|
| 469 |
+
'\u2a34': '\u2a35', '\u2a3c': '\u2a3d', '\u2a64': '\u2a65',
|
| 470 |
+
'\u2a79': '\u2a7a', '\u2a7d': '\u2a7e', '\u2a7f': '\u2a80',
|
| 471 |
+
'\u2a81': '\u2a82', '\u2a83': '\u2a84', '\u2a8b': '\u2a8c',
|
| 472 |
+
'\u2a91': '\u2a92', '\u2a93': '\u2a94', '\u2a95': '\u2a96',
|
| 473 |
+
'\u2a97': '\u2a98', '\u2a99': '\u2a9a', '\u2a9b': '\u2a9c',
|
| 474 |
+
'\u2aa1': '\u2aa2', '\u2aa6': '\u2aa7', '\u2aa8': '\u2aa9',
|
| 475 |
+
'\u2aaa': '\u2aab', '\u2aac': '\u2aad', '\u2aaf': '\u2ab0',
|
| 476 |
+
'\u2ab3': '\u2ab4', '\u2abb': '\u2abc', '\u2abd': '\u2abe',
|
| 477 |
+
'\u2abf': '\u2ac0', '\u2ac1': '\u2ac2', '\u2ac3': '\u2ac4',
|
| 478 |
+
'\u2ac5': '\u2ac6', '\u2acd': '\u2ace', '\u2acf': '\u2ad0',
|
| 479 |
+
'\u2ad1': '\u2ad2', '\u2ad3': '\u2ad4', '\u2ad5': '\u2ad6',
|
| 480 |
+
'\u2aec': '\u2aed', '\u2af7': '\u2af8', '\u2af9': '\u2afa',
|
| 481 |
+
'\u2e02': '\u2e03', '\u2e04': '\u2e05', '\u2e09': '\u2e0a',
|
| 482 |
+
'\u2e0c': '\u2e0d', '\u2e1c': '\u2e1d', '\u2e20': '\u2e21',
|
| 483 |
+
'\u3008': '\u3009', '\u300a': '\u300b', '\u300c': '\u300d',
|
| 484 |
+
'\u300e': '\u300f', '\u3010': '\u3011', '\u3014': '\u3015',
|
| 485 |
+
'\u3016': '\u3017', '\u3018': '\u3019', '\u301a': '\u301b',
|
| 486 |
+
'\u301d': '\u301e', '\ufd3e': '\ufd3f', '\ufe17': '\ufe18',
|
| 487 |
+
'\ufe35': '\ufe36', '\ufe37': '\ufe38', '\ufe39': '\ufe3a',
|
| 488 |
+
'\ufe3b': '\ufe3c', '\ufe3d': '\ufe3e', '\ufe3f': '\ufe40',
|
| 489 |
+
'\ufe41': '\ufe42', '\ufe43': '\ufe44', '\ufe47': '\ufe48',
|
| 490 |
+
'\ufe59': '\ufe5a', '\ufe5b': '\ufe5c', '\ufe5d': '\ufe5e',
|
| 491 |
+
'\uff08': '\uff09', '\uff1c': '\uff1e', '\uff3b': '\uff3d',
|
| 492 |
+
'\uff5b': '\uff5d', '\uff5f': '\uff60', '\uff62': '\uff63',
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
def _build_word_match(words, boundary_regex_fragment=None, prefix='', suffix=''):
|
| 496 |
+
if boundary_regex_fragment is None:
|
| 497 |
+
return r'\b(' + prefix + r'|'.join(re.escape(x) for x in words) + \
|
| 498 |
+
suffix + r')\b'
|
| 499 |
+
else:
|
| 500 |
+
return r'(?<!' + boundary_regex_fragment + r')' + prefix + r'(' + \
|
| 501 |
+
r'|'.join(re.escape(x) for x in words) + r')' + suffix + r'(?!' + \
|
| 502 |
+
boundary_regex_fragment + r')'
|
| 503 |
+
|
| 504 |
+
def brackets_callback(token_class):
|
| 505 |
+
def callback(lexer, match, context):
|
| 506 |
+
groups = match.groupdict()
|
| 507 |
+
opening_chars = groups['delimiter']
|
| 508 |
+
n_chars = len(opening_chars)
|
| 509 |
+
adverbs = groups.get('adverbs')
|
| 510 |
+
|
| 511 |
+
closer = Perl6Lexer.PERL6_BRACKETS.get(opening_chars[0])
|
| 512 |
+
text = context.text
|
| 513 |
+
|
| 514 |
+
if closer is None: # it's not a mirrored character, which means we
|
| 515 |
+
# just need to look for the next occurrence
|
| 516 |
+
|
| 517 |
+
end_pos = text.find(opening_chars, match.start('delimiter') + n_chars)
|
| 518 |
+
else: # we need to look for the corresponding closing character,
|
| 519 |
+
# keep nesting in mind
|
| 520 |
+
closing_chars = closer * n_chars
|
| 521 |
+
nesting_level = 1
|
| 522 |
+
|
| 523 |
+
search_pos = match.start('delimiter')
|
| 524 |
+
|
| 525 |
+
while nesting_level > 0:
|
| 526 |
+
next_open_pos = text.find(opening_chars, search_pos + n_chars)
|
| 527 |
+
next_close_pos = text.find(closing_chars, search_pos + n_chars)
|
| 528 |
+
|
| 529 |
+
if next_close_pos == -1:
|
| 530 |
+
next_close_pos = len(text)
|
| 531 |
+
nesting_level = 0
|
| 532 |
+
elif next_open_pos != -1 and next_open_pos < next_close_pos:
|
| 533 |
+
nesting_level += 1
|
| 534 |
+
search_pos = next_open_pos
|
| 535 |
+
else: # next_close_pos < next_open_pos
|
| 536 |
+
nesting_level -= 1
|
| 537 |
+
search_pos = next_close_pos
|
| 538 |
+
|
| 539 |
+
end_pos = next_close_pos
|
| 540 |
+
|
| 541 |
+
if end_pos < 0: # if we didn't find a closer, just highlight the
|
| 542 |
+
# rest of the text in this class
|
| 543 |
+
end_pos = len(text)
|
| 544 |
+
|
| 545 |
+
if adverbs is not None and re.search(r':to\b', adverbs):
|
| 546 |
+
heredoc_terminator = text[match.start('delimiter') + n_chars:end_pos]
|
| 547 |
+
end_heredoc = re.search(r'^\s*' + re.escape(heredoc_terminator) +
|
| 548 |
+
r'\s*$', text[end_pos:], re.MULTILINE)
|
| 549 |
+
|
| 550 |
+
if end_heredoc:
|
| 551 |
+
end_pos += end_heredoc.end()
|
| 552 |
+
else:
|
| 553 |
+
end_pos = len(text)
|
| 554 |
+
|
| 555 |
+
yield match.start(), token_class, text[match.start():end_pos + n_chars]
|
| 556 |
+
context.pos = end_pos + n_chars
|
| 557 |
+
|
| 558 |
+
return callback
|
| 559 |
+
|
| 560 |
+
def opening_brace_callback(lexer, match, context):
|
| 561 |
+
stack = context.stack
|
| 562 |
+
|
| 563 |
+
yield match.start(), Text, context.text[match.start():match.end()]
|
| 564 |
+
context.pos = match.end()
|
| 565 |
+
|
| 566 |
+
# if we encounter an opening brace and we're one level
|
| 567 |
+
# below a token state, it means we need to increment
|
| 568 |
+
# the nesting level for braces so we know later when
|
| 569 |
+
# we should return to the token rules.
|
| 570 |
+
if len(stack) > 2 and stack[-2] == 'token':
|
| 571 |
+
context.perl6_token_nesting_level += 1
|
| 572 |
+
|
| 573 |
+
def closing_brace_callback(lexer, match, context):
|
| 574 |
+
stack = context.stack
|
| 575 |
+
|
| 576 |
+
yield match.start(), Text, context.text[match.start():match.end()]
|
| 577 |
+
context.pos = match.end()
|
| 578 |
+
|
| 579 |
+
# if we encounter a free closing brace and we're one level
|
| 580 |
+
# below a token state, it means we need to check the nesting
|
| 581 |
+
# level to see if we need to return to the token state.
|
| 582 |
+
if len(stack) > 2 and stack[-2] == 'token':
|
| 583 |
+
context.perl6_token_nesting_level -= 1
|
| 584 |
+
if context.perl6_token_nesting_level == 0:
|
| 585 |
+
stack.pop()
|
| 586 |
+
|
| 587 |
+
def embedded_perl6_callback(lexer, match, context):
|
| 588 |
+
context.perl6_token_nesting_level = 1
|
| 589 |
+
yield match.start(), Text, context.text[match.start():match.end()]
|
| 590 |
+
context.pos = match.end()
|
| 591 |
+
context.stack.append('root')
|
| 592 |
+
|
| 593 |
+
# If you're modifying these rules, be careful if you need to process '{' or '}'
|
| 594 |
+
# characters. We have special logic for processing these characters (due to the fact
|
| 595 |
+
# that you can nest Perl 6 code in regex blocks), so if you need to process one of
|
| 596 |
+
# them, make sure you also process the corresponding one!
|
| 597 |
+
tokens = {
|
| 598 |
+
'common': [
|
| 599 |
+
(r'#[`|=](?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS) + r'])(?P=first_char)*)',
|
| 600 |
+
brackets_callback(Comment.Multiline)),
|
| 601 |
+
(r'#[^\n]*$', Comment.Single),
|
| 602 |
+
(r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline),
|
| 603 |
+
(r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline),
|
| 604 |
+
(r'^=.*?\n\s*?\n', Comment.Multiline),
|
| 605 |
+
(r'(regex|token|rule)(\s*' + PERL6_IDENTIFIER_RANGE + '+:sym)',
|
| 606 |
+
bygroups(Keyword, Name), 'token-sym-brackets'),
|
| 607 |
+
(r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + r')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?',
|
| 608 |
+
bygroups(Keyword, Name), 'pre-token'),
|
| 609 |
+
# deal with a special case in the Perl 6 grammar (role q { ... })
|
| 610 |
+
(r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Whitespace, Name, Whitespace)),
|
| 611 |
+
(_build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_RANGE), Keyword),
|
| 612 |
+
(_build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix='(?::[UD])?'),
|
| 613 |
+
Name.Builtin),
|
| 614 |
+
(_build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin),
|
| 615 |
+
# copied from PerlLexer
|
| 616 |
+
(r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + '+(?:<<.*?>>|<.*?>|«.*?»)*',
|
| 617 |
+
Name.Variable),
|
| 618 |
+
(r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global),
|
| 619 |
+
(r'::\?\w+', Name.Variable.Global),
|
| 620 |
+
(r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + '+(?:<<.*?>>|<.*?>|«.*?»)*',
|
| 621 |
+
Name.Variable.Global),
|
| 622 |
+
(r'\$(?:<.*?>)+', Name.Variable),
|
| 623 |
+
(r'(?:q|qq|Q)[a-zA-Z]?\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])'
|
| 624 |
+
r'(?P=first_char)*)', brackets_callback(String)),
|
| 625 |
+
# copied from PerlLexer
|
| 626 |
+
(r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
|
| 627 |
+
(r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
|
| 628 |
+
(r'0b[01]+(_[01]+)*', Number.Bin),
|
| 629 |
+
(r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?',
|
| 630 |
+
Number.Float),
|
| 631 |
+
(r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
|
| 632 |
+
(r'\d+(_\d+)*', Number.Integer),
|
| 633 |
+
(r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex),
|
| 634 |
+
(r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex),
|
| 635 |
+
(r'm\w+(?=\()', Name),
|
| 636 |
+
(r'(?:m|ms|rx)\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^\w:\s])'
|
| 637 |
+
r'(?P=first_char)*)', brackets_callback(String.Regex)),
|
| 638 |
+
(r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/',
|
| 639 |
+
String.Regex),
|
| 640 |
+
(r'<[^\s=].*?\S>', String),
|
| 641 |
+
(_build_word_match(PERL6_OPERATORS), Operator),
|
| 642 |
+
(r'\w' + PERL6_IDENTIFIER_RANGE + '*', Name),
|
| 643 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String),
|
| 644 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String),
|
| 645 |
+
],
|
| 646 |
+
'root': [
|
| 647 |
+
include('common'),
|
| 648 |
+
(r'\{', opening_brace_callback),
|
| 649 |
+
(r'\}', closing_brace_callback),
|
| 650 |
+
(r'.+?', Text),
|
| 651 |
+
],
|
| 652 |
+
'pre-token': [
|
| 653 |
+
include('common'),
|
| 654 |
+
(r'\{', Text, ('#pop', 'token')),
|
| 655 |
+
(r'.+?', Text),
|
| 656 |
+
],
|
| 657 |
+
'token-sym-brackets': [
|
| 658 |
+
(r'(?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS) + '])(?P=first_char)*)',
|
| 659 |
+
brackets_callback(Name), ('#pop', 'pre-token')),
|
| 660 |
+
default(('#pop', 'pre-token')),
|
| 661 |
+
],
|
| 662 |
+
'token': [
|
| 663 |
+
(r'\}', Text, '#pop'),
|
| 664 |
+
(r'(?<=:)(?:my|our|state|constant|temp|let).*?;', using(this)),
|
| 665 |
+
# make sure that quotes in character classes aren't treated as strings
|
| 666 |
+
(r'<(?:[-!?+.]\s*)?\[.*?\]>', String.Regex),
|
| 667 |
+
# make sure that '#' characters in quotes aren't treated as comments
|
| 668 |
+
(r"(?<!\\)'(\\\\|\\[^\\]|[^'\\])*'", String.Regex),
|
| 669 |
+
(r'(?<!\\)"(\\\\|\\[^\\]|[^"\\])*"', String.Regex),
|
| 670 |
+
(r'#.*?$', Comment.Single),
|
| 671 |
+
(r'\{', embedded_perl6_callback),
|
| 672 |
+
('.+?', String.Regex),
|
| 673 |
+
],
|
| 674 |
+
}
|
| 675 |
+
|
| 676 |
+
def analyse_text(text):
|
| 677 |
+
def strip_pod(lines):
|
| 678 |
+
in_pod = False
|
| 679 |
+
stripped_lines = []
|
| 680 |
+
|
| 681 |
+
for line in lines:
|
| 682 |
+
if re.match(r'^=(?:end|cut)', line):
|
| 683 |
+
in_pod = False
|
| 684 |
+
elif re.match(r'^=\w+', line):
|
| 685 |
+
in_pod = True
|
| 686 |
+
elif not in_pod:
|
| 687 |
+
stripped_lines.append(line)
|
| 688 |
+
|
| 689 |
+
return stripped_lines
|
| 690 |
+
|
| 691 |
+
# XXX handle block comments
|
| 692 |
+
lines = text.splitlines()
|
| 693 |
+
lines = strip_pod(lines)
|
| 694 |
+
text = '\n'.join(lines)
|
| 695 |
+
|
| 696 |
+
if shebang_matches(text, r'perl6|rakudo|niecza|pugs'):
|
| 697 |
+
return True
|
| 698 |
+
|
| 699 |
+
saw_perl_decl = False
|
| 700 |
+
rating = False
|
| 701 |
+
|
| 702 |
+
# check for my/our/has declarations
|
| 703 |
+
if re.search(r"(?:my|our|has)\s+(?:" + Perl6Lexer.PERL6_IDENTIFIER_RANGE +
|
| 704 |
+
r"+\s+)?[$@%&(]", text):
|
| 705 |
+
rating = 0.8
|
| 706 |
+
saw_perl_decl = True
|
| 707 |
+
|
| 708 |
+
for line in lines:
|
| 709 |
+
line = re.sub('#.*', '', line)
|
| 710 |
+
if re.match(r'^\s*$', line):
|
| 711 |
+
continue
|
| 712 |
+
|
| 713 |
+
# match v6; use v6; use v6.0; use v6.0.0;
|
| 714 |
+
if re.match(r'^\s*(?:use\s+)?v6(?:\.\d(?:\.\d)?)?;', line):
|
| 715 |
+
return True
|
| 716 |
+
# match class, module, role, enum, grammar declarations
|
| 717 |
+
class_decl = re.match(r'^\s*(?:(?P<scope>my|our)\s+)?(?:module|class|role|enum|grammar)', line)
|
| 718 |
+
if class_decl:
|
| 719 |
+
if saw_perl_decl or class_decl.group('scope') is not None:
|
| 720 |
+
return True
|
| 721 |
+
rating = 0.05
|
| 722 |
+
continue
|
| 723 |
+
break
|
| 724 |
+
|
| 725 |
+
if ':=' in text:
|
| 726 |
+
# Same logic as above for PerlLexer
|
| 727 |
+
rating /= 2
|
| 728 |
+
|
| 729 |
+
return rating
|
| 730 |
+
|
| 731 |
+
def __init__(self, **options):
|
| 732 |
+
super().__init__(**options)
|
| 733 |
+
self.encoding = options.get('encoding', 'utf-8')
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/phix.py
ADDED
|
@@ -0,0 +1,363 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.phix
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Phix.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, words
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Whitespace
|
| 16 |
+
|
| 17 |
+
__all__ = ['PhixLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class PhixLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
Pygments Lexer for Phix files (.exw).
|
| 23 |
+
See http://phix.x10.mx
|
| 24 |
+
"""
|
| 25 |
+
|
| 26 |
+
name = 'Phix'
|
| 27 |
+
url = 'http://phix.x10.mx'
|
| 28 |
+
aliases = ['phix']
|
| 29 |
+
filenames = ['*.exw']
|
| 30 |
+
mimetypes = ['text/x-phix']
|
| 31 |
+
version_added = '2.14'
|
| 32 |
+
|
| 33 |
+
flags = re.MULTILINE # nb: **NOT** re.DOTALL! (totally spanners comment handling)
|
| 34 |
+
|
| 35 |
+
preproc = (
|
| 36 |
+
'ifdef', 'elsifdef', 'elsedef'
|
| 37 |
+
)
|
| 38 |
+
# Note these lists are auto-generated by pwa/p2js.exw, when pwa\src\p2js_keywords.e (etc)
|
| 39 |
+
# change, though of course subsequent copy/commit/pull requests are all manual steps.
|
| 40 |
+
types = (
|
| 41 |
+
'string', 'nullable_string', 'atom_string', 'atom', 'bool', 'boolean',
|
| 42 |
+
'cdCanvan', 'cdCanvas', 'complex', 'CURLcode', 'dictionary', 'int',
|
| 43 |
+
'integer', 'Ihandle', 'Ihandles', 'Ihandln', 'mpfr', 'mpq', 'mpz',
|
| 44 |
+
'mpz_or_string', 'number', 'rid_string', 'seq', 'sequence', 'timedate',
|
| 45 |
+
'object'
|
| 46 |
+
)
|
| 47 |
+
keywords = (
|
| 48 |
+
'abstract', 'class', 'continue', 'export', 'extends', 'nullable',
|
| 49 |
+
'private', 'public', 'static', 'struct', 'trace',
|
| 50 |
+
'and', 'break', 'by', 'case', 'catch', 'const', 'constant', 'debug',
|
| 51 |
+
'default', 'do', 'else', 'elsif', 'end', 'enum', 'exit', 'fallthru',
|
| 52 |
+
'fallthrough', 'for', 'forward', 'function', 'global', 'if', 'in',
|
| 53 |
+
'include', 'js', 'javascript', 'javascript_semantics', 'let', 'not',
|
| 54 |
+
'or', 'procedure', 'profile', 'profile_time', 'return', 'safe_mode',
|
| 55 |
+
'switch', 'then', 'to', 'try', 'type', 'type_check', 'until', 'warning',
|
| 56 |
+
'while', 'with', 'without', 'xor'
|
| 57 |
+
)
|
| 58 |
+
routines = (
|
| 59 |
+
'abort', 'abs', 'adjust_timedate', 'and_bits', 'and_bitsu', 'apply',
|
| 60 |
+
'append', 'arccos', 'arcsin', 'arctan', 'assert', 'atan2',
|
| 61 |
+
'atom_to_float32', 'atom_to_float64', 'bankers_rounding', 'beep',
|
| 62 |
+
'begins', 'binary_search', 'bits_to_int', 'bk_color', 'bytes_to_int',
|
| 63 |
+
'call_func', 'call_proc', 'cdCanvasActivate', 'cdCanvasArc',
|
| 64 |
+
'cdCanvasBegin', 'cdCanvasBox', 'cdCanvasChord', 'cdCanvasCircle',
|
| 65 |
+
'cdCanvasClear', 'cdCanvasEnd', 'cdCanvasFlush', 'cdCanvasFont',
|
| 66 |
+
'cdCanvasGetImageRGB', 'cdCanvasGetSize', 'cdCanvasGetTextAlignment',
|
| 67 |
+
'cdCanvasGetTextSize', 'cdCanvasLine', 'cdCanvasMark',
|
| 68 |
+
'cdCanvasMarkSize', 'cdCanvasMultiLineVectorText', 'cdCanvasPixel',
|
| 69 |
+
'cdCanvasRect', 'cdCanvasRoundedBox', 'cdCanvasRoundedRect',
|
| 70 |
+
'cdCanvasSector', 'cdCanvasSetAttribute', 'cdCanvasSetBackground',
|
| 71 |
+
'cdCanvasSetFillMode', 'cdCanvasSetForeground',
|
| 72 |
+
'cdCanvasSetInteriorStyle', 'cdCanvasSetLineStyle',
|
| 73 |
+
'cdCanvasSetLineWidth', 'cdCanvasSetTextAlignment', 'cdCanvasText',
|
| 74 |
+
'cdCanvasSetTextOrientation', 'cdCanvasGetTextOrientation',
|
| 75 |
+
'cdCanvasVectorText', 'cdCanvasVectorTextDirection',
|
| 76 |
+
'cdCanvasVectorTextSize', 'cdCanvasVertex', 'cdCreateCanvas',
|
| 77 |
+
'cdDecodeAlpha', 'cdDecodeColor', 'cdDecodeColorAlpha', 'cdEncodeAlpha',
|
| 78 |
+
'cdEncodeColor', 'cdEncodeColorAlpha', 'cdKillCanvas', 'cdVersion',
|
| 79 |
+
'cdVersionDate', 'ceil', 'change_timezone', 'choose', 'clear_screen',
|
| 80 |
+
'columnize', 'command_line', 'compare', 'complex_abs', 'complex_add',
|
| 81 |
+
'complex_arg', 'complex_conjugate', 'complex_cos', 'complex_cosh',
|
| 82 |
+
'complex_div', 'complex_exp', 'complex_imag', 'complex_inv',
|
| 83 |
+
'complex_log', 'complex_mul', 'complex_neg', 'complex_new',
|
| 84 |
+
'complex_norm', 'complex_power', 'complex_rho', 'complex_real',
|
| 85 |
+
'complex_round', 'complex_sin', 'complex_sinh', 'complex_sprint',
|
| 86 |
+
'complex_sqrt', 'complex_sub', 'complex_theta', 'concat', 'cos',
|
| 87 |
+
'crash', 'custom_sort', 'date', 'day_of_week', 'day_of_year',
|
| 88 |
+
'days_in_month', 'decode_base64', 'decode_flags', 'deep_copy', 'deld',
|
| 89 |
+
'deserialize', 'destroy_dict', 'destroy_queue', 'destroy_stack',
|
| 90 |
+
'dict_name', 'dict_size', 'elapsed', 'elapsed_short', 'encode_base64',
|
| 91 |
+
'equal', 'even', 'exp', 'extract', 'factorial', 'factors',
|
| 92 |
+
'file_size_k', 'find', 'find_all', 'find_any', 'find_replace', 'filter',
|
| 93 |
+
'flatten', 'float32_to_atom', 'float64_to_atom', 'floor',
|
| 94 |
+
'format_timedate', 'free_console', 'from_polar', 'gcd', 'get_file_base',
|
| 95 |
+
'get_file_extension', 'get_file_name', 'get_file_name_and_path',
|
| 96 |
+
'get_file_path', 'get_file_path_and_name', 'get_maxprime', 'get_prime',
|
| 97 |
+
'get_primes', 'get_primes_le', 'get_proper_dir', 'get_proper_path',
|
| 98 |
+
'get_rand', 'get_routine_info', 'get_test_abort', 'get_test_logfile',
|
| 99 |
+
'get_test_pause', 'get_test_verbosity', 'get_tzid', 'getd', 'getdd',
|
| 100 |
+
'getd_all_keys', 'getd_by_index', 'getd_index', 'getd_partial_key',
|
| 101 |
+
'glAttachShader', 'glBindBuffer', 'glBindTexture', 'glBufferData',
|
| 102 |
+
'glCanvasSpecialText', 'glClear', 'glClearColor', 'glColor',
|
| 103 |
+
'glCompileShader', 'glCreateBuffer', 'glCreateProgram',
|
| 104 |
+
'glCreateShader', 'glCreateTexture', 'glDeleteProgram',
|
| 105 |
+
'glDeleteShader', 'glDrawArrays', 'glEnable',
|
| 106 |
+
'glEnableVertexAttribArray', 'glFloat32Array', 'glInt32Array',
|
| 107 |
+
'glFlush', 'glGetAttribLocation', 'glGetError', 'glGetProgramInfoLog',
|
| 108 |
+
'glGetProgramParameter', 'glGetShaderInfoLog', 'glGetShaderParameter',
|
| 109 |
+
'glGetUniformLocation', 'glLinkProgram', 'glLoadIdentity',
|
| 110 |
+
'glMatrixMode', 'glOrtho', 'glRotatef', 'glShadeModel',
|
| 111 |
+
'glShaderSource', 'glSimpleA7texcoords', 'glTexImage2Dc',
|
| 112 |
+
'glTexParameteri', 'glTranslate', 'glUniform1f', 'glUniform1i',
|
| 113 |
+
'glUniformMatrix4fv', 'glUseProgram', 'glVertex',
|
| 114 |
+
'glVertexAttribPointer', 'glViewport', 'head', 'hsv_to_rgb', 'iff',
|
| 115 |
+
'iif', 'include_file', 'incl0de_file', 'insert', 'instance',
|
| 116 |
+
'int_to_bits', 'int_to_bytes', 'is_dict', 'is_integer', 's_leap_year',
|
| 117 |
+
'is_prime', 'is_prime2', 'islower', 'isupper', 'Icallback',
|
| 118 |
+
'iup_isdouble', 'iup_isprint', 'iup_XkeyBase', 'IupAppend', 'IupAlarm',
|
| 119 |
+
'IupBackgroundBox', 'IupButton', 'IupCalendar', 'IupCanvas',
|
| 120 |
+
'IupClipboard', 'IupClose', 'IupCloseOnEscape', 'IupControlsOpen',
|
| 121 |
+
'IupDatePick', 'IupDestroy', 'IupDialog', 'IupDrawArc', 'IupDrawBegin',
|
| 122 |
+
'IupDrawEnd', 'IupDrawGetSize', 'IupDrawGetTextSize', 'IupDrawLine',
|
| 123 |
+
'IupDrawRectangle', 'IupDrawText', 'IupExpander', 'IupFill',
|
| 124 |
+
'IupFlatLabel', 'IupFlatList', 'IupFlatTree', 'IupFlush', 'IupFrame',
|
| 125 |
+
'IupGetAttribute', 'IupGetAttributeId', 'IupGetAttributePtr',
|
| 126 |
+
'IupGetBrother', 'IupGetChild', 'IupGetChildCount', 'IupGetClassName',
|
| 127 |
+
'IupGetDialog', 'IupGetDialogChild', 'IupGetDouble', 'IupGetFocus',
|
| 128 |
+
'IupGetGlobal', 'IupGetGlobalInt', 'IupGetGlobalIntInt', 'IupGetInt',
|
| 129 |
+
'IupGetInt2', 'IupGetIntId', 'IupGetIntInt', 'IupGetParent',
|
| 130 |
+
'IupGLCanvas', 'IupGLCanvasOpen', 'IupGLMakeCurrent', 'IupGraph',
|
| 131 |
+
'IupHbox', 'IupHide', 'IupImage', 'IupImageRGBA', 'IupItem',
|
| 132 |
+
'iupKeyCodeToName', 'IupLabel', 'IupLink', 'IupList', 'IupMap',
|
| 133 |
+
'IupMenu', 'IupMenuItem', 'IupMessage', 'IupMessageDlg', 'IupMultiBox',
|
| 134 |
+
'IupMultiLine', 'IupNextField', 'IupNormaliser', 'IupOpen',
|
| 135 |
+
'IupPlayInput', 'IupPopup', 'IupPreviousField', 'IupProgressBar',
|
| 136 |
+
'IupRadio', 'IupRecordInput', 'IupRedraw', 'IupRefresh',
|
| 137 |
+
'IupRefreshChildren', 'IupSeparator', 'IupSetAttribute',
|
| 138 |
+
'IupSetAttributes', 'IupSetAttributeHandle', 'IupSetAttributeId',
|
| 139 |
+
'IupSetAttributePtr', 'IupSetCallback', 'IupSetCallbacks',
|
| 140 |
+
'IupSetDouble', 'IupSetFocus', 'IupSetGlobal', 'IupSetGlobalInt',
|
| 141 |
+
'IupSetGlobalFunction', 'IupSetHandle', 'IupSetInt',
|
| 142 |
+
'IupSetStrAttribute', 'IupSetStrGlobal', 'IupShow', 'IupShowXY',
|
| 143 |
+
'IupSplit', 'IupStoreAttribute', 'IupSubmenu', 'IupTable',
|
| 144 |
+
'IupTableClearSelected', 'IupTableClick_cb', 'IupTableGetSelected',
|
| 145 |
+
'IupTableResize_cb', 'IupTableSetData', 'IupTabs', 'IupText',
|
| 146 |
+
'IupTimer', 'IupToggle', 'IupTreeAddNodes', 'IupTreeView', 'IupUpdate',
|
| 147 |
+
'IupValuator', 'IupVbox', 'join', 'join_by', 'join_path', 'k_perm',
|
| 148 |
+
'largest', 'lcm', 'length', 'log', 'log10', 'log2', 'lower',
|
| 149 |
+
'm4_crossProduct', 'm4_inverse', 'm4_lookAt', 'm4_multiply',
|
| 150 |
+
'm4_normalize', 'm4_perspective', 'm4_subtractVectors', 'm4_xRotate',
|
| 151 |
+
'm4_yRotate', 'machine_bits', 'machine_word', 'match', 'match_all',
|
| 152 |
+
'match_replace', 'max', 'maxsq', 'min', 'minsq', 'mod', 'mpfr_add',
|
| 153 |
+
'mpfr_ceil', 'mpfr_cmp', 'mpfr_cmp_si', 'mpfr_const_pi', 'mpfr_div',
|
| 154 |
+
'mpfr_div_si', 'mpfr_div_z', 'mpfr_floor', 'mpfr_free', 'mpfr_get_d',
|
| 155 |
+
'mpfr_get_default_precision', 'mpfr_get_default_rounding_mode',
|
| 156 |
+
'mpfr_get_fixed', 'mpfr_get_precision', 'mpfr_get_si', 'mpfr_init',
|
| 157 |
+
'mpfr_inits', 'mpfr_init_set', 'mpfr_init_set_q', 'mpfr_init_set_z',
|
| 158 |
+
'mpfr_mul', 'mpfr_mul_si', 'mpfr_pow_si', 'mpfr_set', 'mpfr_set_d',
|
| 159 |
+
'mpfr_set_default_precision', 'mpfr_set_default_rounding_mode',
|
| 160 |
+
'mpfr_set_precision', 'mpfr_set_q', 'mpfr_set_si', 'mpfr_set_str',
|
| 161 |
+
'mpfr_set_z', 'mpfr_si_div', 'mpfr_si_sub', 'mpfr_sqrt', 'mpfr_sub',
|
| 162 |
+
'mpfr_sub_si', 'mpq_abs', 'mpq_add', 'mpq_add_si', 'mpq_canonicalize',
|
| 163 |
+
'mpq_cmp', 'mpq_cmp_si', 'mpq_div', 'mpq_div_2exp', 'mpq_free',
|
| 164 |
+
'mpq_get_den', 'mpq_get_num', 'mpq_get_str', 'mpq_init', 'mpq_init_set',
|
| 165 |
+
'mpq_init_set_si', 'mpq_init_set_str', 'mpq_init_set_z', 'mpq_inits',
|
| 166 |
+
'mpq_inv', 'mpq_mul', 'mpq_neg', 'mpq_set', 'mpq_set_si', 'mpq_set_str',
|
| 167 |
+
'mpq_set_z', 'mpq_sub', 'mpz_abs', 'mpz_add', 'mpz_addmul',
|
| 168 |
+
'mpz_addmul_ui', 'mpz_addmul_si', 'mpz_add_si', 'mpz_add_ui', 'mpz_and',
|
| 169 |
+
'mpz_bin_uiui', 'mpz_cdiv_q', 'mpz_cmp', 'mpz_cmp_si', 'mpz_divexact',
|
| 170 |
+
'mpz_divexact_ui', 'mpz_divisible_p', 'mpz_divisible_ui_p', 'mpz_even',
|
| 171 |
+
'mpz_fac_ui', 'mpz_factorstring', 'mpz_fdiv_q', 'mpz_fdiv_q_2exp',
|
| 172 |
+
'mpz_fdiv_q_ui', 'mpz_fdiv_qr', 'mpz_fdiv_r', 'mpz_fdiv_ui',
|
| 173 |
+
'mpz_fib_ui', 'mpz_fib2_ui', 'mpz_fits_atom', 'mpz_fits_integer',
|
| 174 |
+
'mpz_free', 'mpz_gcd', 'mpz_gcd_ui', 'mpz_get_atom', 'mpz_get_integer',
|
| 175 |
+
'mpz_get_short_str', 'mpz_get_str', 'mpz_init', 'mpz_init_set',
|
| 176 |
+
'mpz_inits', 'mpz_invert', 'mpz_lcm', 'mpz_lcm_ui', 'mpz_max',
|
| 177 |
+
'mpz_min', 'mpz_mod', 'mpz_mod_ui', 'mpz_mul', 'mpz_mul_2exp',
|
| 178 |
+
'mpz_mul_d', 'mpz_mul_si', 'mpz_neg', 'mpz_nthroot', 'mpz_odd',
|
| 179 |
+
'mpz_pollard_rho', 'mpz_pow_ui', 'mpz_powm', 'mpz_powm_ui', 'mpz_prime',
|
| 180 |
+
'mpz_prime_factors', 'mpz_prime_mr', 'mpz_rand', 'mpz_rand_ui',
|
| 181 |
+
'mpz_re_compose', 'mpz_remove', 'mpz_scan0', 'mpz_scan1', 'mpz_set',
|
| 182 |
+
'mpz_set_d', 'mpz_set_si', 'mpz_set_str', 'mpz_set_v', 'mpz_sign',
|
| 183 |
+
'mpz_sizeinbase', 'mpz_sqrt', 'mpz_sub', 'mpz_sub_si', 'mpz_sub_ui',
|
| 184 |
+
'mpz_si_sub', 'mpz_tdiv_q_2exp', 'mpz_tdiv_r_2exp', 'mpz_tstbit',
|
| 185 |
+
'mpz_ui_pow_ui', 'mpz_xor', 'named_dict', 'new_dict', 'new_queue',
|
| 186 |
+
'new_stack', 'not_bits', 'not_bitsu', 'odd', 'or_all', 'or_allu',
|
| 187 |
+
'or_bits', 'or_bitsu', 'ord', 'ordinal', 'ordinant',
|
| 188 |
+
'override_timezone', 'pad', 'pad_head', 'pad_tail', 'parse_date_string',
|
| 189 |
+
'papply', 'peep', 'peepn', 'peep_dict', 'permute', 'permutes',
|
| 190 |
+
'platform', 'pop', 'popn', 'pop_dict', 'power', 'pp', 'ppEx', 'ppExf',
|
| 191 |
+
'ppf', 'ppOpt', 'pq_add', 'pq_destroy', 'pq_empty', 'pq_new', 'pq_peek',
|
| 192 |
+
'pq_pop', 'pq_pop_data', 'pq_size', 'prepend', 'prime_factors',
|
| 193 |
+
'printf', 'product', 'proper', 'push', 'pushn', 'putd', 'puts',
|
| 194 |
+
'queue_empty', 'queue_size', 'rand', 'rand_range', 'reinstate',
|
| 195 |
+
'remainder', 'remove', 'remove_all', 'repeat', 'repeatch', 'replace',
|
| 196 |
+
'requires', 'reverse', 'rfind', 'rgb', 'rmatch', 'rmdr', 'rnd', 'round',
|
| 197 |
+
'routine_id', 'scanf', 'serialize', 'series', 'set_rand',
|
| 198 |
+
'set_test_abort', 'set_test_logfile', 'set_test_module',
|
| 199 |
+
'set_test_pause', 'set_test_verbosity', 'set_timedate_formats',
|
| 200 |
+
'set_timezone', 'setd', 'setd_default', 'shorten', 'sha256',
|
| 201 |
+
'shift_bits', 'shuffle', 'sign', 'sin', 'smallest', 'sort',
|
| 202 |
+
'sort_columns', 'speak', 'splice', 'split', 'split_any', 'split_by',
|
| 203 |
+
'sprint', 'sprintf', 'sq_abs', 'sq_add', 'sq_and', 'sq_and_bits',
|
| 204 |
+
'sq_arccos', 'sq_arcsin', 'sq_arctan', 'sq_atom', 'sq_ceil', 'sq_cmp',
|
| 205 |
+
'sq_cos', 'sq_div', 'sq_even', 'sq_eq', 'sq_floor', 'sq_floor_div',
|
| 206 |
+
'sq_ge', 'sq_gt', 'sq_int', 'sq_le', 'sq_log', 'sq_log10', 'sq_log2',
|
| 207 |
+
'sq_lt', 'sq_max', 'sq_min', 'sq_mod', 'sq_mul', 'sq_ne', 'sq_not',
|
| 208 |
+
'sq_not_bits', 'sq_odd', 'sq_or', 'sq_or_bits', 'sq_power', 'sq_rand',
|
| 209 |
+
'sq_remainder', 'sq_rmdr', 'sq_rnd', 'sq_round', 'sq_seq', 'sq_sign',
|
| 210 |
+
'sq_sin', 'sq_sqrt', 'sq_str', 'sq_sub', 'sq_tan', 'sq_trunc',
|
| 211 |
+
'sq_uminus', 'sq_xor', 'sq_xor_bits', 'sqrt', 'square_free',
|
| 212 |
+
'stack_empty', 'stack_size', 'substitute', 'substitute_all', 'sum',
|
| 213 |
+
'tail', 'tan', 'test_equal', 'test_fail', 'test_false',
|
| 214 |
+
'test_not_equal', 'test_pass', 'test_summary', 'test_true',
|
| 215 |
+
'text_color', 'throw', 'time', 'timedate_diff', 'timedelta',
|
| 216 |
+
'to_integer', 'to_number', 'to_rgb', 'to_string', 'traverse_dict',
|
| 217 |
+
'traverse_dict_partial_key', 'trim', 'trim_head', 'trim_tail', 'trunc',
|
| 218 |
+
'tagset', 'tagstart', 'typeof', 'unique', 'unix_dict', 'upper',
|
| 219 |
+
'utf8_to_utf32', 'utf32_to_utf8', 'version', 'vlookup', 'vslice',
|
| 220 |
+
'wglGetProcAddress', 'wildcard_file', 'wildcard_match', 'with_rho',
|
| 221 |
+
'with_theta', 'xml_new_doc', 'xml_new_element', 'xml_set_attribute',
|
| 222 |
+
'xml_sprint', 'xor_bits', 'xor_bitsu',
|
| 223 |
+
'accept', 'allocate', 'allocate_string', 'allow_break', 'ARM',
|
| 224 |
+
'atom_to_float80', 'c_func', 'c_proc', 'call_back', 'chdir',
|
| 225 |
+
'check_break', 'clearDib', 'close', 'closesocket', 'console',
|
| 226 |
+
'copy_file', 'create', 'create_directory', 'create_thread',
|
| 227 |
+
'curl_easy_cleanup', 'curl_easy_get_file', 'curl_easy_init',
|
| 228 |
+
'curl_easy_perform', 'curl_easy_perform_ex', 'curl_easy_setopt',
|
| 229 |
+
'curl_easy_strerror', 'curl_global_cleanup', 'curl_global_init',
|
| 230 |
+
'curl_slist_append', 'curl_slist_free_all', 'current_dir', 'cursor',
|
| 231 |
+
'define_c_func', 'define_c_proc', 'delete', 'delete_cs', 'delete_file',
|
| 232 |
+
'dir', 'DLL', 'drawDib', 'drawShadedPolygonToDib', 'ELF32', 'ELF64',
|
| 233 |
+
'enter_cs', 'eval', 'exit_thread', 'free', 'file_exists', 'final',
|
| 234 |
+
'float80_to_atom', 'format', 'get_bytes', 'get_file_date',
|
| 235 |
+
'get_file_size', 'get_file_type', 'get_interpreter', 'get_key',
|
| 236 |
+
'get_socket_error', 'get_text', 'get_thread_exitcode', 'get_thread_id',
|
| 237 |
+
'getc', 'getenv', 'gets', 'getsockaddr', 'glBegin', 'glCallList',
|
| 238 |
+
'glFrustum', 'glGenLists', 'glGetString', 'glLight', 'glMaterial',
|
| 239 |
+
'glNewList', 'glNormal', 'glPopMatrix', 'glPushMatrix', 'glRotate',
|
| 240 |
+
'glEnd', 'glEndList', 'glTexImage2D', 'goto', 'GUI', 'icons', 'ilASM',
|
| 241 |
+
'include_files', 'include_paths', 'init_cs', 'ip_to_string',
|
| 242 |
+
'IupConfig', 'IupConfigDialogClosed', 'IupConfigDialogShow',
|
| 243 |
+
'IupConfigGetVariableInt', 'IupConfigLoad', 'IupConfigSave',
|
| 244 |
+
'IupConfigSetVariableInt', 'IupExitLoop', 'IupFileDlg', 'IupFileList',
|
| 245 |
+
'IupGLSwapBuffers', 'IupHelp', 'IupLoopStep', 'IupMainLoop',
|
| 246 |
+
'IupNormalizer', 'IupPlot', 'IupPlotAdd', 'IupPlotBegin', 'IupPlotEnd',
|
| 247 |
+
'IupPlotInsert', 'IupSaveImage', 'IupTreeGetUserId', 'IupUser',
|
| 248 |
+
'IupVersion', 'IupVersionDate', 'IupVersionNumber', 'IupVersionShow',
|
| 249 |
+
'killDib', 'leave_cs', 'listen', 'manifest', 'mem_copy', 'mem_set',
|
| 250 |
+
'mpfr_gamma', 'mpfr_printf', 'mpfr_sprintf', 'mpz_export', 'mpz_import',
|
| 251 |
+
'namespace', 'new', 'newDib', 'open', 'open_dll', 'PE32', 'PE64',
|
| 252 |
+
'peek', 'peek_string', 'peek1s', 'peek1u', 'peek2s', 'peek2u', 'peek4s',
|
| 253 |
+
'peek4u', 'peek8s', 'peek8u', 'peekNS', 'peekns', 'peeknu', 'poke',
|
| 254 |
+
'poke2', 'poke4', 'poke8', 'pokeN', 'poke_string', 'poke_wstring',
|
| 255 |
+
'position', 'progress', 'prompt_number', 'prompt_string', 'read_file',
|
| 256 |
+
'read_lines', 'recv', 'resume_thread', 'seek', 'select', 'send',
|
| 257 |
+
'setHandler', 'shutdown', 'sleep', 'SO', 'sockaddr_in', 'socket',
|
| 258 |
+
'split_path', 'suspend_thread', 'system', 'system_exec', 'system_open',
|
| 259 |
+
'system_wait', 'task_clock_start', 'task_clock_stop', 'task_create',
|
| 260 |
+
'task_delay', 'task_list', 'task_schedule', 'task_self', 'task_status',
|
| 261 |
+
'task_suspend', 'task_yield', 'thread_safe_string', 'try_cs',
|
| 262 |
+
'utf8_to_utf16', 'utf16_to_utf8', 'utf16_to_utf32', 'utf32_to_utf16',
|
| 263 |
+
'video_config', 'WSACleanup', 'wait_thread', 'walk_dir', 'where',
|
| 264 |
+
'write_lines', 'wait_key'
|
| 265 |
+
)
|
| 266 |
+
constants = (
|
| 267 |
+
'ANY_QUEUE', 'ASCENDING', 'BLACK', 'BLOCK_CURSOR', 'BLUE',
|
| 268 |
+
'BRIGHT_CYAN', 'BRIGHT_BLUE', 'BRIGHT_GREEN', 'BRIGHT_MAGENTA',
|
| 269 |
+
'BRIGHT_RED', 'BRIGHT_WHITE', 'BROWN', 'C_DWORD', 'C_INT', 'C_POINTER',
|
| 270 |
+
'C_USHORT', 'C_WORD', 'CD_AMBER', 'CD_BLACK', 'CD_BLUE', 'CD_BOLD',
|
| 271 |
+
'CD_BOLD_ITALIC', 'CD_BOX', 'CD_CENTER', 'CD_CIRCLE', 'CD_CLOSED_LINES',
|
| 272 |
+
'CD_CONTINUOUS', 'CD_CUSTOM', 'CD_CYAN', 'CD_DARK_BLUE', 'CD_DARK_CYAN',
|
| 273 |
+
'CD_DARK_GRAY', 'CD_DARK_GREY', 'CD_DARK_GREEN', 'CD_DARK_MAGENTA',
|
| 274 |
+
'CD_DARK_RED', 'CD_DARK_YELLOW', 'CD_DASH_DOT', 'CD_DASH_DOT_DOT',
|
| 275 |
+
'CD_DASHED', 'CD_DBUFFER', 'CD_DEG2RAD', 'CD_DIAMOND', 'CD_DOTTED',
|
| 276 |
+
'CD_EAST', 'CD_EVENODD', 'CD_FILL', 'CD_GL', 'CD_GRAY', 'CD_GREY',
|
| 277 |
+
'CD_GREEN', 'CD_HATCH', 'CD_HOLLOW', 'CD_HOLLOW_BOX',
|
| 278 |
+
'CD_HOLLOW_CIRCLE', 'CD_HOLLOW_DIAMOND', 'CD_INDIGO', 'CD_ITALIC',
|
| 279 |
+
'CD_IUP', 'CD_IUPDBUFFER', 'CD_LIGHT_BLUE', 'CD_LIGHT_GRAY',
|
| 280 |
+
'CD_LIGHT_GREY', 'CD_LIGHT_GREEN', 'CD_LIGHT_PARCHMENT', 'CD_MAGENTA',
|
| 281 |
+
'CD_NAVY', 'CD_NORTH', 'CD_NORTH_EAST', 'CD_NORTH_WEST', 'CD_OLIVE',
|
| 282 |
+
'CD_OPEN_LINES', 'CD_ORANGE', 'CD_PARCHMENT', 'CD_PATTERN',
|
| 283 |
+
'CD_PRINTER', 'CD_PURPLE', 'CD_PLAIN', 'CD_PLUS', 'CD_QUERY',
|
| 284 |
+
'CD_RAD2DEG', 'CD_RED', 'CD_SILVER', 'CD_SOLID', 'CD_SOUTH_EAST',
|
| 285 |
+
'CD_SOUTH_WEST', 'CD_STAR', 'CD_STIPPLE', 'CD_STRIKEOUT',
|
| 286 |
+
'CD_UNDERLINE', 'CD_WEST', 'CD_WHITE', 'CD_WINDING', 'CD_VIOLET',
|
| 287 |
+
'CD_X', 'CD_YELLOW', 'CURLE_OK', 'CURLOPT_MAIL_FROM',
|
| 288 |
+
'CURLOPT_MAIL_RCPT', 'CURLOPT_PASSWORD', 'CURLOPT_READDATA',
|
| 289 |
+
'CURLOPT_READFUNCTION', 'CURLOPT_SSL_VERIFYPEER',
|
| 290 |
+
'CURLOPT_SSL_VERIFYHOST', 'CURLOPT_UPLOAD', 'CURLOPT_URL',
|
| 291 |
+
'CURLOPT_USE_SSL', 'CURLOPT_USERNAME', 'CURLOPT_VERBOSE',
|
| 292 |
+
'CURLOPT_WRITEFUNCTION', 'CURLUSESSL_ALL', 'CYAN', 'D_NAME',
|
| 293 |
+
'D_ATTRIBUTES', 'D_SIZE', 'D_YEAR', 'D_MONTH', 'D_DAY', 'D_HOUR',
|
| 294 |
+
'D_MINUTE', 'D_SECOND', 'D_CREATION', 'D_LASTACCESS', 'D_MODIFICATION',
|
| 295 |
+
'DT_YEAR', 'DT_MONTH', 'DT_DAY', 'DT_HOUR', 'DT_MINUTE', 'DT_SECOND',
|
| 296 |
+
'DT_DOW', 'DT_MSEC', 'DT_DOY', 'DT_GMT', 'EULER', 'E_CODE', 'E_ADDR',
|
| 297 |
+
'E_LINE', 'E_RTN', 'E_NAME', 'E_FILE', 'E_PATH', 'E_USER', 'false',
|
| 298 |
+
'False', 'FALSE', 'FIFO_QUEUE', 'FILETYPE_DIRECTORY', 'FILETYPE_FILE',
|
| 299 |
+
'GET_EOF', 'GET_FAIL', 'GET_IGNORE', 'GET_SUCCESS',
|
| 300 |
+
'GL_AMBIENT_AND_DIFFUSE', 'GL_ARRAY_BUFFER', 'GL_CLAMP',
|
| 301 |
+
'GL_CLAMP_TO_BORDER', 'GL_CLAMP_TO_EDGE', 'GL_COLOR_BUFFER_BIT',
|
| 302 |
+
'GL_COMPILE', 'GL_COMPILE_STATUS', 'GL_CULL_FACE',
|
| 303 |
+
'GL_DEPTH_BUFFER_BIT', 'GL_DEPTH_TEST', 'GL_EXTENSIONS', 'GL_FLAT',
|
| 304 |
+
'GL_FLOAT', 'GL_FRAGMENT_SHADER', 'GL_FRONT', 'GL_LIGHT0',
|
| 305 |
+
'GL_LIGHTING', 'GL_LINEAR', 'GL_LINK_STATUS', 'GL_MODELVIEW',
|
| 306 |
+
'GL_NEAREST', 'GL_NO_ERROR', 'GL_NORMALIZE', 'GL_POSITION',
|
| 307 |
+
'GL_PROJECTION', 'GL_QUAD_STRIP', 'GL_QUADS', 'GL_RENDERER',
|
| 308 |
+
'GL_REPEAT', 'GL_RGB', 'GL_RGBA', 'GL_SMOOTH', 'GL_STATIC_DRAW',
|
| 309 |
+
'GL_TEXTURE_2D', 'GL_TEXTURE_MAG_FILTER', 'GL_TEXTURE_MIN_FILTER',
|
| 310 |
+
'GL_TEXTURE_WRAP_S', 'GL_TEXTURE_WRAP_T', 'GL_TRIANGLES',
|
| 311 |
+
'GL_UNSIGNED_BYTE', 'GL_VENDOR', 'GL_VERSION', 'GL_VERTEX_SHADER',
|
| 312 |
+
'GRAY', 'GREEN', 'GT_LF_STRIPPED', 'GT_WHOLE_FILE', 'INVLN10',
|
| 313 |
+
'IUP_CLOSE', 'IUP_CONTINUE', 'IUP_DEFAULT', 'IUP_BLACK', 'IUP_BLUE',
|
| 314 |
+
'IUP_BUTTON1', 'IUP_BUTTON3', 'IUP_CENTER', 'IUP_CYAN', 'IUP_DARK_BLUE',
|
| 315 |
+
'IUP_DARK_CYAN', 'IUP_DARK_GRAY', 'IUP_DARK_GREY', 'IUP_DARK_GREEN',
|
| 316 |
+
'IUP_DARK_MAGENTA', 'IUP_DARK_RED', 'IUP_GRAY', 'IUP_GREY', 'IUP_GREEN',
|
| 317 |
+
'IUP_IGNORE', 'IUP_INDIGO', 'IUP_MAGENTA', 'IUP_MASK_INT',
|
| 318 |
+
'IUP_MASK_UINT', 'IUP_MOUSEPOS', 'IUP_NAVY', 'IUP_OLIVE', 'IUP_RECTEXT',
|
| 319 |
+
'IUP_RED', 'IUP_LIGHT_BLUE', 'IUP_LIGHT_GRAY', 'IUP_LIGHT_GREY',
|
| 320 |
+
'IUP_LIGHT_GREEN', 'IUP_ORANGE', 'IUP_PARCHMENT', 'IUP_PURPLE',
|
| 321 |
+
'IUP_SILVER', 'IUP_TEAL', 'IUP_VIOLET', 'IUP_WHITE', 'IUP_YELLOW',
|
| 322 |
+
'K_BS', 'K_cA', 'K_cC', 'K_cD', 'K_cF5', 'K_cK', 'K_cM', 'K_cN', 'K_cO',
|
| 323 |
+
'K_cP', 'K_cR', 'K_cS', 'K_cT', 'K_cW', 'K_CR', 'K_DEL', 'K_DOWN',
|
| 324 |
+
'K_END', 'K_ESC', 'K_F1', 'K_F2', 'K_F3', 'K_F4', 'K_F5', 'K_F6',
|
| 325 |
+
'K_F7', 'K_F8', 'K_F9', 'K_F10', 'K_F11', 'K_F12', 'K_HOME', 'K_INS',
|
| 326 |
+
'K_LEFT', 'K_MIDDLE', 'K_PGDN', 'K_PGUP', 'K_RIGHT', 'K_SP', 'K_TAB',
|
| 327 |
+
'K_UP', 'K_h', 'K_i', 'K_j', 'K_p', 'K_r', 'K_s', 'JS', 'LIFO_QUEUE',
|
| 328 |
+
'LINUX', 'MAX_HEAP', 'MAGENTA', 'MIN_HEAP', 'Nan', 'NO_CURSOR', 'null',
|
| 329 |
+
'NULL', 'PI', 'pp_Ascii', 'pp_Brkt', 'pp_Date', 'pp_File', 'pp_FltFmt',
|
| 330 |
+
'pp_Indent', 'pp_IntCh', 'pp_IntFmt', 'pp_Maxlen', 'pp_Nest',
|
| 331 |
+
'pp_Pause', 'pp_Q22', 'pp_StrFmt', 'RED', 'SEEK_OK', 'SLASH',
|
| 332 |
+
'TEST_ABORT', 'TEST_CRASH', 'TEST_PAUSE', 'TEST_PAUSE_FAIL',
|
| 333 |
+
'TEST_QUIET', 'TEST_SHOW_ALL', 'TEST_SHOW_FAILED', 'TEST_SUMMARY',
|
| 334 |
+
'true', 'True', 'TRUE', 'VC_SCRNLINES', 'WHITE', 'WINDOWS', 'YELLOW'
|
| 335 |
+
)
|
| 336 |
+
|
| 337 |
+
tokens = {
|
| 338 |
+
'root': [
|
| 339 |
+
(r"\s+", Whitespace),
|
| 340 |
+
(r'/\*|--/\*|#\[', Comment.Multiline, 'comment'),
|
| 341 |
+
(r'(?://|--|#!).*$', Comment.Single),
|
| 342 |
+
#Alt:
|
| 343 |
+
# (r'//.*$|--.*$|#!.*$', Comment.Single),
|
| 344 |
+
(r'"([^"\\]|\\.)*"', String.Other),
|
| 345 |
+
(r'\'[^\']*\'', String.Other),
|
| 346 |
+
(r'`[^`]*`', String.Other),
|
| 347 |
+
|
| 348 |
+
(words(types, prefix=r'\b', suffix=r'\b'), Name.Function),
|
| 349 |
+
(words(routines, prefix=r'\b', suffix=r'\b'), Name.Function),
|
| 350 |
+
(words(preproc, prefix=r'\b', suffix=r'\b'), Keyword.Declaration),
|
| 351 |
+
(words(keywords, prefix=r'\b', suffix=r'\b'), Keyword.Declaration),
|
| 352 |
+
(words(constants, prefix=r'\b', suffix=r'\b'), Name.Constant),
|
| 353 |
+
# Aside: Phix only supports/uses the ascii/non-unicode tilde
|
| 354 |
+
(r'!=|==|<<|>>|:=|[-~+/*%=<>&^|\.(){},?:\[\]$\\;#]', Operator),
|
| 355 |
+
(r'[\w-]+', Text)
|
| 356 |
+
],
|
| 357 |
+
'comment': [
|
| 358 |
+
(r'[^*/#]+', Comment.Multiline),
|
| 359 |
+
(r'/\*|#\[', Comment.Multiline, '#push'),
|
| 360 |
+
(r'\*/|#\]', Comment.Multiline, '#pop'),
|
| 361 |
+
(r'[*/#]', Comment.Multiline)
|
| 362 |
+
]
|
| 363 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/php.py
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.php
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for PHP and related languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import Lexer, RegexLexer, include, bygroups, default, \
|
| 14 |
+
using, this, words, do_insertions, line_re
|
| 15 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 16 |
+
Number, Punctuation, Other, Generic
|
| 17 |
+
from pygments.util import get_bool_opt, get_list_opt, shebang_matches
|
| 18 |
+
|
| 19 |
+
__all__ = ['ZephirLexer', 'PsyshConsoleLexer', 'PhpLexer']
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class ZephirLexer(RegexLexer):
|
| 23 |
+
"""
|
| 24 |
+
For Zephir language source code.
|
| 25 |
+
|
| 26 |
+
Zephir is a compiled high level language aimed
|
| 27 |
+
to the creation of C-extensions for PHP.
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
name = 'Zephir'
|
| 31 |
+
url = 'http://zephir-lang.com/'
|
| 32 |
+
aliases = ['zephir']
|
| 33 |
+
filenames = ['*.zep']
|
| 34 |
+
version_added = '2.0'
|
| 35 |
+
|
| 36 |
+
zephir_keywords = ['fetch', 'echo', 'isset', 'empty']
|
| 37 |
+
zephir_type = ['bit', 'bits', 'string']
|
| 38 |
+
|
| 39 |
+
flags = re.DOTALL | re.MULTILINE
|
| 40 |
+
|
| 41 |
+
tokens = {
|
| 42 |
+
'commentsandwhitespace': [
|
| 43 |
+
(r'\s+', Text),
|
| 44 |
+
(r'//.*?\n', Comment.Single),
|
| 45 |
+
(r'/\*.*?\*/', Comment.Multiline)
|
| 46 |
+
],
|
| 47 |
+
'slashstartsregex': [
|
| 48 |
+
include('commentsandwhitespace'),
|
| 49 |
+
(r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
|
| 50 |
+
r'([gim]+\b|\B)', String.Regex, '#pop'),
|
| 51 |
+
(r'/', Operator, '#pop'),
|
| 52 |
+
default('#pop')
|
| 53 |
+
],
|
| 54 |
+
'badregex': [
|
| 55 |
+
(r'\n', Text, '#pop')
|
| 56 |
+
],
|
| 57 |
+
'root': [
|
| 58 |
+
(r'^(?=\s|/)', Text, 'slashstartsregex'),
|
| 59 |
+
include('commentsandwhitespace'),
|
| 60 |
+
(r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
|
| 61 |
+
r'(<<|>>>?|==?|!=?|->|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
|
| 62 |
+
(r'[{(\[;,]', Punctuation, 'slashstartsregex'),
|
| 63 |
+
(r'[})\].]', Punctuation),
|
| 64 |
+
(r'(for|in|while|do|break|return|continue|switch|case|default|if|else|loop|'
|
| 65 |
+
r'require|inline|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
|
| 66 |
+
r'namespace|use|extends|this|fetch|isset|unset|echo|fetch|likely|unlikely|'
|
| 67 |
+
r'empty)\b', Keyword, 'slashstartsregex'),
|
| 68 |
+
(r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
|
| 69 |
+
(r'(abstract|boolean|bool|char|class|const|double|enum|export|extends|final|'
|
| 70 |
+
r'native|goto|implements|import|int|string|interface|long|ulong|char|uchar|'
|
| 71 |
+
r'float|unsigned|private|protected|public|short|static|self|throws|reverse|'
|
| 72 |
+
r'transient|volatile|readonly)\b', Keyword.Reserved),
|
| 73 |
+
(r'(true|false|null|undefined)\b', Keyword.Constant),
|
| 74 |
+
(r'(Array|Boolean|Date|_REQUEST|_COOKIE|_SESSION|'
|
| 75 |
+
r'_GET|_POST|_SERVER|this|stdClass|range|count|iterator|'
|
| 76 |
+
r'window)\b', Name.Builtin),
|
| 77 |
+
(r'[$a-zA-Z_][\w\\]*', Name.Other),
|
| 78 |
+
(r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
|
| 79 |
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
| 80 |
+
(r'[0-9]+', Number.Integer),
|
| 81 |
+
(r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
|
| 82 |
+
(r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single),
|
| 83 |
+
]
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
class PsyshConsoleLexer(Lexer):
|
| 88 |
+
"""
|
| 89 |
+
For PsySH console output, such as:
|
| 90 |
+
|
| 91 |
+
.. sourcecode:: psysh
|
| 92 |
+
|
| 93 |
+
>>> $greeting = function($name): string {
|
| 94 |
+
... return "Hello, {$name}";
|
| 95 |
+
... };
|
| 96 |
+
=> Closure($name): string {#2371 …3}
|
| 97 |
+
>>> $greeting('World')
|
| 98 |
+
=> "Hello, World"
|
| 99 |
+
"""
|
| 100 |
+
name = 'PsySH console session for PHP'
|
| 101 |
+
url = 'https://psysh.org/'
|
| 102 |
+
aliases = ['psysh']
|
| 103 |
+
version_added = '2.7'
|
| 104 |
+
|
| 105 |
+
def __init__(self, **options):
|
| 106 |
+
options['startinline'] = True
|
| 107 |
+
Lexer.__init__(self, **options)
|
| 108 |
+
|
| 109 |
+
def get_tokens_unprocessed(self, text):
|
| 110 |
+
phplexer = PhpLexer(**self.options)
|
| 111 |
+
curcode = ''
|
| 112 |
+
insertions = []
|
| 113 |
+
for match in line_re.finditer(text):
|
| 114 |
+
line = match.group()
|
| 115 |
+
if line.startswith('>>> ') or line.startswith('... '):
|
| 116 |
+
insertions.append((len(curcode),
|
| 117 |
+
[(0, Generic.Prompt, line[:4])]))
|
| 118 |
+
curcode += line[4:]
|
| 119 |
+
elif line.rstrip() == '...':
|
| 120 |
+
insertions.append((len(curcode),
|
| 121 |
+
[(0, Generic.Prompt, '...')]))
|
| 122 |
+
curcode += line[3:]
|
| 123 |
+
else:
|
| 124 |
+
if curcode:
|
| 125 |
+
yield from do_insertions(
|
| 126 |
+
insertions, phplexer.get_tokens_unprocessed(curcode))
|
| 127 |
+
curcode = ''
|
| 128 |
+
insertions = []
|
| 129 |
+
yield match.start(), Generic.Output, line
|
| 130 |
+
if curcode:
|
| 131 |
+
yield from do_insertions(insertions,
|
| 132 |
+
phplexer.get_tokens_unprocessed(curcode))
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
class PhpLexer(RegexLexer):
|
| 136 |
+
"""
|
| 137 |
+
For PHP source code.
|
| 138 |
+
For PHP embedded in HTML, use the `HtmlPhpLexer`.
|
| 139 |
+
|
| 140 |
+
Additional options accepted:
|
| 141 |
+
|
| 142 |
+
`startinline`
|
| 143 |
+
If given and ``True`` the lexer starts highlighting with
|
| 144 |
+
php code (i.e.: no starting ``<?php`` required). The default
|
| 145 |
+
is ``False``.
|
| 146 |
+
`funcnamehighlighting`
|
| 147 |
+
If given and ``True``, highlight builtin function names
|
| 148 |
+
(default: ``True``).
|
| 149 |
+
`disabledmodules`
|
| 150 |
+
If given, must be a list of module names whose function names
|
| 151 |
+
should not be highlighted. By default all modules are highlighted
|
| 152 |
+
except the special ``'unknown'`` module that includes functions
|
| 153 |
+
that are known to php but are undocumented.
|
| 154 |
+
|
| 155 |
+
To get a list of allowed modules have a look into the
|
| 156 |
+
`_php_builtins` module:
|
| 157 |
+
|
| 158 |
+
.. sourcecode:: pycon
|
| 159 |
+
|
| 160 |
+
>>> from pygments.lexers._php_builtins import MODULES
|
| 161 |
+
>>> MODULES.keys()
|
| 162 |
+
['PHP Options/Info', 'Zip', 'dba', ...]
|
| 163 |
+
|
| 164 |
+
In fact the names of those modules match the module names from
|
| 165 |
+
the php documentation.
|
| 166 |
+
"""
|
| 167 |
+
|
| 168 |
+
name = 'PHP'
|
| 169 |
+
url = 'https://www.php.net/'
|
| 170 |
+
aliases = ['php', 'php3', 'php4', 'php5']
|
| 171 |
+
filenames = ['*.php', '*.php[345]', '*.inc']
|
| 172 |
+
mimetypes = ['text/x-php']
|
| 173 |
+
version_added = ''
|
| 174 |
+
|
| 175 |
+
# Note that a backslash is included, PHP uses a backslash as a namespace
|
| 176 |
+
# separator.
|
| 177 |
+
_ident_inner = r'(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*'
|
| 178 |
+
# But not inside strings.
|
| 179 |
+
_ident_nons = r'(?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*'
|
| 180 |
+
|
| 181 |
+
flags = re.IGNORECASE | re.DOTALL | re.MULTILINE
|
| 182 |
+
tokens = {
|
| 183 |
+
'root': [
|
| 184 |
+
(r'<\?(php)?', Comment.Preproc, 'php'),
|
| 185 |
+
(r'[^<]+', Other),
|
| 186 |
+
(r'<', Other)
|
| 187 |
+
],
|
| 188 |
+
'php': [
|
| 189 |
+
(r'\?>', Comment.Preproc, '#pop'),
|
| 190 |
+
(r'(<<<)([\'"]?)(' + _ident_nons + r')(\2\n.*?\n\s*)(\3)(;?)(\n)',
|
| 191 |
+
bygroups(String, String, String.Delimiter, String, String.Delimiter,
|
| 192 |
+
Punctuation, Text)),
|
| 193 |
+
(r'\s+', Text),
|
| 194 |
+
(r'#\[', Punctuation, 'attribute'),
|
| 195 |
+
(r'#.*?\n', Comment.Single),
|
| 196 |
+
(r'//.*?\n', Comment.Single),
|
| 197 |
+
# put the empty comment here, it is otherwise seen as
|
| 198 |
+
# the start of a docstring
|
| 199 |
+
(r'/\*\*/', Comment.Multiline),
|
| 200 |
+
(r'/\*\*.*?\*/', String.Doc),
|
| 201 |
+
(r'/\*.*?\*/', Comment.Multiline),
|
| 202 |
+
(r'(->|::)(\s*)(' + _ident_nons + ')',
|
| 203 |
+
bygroups(Operator, Text, Name.Attribute)),
|
| 204 |
+
(r'[~!%^&*+=|:.<>/@-]+', Operator),
|
| 205 |
+
(r'\?', Operator), # don't add to the charclass above!
|
| 206 |
+
(r'[\[\]{}();,]+', Punctuation),
|
| 207 |
+
(r'(new)(\s+)(class)\b', bygroups(Keyword, Text, Keyword)),
|
| 208 |
+
(r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
|
| 209 |
+
(r'(function)(\s*)(?=\()', bygroups(Keyword, Text)),
|
| 210 |
+
(r'(function)(\s+)(&?)(\s*)',
|
| 211 |
+
bygroups(Keyword, Text, Operator, Text), 'functionname'),
|
| 212 |
+
(r'(const)(\s+)(' + _ident_inner + ')',
|
| 213 |
+
bygroups(Keyword, Text, Name.Constant)),
|
| 214 |
+
# source: https://www.php.net/manual/en/reserved.keywords.php
|
| 215 |
+
(r'(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|'
|
| 216 |
+
r'eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|'
|
| 217 |
+
r'FALSE|print|for|require|continue|foreach|require_once|'
|
| 218 |
+
r'declare|return|default|static|do|switch|die|stdClass|'
|
| 219 |
+
r'echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|'
|
| 220 |
+
r'virtual|endfor|include_once|while|endforeach|global|'
|
| 221 |
+
r'endif|list|endswitch|new|endwhile|not|'
|
| 222 |
+
r'array|E_ALL|NULL|final|php_user_filter|interface|'
|
| 223 |
+
r'implements|public|private|protected|abstract|clone|try|'
|
| 224 |
+
r'catch|throw|this|use|namespace|trait|yield( from)?|'
|
| 225 |
+
r'finally|match|readonly)\b', Keyword),
|
| 226 |
+
(r'(true|false|null)\b', Keyword.Constant),
|
| 227 |
+
include('magicconstants'),
|
| 228 |
+
(r'\$\{', Name.Variable, 'variablevariable'),
|
| 229 |
+
(r'\$+' + _ident_inner, Name.Variable),
|
| 230 |
+
(_ident_inner, Name.Other),
|
| 231 |
+
(r'(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?', Number.Float),
|
| 232 |
+
(r'\d+e[+-]?[0-9]+', Number.Float),
|
| 233 |
+
(r'0[0-7]+', Number.Oct),
|
| 234 |
+
(r'0x[a-f0-9]+', Number.Hex),
|
| 235 |
+
(r'\d+', Number.Integer),
|
| 236 |
+
(r'0b[01]+', Number.Bin),
|
| 237 |
+
(r"'([^'\\]*(?:\\.[^'\\]*)*)'", String.Single),
|
| 238 |
+
(r'`([^`\\]*(?:\\.[^`\\]*)*)`', String.Backtick),
|
| 239 |
+
(r'"', String.Double, 'string'),
|
| 240 |
+
],
|
| 241 |
+
'variablevariable': [
|
| 242 |
+
(r'\}', Name.Variable, '#pop'),
|
| 243 |
+
include('php')
|
| 244 |
+
],
|
| 245 |
+
'magicfuncs': [
|
| 246 |
+
# source: http://php.net/manual/en/language.oop5.magic.php
|
| 247 |
+
(words((
|
| 248 |
+
'__construct', '__destruct', '__call', '__callStatic', '__get', '__set',
|
| 249 |
+
'__isset', '__unset', '__sleep', '__wakeup', '__toString', '__invoke',
|
| 250 |
+
'__set_state', '__clone', '__debugInfo',), suffix=r'\b'),
|
| 251 |
+
Name.Function.Magic),
|
| 252 |
+
],
|
| 253 |
+
'magicconstants': [
|
| 254 |
+
# source: https://www.php.net/manual/en/language.constants.magic.php
|
| 255 |
+
(words((
|
| 256 |
+
'__LINE__', '__FILE__', '__DIR__', '__FUNCTION__', '__CLASS__',
|
| 257 |
+
'__TRAIT__', '__METHOD__', '__NAMESPACE__', '__PROPERTY__',),
|
| 258 |
+
suffix=r'\b'),
|
| 259 |
+
Name.Constant),
|
| 260 |
+
],
|
| 261 |
+
'classname': [
|
| 262 |
+
(_ident_inner, Name.Class, '#pop')
|
| 263 |
+
],
|
| 264 |
+
'functionname': [
|
| 265 |
+
include('magicfuncs'),
|
| 266 |
+
(_ident_inner, Name.Function, '#pop'),
|
| 267 |
+
default('#pop')
|
| 268 |
+
],
|
| 269 |
+
'string': [
|
| 270 |
+
(r'"', String.Double, '#pop'),
|
| 271 |
+
(r'[^{$"\\]+', String.Double),
|
| 272 |
+
(r'\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})', String.Escape),
|
| 273 |
+
(r'\$' + _ident_nons + r'(\[\S+?\]|->' + _ident_nons + ')?',
|
| 274 |
+
String.Interpol),
|
| 275 |
+
(r'(\{\$\{)(.*?)(\}\})',
|
| 276 |
+
bygroups(String.Interpol, using(this, _startinline=True),
|
| 277 |
+
String.Interpol)),
|
| 278 |
+
(r'(\{)(\$.*?)(\})',
|
| 279 |
+
bygroups(String.Interpol, using(this, _startinline=True),
|
| 280 |
+
String.Interpol)),
|
| 281 |
+
(r'(\$\{)(\S+)(\})',
|
| 282 |
+
bygroups(String.Interpol, Name.Variable, String.Interpol)),
|
| 283 |
+
(r'[${\\]', String.Double)
|
| 284 |
+
],
|
| 285 |
+
'attribute': [
|
| 286 |
+
(r'\]', Punctuation, '#pop'),
|
| 287 |
+
(r'\(', Punctuation, 'attributeparams'),
|
| 288 |
+
(_ident_inner, Name.Decorator),
|
| 289 |
+
include('php')
|
| 290 |
+
],
|
| 291 |
+
'attributeparams': [
|
| 292 |
+
(r'\)', Punctuation, '#pop'),
|
| 293 |
+
include('php')
|
| 294 |
+
],
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
def __init__(self, **options):
|
| 298 |
+
self.funcnamehighlighting = get_bool_opt(
|
| 299 |
+
options, 'funcnamehighlighting', True)
|
| 300 |
+
self.disabledmodules = get_list_opt(
|
| 301 |
+
options, 'disabledmodules', ['unknown'])
|
| 302 |
+
self.startinline = get_bool_opt(options, 'startinline', False)
|
| 303 |
+
|
| 304 |
+
# private option argument for the lexer itself
|
| 305 |
+
if '_startinline' in options:
|
| 306 |
+
self.startinline = options.pop('_startinline')
|
| 307 |
+
|
| 308 |
+
# collect activated functions in a set
|
| 309 |
+
self._functions = set()
|
| 310 |
+
if self.funcnamehighlighting:
|
| 311 |
+
from pygments.lexers._php_builtins import MODULES
|
| 312 |
+
for key, value in MODULES.items():
|
| 313 |
+
if key not in self.disabledmodules:
|
| 314 |
+
self._functions.update(value)
|
| 315 |
+
RegexLexer.__init__(self, **options)
|
| 316 |
+
|
| 317 |
+
def get_tokens_unprocessed(self, text):
|
| 318 |
+
stack = ['root']
|
| 319 |
+
if self.startinline:
|
| 320 |
+
stack.append('php')
|
| 321 |
+
for index, token, value in \
|
| 322 |
+
RegexLexer.get_tokens_unprocessed(self, text, stack):
|
| 323 |
+
if token is Name.Other:
|
| 324 |
+
if value in self._functions:
|
| 325 |
+
yield index, Name.Builtin, value
|
| 326 |
+
continue
|
| 327 |
+
yield index, token, value
|
| 328 |
+
|
| 329 |
+
def analyse_text(text):
|
| 330 |
+
if shebang_matches(text, r'php'):
|
| 331 |
+
return True
|
| 332 |
+
rv = 0.0
|
| 333 |
+
if re.search(r'<\?(?!xml)', text):
|
| 334 |
+
rv += 0.3
|
| 335 |
+
return rv
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pointless.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.pointless
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Pointless.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, words
|
| 12 |
+
from pygments.token import Comment, Error, Keyword, Name, Number, Operator, \
|
| 13 |
+
Punctuation, String, Text
|
| 14 |
+
|
| 15 |
+
__all__ = ['PointlessLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class PointlessLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For Pointless source code.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
name = 'Pointless'
|
| 24 |
+
url = 'https://ptls.dev'
|
| 25 |
+
aliases = ['pointless']
|
| 26 |
+
filenames = ['*.ptls']
|
| 27 |
+
version_added = '2.7'
|
| 28 |
+
|
| 29 |
+
ops = words([
|
| 30 |
+
"+", "-", "*", "/", "**", "%", "+=", "-=", "*=",
|
| 31 |
+
"/=", "**=", "%=", "|>", "=", "==", "!=", "<", ">",
|
| 32 |
+
"<=", ">=", "=>", "$", "++",
|
| 33 |
+
])
|
| 34 |
+
|
| 35 |
+
keywords = words([
|
| 36 |
+
"if", "then", "else", "where", "with", "cond",
|
| 37 |
+
"case", "and", "or", "not", "in", "as", "for",
|
| 38 |
+
"requires", "throw", "try", "catch", "when",
|
| 39 |
+
"yield", "upval",
|
| 40 |
+
], suffix=r'\b')
|
| 41 |
+
|
| 42 |
+
tokens = {
|
| 43 |
+
'root': [
|
| 44 |
+
(r'[ \n\r]+', Text),
|
| 45 |
+
(r'--.*$', Comment.Single),
|
| 46 |
+
(r'"""', String, 'multiString'),
|
| 47 |
+
(r'"', String, 'string'),
|
| 48 |
+
(r'[\[\](){}:;,.]', Punctuation),
|
| 49 |
+
(ops, Operator),
|
| 50 |
+
(keywords, Keyword),
|
| 51 |
+
(r'\d+|\d*\.\d+', Number),
|
| 52 |
+
(r'(true|false)\b', Name.Builtin),
|
| 53 |
+
(r'[A-Z][a-zA-Z0-9]*\b', String.Symbol),
|
| 54 |
+
(r'output\b', Name.Variable.Magic),
|
| 55 |
+
(r'(export|import)\b', Keyword.Namespace),
|
| 56 |
+
(r'[a-z][a-zA-Z0-9]*\b', Name.Variable)
|
| 57 |
+
],
|
| 58 |
+
'multiString': [
|
| 59 |
+
(r'\\.', String.Escape),
|
| 60 |
+
(r'"""', String, '#pop'),
|
| 61 |
+
(r'"', String),
|
| 62 |
+
(r'[^\\"]+', String),
|
| 63 |
+
],
|
| 64 |
+
'string': [
|
| 65 |
+
(r'\\.', String.Escape),
|
| 66 |
+
(r'"', String, '#pop'),
|
| 67 |
+
(r'\n', Error),
|
| 68 |
+
(r'[^\\"]+', String),
|
| 69 |
+
],
|
| 70 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/pony.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.pony
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Pony and related languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups, words
|
| 12 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 13 |
+
Number, Punctuation
|
| 14 |
+
|
| 15 |
+
__all__ = ['PonyLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class PonyLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For Pony source code.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
name = 'Pony'
|
| 24 |
+
aliases = ['pony']
|
| 25 |
+
filenames = ['*.pony']
|
| 26 |
+
url = 'https://www.ponylang.io'
|
| 27 |
+
version_added = '2.4'
|
| 28 |
+
|
| 29 |
+
_caps = r'(iso|trn|ref|val|box|tag)'
|
| 30 |
+
|
| 31 |
+
tokens = {
|
| 32 |
+
'root': [
|
| 33 |
+
(r'\n', Text),
|
| 34 |
+
(r'[^\S\n]+', Text),
|
| 35 |
+
(r'//.*\n', Comment.Single),
|
| 36 |
+
(r'/\*', Comment.Multiline, 'nested_comment'),
|
| 37 |
+
(r'"""(?:.|\n)*?"""', String.Doc),
|
| 38 |
+
(r'"', String, 'string'),
|
| 39 |
+
(r'\'.*\'', String.Char),
|
| 40 |
+
(r'=>|[]{}:().~;,|&!^?[]', Punctuation),
|
| 41 |
+
(words((
|
| 42 |
+
'addressof', 'and', 'as', 'consume', 'digestof', 'is', 'isnt',
|
| 43 |
+
'not', 'or'),
|
| 44 |
+
suffix=r'\b'),
|
| 45 |
+
Operator.Word),
|
| 46 |
+
(r'!=|==|<<|>>|[-+/*%=<>]', Operator),
|
| 47 |
+
(words((
|
| 48 |
+
'box', 'break', 'compile_error', 'compile_intrinsic',
|
| 49 |
+
'continue', 'do', 'else', 'elseif', 'embed', 'end', 'error',
|
| 50 |
+
'for', 'if', 'ifdef', 'in', 'iso', 'lambda', 'let', 'match',
|
| 51 |
+
'object', 'recover', 'ref', 'repeat', 'return', 'tag', 'then',
|
| 52 |
+
'this', 'trn', 'try', 'until', 'use', 'var', 'val', 'where',
|
| 53 |
+
'while', 'with', '#any', '#read', '#send', '#share'),
|
| 54 |
+
suffix=r'\b'),
|
| 55 |
+
Keyword),
|
| 56 |
+
(r'(actor|class|struct|primitive|interface|trait|type)((?:\s)+)',
|
| 57 |
+
bygroups(Keyword, Text), 'typename'),
|
| 58 |
+
(r'(new|fun|be)((?:\s)+)', bygroups(Keyword, Text), 'methodname'),
|
| 59 |
+
(words((
|
| 60 |
+
'I8', 'U8', 'I16', 'U16', 'I32', 'U32', 'I64', 'U64', 'I128',
|
| 61 |
+
'U128', 'ILong', 'ULong', 'ISize', 'USize', 'F32', 'F64',
|
| 62 |
+
'Bool', 'Pointer', 'None', 'Any', 'Array', 'String',
|
| 63 |
+
'Iterator'),
|
| 64 |
+
suffix=r'\b'),
|
| 65 |
+
Name.Builtin.Type),
|
| 66 |
+
(r'_?[A-Z]\w*', Name.Type),
|
| 67 |
+
(r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
|
| 68 |
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
| 69 |
+
(r'\d+', Number.Integer),
|
| 70 |
+
(r'(true|false)\b', Name.Builtin),
|
| 71 |
+
(r'_\d*', Name),
|
| 72 |
+
(r'_?[a-z][\w\']*', Name)
|
| 73 |
+
],
|
| 74 |
+
'typename': [
|
| 75 |
+
(_caps + r'?((?:\s)*)(_?[A-Z]\w*)',
|
| 76 |
+
bygroups(Keyword, Text, Name.Class), '#pop')
|
| 77 |
+
],
|
| 78 |
+
'methodname': [
|
| 79 |
+
(_caps + r'?((?:\s)*)(_?[a-z]\w*)',
|
| 80 |
+
bygroups(Keyword, Text, Name.Function), '#pop')
|
| 81 |
+
],
|
| 82 |
+
'nested_comment': [
|
| 83 |
+
(r'[^*/]+', Comment.Multiline),
|
| 84 |
+
(r'/\*', Comment.Multiline, '#push'),
|
| 85 |
+
(r'\*/', Comment.Multiline, '#pop'),
|
| 86 |
+
(r'[*/]', Comment.Multiline)
|
| 87 |
+
],
|
| 88 |
+
'string': [
|
| 89 |
+
(r'"', String, '#pop'),
|
| 90 |
+
(r'\\"', String),
|
| 91 |
+
(r'[^\\"]+', String)
|
| 92 |
+
]
|
| 93 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/praat.py
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.praat
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for Praat
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, words, bygroups, include
|
| 12 |
+
from pygments.token import Name, Text, Comment, Keyword, String, Punctuation, \
|
| 13 |
+
Number, Operator, Whitespace
|
| 14 |
+
|
| 15 |
+
__all__ = ['PraatLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class PraatLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For Praat scripts.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
name = 'Praat'
|
| 24 |
+
url = 'http://www.praat.org'
|
| 25 |
+
aliases = ['praat']
|
| 26 |
+
filenames = ['*.praat', '*.proc', '*.psc']
|
| 27 |
+
version_added = '2.1'
|
| 28 |
+
|
| 29 |
+
keywords = (
|
| 30 |
+
'if', 'then', 'else', 'elsif', 'elif', 'endif', 'fi', 'for', 'from', 'to',
|
| 31 |
+
'endfor', 'endproc', 'while', 'endwhile', 'repeat', 'until', 'select', 'plus',
|
| 32 |
+
'minus', 'demo', 'assert', 'stopwatch', 'nocheck', 'nowarn', 'noprogress',
|
| 33 |
+
'editor', 'endeditor', 'clearinfo',
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
functions_string = (
|
| 37 |
+
'backslashTrigraphsToUnicode', 'chooseDirectory', 'chooseReadFile',
|
| 38 |
+
'chooseWriteFile', 'date', 'demoKey', 'do', 'environment', 'extractLine',
|
| 39 |
+
'extractWord', 'fixed', 'info', 'left', 'mid', 'percent', 'readFile', 'replace',
|
| 40 |
+
'replace_regex', 'right', 'selected', 'string', 'unicodeToBackslashTrigraphs',
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
functions_numeric = (
|
| 44 |
+
'abs', 'appendFile', 'appendFileLine', 'appendInfo', 'appendInfoLine', 'arccos',
|
| 45 |
+
'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'barkToHertz',
|
| 46 |
+
'beginPause', 'beginSendPraat', 'besselI', 'besselK', 'beta', 'beta2',
|
| 47 |
+
'binomialP', 'binomialQ', 'boolean', 'ceiling', 'chiSquareP', 'chiSquareQ',
|
| 48 |
+
'choice', 'comment', 'cos', 'cosh', 'createDirectory', 'deleteFile',
|
| 49 |
+
'demoClicked', 'demoClickedIn', 'demoCommandKeyPressed',
|
| 50 |
+
'demoExtraControlKeyPressed', 'demoInput', 'demoKeyPressed',
|
| 51 |
+
'demoOptionKeyPressed', 'demoShiftKeyPressed', 'demoShow', 'demoWaitForInput',
|
| 52 |
+
'demoWindowTitle', 'demoX', 'demoY', 'differenceLimensToPhon', 'do', 'editor',
|
| 53 |
+
'endPause', 'endSendPraat', 'endsWith', 'erb', 'erbToHertz', 'erf', 'erfc',
|
| 54 |
+
'exitScript', 'exp', 'extractNumber', 'fileReadable', 'fisherP', 'fisherQ',
|
| 55 |
+
'floor', 'gaussP', 'gaussQ', 'hertzToBark', 'hertzToErb', 'hertzToMel',
|
| 56 |
+
'hertzToSemitones', 'imax', 'imin', 'incompleteBeta', 'incompleteGammaP', 'index',
|
| 57 |
+
'index_regex', 'integer', 'invBinomialP', 'invBinomialQ', 'invChiSquareQ', 'invFisherQ',
|
| 58 |
+
'invGaussQ', 'invSigmoid', 'invStudentQ', 'length', 'ln', 'lnBeta', 'lnGamma',
|
| 59 |
+
'log10', 'log2', 'max', 'melToHertz', 'min', 'minusObject', 'natural', 'number',
|
| 60 |
+
'numberOfColumns', 'numberOfRows', 'numberOfSelected', 'objectsAreIdentical',
|
| 61 |
+
'option', 'optionMenu', 'pauseScript', 'phonToDifferenceLimens', 'plusObject',
|
| 62 |
+
'positive', 'randomBinomial', 'randomGauss', 'randomInteger', 'randomPoisson',
|
| 63 |
+
'randomUniform', 'real', 'readFile', 'removeObject', 'rindex', 'rindex_regex',
|
| 64 |
+
'round', 'runScript', 'runSystem', 'runSystem_nocheck', 'selectObject',
|
| 65 |
+
'selected', 'semitonesToHertz', 'sentence', 'sentencetext', 'sigmoid', 'sin', 'sinc',
|
| 66 |
+
'sincpi', 'sinh', 'soundPressureToPhon', 'sqrt', 'startsWith', 'studentP',
|
| 67 |
+
'studentQ', 'tan', 'tanh', 'text', 'variableExists', 'word', 'writeFile', 'writeFileLine',
|
| 68 |
+
'writeInfo', 'writeInfoLine',
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
functions_array = (
|
| 72 |
+
'linear', 'randomGauss', 'randomInteger', 'randomUniform', 'zero',
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
objects = (
|
| 76 |
+
'Activation', 'AffineTransform', 'AmplitudeTier', 'Art', 'Artword',
|
| 77 |
+
'Autosegment', 'BarkFilter', 'BarkSpectrogram', 'CCA', 'Categories',
|
| 78 |
+
'Cepstrogram', 'Cepstrum', 'Cepstrumc', 'ChebyshevSeries', 'ClassificationTable',
|
| 79 |
+
'Cochleagram', 'Collection', 'ComplexSpectrogram', 'Configuration', 'Confusion',
|
| 80 |
+
'ContingencyTable', 'Corpus', 'Correlation', 'Covariance',
|
| 81 |
+
'CrossCorrelationTable', 'CrossCorrelationTables', 'DTW', 'DataModeler',
|
| 82 |
+
'Diagonalizer', 'Discriminant', 'Dissimilarity', 'Distance', 'Distributions',
|
| 83 |
+
'DurationTier', 'EEG', 'ERP', 'ERPTier', 'EditCostsTable', 'EditDistanceTable',
|
| 84 |
+
'Eigen', 'Excitation', 'Excitations', 'ExperimentMFC', 'FFNet', 'FeatureWeights',
|
| 85 |
+
'FileInMemory', 'FilesInMemory', 'Formant', 'FormantFilter', 'FormantGrid',
|
| 86 |
+
'FormantModeler', 'FormantPoint', 'FormantTier', 'GaussianMixture', 'HMM',
|
| 87 |
+
'HMM_Observation', 'HMM_ObservationSequence', 'HMM_State', 'HMM_StateSequence',
|
| 88 |
+
'Harmonicity', 'ISpline', 'Index', 'Intensity', 'IntensityTier', 'IntervalTier',
|
| 89 |
+
'KNN', 'KlattGrid', 'KlattTable', 'LFCC', 'LPC', 'Label', 'LegendreSeries',
|
| 90 |
+
'LinearRegression', 'LogisticRegression', 'LongSound', 'Ltas', 'MFCC', 'MSpline',
|
| 91 |
+
'ManPages', 'Manipulation', 'Matrix', 'MelFilter', 'MelSpectrogram',
|
| 92 |
+
'MixingMatrix', 'Movie', 'Network', 'Object', 'OTGrammar', 'OTHistory', 'OTMulti',
|
| 93 |
+
'PCA', 'PairDistribution', 'ParamCurve', 'Pattern', 'Permutation', 'Photo',
|
| 94 |
+
'Pitch', 'PitchModeler', 'PitchTier', 'PointProcess', 'Polygon', 'Polynomial',
|
| 95 |
+
'PowerCepstrogram', 'PowerCepstrum', 'Procrustes', 'RealPoint', 'RealTier',
|
| 96 |
+
'ResultsMFC', 'Roots', 'SPINET', 'SSCP', 'SVD', 'Salience', 'ScalarProduct',
|
| 97 |
+
'Similarity', 'SimpleString', 'SortedSetOfString', 'Sound', 'Speaker',
|
| 98 |
+
'Spectrogram', 'Spectrum', 'SpectrumTier', 'SpeechSynthesizer', 'SpellingChecker',
|
| 99 |
+
'Strings', 'StringsIndex', 'Table', 'TableOfReal', 'TextGrid', 'TextInterval',
|
| 100 |
+
'TextPoint', 'TextTier', 'Tier', 'Transition', 'VocalTract', 'VocalTractTier',
|
| 101 |
+
'Weight', 'WordList',
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
variables_numeric = (
|
| 105 |
+
'macintosh', 'windows', 'unix', 'praatVersion', 'pi', 'e', 'undefined',
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
variables_string = (
|
| 109 |
+
'praatVersion', 'tab', 'shellDirectory', 'homeDirectory',
|
| 110 |
+
'preferencesDirectory', 'newline', 'temporaryDirectory',
|
| 111 |
+
'defaultDirectory',
|
| 112 |
+
)
|
| 113 |
+
|
| 114 |
+
object_attributes = (
|
| 115 |
+
'ncol', 'nrow', 'xmin', 'ymin', 'xmax', 'ymax', 'nx', 'ny', 'dx', 'dy',
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
tokens = {
|
| 119 |
+
'root': [
|
| 120 |
+
(r'(\s+)(#.*?$)', bygroups(Whitespace, Comment.Single)),
|
| 121 |
+
(r'^#.*?$', Comment.Single),
|
| 122 |
+
(r';[^\n]*', Comment.Single),
|
| 123 |
+
(r'\s+', Whitespace),
|
| 124 |
+
|
| 125 |
+
(r'\bprocedure\b', Keyword, 'procedure_definition'),
|
| 126 |
+
(r'\bcall\b', Keyword, 'procedure_call'),
|
| 127 |
+
(r'@', Name.Function, 'procedure_call'),
|
| 128 |
+
|
| 129 |
+
include('function_call'),
|
| 130 |
+
|
| 131 |
+
(words(keywords, suffix=r'\b'), Keyword),
|
| 132 |
+
|
| 133 |
+
(r'(\bform\b)(\s+)([^\n]+)',
|
| 134 |
+
bygroups(Keyword, Whitespace, String), 'old_form'),
|
| 135 |
+
|
| 136 |
+
(r'(print(?:line|tab)?|echo|exit|asserterror|pause|send(?:praat|socket)|'
|
| 137 |
+
r'include|execute|system(?:_nocheck)?)(\s+)',
|
| 138 |
+
bygroups(Keyword, Whitespace), 'string_unquoted'),
|
| 139 |
+
|
| 140 |
+
(r'(goto|label)(\s+)(\w+)', bygroups(Keyword, Whitespace, Name.Label)),
|
| 141 |
+
|
| 142 |
+
include('variable_name'),
|
| 143 |
+
include('number'),
|
| 144 |
+
|
| 145 |
+
(r'"', String, 'string'),
|
| 146 |
+
|
| 147 |
+
(words((objects), suffix=r'(?=\s+\S+\n)'), Name.Class, 'string_unquoted'),
|
| 148 |
+
|
| 149 |
+
(r'\b[A-Z]', Keyword, 'command'),
|
| 150 |
+
(r'(\.{3}|[)(,])', Punctuation),
|
| 151 |
+
],
|
| 152 |
+
'command': [
|
| 153 |
+
(r'( ?[\w()-]+ ?)', Keyword),
|
| 154 |
+
|
| 155 |
+
include('string_interpolated'),
|
| 156 |
+
|
| 157 |
+
(r'\.{3}', Keyword, ('#pop', 'old_arguments')),
|
| 158 |
+
(r':', Keyword, ('#pop', 'comma_list')),
|
| 159 |
+
(r'\s', Whitespace, '#pop'),
|
| 160 |
+
],
|
| 161 |
+
'procedure_call': [
|
| 162 |
+
(r'\s+', Whitespace),
|
| 163 |
+
(r'([\w.]+)(?:(:)|(?:(\s*)(\()))',
|
| 164 |
+
bygroups(Name.Function, Punctuation,
|
| 165 |
+
Text.Whitespace, Punctuation), '#pop'),
|
| 166 |
+
(r'([\w.]+)', Name.Function, ('#pop', 'old_arguments')),
|
| 167 |
+
],
|
| 168 |
+
'procedure_definition': [
|
| 169 |
+
(r'\s', Whitespace),
|
| 170 |
+
(r'([\w.]+)(\s*?[(:])',
|
| 171 |
+
bygroups(Name.Function, Whitespace), '#pop'),
|
| 172 |
+
(r'([\w.]+)([^\n]*)',
|
| 173 |
+
bygroups(Name.Function, Text), '#pop'),
|
| 174 |
+
],
|
| 175 |
+
'function_call': [
|
| 176 |
+
(words(functions_string, suffix=r'\$(?=\s*[:(])'), Name.Function, 'function'),
|
| 177 |
+
(words(functions_array, suffix=r'#(?=\s*[:(])'), Name.Function, 'function'),
|
| 178 |
+
(words(functions_numeric, suffix=r'(?=\s*[:(])'), Name.Function, 'function'),
|
| 179 |
+
],
|
| 180 |
+
'function': [
|
| 181 |
+
(r'\s+', Whitespace),
|
| 182 |
+
(r':', Punctuation, ('#pop', 'comma_list')),
|
| 183 |
+
(r'\s*\(', Punctuation, ('#pop', 'comma_list')),
|
| 184 |
+
],
|
| 185 |
+
'comma_list': [
|
| 186 |
+
(r'(\s*\n\s*)(\.{3})', bygroups(Whitespace, Punctuation)),
|
| 187 |
+
|
| 188 |
+
(r'(\s*)(?:([)\]])|(\n))', bygroups(
|
| 189 |
+
Whitespace, Punctuation, Whitespace), '#pop'),
|
| 190 |
+
|
| 191 |
+
(r'\s+', Whitespace),
|
| 192 |
+
(r'"', String, 'string'),
|
| 193 |
+
(r'\b(if|then|else|fi|endif)\b', Keyword),
|
| 194 |
+
|
| 195 |
+
include('function_call'),
|
| 196 |
+
include('variable_name'),
|
| 197 |
+
include('operator'),
|
| 198 |
+
include('number'),
|
| 199 |
+
|
| 200 |
+
(r'[()]', Text),
|
| 201 |
+
(r',', Punctuation),
|
| 202 |
+
],
|
| 203 |
+
'old_arguments': [
|
| 204 |
+
(r'\n', Whitespace, '#pop'),
|
| 205 |
+
|
| 206 |
+
include('variable_name'),
|
| 207 |
+
include('operator'),
|
| 208 |
+
include('number'),
|
| 209 |
+
|
| 210 |
+
(r'"', String, 'string'),
|
| 211 |
+
(r'[^\n]', Text),
|
| 212 |
+
],
|
| 213 |
+
'number': [
|
| 214 |
+
(r'\n', Whitespace, '#pop'),
|
| 215 |
+
(r'\b\d+(\.\d*)?([eE][-+]?\d+)?%?', Number),
|
| 216 |
+
],
|
| 217 |
+
'object_reference': [
|
| 218 |
+
include('string_interpolated'),
|
| 219 |
+
(r'([a-z][a-zA-Z0-9_]*|\d+)', Name.Builtin),
|
| 220 |
+
|
| 221 |
+
(words(object_attributes, prefix=r'\.'), Name.Builtin, '#pop'),
|
| 222 |
+
|
| 223 |
+
(r'\$', Name.Builtin),
|
| 224 |
+
(r'\[', Text, '#pop'),
|
| 225 |
+
],
|
| 226 |
+
'variable_name': [
|
| 227 |
+
include('operator'),
|
| 228 |
+
include('number'),
|
| 229 |
+
|
| 230 |
+
(words(variables_string, suffix=r'\$'), Name.Variable.Global),
|
| 231 |
+
(words(variables_numeric,
|
| 232 |
+
suffix=r'(?=[^a-zA-Z0-9_."\'$#\[:(]|\s|^|$)'),
|
| 233 |
+
Name.Variable.Global),
|
| 234 |
+
|
| 235 |
+
(words(objects, prefix=r'\b', suffix=r"(_)"),
|
| 236 |
+
bygroups(Name.Builtin, Name.Builtin),
|
| 237 |
+
'object_reference'),
|
| 238 |
+
|
| 239 |
+
(r'\.?_?[a-z][\w.]*(\$|#)?', Text),
|
| 240 |
+
(r'[\[\]]', Punctuation, 'comma_list'),
|
| 241 |
+
|
| 242 |
+
include('string_interpolated'),
|
| 243 |
+
],
|
| 244 |
+
'operator': [
|
| 245 |
+
(r'([+\/*<>=!-]=?|[&*|][&*|]?|\^|<>)', Operator),
|
| 246 |
+
(r'(?<![\w.])(and|or|not|div|mod)(?![\w.])', Operator.Word),
|
| 247 |
+
],
|
| 248 |
+
'string_interpolated': [
|
| 249 |
+
(r'\'[_a-z][^\[\]\'":]*(\[([\d,]+|"[\w,]+")\])?(:[0-9]+)?\'',
|
| 250 |
+
String.Interpol),
|
| 251 |
+
],
|
| 252 |
+
'string_unquoted': [
|
| 253 |
+
(r'(\n\s*)(\.{3})', bygroups(Whitespace, Punctuation)),
|
| 254 |
+
|
| 255 |
+
(r'\n', Whitespace, '#pop'),
|
| 256 |
+
(r'\s', Whitespace),
|
| 257 |
+
|
| 258 |
+
include('string_interpolated'),
|
| 259 |
+
|
| 260 |
+
(r"'", String),
|
| 261 |
+
(r"[^'\n]+", String),
|
| 262 |
+
],
|
| 263 |
+
'string': [
|
| 264 |
+
(r'(\n\s*)(\.{3})', bygroups(Whitespace, Punctuation)),
|
| 265 |
+
|
| 266 |
+
(r'"', String, '#pop'),
|
| 267 |
+
|
| 268 |
+
include('string_interpolated'),
|
| 269 |
+
|
| 270 |
+
(r"'", String),
|
| 271 |
+
(r'[^\'"\n]+', String),
|
| 272 |
+
],
|
| 273 |
+
'old_form': [
|
| 274 |
+
(r'(\s+)(#.*?$)', bygroups(Whitespace, Comment.Single)),
|
| 275 |
+
(r'\s+', Whitespace),
|
| 276 |
+
|
| 277 |
+
(r'(optionmenu|choice)([ \t]+)(\S+)(:)([ \t]+)',
|
| 278 |
+
bygroups(Keyword, Whitespace, Text, Punctuation, Whitespace), 'number'),
|
| 279 |
+
|
| 280 |
+
(r'(option|button)([ \t]+)',
|
| 281 |
+
bygroups(Keyword, Whitespace), 'string_unquoted'),
|
| 282 |
+
|
| 283 |
+
(r'(sentence|text)([ \t]+)(\S+)',
|
| 284 |
+
bygroups(Keyword, Whitespace, String), 'string_unquoted'),
|
| 285 |
+
|
| 286 |
+
(r'(word)([ \t]+)(\S+)([ \t]*)(\S+)?(?:([ \t]+)(.*))?',
|
| 287 |
+
bygroups(Keyword, Whitespace, Text, Whitespace, Text, Whitespace, Text)),
|
| 288 |
+
|
| 289 |
+
(r'(boolean)(\s+\S+\s*)(0|1|"?(?:yes|no)"?)',
|
| 290 |
+
bygroups(Keyword, Whitespace, Name.Variable)),
|
| 291 |
+
|
| 292 |
+
# Ideally processing of the number would happen in the 'number'
|
| 293 |
+
# but that doesn't seem to work
|
| 294 |
+
(r'(real|natural|positive|integer)([ \t]+\S+[ \t]*)([+-]?)(\d+(?:\.\d*)?'
|
| 295 |
+
r'(?:[eE][-+]?\d+)?%?)',
|
| 296 |
+
bygroups(Keyword, Whitespace, Operator, Number)),
|
| 297 |
+
|
| 298 |
+
(r'(comment)(\s+)',
|
| 299 |
+
bygroups(Keyword, Whitespace), 'string_unquoted'),
|
| 300 |
+
|
| 301 |
+
(r'\bendform\b', Keyword, '#pop'),
|
| 302 |
+
]
|
| 303 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/procfile.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.procfile
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for Procfile file format.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups
|
| 12 |
+
from pygments.token import Name, Number, String, Text, Punctuation
|
| 13 |
+
|
| 14 |
+
__all__ = ["ProcfileLexer"]
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
class ProcfileLexer(RegexLexer):
|
| 18 |
+
"""
|
| 19 |
+
Lexer for Procfile file format.
|
| 20 |
+
|
| 21 |
+
The format is used to run processes on Heroku or is used by Foreman or
|
| 22 |
+
Honcho tools.
|
| 23 |
+
"""
|
| 24 |
+
name = 'Procfile'
|
| 25 |
+
url = 'https://devcenter.heroku.com/articles/procfile#procfile-format'
|
| 26 |
+
aliases = ['procfile']
|
| 27 |
+
filenames = ['Procfile']
|
| 28 |
+
version_added = '2.10'
|
| 29 |
+
|
| 30 |
+
tokens = {
|
| 31 |
+
'root': [
|
| 32 |
+
(r'^([a-z]+)(:)', bygroups(Name.Label, Punctuation)),
|
| 33 |
+
(r'\s+', Text.Whitespace),
|
| 34 |
+
(r'"[^"]*"', String),
|
| 35 |
+
(r"'[^']*'", String),
|
| 36 |
+
(r'[0-9]+', Number.Integer),
|
| 37 |
+
(r'\$[a-zA-Z_][\w]*', Name.Variable),
|
| 38 |
+
(r'(\w+)(=)(\w+)', bygroups(Name.Variable, Punctuation, String)),
|
| 39 |
+
(r'([\w\-\./]+)', Text),
|
| 40 |
+
],
|
| 41 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/prolog.py
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.prolog
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for Prolog and Prolog-like languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, bygroups
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation
|
| 16 |
+
|
| 17 |
+
__all__ = ['PrologLexer', 'LogtalkLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class PrologLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
Lexer for Prolog files.
|
| 23 |
+
"""
|
| 24 |
+
name = 'Prolog'
|
| 25 |
+
aliases = ['prolog']
|
| 26 |
+
filenames = ['*.ecl', '*.prolog', '*.pro', '*.pl']
|
| 27 |
+
mimetypes = ['text/x-prolog']
|
| 28 |
+
url = 'https://en.wikipedia.org/wiki/Prolog'
|
| 29 |
+
version_added = ''
|
| 30 |
+
|
| 31 |
+
tokens = {
|
| 32 |
+
'root': [
|
| 33 |
+
(r'/\*', Comment.Multiline, 'nested-comment'),
|
| 34 |
+
(r'%.*', Comment.Single),
|
| 35 |
+
# character literal
|
| 36 |
+
(r'0\'.', String.Char),
|
| 37 |
+
(r'0b[01]+', Number.Bin),
|
| 38 |
+
(r'0o[0-7]+', Number.Oct),
|
| 39 |
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
| 40 |
+
# literal with prepended base
|
| 41 |
+
(r'\d\d?\'[a-zA-Z0-9]+', Number.Integer),
|
| 42 |
+
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
| 43 |
+
(r'\d+', Number.Integer),
|
| 44 |
+
(r'[\[\](){}|.,;!]', Punctuation),
|
| 45 |
+
(r':-|-->', Punctuation),
|
| 46 |
+
(r'"(?:\\x[0-9a-fA-F]+\\|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|'
|
| 47 |
+
r'\\[0-7]+\\|\\["\\abcefnrstv]|[^\\"])*"', String.Double),
|
| 48 |
+
(r"'(?:''|[^'])*'", String.Atom), # quoted atom
|
| 49 |
+
# Needs to not be followed by an atom.
|
| 50 |
+
# (r'=(?=\s|[a-zA-Z\[])', Operator),
|
| 51 |
+
(r'is\b', Operator),
|
| 52 |
+
(r'(<|>|=<|>=|==|=:=|=|/|//|\*|\+|-)(?=\s|[a-zA-Z0-9\[])',
|
| 53 |
+
Operator),
|
| 54 |
+
(r'(mod|div|not)\b', Operator),
|
| 55 |
+
(r'_', Keyword), # The don't-care variable
|
| 56 |
+
(r'([a-z]+)(:)', bygroups(Name.Namespace, Punctuation)),
|
| 57 |
+
(r'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
|
| 58 |
+
r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
|
| 59 |
+
r'(\s*)(:-|-->)',
|
| 60 |
+
bygroups(Name.Function, Text, Operator)), # function defn
|
| 61 |
+
(r'([a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
|
| 62 |
+
r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*)'
|
| 63 |
+
r'(\s*)(\()',
|
| 64 |
+
bygroups(Name.Function, Text, Punctuation)),
|
| 65 |
+
(r'[a-z\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]'
|
| 66 |
+
r'[\w$\u00c0-\u1fff\u3040-\ud7ff\ue000-\uffef]*',
|
| 67 |
+
String.Atom), # atom, characters
|
| 68 |
+
# This one includes !
|
| 69 |
+
(r'[#&*+\-./:<=>?@\\^~\u00a1-\u00bf\u2010-\u303f]+',
|
| 70 |
+
String.Atom), # atom, graphics
|
| 71 |
+
(r'[A-Z_]\w*', Name.Variable),
|
| 72 |
+
(r'\s+|[\u2000-\u200f\ufff0-\ufffe\uffef]', Text),
|
| 73 |
+
],
|
| 74 |
+
'nested-comment': [
|
| 75 |
+
(r'\*/', Comment.Multiline, '#pop'),
|
| 76 |
+
(r'/\*', Comment.Multiline, '#push'),
|
| 77 |
+
(r'[^*/]+', Comment.Multiline),
|
| 78 |
+
(r'[*/]', Comment.Multiline),
|
| 79 |
+
],
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
def analyse_text(text):
|
| 83 |
+
"""Competes with IDL and Visual Prolog on *.pro"""
|
| 84 |
+
if ':-' in text:
|
| 85 |
+
# Visual Prolog also uses :-
|
| 86 |
+
return 0.5
|
| 87 |
+
else:
|
| 88 |
+
return 0
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
class LogtalkLexer(RegexLexer):
|
| 92 |
+
"""
|
| 93 |
+
For Logtalk source code.
|
| 94 |
+
"""
|
| 95 |
+
|
| 96 |
+
name = 'Logtalk'
|
| 97 |
+
url = 'http://logtalk.org/'
|
| 98 |
+
aliases = ['logtalk']
|
| 99 |
+
filenames = ['*.lgt', '*.logtalk']
|
| 100 |
+
mimetypes = ['text/x-logtalk']
|
| 101 |
+
version_added = '0.10'
|
| 102 |
+
|
| 103 |
+
tokens = {
|
| 104 |
+
'root': [
|
| 105 |
+
# Directives
|
| 106 |
+
(r'^\s*:-\s', Punctuation, 'directive'),
|
| 107 |
+
# Comments
|
| 108 |
+
(r'%.*?\n', Comment),
|
| 109 |
+
(r'/\*(.|\n)*?\*/', Comment),
|
| 110 |
+
# Whitespace
|
| 111 |
+
(r'\n', Text),
|
| 112 |
+
(r'\s+', Text),
|
| 113 |
+
# Numbers
|
| 114 |
+
(r"0'[\\]?.", Number),
|
| 115 |
+
(r'0b[01]+', Number.Bin),
|
| 116 |
+
(r'0o[0-7]+', Number.Oct),
|
| 117 |
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
| 118 |
+
(r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
|
| 119 |
+
# Variables
|
| 120 |
+
(r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
|
| 121 |
+
# Event handlers
|
| 122 |
+
(r'(after|before)(?=[(])', Keyword),
|
| 123 |
+
# Message forwarding handler
|
| 124 |
+
(r'forward(?=[(])', Keyword),
|
| 125 |
+
# Execution-context methods
|
| 126 |
+
(r'(context|parameter|this|se(lf|nder))(?=[(])', Keyword),
|
| 127 |
+
# Reflection
|
| 128 |
+
(r'(current_predicate|predicate_property)(?=[(])', Keyword),
|
| 129 |
+
# DCGs and term expansion
|
| 130 |
+
(r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])', Keyword),
|
| 131 |
+
# Entity
|
| 132 |
+
(r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])', Keyword),
|
| 133 |
+
(r'(object|protocol|category)_property(?=[(])', Keyword),
|
| 134 |
+
# Entity relations
|
| 135 |
+
(r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword),
|
| 136 |
+
(r'extends_(object|protocol|category)(?=[(])', Keyword),
|
| 137 |
+
(r'imp(lements_protocol|orts_category)(?=[(])', Keyword),
|
| 138 |
+
(r'(instantiat|specializ)es_class(?=[(])', Keyword),
|
| 139 |
+
# Events
|
| 140 |
+
(r'(current_event|(abolish|define)_events)(?=[(])', Keyword),
|
| 141 |
+
# Flags
|
| 142 |
+
(r'(create|current|set)_logtalk_flag(?=[(])', Keyword),
|
| 143 |
+
# Compiling, loading, and library paths
|
| 144 |
+
(r'logtalk_(compile|l(ibrary_path|oad|oad_context)|make(_target_action)?)(?=[(])', Keyword),
|
| 145 |
+
(r'\blogtalk_make\b', Keyword),
|
| 146 |
+
# Database
|
| 147 |
+
(r'(clause|retract(all)?)(?=[(])', Keyword),
|
| 148 |
+
(r'a(bolish|ssert(a|z))(?=[(])', Keyword),
|
| 149 |
+
# Control constructs
|
| 150 |
+
(r'(ca(ll|tch)|throw)(?=[(])', Keyword),
|
| 151 |
+
(r'(fa(il|lse)|true|(instantiation|system)_error)\b', Keyword),
|
| 152 |
+
(r'(uninstantiation|type|domain|existence|permission|representation|evaluation|resource|syntax)_error(?=[(])', Keyword),
|
| 153 |
+
# All solutions
|
| 154 |
+
(r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword),
|
| 155 |
+
# Multi-threading predicates
|
| 156 |
+
(r'threaded(_(ca(ll|ncel)|once|ignore|exit|peek|wait|notify))?(?=[(])', Keyword),
|
| 157 |
+
# Engine predicates
|
| 158 |
+
(r'threaded_engine(_(create|destroy|self|next|next_reified|yield|post|fetch))?(?=[(])', Keyword),
|
| 159 |
+
# Term unification
|
| 160 |
+
(r'(subsumes_term|unify_with_occurs_check)(?=[(])', Keyword),
|
| 161 |
+
# Term creation and decomposition
|
| 162 |
+
(r'(functor|arg|copy_term|numbervars|term_variables)(?=[(])', Keyword),
|
| 163 |
+
# Evaluable functors
|
| 164 |
+
(r'(div|rem|m(ax|in|od)|abs|sign)(?=[(])', Keyword),
|
| 165 |
+
(r'float(_(integer|fractional)_part)?(?=[(])', Keyword),
|
| 166 |
+
(r'(floor|t(an|runcate)|round|ceiling)(?=[(])', Keyword),
|
| 167 |
+
# Other arithmetic functors
|
| 168 |
+
(r'(cos|a(cos|sin|tan|tan2)|exp|log|s(in|qrt)|xor)(?=[(])', Keyword),
|
| 169 |
+
# Term testing
|
| 170 |
+
(r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|ground|acyclic_term)(?=[(])', Keyword),
|
| 171 |
+
# Term comparison
|
| 172 |
+
(r'compare(?=[(])', Keyword),
|
| 173 |
+
# Stream selection and control
|
| 174 |
+
(r'(curren|se)t_(in|out)put(?=[(])', Keyword),
|
| 175 |
+
(r'(open|close)(?=[(])', Keyword),
|
| 176 |
+
(r'flush_output(?=[(])', Keyword),
|
| 177 |
+
(r'(at_end_of_stream|flush_output)\b', Keyword),
|
| 178 |
+
(r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])', Keyword),
|
| 179 |
+
# Character and byte input/output
|
| 180 |
+
(r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword),
|
| 181 |
+
(r'\bnl\b', Keyword),
|
| 182 |
+
# Term input/output
|
| 183 |
+
(r'read(_term)?(?=[(])', Keyword),
|
| 184 |
+
(r'write(q|_(canonical|term))?(?=[(])', Keyword),
|
| 185 |
+
(r'(current_)?op(?=[(])', Keyword),
|
| 186 |
+
(r'(current_)?char_conversion(?=[(])', Keyword),
|
| 187 |
+
# Atomic term processing
|
| 188 |
+
(r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword),
|
| 189 |
+
(r'(char_code|sub_atom)(?=[(])', Keyword),
|
| 190 |
+
(r'number_c(har|ode)s(?=[(])', Keyword),
|
| 191 |
+
# Implementation defined hooks functions
|
| 192 |
+
(r'(se|curren)t_prolog_flag(?=[(])', Keyword),
|
| 193 |
+
(r'\bhalt\b', Keyword),
|
| 194 |
+
(r'halt(?=[(])', Keyword),
|
| 195 |
+
# Message sending operators
|
| 196 |
+
(r'(::|:|\^\^)', Operator),
|
| 197 |
+
# External call
|
| 198 |
+
(r'[{}]', Keyword),
|
| 199 |
+
# Logic and control
|
| 200 |
+
(r'(ignore|once)(?=[(])', Keyword),
|
| 201 |
+
(r'\brepeat\b', Keyword),
|
| 202 |
+
# Sorting
|
| 203 |
+
(r'(key)?sort(?=[(])', Keyword),
|
| 204 |
+
# Bitwise functors
|
| 205 |
+
(r'(>>|<<|/\\|\\\\|\\)', Operator),
|
| 206 |
+
# Predicate aliases
|
| 207 |
+
(r'\bas\b', Operator),
|
| 208 |
+
# Arithmetic evaluation
|
| 209 |
+
(r'\bis\b', Keyword),
|
| 210 |
+
# Arithmetic comparison
|
| 211 |
+
(r'(=:=|=\\=|<|=<|>=|>)', Operator),
|
| 212 |
+
# Term creation and decomposition
|
| 213 |
+
(r'=\.\.', Operator),
|
| 214 |
+
# Term unification
|
| 215 |
+
(r'(=|\\=)', Operator),
|
| 216 |
+
# Term comparison
|
| 217 |
+
(r'(==|\\==|@=<|@<|@>=|@>)', Operator),
|
| 218 |
+
# Evaluable functors
|
| 219 |
+
(r'(//|[-+*/])', Operator),
|
| 220 |
+
(r'\b(e|pi|div|mod|rem)\b', Operator),
|
| 221 |
+
# Other arithmetic functors
|
| 222 |
+
(r'\b\*\*\b', Operator),
|
| 223 |
+
# DCG rules
|
| 224 |
+
(r'-->', Operator),
|
| 225 |
+
# Control constructs
|
| 226 |
+
(r'([!;]|->)', Operator),
|
| 227 |
+
# Logic and control
|
| 228 |
+
(r'\\+', Operator),
|
| 229 |
+
# Mode operators
|
| 230 |
+
(r'[?@]', Operator),
|
| 231 |
+
# Existential quantifier
|
| 232 |
+
(r'\^', Operator),
|
| 233 |
+
# Punctuation
|
| 234 |
+
(r'[()\[\],.|]', Text),
|
| 235 |
+
# Atoms
|
| 236 |
+
(r"[a-z][a-zA-Z0-9_]*", Text),
|
| 237 |
+
(r"'", String, 'quoted_atom'),
|
| 238 |
+
# Double-quoted terms
|
| 239 |
+
(r'"', String, 'double_quoted_term'),
|
| 240 |
+
],
|
| 241 |
+
|
| 242 |
+
'quoted_atom': [
|
| 243 |
+
(r"''", String),
|
| 244 |
+
(r"'", String, '#pop'),
|
| 245 |
+
(r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
|
| 246 |
+
(r"[^\\'\n]+", String),
|
| 247 |
+
(r'\\', String),
|
| 248 |
+
],
|
| 249 |
+
|
| 250 |
+
'double_quoted_term': [
|
| 251 |
+
(r'""', String),
|
| 252 |
+
(r'"', String, '#pop'),
|
| 253 |
+
(r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
|
| 254 |
+
(r'[^\\"\n]+', String),
|
| 255 |
+
(r'\\', String),
|
| 256 |
+
],
|
| 257 |
+
|
| 258 |
+
'directive': [
|
| 259 |
+
# Conditional compilation directives
|
| 260 |
+
(r'(el)?if(?=[(])', Keyword, 'root'),
|
| 261 |
+
(r'(e(lse|ndif))(?=[.])', Keyword, 'root'),
|
| 262 |
+
# Entity directives
|
| 263 |
+
(r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
|
| 264 |
+
(r'(end_(category|object|protocol))(?=[.])', Keyword, 'root'),
|
| 265 |
+
# Predicate scope directives
|
| 266 |
+
(r'(public|protected|private)(?=[(])', Keyword, 'root'),
|
| 267 |
+
# Other directives
|
| 268 |
+
(r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
|
| 269 |
+
(r'in(clude|itialization|fo)(?=[(])', Keyword, 'root'),
|
| 270 |
+
(r'(built_in|dynamic|synchronized|threaded)(?=[.])', Keyword, 'root'),
|
| 271 |
+
(r'(alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|ode|ultifile)|s(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'),
|
| 272 |
+
(r'op(?=[(])', Keyword, 'root'),
|
| 273 |
+
(r'(c(alls|oinductive)|module|reexport|use(s|_module))(?=[(])', Keyword, 'root'),
|
| 274 |
+
(r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'),
|
| 275 |
+
(r'[a-z][a-zA-Z0-9_]*(?=[.])', Text, 'root'),
|
| 276 |
+
],
|
| 277 |
+
|
| 278 |
+
'entityrelations': [
|
| 279 |
+
(r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])', Keyword),
|
| 280 |
+
# Numbers
|
| 281 |
+
(r"0'[\\]?.", Number),
|
| 282 |
+
(r'0b[01]+', Number.Bin),
|
| 283 |
+
(r'0o[0-7]+', Number.Oct),
|
| 284 |
+
(r'0x[0-9a-fA-F]+', Number.Hex),
|
| 285 |
+
(r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
|
| 286 |
+
# Variables
|
| 287 |
+
(r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
|
| 288 |
+
# Atoms
|
| 289 |
+
(r"[a-z][a-zA-Z0-9_]*", Text),
|
| 290 |
+
(r"'", String, 'quoted_atom'),
|
| 291 |
+
# Double-quoted terms
|
| 292 |
+
(r'"', String, 'double_quoted_term'),
|
| 293 |
+
# End of entity-opening directive
|
| 294 |
+
(r'([)]\.)', Text, 'root'),
|
| 295 |
+
# Scope operator
|
| 296 |
+
(r'(::)', Operator),
|
| 297 |
+
# Punctuation
|
| 298 |
+
(r'[()\[\],.|]', Text),
|
| 299 |
+
# Comments
|
| 300 |
+
(r'%.*?\n', Comment),
|
| 301 |
+
(r'/\*(.|\n)*?\*/', Comment),
|
| 302 |
+
# Whitespace
|
| 303 |
+
(r'\n', Text),
|
| 304 |
+
(r'\s+', Text),
|
| 305 |
+
]
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
def analyse_text(text):
|
| 309 |
+
if ':- object(' in text:
|
| 310 |
+
return 1.0
|
| 311 |
+
elif ':- protocol(' in text:
|
| 312 |
+
return 1.0
|
| 313 |
+
elif ':- category(' in text:
|
| 314 |
+
return 1.0
|
| 315 |
+
el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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.promql
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for Prometheus Query Language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups, default, words
|
| 12 |
+
from pygments.token import Comment, Keyword, Name, Number, Operator, \
|
| 13 |
+
Punctuation, String, Whitespace
|
| 14 |
+
|
| 15 |
+
__all__ = ["PromQLLexer"]
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class PromQLLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For PromQL queries.
|
| 21 |
+
|
| 22 |
+
For details about the grammar see:
|
| 23 |
+
https://github.com/prometheus/prometheus/tree/master/promql/parser
|
| 24 |
+
|
| 25 |
+
.. versionadded: 2.7
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
name = "PromQL"
|
| 29 |
+
url = 'https://prometheus.io/docs/prometheus/latest/querying/basics/'
|
| 30 |
+
aliases = ["promql"]
|
| 31 |
+
filenames = ["*.promql"]
|
| 32 |
+
version_added = ''
|
| 33 |
+
|
| 34 |
+
base_keywords = (
|
| 35 |
+
words(
|
| 36 |
+
(
|
| 37 |
+
"bool",
|
| 38 |
+
"by",
|
| 39 |
+
"group_left",
|
| 40 |
+
"group_right",
|
| 41 |
+
"ignoring",
|
| 42 |
+
"offset",
|
| 43 |
+
"on",
|
| 44 |
+
"without",
|
| 45 |
+
),
|
| 46 |
+
suffix=r"\b",
|
| 47 |
+
),
|
| 48 |
+
Keyword,
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
aggregator_keywords = (
|
| 52 |
+
words(
|
| 53 |
+
(
|
| 54 |
+
"sum",
|
| 55 |
+
"min",
|
| 56 |
+
"max",
|
| 57 |
+
"avg",
|
| 58 |
+
"group",
|
| 59 |
+
"stddev",
|
| 60 |
+
"stdvar",
|
| 61 |
+
"count",
|
| 62 |
+
"count_values",
|
| 63 |
+
"bottomk",
|
| 64 |
+
"topk",
|
| 65 |
+
"quantile",
|
| 66 |
+
),
|
| 67 |
+
suffix=r"\b",
|
| 68 |
+
),
|
| 69 |
+
Keyword,
|
| 70 |
+
)
|
| 71 |
+
|
| 72 |
+
function_keywords = (
|
| 73 |
+
words(
|
| 74 |
+
(
|
| 75 |
+
"abs",
|
| 76 |
+
"absent",
|
| 77 |
+
"absent_over_time",
|
| 78 |
+
"avg_over_time",
|
| 79 |
+
"ceil",
|
| 80 |
+
"changes",
|
| 81 |
+
"clamp_max",
|
| 82 |
+
"clamp_min",
|
| 83 |
+
"count_over_time",
|
| 84 |
+
"day_of_month",
|
| 85 |
+
"day_of_week",
|
| 86 |
+
"days_in_month",
|
| 87 |
+
"delta",
|
| 88 |
+
"deriv",
|
| 89 |
+
"exp",
|
| 90 |
+
"floor",
|
| 91 |
+
"histogram_quantile",
|
| 92 |
+
"holt_winters",
|
| 93 |
+
"hour",
|
| 94 |
+
"idelta",
|
| 95 |
+
"increase",
|
| 96 |
+
"irate",
|
| 97 |
+
"label_join",
|
| 98 |
+
"label_replace",
|
| 99 |
+
"ln",
|
| 100 |
+
"log10",
|
| 101 |
+
"log2",
|
| 102 |
+
"max_over_time",
|
| 103 |
+
"min_over_time",
|
| 104 |
+
"minute",
|
| 105 |
+
"month",
|
| 106 |
+
"predict_linear",
|
| 107 |
+
"quantile_over_time",
|
| 108 |
+
"rate",
|
| 109 |
+
"resets",
|
| 110 |
+
"round",
|
| 111 |
+
"scalar",
|
| 112 |
+
"sort",
|
| 113 |
+
"sort_desc",
|
| 114 |
+
"sqrt",
|
| 115 |
+
"stddev_over_time",
|
| 116 |
+
"stdvar_over_time",
|
| 117 |
+
"sum_over_time",
|
| 118 |
+
"time",
|
| 119 |
+
"timestamp",
|
| 120 |
+
"vector",
|
| 121 |
+
"year",
|
| 122 |
+
),
|
| 123 |
+
suffix=r"\b",
|
| 124 |
+
),
|
| 125 |
+
Keyword.Reserved,
|
| 126 |
+
)
|
| 127 |
+
|
| 128 |
+
tokens = {
|
| 129 |
+
"root": [
|
| 130 |
+
(r"\n", Whitespace),
|
| 131 |
+
(r"\s+", Whitespace),
|
| 132 |
+
(r",", Punctuation),
|
| 133 |
+
# Keywords
|
| 134 |
+
base_keywords,
|
| 135 |
+
aggregator_keywords,
|
| 136 |
+
function_keywords,
|
| 137 |
+
# Offsets
|
| 138 |
+
(r"[1-9][0-9]*[smhdwy]", String),
|
| 139 |
+
# Numbers
|
| 140 |
+
(r"-?[0-9]+\.[0-9]+", Number.Float),
|
| 141 |
+
(r"-?[0-9]+", Number.Integer),
|
| 142 |
+
# Comments
|
| 143 |
+
(r"#.*?$", Comment.Single),
|
| 144 |
+
# Operators
|
| 145 |
+
(r"(\+|\-|\*|\/|\%|\^)", Operator),
|
| 146 |
+
(r"==|!=|>=|<=|<|>", Operator),
|
| 147 |
+
(r"and|or|unless", Operator.Word),
|
| 148 |
+
# Metrics
|
| 149 |
+
(r"[_a-zA-Z][a-zA-Z0-9_]+", Name.Variable),
|
| 150 |
+
# Params
|
| 151 |
+
(r'(["\'])(.*?)(["\'])', bygroups(Punctuation, String, Punctuation)),
|
| 152 |
+
# Other states
|
| 153 |
+
(r"\(", Operator, "function"),
|
| 154 |
+
(r"\)", Operator),
|
| 155 |
+
(r"\{", Punctuation, "labels"),
|
| 156 |
+
(r"\[", Punctuation, "range"),
|
| 157 |
+
],
|
| 158 |
+
"labels": [
|
| 159 |
+
(r"\}", Punctuation, "#pop"),
|
| 160 |
+
(r"\n", Whitespace),
|
| 161 |
+
(r"\s+", Whitespace),
|
| 162 |
+
(r",", Punctuation),
|
| 163 |
+
(r'([_a-zA-Z][a-zA-Z0-9_]*?)(\s*?)(=~|!=|=|!~)(\s*?)("|\')(.*?)("|\')',
|
| 164 |
+
bygroups(Name.Label, Whitespace, Operator, Whitespace,
|
| 165 |
+
Punctuation, String, Punctuation)),
|
| 166 |
+
],
|
| 167 |
+
"range": [
|
| 168 |
+
(r"\]", Punctuation, "#pop"),
|
| 169 |
+
(r"[1-9][0-9]*[smhdwy]", String),
|
| 170 |
+
],
|
| 171 |
+
"function": [
|
| 172 |
+
(r"\)", Operator, "#pop"),
|
| 173 |
+
(r"\(", Operator, "#push"),
|
| 174 |
+
default("#pop"),
|
| 175 |
+
],
|
| 176 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/prql.py
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the PRQL query language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, combined, words, include, bygroups
|
| 12 |
+
from pygments.token import Comment, Literal, Keyword, Name, Number, Operator, \
|
| 13 |
+
Punctuation, String, Text, Whitespace
|
| 14 |
+
|
| 15 |
+
__all__ = ['PrqlLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class PrqlLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For PRQL source code.
|
| 21 |
+
|
| 22 |
+
grammar: https://github.com/PRQL/prql/tree/main/grammars
|
| 23 |
+
"""
|
| 24 |
+
|
| 25 |
+
name = 'PRQL'
|
| 26 |
+
url = 'https://prql-lang.org/'
|
| 27 |
+
aliases = ['prql']
|
| 28 |
+
filenames = ['*.prql']
|
| 29 |
+
mimetypes = ['application/prql', 'application/x-prql']
|
| 30 |
+
version_added = '2.17'
|
| 31 |
+
|
| 32 |
+
builtinTypes = words((
|
| 33 |
+
"bool",
|
| 34 |
+
"int",
|
| 35 |
+
"int8", "int16", "int32", "int64", "int128",
|
| 36 |
+
"float",
|
| 37 |
+
"text",
|
| 38 |
+
"set"), suffix=r'\b')
|
| 39 |
+
|
| 40 |
+
def innerstring_rules(ttype):
|
| 41 |
+
return [
|
| 42 |
+
# the new style '{}'.format(...) string formatting
|
| 43 |
+
(r'\{'
|
| 44 |
+
r'((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name
|
| 45 |
+
r'(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?'
|
| 46 |
+
r'\}', String.Interpol),
|
| 47 |
+
|
| 48 |
+
(r'[^\\\'"%{\n]+', ttype),
|
| 49 |
+
(r'[\'"\\]', ttype),
|
| 50 |
+
(r'%|(\{{1,2})', ttype)
|
| 51 |
+
]
|
| 52 |
+
|
| 53 |
+
def fstring_rules(ttype):
|
| 54 |
+
return [
|
| 55 |
+
(r'\}', String.Interpol),
|
| 56 |
+
(r'\{', String.Interpol, 'expr-inside-fstring'),
|
| 57 |
+
(r'[^\\\'"{}\n]+', ttype),
|
| 58 |
+
(r'[\'"\\]', ttype),
|
| 59 |
+
]
|
| 60 |
+
|
| 61 |
+
tokens = {
|
| 62 |
+
'root': [
|
| 63 |
+
|
| 64 |
+
# Comments
|
| 65 |
+
(r'#!.*', String.Doc),
|
| 66 |
+
(r'#.*', Comment.Single),
|
| 67 |
+
|
| 68 |
+
# Whitespace
|
| 69 |
+
(r'\s+', Whitespace),
|
| 70 |
+
|
| 71 |
+
# Modules
|
| 72 |
+
(r'^(\s*)(module)(\s*)',
|
| 73 |
+
bygroups(Whitespace, Keyword.Namespace, Whitespace),
|
| 74 |
+
'imports'),
|
| 75 |
+
|
| 76 |
+
(builtinTypes, Keyword.Type),
|
| 77 |
+
|
| 78 |
+
# Main
|
| 79 |
+
(r'^prql ', Keyword.Reserved),
|
| 80 |
+
|
| 81 |
+
('let', Keyword.Declaration),
|
| 82 |
+
|
| 83 |
+
include('keywords'),
|
| 84 |
+
include('expr'),
|
| 85 |
+
|
| 86 |
+
# Transforms
|
| 87 |
+
(r'^[A-Za-z_][a-zA-Z0-9_]*', Keyword),
|
| 88 |
+
],
|
| 89 |
+
'expr': [
|
| 90 |
+
# non-raw f-strings
|
| 91 |
+
('(f)(""")', bygroups(String.Affix, String.Double),
|
| 92 |
+
combined('fstringescape', 'tdqf')),
|
| 93 |
+
("(f)(''')", bygroups(String.Affix, String.Single),
|
| 94 |
+
combined('fstringescape', 'tsqf')),
|
| 95 |
+
('(f)(")', bygroups(String.Affix, String.Double),
|
| 96 |
+
combined('fstringescape', 'dqf')),
|
| 97 |
+
("(f)(')", bygroups(String.Affix, String.Single),
|
| 98 |
+
combined('fstringescape', 'sqf')),
|
| 99 |
+
|
| 100 |
+
# non-raw s-strings
|
| 101 |
+
('(s)(""")', bygroups(String.Affix, String.Double),
|
| 102 |
+
combined('stringescape', 'tdqf')),
|
| 103 |
+
("(s)(''')", bygroups(String.Affix, String.Single),
|
| 104 |
+
combined('stringescape', 'tsqf')),
|
| 105 |
+
('(s)(")', bygroups(String.Affix, String.Double),
|
| 106 |
+
combined('stringescape', 'dqf')),
|
| 107 |
+
("(s)(')", bygroups(String.Affix, String.Single),
|
| 108 |
+
combined('stringescape', 'sqf')),
|
| 109 |
+
|
| 110 |
+
# raw strings
|
| 111 |
+
('(?i)(r)(""")',
|
| 112 |
+
bygroups(String.Affix, String.Double), 'tdqs'),
|
| 113 |
+
("(?i)(r)(''')",
|
| 114 |
+
bygroups(String.Affix, String.Single), 'tsqs'),
|
| 115 |
+
('(?i)(r)(")',
|
| 116 |
+
bygroups(String.Affix, String.Double), 'dqs'),
|
| 117 |
+
("(?i)(r)(')",
|
| 118 |
+
bygroups(String.Affix, String.Single), 'sqs'),
|
| 119 |
+
|
| 120 |
+
# non-raw strings
|
| 121 |
+
('"""', String.Double, combined('stringescape', 'tdqs')),
|
| 122 |
+
("'''", String.Single, combined('stringescape', 'tsqs')),
|
| 123 |
+
('"', String.Double, combined('stringescape', 'dqs')),
|
| 124 |
+
("'", String.Single, combined('stringescape', 'sqs')),
|
| 125 |
+
|
| 126 |
+
# Time and dates
|
| 127 |
+
(r'@\d{4}-\d{2}-\d{2}T\d{2}(:\d{2})?(:\d{2})?(\.\d{1,6})?(Z|[+-]\d{1,2}(:\d{1,2})?)?', Literal.Date),
|
| 128 |
+
(r'@\d{4}-\d{2}-\d{2}', Literal.Date),
|
| 129 |
+
(r'@\d{2}(:\d{2})?(:\d{2})?(\.\d{1,6})?(Z|[+-]\d{1,2}(:\d{1,2})?)?', Literal.Date),
|
| 130 |
+
|
| 131 |
+
(r'[^\S\n]+', Text),
|
| 132 |
+
include('numbers'),
|
| 133 |
+
(r'->|=>|==|!=|>=|<=|~=|&&|\|\||\?\?|\/\/', Operator),
|
| 134 |
+
(r'[-~+/*%=<>&^|.@]', Operator),
|
| 135 |
+
(r'[]{}:(),;[]', Punctuation),
|
| 136 |
+
include('functions'),
|
| 137 |
+
|
| 138 |
+
# Variable Names
|
| 139 |
+
(r'[A-Za-z_][a-zA-Z0-9_]*', Name.Variable),
|
| 140 |
+
],
|
| 141 |
+
'numbers': [
|
| 142 |
+
(r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)'
|
| 143 |
+
r'([eE][+-]?\d(?:_?\d)*)?', Number.Float),
|
| 144 |
+
(r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float),
|
| 145 |
+
(r'0[oO](?:_?[0-7])+', Number.Oct),
|
| 146 |
+
(r'0[bB](?:_?[01])+', Number.Bin),
|
| 147 |
+
(r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex),
|
| 148 |
+
(r'\d(?:_?\d)*', Number.Integer),
|
| 149 |
+
],
|
| 150 |
+
'fstringescape': [
|
| 151 |
+
include('stringescape'),
|
| 152 |
+
],
|
| 153 |
+
'bytesescape': [
|
| 154 |
+
(r'\\([\\bfnrt"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
| 155 |
+
],
|
| 156 |
+
'stringescape': [
|
| 157 |
+
(r'\\(N\{.*?\}|u\{[a-fA-F0-9]{1,6}\})', String.Escape),
|
| 158 |
+
include('bytesescape')
|
| 159 |
+
],
|
| 160 |
+
'fstrings-single': fstring_rules(String.Single),
|
| 161 |
+
'fstrings-double': fstring_rules(String.Double),
|
| 162 |
+
'strings-single': innerstring_rules(String.Single),
|
| 163 |
+
'strings-double': innerstring_rules(String.Double),
|
| 164 |
+
'dqf': [
|
| 165 |
+
(r'"', String.Double, '#pop'),
|
| 166 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 167 |
+
include('fstrings-double')
|
| 168 |
+
],
|
| 169 |
+
'sqf': [
|
| 170 |
+
(r"'", String.Single, '#pop'),
|
| 171 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 172 |
+
include('fstrings-single')
|
| 173 |
+
],
|
| 174 |
+
'dqs': [
|
| 175 |
+
(r'"', String.Double, '#pop'),
|
| 176 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 177 |
+
include('strings-double')
|
| 178 |
+
],
|
| 179 |
+
'sqs': [
|
| 180 |
+
(r"'", String.Single, '#pop'),
|
| 181 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 182 |
+
include('strings-single')
|
| 183 |
+
],
|
| 184 |
+
'tdqf': [
|
| 185 |
+
(r'"""', String.Double, '#pop'),
|
| 186 |
+
include('fstrings-double'),
|
| 187 |
+
(r'\n', String.Double)
|
| 188 |
+
],
|
| 189 |
+
'tsqf': [
|
| 190 |
+
(r"'''", String.Single, '#pop'),
|
| 191 |
+
include('fstrings-single'),
|
| 192 |
+
(r'\n', String.Single)
|
| 193 |
+
],
|
| 194 |
+
'tdqs': [
|
| 195 |
+
(r'"""', String.Double, '#pop'),
|
| 196 |
+
include('strings-double'),
|
| 197 |
+
(r'\n', String.Double)
|
| 198 |
+
],
|
| 199 |
+
'tsqs': [
|
| 200 |
+
(r"'''", String.Single, '#pop'),
|
| 201 |
+
include('strings-single'),
|
| 202 |
+
(r'\n', String.Single)
|
| 203 |
+
],
|
| 204 |
+
|
| 205 |
+
'expr-inside-fstring': [
|
| 206 |
+
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
|
| 207 |
+
# without format specifier
|
| 208 |
+
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
|
| 209 |
+
r'\}', String.Interpol, '#pop'),
|
| 210 |
+
# with format specifier
|
| 211 |
+
# we'll catch the remaining '}' in the outer scope
|
| 212 |
+
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
|
| 213 |
+
r':', String.Interpol, '#pop'),
|
| 214 |
+
(r'\s+', Whitespace), # allow new lines
|
| 215 |
+
include('expr'),
|
| 216 |
+
],
|
| 217 |
+
'expr-inside-fstring-inner': [
|
| 218 |
+
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
|
| 219 |
+
(r'[])}]', Punctuation, '#pop'),
|
| 220 |
+
(r'\s+', Whitespace), # allow new lines
|
| 221 |
+
include('expr'),
|
| 222 |
+
],
|
| 223 |
+
'keywords': [
|
| 224 |
+
(words((
|
| 225 |
+
'into', 'case', 'type', 'module', 'internal',
|
| 226 |
+
), suffix=r'\b'),
|
| 227 |
+
Keyword),
|
| 228 |
+
(words(('true', 'false', 'null'), suffix=r'\b'), Keyword.Constant),
|
| 229 |
+
],
|
| 230 |
+
'functions': [
|
| 231 |
+
(words((
|
| 232 |
+
"min", "max", "sum", "average", "stddev", "every", "any",
|
| 233 |
+
"concat_array", "count", "lag", "lead", "first", "last",
|
| 234 |
+
"rank", "rank_dense", "row_number", "round", "as", "in",
|
| 235 |
+
"tuple_every", "tuple_map", "tuple_zip", "_eq", "_is_null",
|
| 236 |
+
"from_text", "lower", "upper", "read_parquet", "read_csv"),
|
| 237 |
+
suffix=r'\b'),
|
| 238 |
+
Name.Function),
|
| 239 |
+
],
|
| 240 |
+
|
| 241 |
+
'comment': [
|
| 242 |
+
(r'-(?!\})', Comment.Multiline),
|
| 243 |
+
(r'\{-', Comment.Multiline, 'comment'),
|
| 244 |
+
(r'[^-}]', Comment.Multiline),
|
| 245 |
+
(r'-\}', Comment.Multiline, '#pop'),
|
| 246 |
+
],
|
| 247 |
+
|
| 248 |
+
'imports': [
|
| 249 |
+
(r'\w+(\.\w+)*', Name.Class, '#pop'),
|
| 250 |
+
],
|
| 251 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ptx.py
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.ptx
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for other PTX language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, include, words
|
| 12 |
+
from pygments.token import Comment, Keyword, Name, String, Number, \
|
| 13 |
+
Punctuation, Whitespace, Operator
|
| 14 |
+
|
| 15 |
+
__all__ = ["PtxLexer"]
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class PtxLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For NVIDIA `PTX <https://docs.nvidia.com/cuda/parallel-thread-execution/>`_
|
| 21 |
+
source.
|
| 22 |
+
"""
|
| 23 |
+
name = 'PTX'
|
| 24 |
+
url = "https://docs.nvidia.com/cuda/parallel-thread-execution/"
|
| 25 |
+
filenames = ['*.ptx']
|
| 26 |
+
aliases = ['ptx']
|
| 27 |
+
mimetypes = ['text/x-ptx']
|
| 28 |
+
version_added = '2.16'
|
| 29 |
+
|
| 30 |
+
#: optional Comment or Whitespace
|
| 31 |
+
string = r'"[^"]*?"'
|
| 32 |
+
followsym = r'[a-zA-Z0-9_$]'
|
| 33 |
+
identifier = r'([-a-zA-Z$._][\w\-$.]*|' + string + ')'
|
| 34 |
+
block_label = r'(' + identifier + r'|(\d+))'
|
| 35 |
+
|
| 36 |
+
tokens = {
|
| 37 |
+
'root': [
|
| 38 |
+
include('whitespace'),
|
| 39 |
+
|
| 40 |
+
(block_label + r'\s*:', Name.Label),
|
| 41 |
+
|
| 42 |
+
include('keyword'),
|
| 43 |
+
|
| 44 |
+
(r'%' + identifier, Name.Variable),
|
| 45 |
+
(r'%\d+', Name.Variable.Anonymous),
|
| 46 |
+
(r'c?' + string, String),
|
| 47 |
+
(identifier, Name.Variable),
|
| 48 |
+
(r';', Punctuation),
|
| 49 |
+
(r'[*+-/]', Operator),
|
| 50 |
+
|
| 51 |
+
(r'0[xX][a-fA-F0-9]+', Number),
|
| 52 |
+
(r'-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?', Number),
|
| 53 |
+
|
| 54 |
+
(r'[=<>{}\[\]()*.,!]|x\b', Punctuation)
|
| 55 |
+
|
| 56 |
+
],
|
| 57 |
+
'whitespace': [
|
| 58 |
+
(r'(\n|\s+)+', Whitespace),
|
| 59 |
+
(r'//.*?\n', Comment)
|
| 60 |
+
],
|
| 61 |
+
|
| 62 |
+
'keyword': [
|
| 63 |
+
# Instruction keywords
|
| 64 |
+
(words((
|
| 65 |
+
'abs', 'discard', 'min', 'shf', 'vadd',
|
| 66 |
+
'activemask', 'div', 'mma', 'shfl', 'vadd2',
|
| 67 |
+
'add', 'dp2a', 'mov', 'shl', 'vadd4',
|
| 68 |
+
'addc', 'dp4a', 'movmatrix', 'shr', 'vavrg2',
|
| 69 |
+
'alloca', 'elect', 'mul', 'sin', 'vavrg4',
|
| 70 |
+
'and', 'ex2', 'mul24', 'slct', 'vmad',
|
| 71 |
+
'applypriority', 'exit', 'multimem', 'sqrt', 'vmax',
|
| 72 |
+
'atom', 'fence', 'nanosleep', 'st', 'vmax2',
|
| 73 |
+
'bar', 'fma', 'neg', 'stackrestore', 'vmax4',
|
| 74 |
+
'barrier', 'fns', 'not', 'stacksave', 'vmin',
|
| 75 |
+
'bfe', 'getctarank', 'or', 'stmatrix', 'vmin2',
|
| 76 |
+
'bfi', 'griddepcontrol', 'pmevent', 'sub', 'vmin4',
|
| 77 |
+
'bfind', 'isspacep', 'popc', 'subc', 'vote',
|
| 78 |
+
'bmsk', 'istypep', 'prefetch', 'suld', 'vset',
|
| 79 |
+
'bra', 'ld', 'prefetchu', 'suq', 'vset2',
|
| 80 |
+
'brev', 'ldmatrix', 'prmt', 'sured', 'vset4',
|
| 81 |
+
'brkpt', 'ldu', 'rcp', 'sust', 'vshl',
|
| 82 |
+
'brx', 'lg2', 'red', 'szext', 'vshr',
|
| 83 |
+
'call', 'lop3', 'redux', 'tanh', 'vsub',
|
| 84 |
+
'clz', 'mad', 'rem', 'testp', 'vsub2',
|
| 85 |
+
'cnot', 'mad24', 'ret', 'tex', 'vsub4',
|
| 86 |
+
'copysign', 'madc', 'rsqrt', 'tld4', 'wgmma',
|
| 87 |
+
'cos', 'mapa', 'sad', 'trap', 'wmma',
|
| 88 |
+
'cp', 'match', 'selp', 'txq', 'xor',
|
| 89 |
+
'createpolicy', 'max', 'set', 'vabsdiff', 'cvt',
|
| 90 |
+
'mbarrier', 'setmaxnreg', 'vabsdiff2', 'cvta',
|
| 91 |
+
'membar', 'setp', 'vabsdiff4')), Keyword),
|
| 92 |
+
# State Spaces and Suffixes
|
| 93 |
+
(words((
|
| 94 |
+
'reg', '.sreg', '.const', '.global',
|
| 95 |
+
'.local', '.param', '.shared', '.tex',
|
| 96 |
+
'.wide', '.loc'
|
| 97 |
+
)), Keyword.Pseudo),
|
| 98 |
+
# PTX Directives
|
| 99 |
+
(words((
|
| 100 |
+
'.address_size', '.explicitcluster', '.maxnreg', '.section',
|
| 101 |
+
'.alias', '.extern', '.maxntid', '.shared',
|
| 102 |
+
'.align', '.file', '.minnctapersm', '.sreg',
|
| 103 |
+
'.branchtargets', '.func', '.noreturn', '.target',
|
| 104 |
+
'.callprototype', '.global', '.param', '.tex',
|
| 105 |
+
'.calltargets', '.loc', '.pragma', '.version',
|
| 106 |
+
'.common', '.local', '.reg', '.visible',
|
| 107 |
+
'.const', '.maxclusterrank', '.reqnctapercluster', '.weak',
|
| 108 |
+
'.entry', '.maxnctapersm', '.reqntid')), Keyword.Reserved),
|
| 109 |
+
# Fundamental Types
|
| 110 |
+
(words((
|
| 111 |
+
'.s8', '.s16', '.s32', '.s64',
|
| 112 |
+
'.u8', '.u16', '.u32', '.u64',
|
| 113 |
+
'.f16', '.f16x2', '.f32', '.f64',
|
| 114 |
+
'.b8', '.b16', '.b32', '.b64',
|
| 115 |
+
'.pred'
|
| 116 |
+
)), Keyword.Type)
|
| 117 |
+
],
|
| 118 |
+
|
| 119 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/python.py
ADDED
|
@@ -0,0 +1,1204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import keyword
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import DelegatingLexer, RegexLexer, include, \
|
| 14 |
+
bygroups, using, default, words, combined, this
|
| 15 |
+
from pygments.util import get_bool_opt, shebang_matches
|
| 16 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 17 |
+
Number, Punctuation, Generic, Other, Error, Whitespace
|
| 18 |
+
from pygments import unistring as uni
|
| 19 |
+
|
| 20 |
+
__all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
|
| 21 |
+
'Python2Lexer', 'Python2TracebackLexer',
|
| 22 |
+
'CythonLexer', 'DgLexer', 'NumPyLexer']
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class PythonLexer(RegexLexer):
|
| 26 |
+
"""
|
| 27 |
+
For Python source code (version 3.x).
|
| 28 |
+
|
| 29 |
+
.. versionchanged:: 2.5
|
| 30 |
+
This is now the default ``PythonLexer``. It is still available as the
|
| 31 |
+
alias ``Python3Lexer``.
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
name = 'Python'
|
| 35 |
+
url = 'https://www.python.org'
|
| 36 |
+
aliases = ['python', 'py', 'sage', 'python3', 'py3', 'bazel', 'starlark', 'pyi']
|
| 37 |
+
filenames = [
|
| 38 |
+
'*.py',
|
| 39 |
+
'*.pyw',
|
| 40 |
+
# Type stubs
|
| 41 |
+
'*.pyi',
|
| 42 |
+
# Jython
|
| 43 |
+
'*.jy',
|
| 44 |
+
# Sage
|
| 45 |
+
'*.sage',
|
| 46 |
+
# SCons
|
| 47 |
+
'*.sc',
|
| 48 |
+
'SConstruct',
|
| 49 |
+
'SConscript',
|
| 50 |
+
# Skylark/Starlark (used by Bazel, Buck, and Pants)
|
| 51 |
+
'*.bzl',
|
| 52 |
+
'BUCK',
|
| 53 |
+
'BUILD',
|
| 54 |
+
'BUILD.bazel',
|
| 55 |
+
'WORKSPACE',
|
| 56 |
+
# Twisted Application infrastructure
|
| 57 |
+
'*.tac',
|
| 58 |
+
# Execubot level format
|
| 59 |
+
'*.pye',
|
| 60 |
+
]
|
| 61 |
+
mimetypes = ['text/x-python', 'application/x-python',
|
| 62 |
+
'text/x-python3', 'application/x-python3']
|
| 63 |
+
version_added = '0.10'
|
| 64 |
+
|
| 65 |
+
uni_name = f"[{uni.xid_start}][{uni.xid_continue}]*"
|
| 66 |
+
|
| 67 |
+
def innerstring_rules(ttype):
|
| 68 |
+
return [
|
| 69 |
+
# the old style '%s' % (...) string formatting (still valid in Py3)
|
| 70 |
+
(r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
| 71 |
+
'[hlL]?[E-GXc-giorsaux%]', String.Interpol),
|
| 72 |
+
# the new style '{}'.format(...) string formatting
|
| 73 |
+
(r'\{'
|
| 74 |
+
r'((\w+)((\.\w+)|(\[[^\]]+\]))*)?' # field name
|
| 75 |
+
r'(\![sra])?' # conversion
|
| 76 |
+
r'(\:(.?[<>=\^])?[-+ ]?#?0?(\d+)?,?(\.\d+)?[E-GXb-gnosx%]?)?'
|
| 77 |
+
r'\}', String.Interpol),
|
| 78 |
+
|
| 79 |
+
# backslashes, quotes and formatting signs must be parsed one at a time
|
| 80 |
+
(r'[^\\\'"%{\n]+', ttype),
|
| 81 |
+
(r'[\'"\\]', ttype),
|
| 82 |
+
# unhandled string formatting sign
|
| 83 |
+
(r'%|(\{{1,2})', ttype)
|
| 84 |
+
# newlines are an error (use "nl" state)
|
| 85 |
+
]
|
| 86 |
+
|
| 87 |
+
def fstring_rules(ttype):
|
| 88 |
+
return [
|
| 89 |
+
# Assuming that a '}' is the closing brace after format specifier.
|
| 90 |
+
# Sadly, this means that we won't detect syntax error. But it's
|
| 91 |
+
# more important to parse correct syntax correctly, than to
|
| 92 |
+
# highlight invalid syntax.
|
| 93 |
+
(r'\}', String.Interpol),
|
| 94 |
+
(r'\{', String.Interpol, 'expr-inside-fstring'),
|
| 95 |
+
# backslashes, quotes and formatting signs must be parsed one at a time
|
| 96 |
+
(r'[^\\\'"{}\n]+', ttype),
|
| 97 |
+
(r'[\'"\\]', ttype),
|
| 98 |
+
# newlines are an error (use "nl" state)
|
| 99 |
+
]
|
| 100 |
+
|
| 101 |
+
tokens = {
|
| 102 |
+
'root': [
|
| 103 |
+
(r'\n', Whitespace),
|
| 104 |
+
(r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
|
| 105 |
+
bygroups(Whitespace, String.Affix, String.Doc)),
|
| 106 |
+
(r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
|
| 107 |
+
bygroups(Whitespace, String.Affix, String.Doc)),
|
| 108 |
+
(r'\A#!.+$', Comment.Hashbang),
|
| 109 |
+
(r'#.*$', Comment.Single),
|
| 110 |
+
(r'\\\n', Text),
|
| 111 |
+
(r'\\', Text),
|
| 112 |
+
include('keywords'),
|
| 113 |
+
include('soft-keywords'),
|
| 114 |
+
(r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'funcname'),
|
| 115 |
+
(r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'classname'),
|
| 116 |
+
(r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace),
|
| 117 |
+
'fromimport'),
|
| 118 |
+
(r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace),
|
| 119 |
+
'import'),
|
| 120 |
+
include('expr'),
|
| 121 |
+
],
|
| 122 |
+
'expr': [
|
| 123 |
+
# raw f-strings and t-strings
|
| 124 |
+
('(?i)(r[ft]|[ft]r)(""")',
|
| 125 |
+
bygroups(String.Affix, String.Double),
|
| 126 |
+
combined('rfstringescape', 'tdqf')),
|
| 127 |
+
("(?i)(r[ft]|[ft]r)(''')",
|
| 128 |
+
bygroups(String.Affix, String.Single),
|
| 129 |
+
combined('rfstringescape', 'tsqf')),
|
| 130 |
+
('(?i)(r[ft]|[ft]r)(")',
|
| 131 |
+
bygroups(String.Affix, String.Double),
|
| 132 |
+
combined('rfstringescape', 'dqf')),
|
| 133 |
+
("(?i)(r[ft]|[ft]r)(')",
|
| 134 |
+
bygroups(String.Affix, String.Single),
|
| 135 |
+
combined('rfstringescape', 'sqf')),
|
| 136 |
+
# non-raw f-strings and t-strings
|
| 137 |
+
('([fFtT])(""")', bygroups(String.Affix, String.Double),
|
| 138 |
+
combined('fstringescape', 'tdqf')),
|
| 139 |
+
("([fFtT])(''')", bygroups(String.Affix, String.Single),
|
| 140 |
+
combined('fstringescape', 'tsqf')),
|
| 141 |
+
('([fFtT])(")', bygroups(String.Affix, String.Double),
|
| 142 |
+
combined('fstringescape', 'dqf')),
|
| 143 |
+
("([fFtT])(')", bygroups(String.Affix, String.Single),
|
| 144 |
+
combined('fstringescape', 'sqf')),
|
| 145 |
+
# raw bytes and strings
|
| 146 |
+
('(?i)(rb|br|r)(""")',
|
| 147 |
+
bygroups(String.Affix, String.Double), 'tdqs'),
|
| 148 |
+
("(?i)(rb|br|r)(''')",
|
| 149 |
+
bygroups(String.Affix, String.Single), 'tsqs'),
|
| 150 |
+
('(?i)(rb|br|r)(")',
|
| 151 |
+
bygroups(String.Affix, String.Double), 'dqs'),
|
| 152 |
+
("(?i)(rb|br|r)(')",
|
| 153 |
+
bygroups(String.Affix, String.Single), 'sqs'),
|
| 154 |
+
# non-raw strings
|
| 155 |
+
('([uU]?)(""")', bygroups(String.Affix, String.Double),
|
| 156 |
+
combined('stringescape', 'tdqs')),
|
| 157 |
+
("([uU]?)(''')", bygroups(String.Affix, String.Single),
|
| 158 |
+
combined('stringescape', 'tsqs')),
|
| 159 |
+
('([uU]?)(")', bygroups(String.Affix, String.Double),
|
| 160 |
+
combined('stringescape', 'dqs')),
|
| 161 |
+
("([uU]?)(')", bygroups(String.Affix, String.Single),
|
| 162 |
+
combined('stringescape', 'sqs')),
|
| 163 |
+
# non-raw bytes
|
| 164 |
+
('([bB])(""")', bygroups(String.Affix, String.Double),
|
| 165 |
+
combined('bytesescape', 'tdqs')),
|
| 166 |
+
("([bB])(''')", bygroups(String.Affix, String.Single),
|
| 167 |
+
combined('bytesescape', 'tsqs')),
|
| 168 |
+
('([bB])(")', bygroups(String.Affix, String.Double),
|
| 169 |
+
combined('bytesescape', 'dqs')),
|
| 170 |
+
("([bB])(')", bygroups(String.Affix, String.Single),
|
| 171 |
+
combined('bytesescape', 'sqs')),
|
| 172 |
+
|
| 173 |
+
(r'[^\S\n]+', Text),
|
| 174 |
+
include('numbers'),
|
| 175 |
+
(r'!=|==|<<|>>|:=|[-~+/*%=<>&^|.]', Operator),
|
| 176 |
+
(r'[]{}:(),;[]', Punctuation),
|
| 177 |
+
(r'(in|is|and|or|not)\b', Operator.Word),
|
| 178 |
+
include('expr-keywords'),
|
| 179 |
+
include('builtins'),
|
| 180 |
+
include('magicfuncs'),
|
| 181 |
+
include('magicvars'),
|
| 182 |
+
include('name'),
|
| 183 |
+
],
|
| 184 |
+
'expr-inside-fstring': [
|
| 185 |
+
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
|
| 186 |
+
# without format specifier
|
| 187 |
+
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
|
| 188 |
+
r'(\![sraf])?' # conversion
|
| 189 |
+
r'\}', String.Interpol, '#pop'),
|
| 190 |
+
# with format specifier
|
| 191 |
+
# we'll catch the remaining '}' in the outer scope
|
| 192 |
+
(r'(=\s*)?' # debug (https://bugs.python.org/issue36817)
|
| 193 |
+
r'(\![sraf])?' # conversion
|
| 194 |
+
r':', String.Interpol, '#pop'),
|
| 195 |
+
(r'\s+', Whitespace), # allow new lines
|
| 196 |
+
include('expr'),
|
| 197 |
+
],
|
| 198 |
+
'expr-inside-fstring-inner': [
|
| 199 |
+
(r'[{([]', Punctuation, 'expr-inside-fstring-inner'),
|
| 200 |
+
(r'[])}]', Punctuation, '#pop'),
|
| 201 |
+
(r'\s+', Whitespace), # allow new lines
|
| 202 |
+
include('expr'),
|
| 203 |
+
],
|
| 204 |
+
'expr-keywords': [
|
| 205 |
+
# Based on https://docs.python.org/3/reference/expressions.html
|
| 206 |
+
(words((
|
| 207 |
+
'async for', 'await', 'else', 'for', 'if', 'lambda',
|
| 208 |
+
'yield', 'yield from'), suffix=r'\b'),
|
| 209 |
+
Keyword),
|
| 210 |
+
(words(('True', 'False', 'None'), suffix=r'\b'), Keyword.Constant),
|
| 211 |
+
],
|
| 212 |
+
'keywords': [
|
| 213 |
+
(words((
|
| 214 |
+
'assert', 'async', 'await', 'break', 'continue', 'del', 'elif',
|
| 215 |
+
'else', 'except', 'finally', 'for', 'global', 'if', 'lambda',
|
| 216 |
+
'pass', 'raise', 'nonlocal', 'return', 'try', 'while', 'yield',
|
| 217 |
+
'yield from', 'as', 'with'), suffix=r'\b'),
|
| 218 |
+
Keyword),
|
| 219 |
+
(words(('True', 'False', 'None'), suffix=r'\b'), Keyword.Constant),
|
| 220 |
+
],
|
| 221 |
+
'soft-keywords': [
|
| 222 |
+
# `match`, `case` and `_` soft keywords
|
| 223 |
+
(r'(^[ \t]*)' # at beginning of line + possible indentation
|
| 224 |
+
r'(match|case)\b' # a possible keyword
|
| 225 |
+
r'(?![ \t]*(?:' # not followed by...
|
| 226 |
+
r'[:,;=^&|@~)\]}]|(?:' + # characters and keywords that mean this isn't
|
| 227 |
+
# pattern matching (but None/True/False is ok)
|
| 228 |
+
r'|'.join(k for k in keyword.kwlist if k[0].islower()) + r')\b))',
|
| 229 |
+
bygroups(Text, Keyword), 'soft-keywords-inner'),
|
| 230 |
+
],
|
| 231 |
+
'soft-keywords-inner': [
|
| 232 |
+
# optional `_` keyword
|
| 233 |
+
(r'(\s+)([^\n_]*)(_\b)', bygroups(Whitespace, using(this), Keyword)),
|
| 234 |
+
default('#pop')
|
| 235 |
+
],
|
| 236 |
+
'builtins': [
|
| 237 |
+
(words((
|
| 238 |
+
'__import__', 'abs', 'aiter', 'all', 'any', 'bin', 'bool', 'bytearray',
|
| 239 |
+
'breakpoint', 'bytes', 'callable', 'chr', 'classmethod', 'compile',
|
| 240 |
+
'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval',
|
| 241 |
+
'filter', 'float', 'format', 'frozenset', 'getattr', 'globals',
|
| 242 |
+
'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'isinstance',
|
| 243 |
+
'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max',
|
| 244 |
+
'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow',
|
| 245 |
+
'print', 'property', 'range', 'repr', 'reversed', 'round', 'set',
|
| 246 |
+
'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super',
|
| 247 |
+
'tuple', 'type', 'vars', 'zip'), prefix=r'(?<!\.)', suffix=r'\b'),
|
| 248 |
+
Name.Builtin),
|
| 249 |
+
(r'(?<!\.)(self|Ellipsis|NotImplemented|cls)\b', Name.Builtin.Pseudo),
|
| 250 |
+
(words((
|
| 251 |
+
'ArithmeticError', 'AssertionError', 'AttributeError',
|
| 252 |
+
'BaseException', 'BufferError', 'BytesWarning', 'DeprecationWarning',
|
| 253 |
+
'EOFError', 'EnvironmentError', 'Exception', 'FloatingPointError',
|
| 254 |
+
'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError',
|
| 255 |
+
'ImportWarning', 'IndentationError', 'IndexError', 'KeyError',
|
| 256 |
+
'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError',
|
| 257 |
+
'NotImplementedError', 'OSError', 'OverflowError',
|
| 258 |
+
'PendingDeprecationWarning', 'ReferenceError', 'ResourceWarning',
|
| 259 |
+
'RuntimeError', 'RuntimeWarning', 'StopIteration',
|
| 260 |
+
'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit',
|
| 261 |
+
'TabError', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
|
| 262 |
+
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
|
| 263 |
+
'UnicodeWarning', 'UserWarning', 'ValueError', 'VMSError',
|
| 264 |
+
'Warning', 'WindowsError', 'ZeroDivisionError',
|
| 265 |
+
# new builtin exceptions from PEP 3151
|
| 266 |
+
'BlockingIOError', 'ChildProcessError', 'ConnectionError',
|
| 267 |
+
'BrokenPipeError', 'ConnectionAbortedError', 'ConnectionRefusedError',
|
| 268 |
+
'ConnectionResetError', 'FileExistsError', 'FileNotFoundError',
|
| 269 |
+
'InterruptedError', 'IsADirectoryError', 'NotADirectoryError',
|
| 270 |
+
'PermissionError', 'ProcessLookupError', 'TimeoutError',
|
| 271 |
+
# others new in Python 3
|
| 272 |
+
'StopAsyncIteration', 'ModuleNotFoundError', 'RecursionError',
|
| 273 |
+
'EncodingWarning'),
|
| 274 |
+
prefix=r'(?<!\.)', suffix=r'\b'),
|
| 275 |
+
Name.Exception),
|
| 276 |
+
],
|
| 277 |
+
'magicfuncs': [
|
| 278 |
+
(words((
|
| 279 |
+
'__abs__', '__add__', '__aenter__', '__aexit__', '__aiter__',
|
| 280 |
+
'__and__', '__anext__', '__await__', '__bool__', '__bytes__',
|
| 281 |
+
'__call__', '__complex__', '__contains__', '__del__', '__delattr__',
|
| 282 |
+
'__delete__', '__delitem__', '__dir__', '__divmod__', '__enter__',
|
| 283 |
+
'__eq__', '__exit__', '__float__', '__floordiv__', '__format__',
|
| 284 |
+
'__ge__', '__get__', '__getattr__', '__getattribute__',
|
| 285 |
+
'__getitem__', '__gt__', '__hash__', '__iadd__', '__iand__',
|
| 286 |
+
'__ifloordiv__', '__ilshift__', '__imatmul__', '__imod__',
|
| 287 |
+
'__imul__', '__index__', '__init__', '__instancecheck__',
|
| 288 |
+
'__int__', '__invert__', '__ior__', '__ipow__', '__irshift__',
|
| 289 |
+
'__isub__', '__iter__', '__itruediv__', '__ixor__', '__le__',
|
| 290 |
+
'__len__', '__length_hint__', '__lshift__', '__lt__', '__matmul__',
|
| 291 |
+
'__missing__', '__mod__', '__mul__', '__ne__', '__neg__',
|
| 292 |
+
'__new__', '__next__', '__or__', '__pos__', '__pow__',
|
| 293 |
+
'__prepare__', '__radd__', '__rand__', '__rdivmod__', '__repr__',
|
| 294 |
+
'__reversed__', '__rfloordiv__', '__rlshift__', '__rmatmul__',
|
| 295 |
+
'__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__',
|
| 296 |
+
'__rrshift__', '__rshift__', '__rsub__', '__rtruediv__',
|
| 297 |
+
'__rxor__', '__set__', '__setattr__', '__setitem__', '__str__',
|
| 298 |
+
'__sub__', '__subclasscheck__', '__truediv__',
|
| 299 |
+
'__xor__'), suffix=r'\b'),
|
| 300 |
+
Name.Function.Magic),
|
| 301 |
+
],
|
| 302 |
+
'magicvars': [
|
| 303 |
+
(words((
|
| 304 |
+
'__annotations__', '__bases__', '__class__', '__closure__',
|
| 305 |
+
'__code__', '__defaults__', '__dict__', '__doc__', '__file__',
|
| 306 |
+
'__func__', '__globals__', '__kwdefaults__', '__module__',
|
| 307 |
+
'__mro__', '__name__', '__objclass__', '__qualname__',
|
| 308 |
+
'__self__', '__slots__', '__weakref__'), suffix=r'\b'),
|
| 309 |
+
Name.Variable.Magic),
|
| 310 |
+
],
|
| 311 |
+
'numbers': [
|
| 312 |
+
(r'(\d(?:_?\d)*\.(?:\d(?:_?\d)*)?|(?:\d(?:_?\d)*)?\.\d(?:_?\d)*)'
|
| 313 |
+
r'([eE][+-]?\d(?:_?\d)*)?', Number.Float),
|
| 314 |
+
(r'\d(?:_?\d)*[eE][+-]?\d(?:_?\d)*j?', Number.Float),
|
| 315 |
+
(r'0[oO](?:_?[0-7])+', Number.Oct),
|
| 316 |
+
(r'0[bB](?:_?[01])+', Number.Bin),
|
| 317 |
+
(r'0[xX](?:_?[a-fA-F0-9])+', Number.Hex),
|
| 318 |
+
(r'\d(?:_?\d)*', Number.Integer),
|
| 319 |
+
],
|
| 320 |
+
'name': [
|
| 321 |
+
(r'@' + uni_name, Name.Decorator),
|
| 322 |
+
(r'@', Operator), # new matrix multiplication operator
|
| 323 |
+
(uni_name, Name),
|
| 324 |
+
],
|
| 325 |
+
'funcname': [
|
| 326 |
+
include('magicfuncs'),
|
| 327 |
+
(uni_name, Name.Function, '#pop'),
|
| 328 |
+
default('#pop'),
|
| 329 |
+
],
|
| 330 |
+
'classname': [
|
| 331 |
+
(uni_name, Name.Class, '#pop'),
|
| 332 |
+
],
|
| 333 |
+
'import': [
|
| 334 |
+
(r'(\s+)(as)(\s+)', bygroups(Whitespace, Keyword, Whitespace)),
|
| 335 |
+
(r'\.', Name.Namespace),
|
| 336 |
+
(uni_name, Name.Namespace),
|
| 337 |
+
(r'(\s*)(,)(\s*)', bygroups(Whitespace, Operator, Whitespace)),
|
| 338 |
+
default('#pop') # all else: go back
|
| 339 |
+
],
|
| 340 |
+
'fromimport': [
|
| 341 |
+
(r'(\s+)(import)\b', bygroups(Whitespace, Keyword.Namespace), '#pop'),
|
| 342 |
+
(r'\.', Name.Namespace),
|
| 343 |
+
# if None occurs here, it's "raise x from None", since None can
|
| 344 |
+
# never be a module name
|
| 345 |
+
(r'None\b', Keyword.Constant, '#pop'),
|
| 346 |
+
(uni_name, Name.Namespace),
|
| 347 |
+
default('#pop'),
|
| 348 |
+
],
|
| 349 |
+
'rfstringescape': [
|
| 350 |
+
(r'\{\{', String.Escape),
|
| 351 |
+
(r'\}\}', String.Escape),
|
| 352 |
+
],
|
| 353 |
+
'fstringescape': [
|
| 354 |
+
include('rfstringescape'),
|
| 355 |
+
include('stringescape'),
|
| 356 |
+
],
|
| 357 |
+
'bytesescape': [
|
| 358 |
+
(r'\\([\\abfnrtv"\']|\n|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
| 359 |
+
],
|
| 360 |
+
'stringescape': [
|
| 361 |
+
(r'\\(N\{.*?\}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8})', String.Escape),
|
| 362 |
+
include('bytesescape')
|
| 363 |
+
],
|
| 364 |
+
'fstrings-single': fstring_rules(String.Single),
|
| 365 |
+
'fstrings-double': fstring_rules(String.Double),
|
| 366 |
+
'strings-single': innerstring_rules(String.Single),
|
| 367 |
+
'strings-double': innerstring_rules(String.Double),
|
| 368 |
+
'dqf': [
|
| 369 |
+
(r'"', String.Double, '#pop'),
|
| 370 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 371 |
+
include('fstrings-double')
|
| 372 |
+
],
|
| 373 |
+
'sqf': [
|
| 374 |
+
(r"'", String.Single, '#pop'),
|
| 375 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 376 |
+
include('fstrings-single')
|
| 377 |
+
],
|
| 378 |
+
'dqs': [
|
| 379 |
+
(r'"', String.Double, '#pop'),
|
| 380 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 381 |
+
include('strings-double')
|
| 382 |
+
],
|
| 383 |
+
'sqs': [
|
| 384 |
+
(r"'", String.Single, '#pop'),
|
| 385 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 386 |
+
include('strings-single')
|
| 387 |
+
],
|
| 388 |
+
'tdqf': [
|
| 389 |
+
(r'"""', String.Double, '#pop'),
|
| 390 |
+
include('fstrings-double'),
|
| 391 |
+
(r'\n', String.Double)
|
| 392 |
+
],
|
| 393 |
+
'tsqf': [
|
| 394 |
+
(r"'''", String.Single, '#pop'),
|
| 395 |
+
include('fstrings-single'),
|
| 396 |
+
(r'\n', String.Single)
|
| 397 |
+
],
|
| 398 |
+
'tdqs': [
|
| 399 |
+
(r'"""', String.Double, '#pop'),
|
| 400 |
+
include('strings-double'),
|
| 401 |
+
(r'\n', String.Double)
|
| 402 |
+
],
|
| 403 |
+
'tsqs': [
|
| 404 |
+
(r"'''", String.Single, '#pop'),
|
| 405 |
+
include('strings-single'),
|
| 406 |
+
(r'\n', String.Single)
|
| 407 |
+
],
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
def analyse_text(text):
|
| 411 |
+
return shebang_matches(text, r'pythonw?(3(\.\d)?)?') or \
|
| 412 |
+
'import ' in text[:1000]
|
| 413 |
+
|
| 414 |
+
|
| 415 |
+
Python3Lexer = PythonLexer
|
| 416 |
+
|
| 417 |
+
|
| 418 |
+
class Python2Lexer(RegexLexer):
|
| 419 |
+
"""
|
| 420 |
+
For Python 2.x source code.
|
| 421 |
+
|
| 422 |
+
.. versionchanged:: 2.5
|
| 423 |
+
This class has been renamed from ``PythonLexer``. ``PythonLexer`` now
|
| 424 |
+
refers to the Python 3 variant. File name patterns like ``*.py`` have
|
| 425 |
+
been moved to Python 3 as well.
|
| 426 |
+
"""
|
| 427 |
+
|
| 428 |
+
name = 'Python 2.x'
|
| 429 |
+
url = 'https://www.python.org'
|
| 430 |
+
aliases = ['python2', 'py2']
|
| 431 |
+
filenames = [] # now taken over by PythonLexer (3.x)
|
| 432 |
+
mimetypes = ['text/x-python2', 'application/x-python2']
|
| 433 |
+
version_added = ''
|
| 434 |
+
|
| 435 |
+
def innerstring_rules(ttype):
|
| 436 |
+
return [
|
| 437 |
+
# the old style '%s' % (...) string formatting
|
| 438 |
+
(r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
| 439 |
+
'[hlL]?[E-GXc-giorsux%]', String.Interpol),
|
| 440 |
+
# backslashes, quotes and formatting signs must be parsed one at a time
|
| 441 |
+
(r'[^\\\'"%\n]+', ttype),
|
| 442 |
+
(r'[\'"\\]', ttype),
|
| 443 |
+
# unhandled string formatting sign
|
| 444 |
+
(r'%', ttype),
|
| 445 |
+
# newlines are an error (use "nl" state)
|
| 446 |
+
]
|
| 447 |
+
|
| 448 |
+
tokens = {
|
| 449 |
+
'root': [
|
| 450 |
+
(r'\n', Whitespace),
|
| 451 |
+
(r'^(\s*)([rRuUbB]{,2})("""(?:.|\n)*?""")',
|
| 452 |
+
bygroups(Whitespace, String.Affix, String.Doc)),
|
| 453 |
+
(r"^(\s*)([rRuUbB]{,2})('''(?:.|\n)*?''')",
|
| 454 |
+
bygroups(Whitespace, String.Affix, String.Doc)),
|
| 455 |
+
(r'[^\S\n]+', Text),
|
| 456 |
+
(r'\A#!.+$', Comment.Hashbang),
|
| 457 |
+
(r'#.*$', Comment.Single),
|
| 458 |
+
(r'[]{}:(),;[]', Punctuation),
|
| 459 |
+
(r'\\\n', Text),
|
| 460 |
+
(r'\\', Text),
|
| 461 |
+
(r'(in|is|and|or|not)\b', Operator.Word),
|
| 462 |
+
(r'!=|==|<<|>>|[-~+/*%=<>&^|.]', Operator),
|
| 463 |
+
include('keywords'),
|
| 464 |
+
(r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'funcname'),
|
| 465 |
+
(r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Whitespace), 'classname'),
|
| 466 |
+
(r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace),
|
| 467 |
+
'fromimport'),
|
| 468 |
+
(r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Whitespace),
|
| 469 |
+
'import'),
|
| 470 |
+
include('builtins'),
|
| 471 |
+
include('magicfuncs'),
|
| 472 |
+
include('magicvars'),
|
| 473 |
+
include('backtick'),
|
| 474 |
+
('([rR]|[uUbB][rR]|[rR][uUbB])(""")',
|
| 475 |
+
bygroups(String.Affix, String.Double), 'tdqs'),
|
| 476 |
+
("([rR]|[uUbB][rR]|[rR][uUbB])(''')",
|
| 477 |
+
bygroups(String.Affix, String.Single), 'tsqs'),
|
| 478 |
+
('([rR]|[uUbB][rR]|[rR][uUbB])(")',
|
| 479 |
+
bygroups(String.Affix, String.Double), 'dqs'),
|
| 480 |
+
("([rR]|[uUbB][rR]|[rR][uUbB])(')",
|
| 481 |
+
bygroups(String.Affix, String.Single), 'sqs'),
|
| 482 |
+
('([uUbB]?)(""")', bygroups(String.Affix, String.Double),
|
| 483 |
+
combined('stringescape', 'tdqs')),
|
| 484 |
+
("([uUbB]?)(''')", bygroups(String.Affix, String.Single),
|
| 485 |
+
combined('stringescape', 'tsqs')),
|
| 486 |
+
('([uUbB]?)(")', bygroups(String.Affix, String.Double),
|
| 487 |
+
combined('stringescape', 'dqs')),
|
| 488 |
+
("([uUbB]?)(')", bygroups(String.Affix, String.Single),
|
| 489 |
+
combined('stringescape', 'sqs')),
|
| 490 |
+
include('name'),
|
| 491 |
+
include('numbers'),
|
| 492 |
+
],
|
| 493 |
+
'keywords': [
|
| 494 |
+
(words((
|
| 495 |
+
'assert', 'break', 'continue', 'del', 'elif', 'else', 'except',
|
| 496 |
+
'exec', 'finally', 'for', 'global', 'if', 'lambda', 'pass',
|
| 497 |
+
'print', 'raise', 'return', 'try', 'while', 'yield',
|
| 498 |
+
'yield from', 'as', 'with'), suffix=r'\b'),
|
| 499 |
+
Keyword),
|
| 500 |
+
],
|
| 501 |
+
'builtins': [
|
| 502 |
+
(words((
|
| 503 |
+
'__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin',
|
| 504 |
+
'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod',
|
| 505 |
+
'cmp', 'coerce', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod',
|
| 506 |
+
'enumerate', 'eval', 'execfile', 'exit', 'file', 'filter', 'float',
|
| 507 |
+
'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'hex', 'id',
|
| 508 |
+
'input', 'int', 'intern', 'isinstance', 'issubclass', 'iter', 'len',
|
| 509 |
+
'list', 'locals', 'long', 'map', 'max', 'min', 'next', 'object',
|
| 510 |
+
'oct', 'open', 'ord', 'pow', 'property', 'range', 'raw_input', 'reduce',
|
| 511 |
+
'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
|
| 512 |
+
'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type',
|
| 513 |
+
'unichr', 'unicode', 'vars', 'xrange', 'zip'),
|
| 514 |
+
prefix=r'(?<!\.)', suffix=r'\b'),
|
| 515 |
+
Name.Builtin),
|
| 516 |
+
(r'(?<!\.)(self|None|Ellipsis|NotImplemented|False|True|cls'
|
| 517 |
+
r')\b', Name.Builtin.Pseudo),
|
| 518 |
+
(words((
|
| 519 |
+
'ArithmeticError', 'AssertionError', 'AttributeError',
|
| 520 |
+
'BaseException', 'DeprecationWarning', 'EOFError', 'EnvironmentError',
|
| 521 |
+
'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
|
| 522 |
+
'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
|
| 523 |
+
'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
|
| 524 |
+
'MemoryError', 'NameError',
|
| 525 |
+
'NotImplementedError', 'OSError', 'OverflowError', 'OverflowWarning',
|
| 526 |
+
'PendingDeprecationWarning', 'ReferenceError',
|
| 527 |
+
'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration',
|
| 528 |
+
'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit',
|
| 529 |
+
'TabError', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
|
| 530 |
+
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
|
| 531 |
+
'UnicodeWarning', 'UserWarning', 'ValueError', 'VMSError', 'Warning',
|
| 532 |
+
'WindowsError', 'ZeroDivisionError'), prefix=r'(?<!\.)', suffix=r'\b'),
|
| 533 |
+
Name.Exception),
|
| 534 |
+
],
|
| 535 |
+
'magicfuncs': [
|
| 536 |
+
(words((
|
| 537 |
+
'__abs__', '__add__', '__and__', '__call__', '__cmp__', '__coerce__',
|
| 538 |
+
'__complex__', '__contains__', '__del__', '__delattr__', '__delete__',
|
| 539 |
+
'__delitem__', '__delslice__', '__div__', '__divmod__', '__enter__',
|
| 540 |
+
'__eq__', '__exit__', '__float__', '__floordiv__', '__ge__', '__get__',
|
| 541 |
+
'__getattr__', '__getattribute__', '__getitem__', '__getslice__', '__gt__',
|
| 542 |
+
'__hash__', '__hex__', '__iadd__', '__iand__', '__idiv__', '__ifloordiv__',
|
| 543 |
+
'__ilshift__', '__imod__', '__imul__', '__index__', '__init__',
|
| 544 |
+
'__instancecheck__', '__int__', '__invert__', '__iop__', '__ior__',
|
| 545 |
+
'__ipow__', '__irshift__', '__isub__', '__iter__', '__itruediv__',
|
| 546 |
+
'__ixor__', '__le__', '__len__', '__long__', '__lshift__', '__lt__',
|
| 547 |
+
'__missing__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__',
|
| 548 |
+
'__nonzero__', '__oct__', '__op__', '__or__', '__pos__', '__pow__',
|
| 549 |
+
'__radd__', '__rand__', '__rcmp__', '__rdiv__', '__rdivmod__', '__repr__',
|
| 550 |
+
'__reversed__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__',
|
| 551 |
+
'__rop__', '__ror__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__',
|
| 552 |
+
'__rtruediv__', '__rxor__', '__set__', '__setattr__', '__setitem__',
|
| 553 |
+
'__setslice__', '__str__', '__sub__', '__subclasscheck__', '__truediv__',
|
| 554 |
+
'__unicode__', '__xor__'), suffix=r'\b'),
|
| 555 |
+
Name.Function.Magic),
|
| 556 |
+
],
|
| 557 |
+
'magicvars': [
|
| 558 |
+
(words((
|
| 559 |
+
'__bases__', '__class__', '__closure__', '__code__', '__defaults__',
|
| 560 |
+
'__dict__', '__doc__', '__file__', '__func__', '__globals__',
|
| 561 |
+
'__metaclass__', '__module__', '__mro__', '__name__', '__self__',
|
| 562 |
+
'__slots__', '__weakref__'),
|
| 563 |
+
suffix=r'\b'),
|
| 564 |
+
Name.Variable.Magic),
|
| 565 |
+
],
|
| 566 |
+
'numbers': [
|
| 567 |
+
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
|
| 568 |
+
(r'\d+[eE][+-]?[0-9]+j?', Number.Float),
|
| 569 |
+
(r'0[0-7]+j?', Number.Oct),
|
| 570 |
+
(r'0[bB][01]+', Number.Bin),
|
| 571 |
+
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
| 572 |
+
(r'\d+L', Number.Integer.Long),
|
| 573 |
+
(r'\d+j?', Number.Integer)
|
| 574 |
+
],
|
| 575 |
+
'backtick': [
|
| 576 |
+
('`.*?`', String.Backtick),
|
| 577 |
+
],
|
| 578 |
+
'name': [
|
| 579 |
+
(r'@[\w.]+', Name.Decorator),
|
| 580 |
+
(r'[a-zA-Z_]\w*', Name),
|
| 581 |
+
],
|
| 582 |
+
'funcname': [
|
| 583 |
+
include('magicfuncs'),
|
| 584 |
+
(r'[a-zA-Z_]\w*', Name.Function, '#pop'),
|
| 585 |
+
default('#pop'),
|
| 586 |
+
],
|
| 587 |
+
'classname': [
|
| 588 |
+
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
| 589 |
+
],
|
| 590 |
+
'import': [
|
| 591 |
+
(r'(?:[ \t]|\\\n)+', Text),
|
| 592 |
+
(r'as\b', Keyword.Namespace),
|
| 593 |
+
(r',', Operator),
|
| 594 |
+
(r'[a-zA-Z_][\w.]*', Name.Namespace),
|
| 595 |
+
default('#pop') # all else: go back
|
| 596 |
+
],
|
| 597 |
+
'fromimport': [
|
| 598 |
+
(r'(?:[ \t]|\\\n)+', Text),
|
| 599 |
+
(r'import\b', Keyword.Namespace, '#pop'),
|
| 600 |
+
# if None occurs here, it's "raise x from None", since None can
|
| 601 |
+
# never be a module name
|
| 602 |
+
(r'None\b', Name.Builtin.Pseudo, '#pop'),
|
| 603 |
+
# sadly, in "raise x from y" y will be highlighted as namespace too
|
| 604 |
+
(r'[a-zA-Z_.][\w.]*', Name.Namespace),
|
| 605 |
+
# anything else here also means "raise x from y" and is therefore
|
| 606 |
+
# not an error
|
| 607 |
+
default('#pop'),
|
| 608 |
+
],
|
| 609 |
+
'stringescape': [
|
| 610 |
+
(r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
| 611 |
+
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
| 612 |
+
],
|
| 613 |
+
'strings-single': innerstring_rules(String.Single),
|
| 614 |
+
'strings-double': innerstring_rules(String.Double),
|
| 615 |
+
'dqs': [
|
| 616 |
+
(r'"', String.Double, '#pop'),
|
| 617 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
|
| 618 |
+
include('strings-double')
|
| 619 |
+
],
|
| 620 |
+
'sqs': [
|
| 621 |
+
(r"'", String.Single, '#pop'),
|
| 622 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
|
| 623 |
+
include('strings-single')
|
| 624 |
+
],
|
| 625 |
+
'tdqs': [
|
| 626 |
+
(r'"""', String.Double, '#pop'),
|
| 627 |
+
include('strings-double'),
|
| 628 |
+
(r'\n', String.Double)
|
| 629 |
+
],
|
| 630 |
+
'tsqs': [
|
| 631 |
+
(r"'''", String.Single, '#pop'),
|
| 632 |
+
include('strings-single'),
|
| 633 |
+
(r'\n', String.Single)
|
| 634 |
+
],
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
def analyse_text(text):
|
| 638 |
+
return shebang_matches(text, r'pythonw?2(\.\d)?')
|
| 639 |
+
|
| 640 |
+
|
| 641 |
+
class _PythonConsoleLexerBase(RegexLexer):
|
| 642 |
+
name = 'Python console session'
|
| 643 |
+
aliases = ['pycon', 'python-console']
|
| 644 |
+
mimetypes = ['text/x-python-doctest']
|
| 645 |
+
|
| 646 |
+
"""Auxiliary lexer for `PythonConsoleLexer`.
|
| 647 |
+
|
| 648 |
+
Code tokens are output as ``Token.Other.Code``, traceback tokens as
|
| 649 |
+
``Token.Other.Traceback``.
|
| 650 |
+
"""
|
| 651 |
+
tokens = {
|
| 652 |
+
'root': [
|
| 653 |
+
(r'(>>> )(.*\n)', bygroups(Generic.Prompt, Other.Code), 'continuations'),
|
| 654 |
+
# This happens, e.g., when tracebacks are embedded in documentation;
|
| 655 |
+
# trailing whitespaces are often stripped in such contexts.
|
| 656 |
+
(r'(>>>)(\n)', bygroups(Generic.Prompt, Whitespace)),
|
| 657 |
+
(r'(\^C)?Traceback \(most recent call last\):\n', Other.Traceback, 'traceback'),
|
| 658 |
+
# SyntaxError starts with this
|
| 659 |
+
(r' File "[^"]+", line \d+', Other.Traceback, 'traceback'),
|
| 660 |
+
(r'.*\n', Generic.Output),
|
| 661 |
+
],
|
| 662 |
+
'continuations': [
|
| 663 |
+
(r'(\.\.\. )(.*\n)', bygroups(Generic.Prompt, Other.Code)),
|
| 664 |
+
# See above.
|
| 665 |
+
(r'(\.\.\.)(\n)', bygroups(Generic.Prompt, Whitespace)),
|
| 666 |
+
default('#pop'),
|
| 667 |
+
],
|
| 668 |
+
'traceback': [
|
| 669 |
+
# As soon as we see a traceback, consume everything until the next
|
| 670 |
+
# >>> prompt.
|
| 671 |
+
(r'(?=>>>( |$))', Text, '#pop'),
|
| 672 |
+
(r'(KeyboardInterrupt)(\n)', bygroups(Name.Class, Whitespace)),
|
| 673 |
+
(r'.*\n', Other.Traceback),
|
| 674 |
+
],
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
|
| 678 |
+
class PythonConsoleLexer(DelegatingLexer):
|
| 679 |
+
"""
|
| 680 |
+
For Python console output or doctests, such as:
|
| 681 |
+
|
| 682 |
+
.. sourcecode:: pycon
|
| 683 |
+
|
| 684 |
+
>>> a = 'foo'
|
| 685 |
+
>>> print(a)
|
| 686 |
+
foo
|
| 687 |
+
>>> 1 / 0
|
| 688 |
+
Traceback (most recent call last):
|
| 689 |
+
File "<stdin>", line 1, in <module>
|
| 690 |
+
ZeroDivisionError: integer division or modulo by zero
|
| 691 |
+
|
| 692 |
+
Additional options:
|
| 693 |
+
|
| 694 |
+
`python3`
|
| 695 |
+
Use Python 3 lexer for code. Default is ``True``.
|
| 696 |
+
|
| 697 |
+
.. versionadded:: 1.0
|
| 698 |
+
.. versionchanged:: 2.5
|
| 699 |
+
Now defaults to ``True``.
|
| 700 |
+
"""
|
| 701 |
+
|
| 702 |
+
name = 'Python console session'
|
| 703 |
+
aliases = ['pycon', 'python-console']
|
| 704 |
+
mimetypes = ['text/x-python-doctest']
|
| 705 |
+
url = 'https://python.org'
|
| 706 |
+
version_added = ''
|
| 707 |
+
|
| 708 |
+
def __init__(self, **options):
|
| 709 |
+
python3 = get_bool_opt(options, 'python3', True)
|
| 710 |
+
if python3:
|
| 711 |
+
pylexer = PythonLexer
|
| 712 |
+
tblexer = PythonTracebackLexer
|
| 713 |
+
else:
|
| 714 |
+
pylexer = Python2Lexer
|
| 715 |
+
tblexer = Python2TracebackLexer
|
| 716 |
+
# We have two auxiliary lexers. Use DelegatingLexer twice with
|
| 717 |
+
# different tokens. TODO: DelegatingLexer should support this
|
| 718 |
+
# directly, by accepting a tuplet of auxiliary lexers and a tuple of
|
| 719 |
+
# distinguishing tokens. Then we wouldn't need this intermediary
|
| 720 |
+
# class.
|
| 721 |
+
class _ReplaceInnerCode(DelegatingLexer):
|
| 722 |
+
def __init__(self, **options):
|
| 723 |
+
super().__init__(pylexer, _PythonConsoleLexerBase, Other.Code, **options)
|
| 724 |
+
super().__init__(tblexer, _ReplaceInnerCode, Other.Traceback, **options)
|
| 725 |
+
|
| 726 |
+
|
| 727 |
+
class PythonTracebackLexer(RegexLexer):
|
| 728 |
+
"""
|
| 729 |
+
For Python 3.x tracebacks, with support for chained exceptions.
|
| 730 |
+
|
| 731 |
+
.. versionchanged:: 2.5
|
| 732 |
+
This is now the default ``PythonTracebackLexer``. It is still available
|
| 733 |
+
as the alias ``Python3TracebackLexer``.
|
| 734 |
+
"""
|
| 735 |
+
|
| 736 |
+
name = 'Python Traceback'
|
| 737 |
+
aliases = ['pytb', 'py3tb']
|
| 738 |
+
filenames = ['*.pytb', '*.py3tb']
|
| 739 |
+
mimetypes = ['text/x-python-traceback', 'text/x-python3-traceback']
|
| 740 |
+
url = 'https://python.org'
|
| 741 |
+
version_added = '1.0'
|
| 742 |
+
|
| 743 |
+
tokens = {
|
| 744 |
+
'root': [
|
| 745 |
+
(r'\n', Whitespace),
|
| 746 |
+
(r'^(\^C)?Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'),
|
| 747 |
+
(r'^During handling of the above exception, another '
|
| 748 |
+
r'exception occurred:\n\n', Generic.Traceback),
|
| 749 |
+
(r'^The above exception was the direct cause of the '
|
| 750 |
+
r'following exception:\n\n', Generic.Traceback),
|
| 751 |
+
(r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
|
| 752 |
+
(r'^.*\n', Other),
|
| 753 |
+
],
|
| 754 |
+
'intb': [
|
| 755 |
+
(r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
|
| 756 |
+
bygroups(Text, Name.Builtin, Text, Number, Text, Name, Whitespace)),
|
| 757 |
+
(r'^( File )("[^"]+")(, line )(\d+)(\n)',
|
| 758 |
+
bygroups(Text, Name.Builtin, Text, Number, Whitespace)),
|
| 759 |
+
(r'^( )(.+)(\n)',
|
| 760 |
+
bygroups(Whitespace, using(PythonLexer), Whitespace), 'markers'),
|
| 761 |
+
(r'^([ \t]*)(\.\.\.)(\n)',
|
| 762 |
+
bygroups(Whitespace, Comment, Whitespace)), # for doctests...
|
| 763 |
+
(r'^([^:]+)(: )(.+)(\n)',
|
| 764 |
+
bygroups(Generic.Error, Text, Name, Whitespace), '#pop'),
|
| 765 |
+
(r'^([a-zA-Z_][\w.]*)(:?\n)',
|
| 766 |
+
bygroups(Generic.Error, Whitespace), '#pop'),
|
| 767 |
+
default('#pop'),
|
| 768 |
+
],
|
| 769 |
+
'markers': [
|
| 770 |
+
# Either `PEP 657 <https://www.python.org/dev/peps/pep-0657/>`
|
| 771 |
+
# error locations in Python 3.11+, or single-caret markers
|
| 772 |
+
# for syntax errors before that.
|
| 773 |
+
(r'^( {4,})([~^]+)(\n)',
|
| 774 |
+
bygroups(Whitespace, Punctuation.Marker, Whitespace),
|
| 775 |
+
'#pop'),
|
| 776 |
+
default('#pop'),
|
| 777 |
+
],
|
| 778 |
+
}
|
| 779 |
+
|
| 780 |
+
|
| 781 |
+
Python3TracebackLexer = PythonTracebackLexer
|
| 782 |
+
|
| 783 |
+
|
| 784 |
+
class Python2TracebackLexer(RegexLexer):
|
| 785 |
+
"""
|
| 786 |
+
For Python tracebacks.
|
| 787 |
+
|
| 788 |
+
.. versionchanged:: 2.5
|
| 789 |
+
This class has been renamed from ``PythonTracebackLexer``.
|
| 790 |
+
``PythonTracebackLexer`` now refers to the Python 3 variant.
|
| 791 |
+
"""
|
| 792 |
+
|
| 793 |
+
name = 'Python 2.x Traceback'
|
| 794 |
+
aliases = ['py2tb']
|
| 795 |
+
filenames = ['*.py2tb']
|
| 796 |
+
mimetypes = ['text/x-python2-traceback']
|
| 797 |
+
url = 'https://python.org'
|
| 798 |
+
version_added = '0.7'
|
| 799 |
+
|
| 800 |
+
tokens = {
|
| 801 |
+
'root': [
|
| 802 |
+
# Cover both (most recent call last) and (innermost last)
|
| 803 |
+
# The optional ^C allows us to catch keyboard interrupt signals.
|
| 804 |
+
(r'^(\^C)?(Traceback.*\n)',
|
| 805 |
+
bygroups(Text, Generic.Traceback), 'intb'),
|
| 806 |
+
# SyntaxError starts with this.
|
| 807 |
+
(r'^(?= File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
|
| 808 |
+
(r'^.*\n', Other),
|
| 809 |
+
],
|
| 810 |
+
'intb': [
|
| 811 |
+
(r'^( File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
|
| 812 |
+
bygroups(Text, Name.Builtin, Text, Number, Text, Name, Whitespace)),
|
| 813 |
+
(r'^( File )("[^"]+")(, line )(\d+)(\n)',
|
| 814 |
+
bygroups(Text, Name.Builtin, Text, Number, Whitespace)),
|
| 815 |
+
(r'^( )(.+)(\n)',
|
| 816 |
+
bygroups(Text, using(Python2Lexer), Whitespace), 'marker'),
|
| 817 |
+
(r'^([ \t]*)(\.\.\.)(\n)',
|
| 818 |
+
bygroups(Text, Comment, Whitespace)), # for doctests...
|
| 819 |
+
(r'^([^:]+)(: )(.+)(\n)',
|
| 820 |
+
bygroups(Generic.Error, Text, Name, Whitespace), '#pop'),
|
| 821 |
+
(r'^([a-zA-Z_]\w*)(:?\n)',
|
| 822 |
+
bygroups(Generic.Error, Whitespace), '#pop')
|
| 823 |
+
],
|
| 824 |
+
'marker': [
|
| 825 |
+
# For syntax errors.
|
| 826 |
+
(r'( {4,})(\^)', bygroups(Text, Punctuation.Marker), '#pop'),
|
| 827 |
+
default('#pop'),
|
| 828 |
+
],
|
| 829 |
+
}
|
| 830 |
+
|
| 831 |
+
|
| 832 |
+
class CythonLexer(RegexLexer):
|
| 833 |
+
"""
|
| 834 |
+
For Pyrex and Cython source code.
|
| 835 |
+
"""
|
| 836 |
+
|
| 837 |
+
name = 'Cython'
|
| 838 |
+
url = 'https://cython.org'
|
| 839 |
+
aliases = ['cython', 'pyx', 'pyrex']
|
| 840 |
+
filenames = ['*.pyx', '*.pxd', '*.pxi']
|
| 841 |
+
mimetypes = ['text/x-cython', 'application/x-cython']
|
| 842 |
+
version_added = '1.1'
|
| 843 |
+
|
| 844 |
+
tokens = {
|
| 845 |
+
'root': [
|
| 846 |
+
(r'\n', Whitespace),
|
| 847 |
+
(r'^(\s*)("""(?:.|\n)*?""")', bygroups(Whitespace, String.Doc)),
|
| 848 |
+
(r"^(\s*)('''(?:.|\n)*?''')", bygroups(Whitespace, String.Doc)),
|
| 849 |
+
(r'[^\S\n]+', Text),
|
| 850 |
+
(r'#.*$', Comment),
|
| 851 |
+
(r'[]{}:(),;[]', Punctuation),
|
| 852 |
+
(r'\\\n', Whitespace),
|
| 853 |
+
(r'\\', Text),
|
| 854 |
+
(r'(in|is|and|or|not)\b', Operator.Word),
|
| 855 |
+
(r'(<)([a-zA-Z0-9.?]+)(>)',
|
| 856 |
+
bygroups(Punctuation, Keyword.Type, Punctuation)),
|
| 857 |
+
(r'!=|==|<<|>>|[-~+/*%=<>&^|.?]', Operator),
|
| 858 |
+
(r'(from)(\d+)(<=)(\s+)(<)(\d+)(:)',
|
| 859 |
+
bygroups(Keyword, Number.Integer, Operator, Whitespace, Operator,
|
| 860 |
+
Name, Punctuation)),
|
| 861 |
+
include('keywords'),
|
| 862 |
+
(r'(def|property)(\s+)', bygroups(Keyword, Whitespace), 'funcname'),
|
| 863 |
+
(r'(cp?def)(\s+)', bygroups(Keyword, Whitespace), 'cdef'),
|
| 864 |
+
# (should actually start a block with only cdefs)
|
| 865 |
+
(r'(cdef)(:)', bygroups(Keyword, Punctuation)),
|
| 866 |
+
(r'(class|cppclass|struct)(\s+)', bygroups(Keyword, Whitespace), 'classname'),
|
| 867 |
+
(r'(from)(\s+)', bygroups(Keyword, Whitespace), 'fromimport'),
|
| 868 |
+
(r'(c?import)(\s+)', bygroups(Keyword, Whitespace), 'import'),
|
| 869 |
+
include('builtins'),
|
| 870 |
+
include('backtick'),
|
| 871 |
+
('(?:[rR]|[uU][rR]|[rR][uU])"""', String, 'tdqs'),
|
| 872 |
+
("(?:[rR]|[uU][rR]|[rR][uU])'''", String, 'tsqs'),
|
| 873 |
+
('(?:[rR]|[uU][rR]|[rR][uU])"', String, 'dqs'),
|
| 874 |
+
("(?:[rR]|[uU][rR]|[rR][uU])'", String, 'sqs'),
|
| 875 |
+
('[uU]?"""', String, combined('stringescape', 'tdqs')),
|
| 876 |
+
("[uU]?'''", String, combined('stringescape', 'tsqs')),
|
| 877 |
+
('[uU]?"', String, combined('stringescape', 'dqs')),
|
| 878 |
+
("[uU]?'", String, combined('stringescape', 'sqs')),
|
| 879 |
+
include('name'),
|
| 880 |
+
include('numbers'),
|
| 881 |
+
],
|
| 882 |
+
'keywords': [
|
| 883 |
+
(words((
|
| 884 |
+
'assert', 'async', 'await', 'break', 'by', 'continue', 'ctypedef', 'del',
|
| 885 |
+
'elif', 'else', 'except', 'except?', 'exec', 'finally', 'for', 'fused', 'gil',
|
| 886 |
+
'global', 'if', 'include', 'lambda', 'namespace', 'new', 'noexcept','nogil',
|
| 887 |
+
'pass', 'print', 'raise', 'return', 'try', 'while', 'yield', 'as', 'with'),
|
| 888 |
+
suffix=r'\b'),
|
| 889 |
+
Keyword),
|
| 890 |
+
(words(('True', 'False', 'None', 'NULL'), suffix=r'\b'), Keyword.Constant),
|
| 891 |
+
(r'(DEF|IF|ELIF|ELSE)\b', Comment.Preproc),
|
| 892 |
+
],
|
| 893 |
+
'builtins': [
|
| 894 |
+
(words((
|
| 895 |
+
'__import__', 'abs', 'all', 'any', 'apply', 'basestring', 'bin', 'bint',
|
| 896 |
+
'bool', 'buffer', 'bytearray', 'bytes', 'callable', 'char', 'chr',
|
| 897 |
+
'classmethod', 'cmp', 'coerce', 'compile', 'complex', 'delattr',
|
| 898 |
+
'dict', 'dir', 'divmod', 'double', 'enumerate', 'eval', 'execfile', 'exit',
|
| 899 |
+
'file', 'filter', 'float', 'frozenset', 'getattr', 'globals',
|
| 900 |
+
'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'intern', 'isinstance',
|
| 901 |
+
'issubclass', 'iter', 'len', 'list', 'locals', 'long', 'map', 'max',
|
| 902 |
+
'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'property',
|
| 903 |
+
'Py_ssize_t', 'range', 'raw_input', 'reduce', 'reload', 'repr', 'reversed',
|
| 904 |
+
'round', 'set', 'setattr', 'size_t', 'slice', 'sorted', 'staticmethod',
|
| 905 |
+
'ssize_t', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
|
| 906 |
+
'unsigned', 'vars', 'xrange', 'zip'), prefix=r'(?<!\.)', suffix=r'\b'),
|
| 907 |
+
Name.Builtin),
|
| 908 |
+
(r'(?<!\.)(self|cls|Ellipsis|NotImplemented)\b', Name.Builtin.Pseudo),
|
| 909 |
+
(words((
|
| 910 |
+
'ArithmeticError', 'AssertionError', 'AttributeError',
|
| 911 |
+
'BaseException', 'DeprecationWarning', 'EOFError', 'EnvironmentError',
|
| 912 |
+
'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
|
| 913 |
+
'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
|
| 914 |
+
'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
|
| 915 |
+
'MemoryError', 'NameError', 'NotImplementedError',
|
| 916 |
+
'OSError', 'OverflowError', 'OverflowWarning',
|
| 917 |
+
'PendingDeprecationWarning', 'ReferenceError', 'RuntimeError',
|
| 918 |
+
'RuntimeWarning', 'StandardError', 'StopIteration', 'SyntaxError',
|
| 919 |
+
'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError',
|
| 920 |
+
'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
|
| 921 |
+
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError',
|
| 922 |
+
'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning',
|
| 923 |
+
'ZeroDivisionError'), prefix=r'(?<!\.)', suffix=r'\b'),
|
| 924 |
+
Name.Exception),
|
| 925 |
+
],
|
| 926 |
+
'numbers': [
|
| 927 |
+
(r'(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
| 928 |
+
(r'0\d+', Number.Oct),
|
| 929 |
+
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
| 930 |
+
(r'\d+L', Number.Integer.Long),
|
| 931 |
+
(r'\d+', Number.Integer)
|
| 932 |
+
],
|
| 933 |
+
'backtick': [
|
| 934 |
+
('`.*?`', String.Backtick),
|
| 935 |
+
],
|
| 936 |
+
'name': [
|
| 937 |
+
(r'@\w+', Name.Decorator),
|
| 938 |
+
(r'[a-zA-Z_]\w*', Name),
|
| 939 |
+
],
|
| 940 |
+
'funcname': [
|
| 941 |
+
(r'[a-zA-Z_]\w*', Name.Function, '#pop')
|
| 942 |
+
],
|
| 943 |
+
'cdef': [
|
| 944 |
+
(r"(public|readonly|extern|api|inline|packed)\b", Keyword.Reserved),
|
| 945 |
+
(r"(struct|enum|union|class|cppclass)\b(\s+)([a-zA-Z_]\w*)",
|
| 946 |
+
bygroups(Keyword, Whitespace, Name.Class), "#pop",),
|
| 947 |
+
(r"([a-zA-Z_]\w*)(\s*)(?=\()", bygroups(Name.Function, Whitespace), "#pop"),
|
| 948 |
+
(r"([a-zA-Z_]\w*)(\s*)(?=[:,=#\n]|$)", bygroups(Name.Variable, Whitespace), "#pop"),
|
| 949 |
+
(r"([a-zA-Z_]\w*)(\s*)(,)", bygroups(Name.Variable, Whitespace, Punctuation)),
|
| 950 |
+
(r'from\b', Keyword, '#pop'),
|
| 951 |
+
(r'as\b', Keyword),
|
| 952 |
+
(r':', Punctuation, '#pop'),
|
| 953 |
+
(r'(?=["\'])', Text, '#pop'),
|
| 954 |
+
(r'[a-zA-Z_]\w*', Keyword.Type),
|
| 955 |
+
(r'.', Text),
|
| 956 |
+
],
|
| 957 |
+
'classname': [
|
| 958 |
+
(r'[a-zA-Z_]\w*', Name.Class, '#pop')
|
| 959 |
+
],
|
| 960 |
+
'import': [
|
| 961 |
+
(r'(\s+)(as)(\s+)', bygroups(Whitespace, Keyword, Whitespace)),
|
| 962 |
+
(r'[a-zA-Z_][\w.]*', Name.Namespace),
|
| 963 |
+
(r'(\s*)(,)(\s*)', bygroups(Whitespace, Operator, Whitespace)),
|
| 964 |
+
default('#pop') # all else: go back
|
| 965 |
+
],
|
| 966 |
+
'fromimport': [
|
| 967 |
+
(r'(\s+)(c?import)\b', bygroups(Whitespace, Keyword), '#pop'),
|
| 968 |
+
(r'[a-zA-Z_.][\w.]*', Name.Namespace),
|
| 969 |
+
# ``cdef foo from "header"``, or ``for foo from 0 < i < 10``
|
| 970 |
+
default('#pop'),
|
| 971 |
+
],
|
| 972 |
+
'stringescape': [
|
| 973 |
+
(r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
| 974 |
+
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
| 975 |
+
],
|
| 976 |
+
'strings': [
|
| 977 |
+
(r'%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
| 978 |
+
'[hlL]?[E-GXc-giorsux%]', String.Interpol),
|
| 979 |
+
(r'[^\\\'"%\n]+', String),
|
| 980 |
+
# quotes, percents and backslashes must be parsed one at a time
|
| 981 |
+
(r'[\'"\\]', String),
|
| 982 |
+
# unhandled string formatting sign
|
| 983 |
+
(r'%', String)
|
| 984 |
+
# newlines are an error (use "nl" state)
|
| 985 |
+
],
|
| 986 |
+
'nl': [
|
| 987 |
+
(r'\n', String)
|
| 988 |
+
],
|
| 989 |
+
'dqs': [
|
| 990 |
+
(r'"', String, '#pop'),
|
| 991 |
+
(r'\\\\|\\"|\\\n', String.Escape), # included here again for raw strings
|
| 992 |
+
include('strings')
|
| 993 |
+
],
|
| 994 |
+
'sqs': [
|
| 995 |
+
(r"'", String, '#pop'),
|
| 996 |
+
(r"\\\\|\\'|\\\n", String.Escape), # included here again for raw strings
|
| 997 |
+
include('strings')
|
| 998 |
+
],
|
| 999 |
+
'tdqs': [
|
| 1000 |
+
(r'"""', String, '#pop'),
|
| 1001 |
+
include('strings'),
|
| 1002 |
+
include('nl')
|
| 1003 |
+
],
|
| 1004 |
+
'tsqs': [
|
| 1005 |
+
(r"'''", String, '#pop'),
|
| 1006 |
+
include('strings'),
|
| 1007 |
+
include('nl')
|
| 1008 |
+
],
|
| 1009 |
+
}
|
| 1010 |
+
|
| 1011 |
+
|
| 1012 |
+
class DgLexer(RegexLexer):
|
| 1013 |
+
"""
|
| 1014 |
+
Lexer for dg,
|
| 1015 |
+
a functional and object-oriented programming language
|
| 1016 |
+
running on the CPython 3 VM.
|
| 1017 |
+
"""
|
| 1018 |
+
name = 'dg'
|
| 1019 |
+
aliases = ['dg']
|
| 1020 |
+
filenames = ['*.dg']
|
| 1021 |
+
mimetypes = ['text/x-dg']
|
| 1022 |
+
url = 'http://pyos.github.io/dg'
|
| 1023 |
+
version_added = '1.6'
|
| 1024 |
+
|
| 1025 |
+
tokens = {
|
| 1026 |
+
'root': [
|
| 1027 |
+
(r'\s+', Text),
|
| 1028 |
+
(r'#.*?$', Comment.Single),
|
| 1029 |
+
|
| 1030 |
+
(r'(?i)0b[01]+', Number.Bin),
|
| 1031 |
+
(r'(?i)0o[0-7]+', Number.Oct),
|
| 1032 |
+
(r'(?i)0x[0-9a-f]+', Number.Hex),
|
| 1033 |
+
(r'(?i)[+-]?[0-9]+\.[0-9]+(e[+-]?[0-9]+)?j?', Number.Float),
|
| 1034 |
+
(r'(?i)[+-]?[0-9]+e[+-]?\d+j?', Number.Float),
|
| 1035 |
+
(r'(?i)[+-]?[0-9]+j?', Number.Integer),
|
| 1036 |
+
|
| 1037 |
+
(r"(?i)(br|r?b?)'''", String, combined('stringescape', 'tsqs', 'string')),
|
| 1038 |
+
(r'(?i)(br|r?b?)"""', String, combined('stringescape', 'tdqs', 'string')),
|
| 1039 |
+
(r"(?i)(br|r?b?)'", String, combined('stringescape', 'sqs', 'string')),
|
| 1040 |
+
(r'(?i)(br|r?b?)"', String, combined('stringescape', 'dqs', 'string')),
|
| 1041 |
+
|
| 1042 |
+
(r"`\w+'*`", Operator),
|
| 1043 |
+
(r'\b(and|in|is|or|where)\b', Operator.Word),
|
| 1044 |
+
(r'[!$%&*+\-./:<-@\\^|~;,]+', Operator),
|
| 1045 |
+
|
| 1046 |
+
(words((
|
| 1047 |
+
'bool', 'bytearray', 'bytes', 'classmethod', 'complex', 'dict', 'dict\'',
|
| 1048 |
+
'float', 'frozenset', 'int', 'list', 'list\'', 'memoryview', 'object',
|
| 1049 |
+
'property', 'range', 'set', 'set\'', 'slice', 'staticmethod', 'str',
|
| 1050 |
+
'super', 'tuple', 'tuple\'', 'type'),
|
| 1051 |
+
prefix=r'(?<!\.)', suffix=r'(?![\'\w])'),
|
| 1052 |
+
Name.Builtin),
|
| 1053 |
+
(words((
|
| 1054 |
+
'__import__', 'abs', 'all', 'any', 'bin', 'bind', 'chr', 'cmp', 'compile',
|
| 1055 |
+
'complex', 'delattr', 'dir', 'divmod', 'drop', 'dropwhile', 'enumerate',
|
| 1056 |
+
'eval', 'exhaust', 'filter', 'flip', 'foldl1?', 'format', 'fst',
|
| 1057 |
+
'getattr', 'globals', 'hasattr', 'hash', 'head', 'hex', 'id', 'init',
|
| 1058 |
+
'input', 'isinstance', 'issubclass', 'iter', 'iterate', 'last', 'len',
|
| 1059 |
+
'locals', 'map', 'max', 'min', 'next', 'oct', 'open', 'ord', 'pow',
|
| 1060 |
+
'print', 'repr', 'reversed', 'round', 'setattr', 'scanl1?', 'snd',
|
| 1061 |
+
'sorted', 'sum', 'tail', 'take', 'takewhile', 'vars', 'zip'),
|
| 1062 |
+
prefix=r'(?<!\.)', suffix=r'(?![\'\w])'),
|
| 1063 |
+
Name.Builtin),
|
| 1064 |
+
(r"(?<!\.)(self|Ellipsis|NotImplemented|None|True|False)(?!['\w])",
|
| 1065 |
+
Name.Builtin.Pseudo),
|
| 1066 |
+
|
| 1067 |
+
(r"(?<!\.)[A-Z]\w*(Error|Exception|Warning)'*(?!['\w])",
|
| 1068 |
+
Name.Exception),
|
| 1069 |
+
(r"(?<!\.)(Exception|GeneratorExit|KeyboardInterrupt|StopIteration|"
|
| 1070 |
+
r"SystemExit)(?!['\w])", Name.Exception),
|
| 1071 |
+
|
| 1072 |
+
(r"(?<![\w.])(except|finally|for|if|import|not|otherwise|raise|"
|
| 1073 |
+
r"subclass|while|with|yield)(?!['\w])", Keyword.Reserved),
|
| 1074 |
+
|
| 1075 |
+
(r"[A-Z_]+'*(?!['\w])", Name),
|
| 1076 |
+
(r"[A-Z]\w+'*(?!['\w])", Keyword.Type),
|
| 1077 |
+
(r"\w+'*", Name),
|
| 1078 |
+
|
| 1079 |
+
(r'[()]', Punctuation),
|
| 1080 |
+
(r'.', Error),
|
| 1081 |
+
],
|
| 1082 |
+
'stringescape': [
|
| 1083 |
+
(r'\\([\\abfnrtv"\']|\n|N\{.*?\}|u[a-fA-F0-9]{4}|'
|
| 1084 |
+
r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
|
| 1085 |
+
],
|
| 1086 |
+
'string': [
|
| 1087 |
+
(r'%(\(\w+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
|
| 1088 |
+
'[hlL]?[E-GXc-giorsux%]', String.Interpol),
|
| 1089 |
+
(r'[^\\\'"%\n]+', String),
|
| 1090 |
+
# quotes, percents and backslashes must be parsed one at a time
|
| 1091 |
+
(r'[\'"\\]', String),
|
| 1092 |
+
# unhandled string formatting sign
|
| 1093 |
+
(r'%', String),
|
| 1094 |
+
(r'\n', String)
|
| 1095 |
+
],
|
| 1096 |
+
'dqs': [
|
| 1097 |
+
(r'"', String, '#pop')
|
| 1098 |
+
],
|
| 1099 |
+
'sqs': [
|
| 1100 |
+
(r"'", String, '#pop')
|
| 1101 |
+
],
|
| 1102 |
+
'tdqs': [
|
| 1103 |
+
(r'"""', String, '#pop')
|
| 1104 |
+
],
|
| 1105 |
+
'tsqs': [
|
| 1106 |
+
(r"'''", String, '#pop')
|
| 1107 |
+
],
|
| 1108 |
+
}
|
| 1109 |
+
|
| 1110 |
+
|
| 1111 |
+
class NumPyLexer(PythonLexer):
|
| 1112 |
+
"""
|
| 1113 |
+
A Python lexer recognizing Numerical Python builtins.
|
| 1114 |
+
"""
|
| 1115 |
+
|
| 1116 |
+
name = 'NumPy'
|
| 1117 |
+
url = 'https://numpy.org/'
|
| 1118 |
+
aliases = ['numpy']
|
| 1119 |
+
version_added = '0.10'
|
| 1120 |
+
|
| 1121 |
+
# override the mimetypes to not inherit them from python
|
| 1122 |
+
mimetypes = []
|
| 1123 |
+
filenames = []
|
| 1124 |
+
|
| 1125 |
+
EXTRA_KEYWORDS = {
|
| 1126 |
+
'abs', 'absolute', 'accumulate', 'add', 'alen', 'all', 'allclose',
|
| 1127 |
+
'alltrue', 'alterdot', 'amax', 'amin', 'angle', 'any', 'append',
|
| 1128 |
+
'apply_along_axis', 'apply_over_axes', 'arange', 'arccos', 'arccosh',
|
| 1129 |
+
'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'argmax', 'argmin',
|
| 1130 |
+
'argsort', 'argwhere', 'around', 'array', 'array2string', 'array_equal',
|
| 1131 |
+
'array_equiv', 'array_repr', 'array_split', 'array_str', 'arrayrange',
|
| 1132 |
+
'asanyarray', 'asarray', 'asarray_chkfinite', 'ascontiguousarray',
|
| 1133 |
+
'asfarray', 'asfortranarray', 'asmatrix', 'asscalar', 'astype',
|
| 1134 |
+
'atleast_1d', 'atleast_2d', 'atleast_3d', 'average', 'bartlett',
|
| 1135 |
+
'base_repr', 'beta', 'binary_repr', 'bincount', 'binomial',
|
| 1136 |
+
'bitwise_and', 'bitwise_not', 'bitwise_or', 'bitwise_xor', 'blackman',
|
| 1137 |
+
'bmat', 'broadcast', 'byte_bounds', 'bytes', 'byteswap', 'c_',
|
| 1138 |
+
'can_cast', 'ceil', 'choose', 'clip', 'column_stack', 'common_type',
|
| 1139 |
+
'compare_chararrays', 'compress', 'concatenate', 'conj', 'conjugate',
|
| 1140 |
+
'convolve', 'copy', 'corrcoef', 'correlate', 'cos', 'cosh', 'cov',
|
| 1141 |
+
'cross', 'cumprod', 'cumproduct', 'cumsum', 'delete', 'deprecate',
|
| 1142 |
+
'diag', 'diagflat', 'diagonal', 'diff', 'digitize', 'disp', 'divide',
|
| 1143 |
+
'dot', 'dsplit', 'dstack', 'dtype', 'dump', 'dumps', 'ediff1d', 'empty',
|
| 1144 |
+
'empty_like', 'equal', 'exp', 'expand_dims', 'expm1', 'extract', 'eye',
|
| 1145 |
+
'fabs', 'fastCopyAndTranspose', 'fft', 'fftfreq', 'fftshift', 'fill',
|
| 1146 |
+
'finfo', 'fix', 'flat', 'flatnonzero', 'flatten', 'fliplr', 'flipud',
|
| 1147 |
+
'floor', 'floor_divide', 'fmod', 'frexp', 'fromarrays', 'frombuffer',
|
| 1148 |
+
'fromfile', 'fromfunction', 'fromiter', 'frompyfunc', 'fromstring',
|
| 1149 |
+
'generic', 'get_array_wrap', 'get_include', 'get_numarray_include',
|
| 1150 |
+
'get_numpy_include', 'get_printoptions', 'getbuffer', 'getbufsize',
|
| 1151 |
+
'geterr', 'geterrcall', 'geterrobj', 'getfield', 'gradient', 'greater',
|
| 1152 |
+
'greater_equal', 'gumbel', 'hamming', 'hanning', 'histogram',
|
| 1153 |
+
'histogram2d', 'histogramdd', 'hsplit', 'hstack', 'hypot', 'i0',
|
| 1154 |
+
'identity', 'ifft', 'imag', 'index_exp', 'indices', 'inf', 'info',
|
| 1155 |
+
'inner', 'insert', 'int_asbuffer', 'interp', 'intersect1d',
|
| 1156 |
+
'intersect1d_nu', 'inv', 'invert', 'iscomplex', 'iscomplexobj',
|
| 1157 |
+
'isfinite', 'isfortran', 'isinf', 'isnan', 'isneginf', 'isposinf',
|
| 1158 |
+
'isreal', 'isrealobj', 'isscalar', 'issctype', 'issubclass_',
|
| 1159 |
+
'issubdtype', 'issubsctype', 'item', 'itemset', 'iterable', 'ix_',
|
| 1160 |
+
'kaiser', 'kron', 'ldexp', 'left_shift', 'less', 'less_equal', 'lexsort',
|
| 1161 |
+
'linspace', 'load', 'loads', 'loadtxt', 'log', 'log10', 'log1p', 'log2',
|
| 1162 |
+
'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'logspace',
|
| 1163 |
+
'lstsq', 'mat', 'matrix', 'max', 'maximum', 'maximum_sctype',
|
| 1164 |
+
'may_share_memory', 'mean', 'median', 'meshgrid', 'mgrid', 'min',
|
| 1165 |
+
'minimum', 'mintypecode', 'mod', 'modf', 'msort', 'multiply', 'nan',
|
| 1166 |
+
'nan_to_num', 'nanargmax', 'nanargmin', 'nanmax', 'nanmin', 'nansum',
|
| 1167 |
+
'ndenumerate', 'ndim', 'ndindex', 'negative', 'newaxis', 'newbuffer',
|
| 1168 |
+
'newbyteorder', 'nonzero', 'not_equal', 'obj2sctype', 'ogrid', 'ones',
|
| 1169 |
+
'ones_like', 'outer', 'permutation', 'piecewise', 'pinv', 'pkgload',
|
| 1170 |
+
'place', 'poisson', 'poly', 'poly1d', 'polyadd', 'polyder', 'polydiv',
|
| 1171 |
+
'polyfit', 'polyint', 'polymul', 'polysub', 'polyval', 'power', 'prod',
|
| 1172 |
+
'product', 'ptp', 'put', 'putmask', 'r_', 'randint', 'random_integers',
|
| 1173 |
+
'random_sample', 'ranf', 'rank', 'ravel', 'real', 'real_if_close',
|
| 1174 |
+
'recarray', 'reciprocal', 'reduce', 'remainder', 'repeat', 'require',
|
| 1175 |
+
'reshape', 'resize', 'restoredot', 'right_shift', 'rint', 'roll',
|
| 1176 |
+
'rollaxis', 'roots', 'rot90', 'round', 'round_', 'row_stack', 's_',
|
| 1177 |
+
'sample', 'savetxt', 'sctype2char', 'searchsorted', 'seed', 'select',
|
| 1178 |
+
'set_numeric_ops', 'set_printoptions', 'set_string_function',
|
| 1179 |
+
'setbufsize', 'setdiff1d', 'seterr', 'seterrcall', 'seterrobj',
|
| 1180 |
+
'setfield', 'setflags', 'setmember1d', 'setxor1d', 'shape',
|
| 1181 |
+
'show_config', 'shuffle', 'sign', 'signbit', 'sin', 'sinc', 'sinh',
|
| 1182 |
+
'size', 'slice', 'solve', 'sometrue', 'sort', 'sort_complex', 'source',
|
| 1183 |
+
'split', 'sqrt', 'square', 'squeeze', 'standard_normal', 'std',
|
| 1184 |
+
'subtract', 'sum', 'svd', 'swapaxes', 'take', 'tan', 'tanh', 'tensordot',
|
| 1185 |
+
'test', 'tile', 'tofile', 'tolist', 'tostring', 'trace', 'transpose',
|
| 1186 |
+
'trapz', 'tri', 'tril', 'trim_zeros', 'triu', 'true_divide', 'typeDict',
|
| 1187 |
+
'typename', 'uniform', 'union1d', 'unique', 'unique1d', 'unravel_index',
|
| 1188 |
+
'unwrap', 'vander', 'var', 'vdot', 'vectorize', 'view', 'vonmises',
|
| 1189 |
+
'vsplit', 'vstack', 'weibull', 'where', 'who', 'zeros', 'zeros_like'
|
| 1190 |
+
}
|
| 1191 |
+
|
| 1192 |
+
def get_tokens_unprocessed(self, text):
|
| 1193 |
+
for index, token, value in \
|
| 1194 |
+
PythonLexer.get_tokens_unprocessed(self, text):
|
| 1195 |
+
if token is Name and value in self.EXTRA_KEYWORDS:
|
| 1196 |
+
yield index, Keyword.Pseudo, value
|
| 1197 |
+
else:
|
| 1198 |
+
yield index, token, value
|
| 1199 |
+
|
| 1200 |
+
def analyse_text(text):
|
| 1201 |
+
ltext = text[:1000]
|
| 1202 |
+
return (shebang_matches(text, r'pythonw?(3(\.\d)?)?') or
|
| 1203 |
+
'import ' in ltext) \
|
| 1204 |
+
and ('import numpy' in ltext or 'from numpy import' in ltext)
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/q.py
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.q
|
| 3 |
+
~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the Q programming language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, words, include, bygroups, inherit
|
| 12 |
+
from pygments.token import Comment, Name, Number, Operator, Punctuation, \
|
| 13 |
+
String, Whitespace, Literal, Generic
|
| 14 |
+
|
| 15 |
+
__all__ = ["KLexer", "QLexer"]
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class KLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For K source code.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
name = "K"
|
| 24 |
+
aliases = ["k"]
|
| 25 |
+
filenames = ["*.k"]
|
| 26 |
+
url = "https://code.kx.com"
|
| 27 |
+
version_added = '2.12'
|
| 28 |
+
|
| 29 |
+
tokens = {
|
| 30 |
+
"whitespace": [
|
| 31 |
+
# hashbang script
|
| 32 |
+
(r"^#!.*", Comment.Hashbang),
|
| 33 |
+
# Comments
|
| 34 |
+
(r"^/\s*\n", Comment.Multiline, "comments"),
|
| 35 |
+
(r"(?<!\S)/.*", Comment.Single),
|
| 36 |
+
# Whitespace
|
| 37 |
+
(r"\s+", Whitespace),
|
| 38 |
+
# Strings
|
| 39 |
+
(r"\"", String.Double, "strings"),
|
| 40 |
+
],
|
| 41 |
+
"root": [
|
| 42 |
+
include("whitespace"),
|
| 43 |
+
include("keywords"),
|
| 44 |
+
include("declarations"),
|
| 45 |
+
],
|
| 46 |
+
"keywords": [
|
| 47 |
+
(words(("abs", "acos", "asin", "atan", "avg", "bin",
|
| 48 |
+
"binr", "by", "cor", "cos", "cov", "dev",
|
| 49 |
+
"delete", "div", "do", "enlist", "exec", "exit",
|
| 50 |
+
"exp", "from", "getenv", "hopen", "if", "in",
|
| 51 |
+
"insert", "last", "like", "log", "max", "min",
|
| 52 |
+
"prd", "select", "setenv", "sin", "sqrt", "ss",
|
| 53 |
+
"sum", "tan", "update", "var", "wavg", "while",
|
| 54 |
+
"within", "wsum", "xexp"),
|
| 55 |
+
suffix=r"\b"), Operator.Word),
|
| 56 |
+
],
|
| 57 |
+
"declarations": [
|
| 58 |
+
# Timing
|
| 59 |
+
(r"^\\ts?", Comment.Preproc),
|
| 60 |
+
(r"^(\\\w\s+[^/\n]*?)(/.*)",
|
| 61 |
+
bygroups(Comment.Preproc, Comment.Single)),
|
| 62 |
+
# Generic System Commands
|
| 63 |
+
(r"^\\\w.*", Comment.Preproc),
|
| 64 |
+
# Prompt
|
| 65 |
+
(r"^[a-zA-Z]\)", Generic.Prompt),
|
| 66 |
+
# Function Names
|
| 67 |
+
(r"([.]?[a-zA-Z][\w.]*)(\s*)([-.~=!@#$%^&*_+|,<>?/\\:']?:)(\s*)(\{)",
|
| 68 |
+
bygroups(Name.Function, Whitespace, Operator, Whitespace, Punctuation),
|
| 69 |
+
"functions"),
|
| 70 |
+
# Variable Names
|
| 71 |
+
(r"([.]?[a-zA-Z][\w.]*)(\s*)([-.~=!@#$%^&*_+|,<>?/\\:']?:)",
|
| 72 |
+
bygroups(Name.Variable, Whitespace, Operator)),
|
| 73 |
+
# Functions
|
| 74 |
+
(r"\{", Punctuation, "functions"),
|
| 75 |
+
# Parentheses
|
| 76 |
+
(r"\(", Punctuation, "parentheses"),
|
| 77 |
+
# Brackets
|
| 78 |
+
(r"\[", Punctuation, "brackets"),
|
| 79 |
+
# Errors
|
| 80 |
+
(r"'`([a-zA-Z][\w.]*)?", Name.Exception),
|
| 81 |
+
# File Symbols
|
| 82 |
+
(r"`:([a-zA-Z/][\w./]*)?", String.Symbol),
|
| 83 |
+
# Symbols
|
| 84 |
+
(r"`([a-zA-Z][\w.]*)?", String.Symbol),
|
| 85 |
+
# Numbers
|
| 86 |
+
include("numbers"),
|
| 87 |
+
# Variable Names
|
| 88 |
+
(r"[a-zA-Z][\w.]*", Name),
|
| 89 |
+
# Operators
|
| 90 |
+
(r"[-=+*#$%@!~^&:.,<>'\\|/?_]", Operator),
|
| 91 |
+
# Punctuation
|
| 92 |
+
(r";", Punctuation),
|
| 93 |
+
],
|
| 94 |
+
"functions": [
|
| 95 |
+
include("root"),
|
| 96 |
+
(r"\}", Punctuation, "#pop"),
|
| 97 |
+
],
|
| 98 |
+
"parentheses": [
|
| 99 |
+
include("root"),
|
| 100 |
+
(r"\)", Punctuation, "#pop"),
|
| 101 |
+
],
|
| 102 |
+
"brackets": [
|
| 103 |
+
include("root"),
|
| 104 |
+
(r"\]", Punctuation, "#pop"),
|
| 105 |
+
],
|
| 106 |
+
"numbers": [
|
| 107 |
+
# Binary Values
|
| 108 |
+
(r"[01]+b", Number.Bin),
|
| 109 |
+
# Nulls/Infinities
|
| 110 |
+
(r"0[nNwW][cefghijmndzuvtp]?", Number),
|
| 111 |
+
# Timestamps
|
| 112 |
+
((r"(?:[0-9]{4}[.][0-9]{2}[.][0-9]{2}|[0-9]+)"
|
| 113 |
+
"D(?:[0-9](?:[0-9](?::[0-9]{2}"
|
| 114 |
+
"(?::[0-9]{2}(?:[.][0-9]*)?)?)?)?)?"), Literal.Date),
|
| 115 |
+
# Datetimes
|
| 116 |
+
((r"[0-9]{4}[.][0-9]{2}"
|
| 117 |
+
"(?:m|[.][0-9]{2}(?:T(?:[0-9]{2}:[0-9]{2}"
|
| 118 |
+
"(?::[0-9]{2}(?:[.][0-9]*)?)?)?)?)"), Literal.Date),
|
| 119 |
+
# Times
|
| 120 |
+
(r"[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:[.][0-9]{1,3})?)?",
|
| 121 |
+
Literal.Date),
|
| 122 |
+
# GUIDs
|
| 123 |
+
(r"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
|
| 124 |
+
Number.Hex),
|
| 125 |
+
# Byte Vectors
|
| 126 |
+
(r"0x[0-9a-fA-F]+", Number.Hex),
|
| 127 |
+
# Floats
|
| 128 |
+
(r"([0-9]*[.]?[0-9]+|[0-9]+[.]?[0-9]*)[eE][+-]?[0-9]+[ef]?",
|
| 129 |
+
Number.Float),
|
| 130 |
+
(r"([0-9]*[.][0-9]+|[0-9]+[.][0-9]*)[ef]?", Number.Float),
|
| 131 |
+
(r"[0-9]+[ef]", Number.Float),
|
| 132 |
+
# Characters
|
| 133 |
+
(r"[0-9]+c", Number),
|
| 134 |
+
# Integers
|
| 135 |
+
(r"[0-9]+[ihtuv]", Number.Integer),
|
| 136 |
+
# Long Integers
|
| 137 |
+
(r"[0-9]+[jnp]?", Number.Integer.Long),
|
| 138 |
+
],
|
| 139 |
+
"comments": [
|
| 140 |
+
(r"[^\\]+", Comment.Multiline),
|
| 141 |
+
(r"^\\", Comment.Multiline, "#pop"),
|
| 142 |
+
(r"\\", Comment.Multiline),
|
| 143 |
+
],
|
| 144 |
+
"strings": [
|
| 145 |
+
(r'[^"\\]+', String.Double),
|
| 146 |
+
(r"\\.", String.Escape),
|
| 147 |
+
(r'"', String.Double, "#pop"),
|
| 148 |
+
],
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
class QLexer(KLexer):
|
| 153 |
+
"""
|
| 154 |
+
For `Q <https://code.kx.com/>`_ source code.
|
| 155 |
+
"""
|
| 156 |
+
|
| 157 |
+
name = "Q"
|
| 158 |
+
aliases = ["q"]
|
| 159 |
+
filenames = ["*.q"]
|
| 160 |
+
version_added = '2.12'
|
| 161 |
+
|
| 162 |
+
tokens = {
|
| 163 |
+
"root": [
|
| 164 |
+
(words(("aj", "aj0", "ajf", "ajf0", "all", "and", "any", "asc",
|
| 165 |
+
"asof", "attr", "avgs", "ceiling", "cols", "count", "cross",
|
| 166 |
+
"csv", "cut", "deltas", "desc", "differ", "distinct", "dsave",
|
| 167 |
+
"each", "ej", "ema", "eval", "except", "fby", "fills", "first",
|
| 168 |
+
"fkeys", "flip", "floor", "get", "group", "gtime", "hclose",
|
| 169 |
+
"hcount", "hdel", "hsym", "iasc", "idesc", "ij", "ijf",
|
| 170 |
+
"inter", "inv", "key", "keys", "lj", "ljf", "load", "lower",
|
| 171 |
+
"lsq", "ltime", "ltrim", "mavg", "maxs", "mcount", "md5",
|
| 172 |
+
"mdev", "med", "meta", "mins", "mmax", "mmin", "mmu", "mod",
|
| 173 |
+
"msum", "neg", "next", "not", "null", "or", "over", "parse",
|
| 174 |
+
"peach", "pj", "prds", "prior", "prev", "rand", "rank", "ratios",
|
| 175 |
+
"raze", "read0", "read1", "reciprocal", "reval", "reverse",
|
| 176 |
+
"rload", "rotate", "rsave", "rtrim", "save", "scan", "scov",
|
| 177 |
+
"sdev", "set", "show", "signum", "ssr", "string", "sublist",
|
| 178 |
+
"sums", "sv", "svar", "system", "tables", "til", "trim", "txf",
|
| 179 |
+
"type", "uj", "ujf", "ungroup", "union", "upper", "upsert",
|
| 180 |
+
"value", "view", "views", "vs", "where", "wj", "wj1", "ww",
|
| 181 |
+
"xasc", "xbar", "xcol", "xcols", "xdesc", "xgroup", "xkey",
|
| 182 |
+
"xlog", "xprev", "xrank"),
|
| 183 |
+
suffix=r"\b"), Name.Builtin,
|
| 184 |
+
),
|
| 185 |
+
inherit,
|
| 186 |
+
],
|
| 187 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/qlik.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.qlik
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the qlik scripting language
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, include, bygroups, words
|
| 14 |
+
from pygments.token import Comment, Keyword, Name, Number, Operator, \
|
| 15 |
+
Punctuation, String, Text
|
| 16 |
+
from pygments.lexers._qlik_builtins import OPERATORS_LIST, STATEMENT_LIST, \
|
| 17 |
+
SCRIPT_FUNCTIONS, CONSTANT_LIST
|
| 18 |
+
|
| 19 |
+
__all__ = ["QlikLexer"]
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class QlikLexer(RegexLexer):
|
| 23 |
+
"""
|
| 24 |
+
Lexer for qlik code, including .qvs files
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
name = "Qlik"
|
| 28 |
+
aliases = ["qlik", "qlikview", "qliksense", "qlikscript"]
|
| 29 |
+
filenames = ["*.qvs", "*.qvw"]
|
| 30 |
+
url = "https://qlik.com"
|
| 31 |
+
version_added = '2.12'
|
| 32 |
+
|
| 33 |
+
flags = re.IGNORECASE
|
| 34 |
+
|
| 35 |
+
tokens = {
|
| 36 |
+
# Handle multi-line comments
|
| 37 |
+
"comment": [
|
| 38 |
+
(r"\*/", Comment.Multiline, "#pop"),
|
| 39 |
+
(r"[^*]+", Comment.Multiline),
|
| 40 |
+
],
|
| 41 |
+
# Handle numbers
|
| 42 |
+
"numerics": [
|
| 43 |
+
(r"\b\d+\.\d+(e\d+)?[fd]?\b", Number.Float),
|
| 44 |
+
(r"\b\d+\b", Number.Integer),
|
| 45 |
+
],
|
| 46 |
+
# Handle variable names in things
|
| 47 |
+
"interp": [
|
| 48 |
+
(
|
| 49 |
+
r"(\$\()(\w+)(\))",
|
| 50 |
+
bygroups(String.Interpol, Name.Variable, String.Interpol),
|
| 51 |
+
),
|
| 52 |
+
],
|
| 53 |
+
# Handle strings
|
| 54 |
+
"string": [
|
| 55 |
+
(r"'", String, "#pop"),
|
| 56 |
+
include("interp"),
|
| 57 |
+
(r"[^'$]+", String),
|
| 58 |
+
(r"\$", String),
|
| 59 |
+
],
|
| 60 |
+
#
|
| 61 |
+
"assignment": [
|
| 62 |
+
(r";", Punctuation, "#pop"),
|
| 63 |
+
include("root"),
|
| 64 |
+
],
|
| 65 |
+
"field_name_quote": [
|
| 66 |
+
(r'"', String.Symbol, "#pop"),
|
| 67 |
+
include("interp"),
|
| 68 |
+
(r"[^\"$]+", String.Symbol),
|
| 69 |
+
(r"\$", String.Symbol),
|
| 70 |
+
],
|
| 71 |
+
"field_name_bracket": [
|
| 72 |
+
(r"\]", String.Symbol, "#pop"),
|
| 73 |
+
include("interp"),
|
| 74 |
+
(r"[^\]$]+", String.Symbol),
|
| 75 |
+
(r"\$", String.Symbol),
|
| 76 |
+
],
|
| 77 |
+
"function": [(r"\)", Punctuation, "#pop"), include("root")],
|
| 78 |
+
"root": [
|
| 79 |
+
# Whitespace and comments
|
| 80 |
+
(r"\s+", Text.Whitespace),
|
| 81 |
+
(r"/\*", Comment.Multiline, "comment"),
|
| 82 |
+
(r"//.*\n", Comment.Single),
|
| 83 |
+
# variable assignment
|
| 84 |
+
(r"(let|set)(\s+)", bygroups(Keyword.Declaration, Text.Whitespace),
|
| 85 |
+
"assignment"),
|
| 86 |
+
# Word operators
|
| 87 |
+
(words(OPERATORS_LIST["words"], prefix=r"\b", suffix=r"\b"),
|
| 88 |
+
Operator.Word),
|
| 89 |
+
# Statements
|
| 90 |
+
(words(STATEMENT_LIST, suffix=r"\b"), Keyword),
|
| 91 |
+
# Table names
|
| 92 |
+
(r"[a-z]\w*:", Keyword.Declaration),
|
| 93 |
+
# Constants
|
| 94 |
+
(words(CONSTANT_LIST, suffix=r"\b"), Keyword.Constant),
|
| 95 |
+
# Functions
|
| 96 |
+
(words(SCRIPT_FUNCTIONS, suffix=r"(?=\s*\()"), Name.Builtin,
|
| 97 |
+
"function"),
|
| 98 |
+
# interpolation - e.g. $(variableName)
|
| 99 |
+
include("interp"),
|
| 100 |
+
# Quotes denote a field/file name
|
| 101 |
+
(r'"', String.Symbol, "field_name_quote"),
|
| 102 |
+
# Square brackets denote a field/file name
|
| 103 |
+
(r"\[", String.Symbol, "field_name_bracket"),
|
| 104 |
+
# Strings
|
| 105 |
+
(r"'", String, "string"),
|
| 106 |
+
# Numbers
|
| 107 |
+
include("numerics"),
|
| 108 |
+
# Operator symbols
|
| 109 |
+
(words(OPERATORS_LIST["symbols"]), Operator),
|
| 110 |
+
# Strings denoted by single quotes
|
| 111 |
+
(r"'.+?'", String),
|
| 112 |
+
# Words as text
|
| 113 |
+
(r"\b\w+\b", Text),
|
| 114 |
+
# Basic punctuation
|
| 115 |
+
(r"[,;.()\\/]", Punctuation),
|
| 116 |
+
],
|
| 117 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/qvt.py
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.qvt
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for QVT Operational language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups, include, combined, default, \
|
| 12 |
+
words
|
| 13 |
+
from pygments.token import Text, Comment, Operator, Keyword, Punctuation, \
|
| 14 |
+
Name, String, Number
|
| 15 |
+
|
| 16 |
+
__all__ = ['QVToLexer']
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class QVToLexer(RegexLexer):
|
| 20 |
+
"""
|
| 21 |
+
For the QVT Operational Mapping language.
|
| 22 |
+
|
| 23 |
+
Reference for implementing this: «Meta Object Facility (MOF) 2.0
|
| 24 |
+
Query/View/Transformation Specification», Version 1.1 - January 2011
|
| 25 |
+
(https://www.omg.org/spec/QVT/1.1/), see §8.4, «Concrete Syntax» in
|
| 26 |
+
particular.
|
| 27 |
+
|
| 28 |
+
Notable tokens assignments:
|
| 29 |
+
|
| 30 |
+
- Name.Class is assigned to the identifier following any of the following
|
| 31 |
+
keywords: metamodel, class, exception, primitive, enum, transformation
|
| 32 |
+
or library
|
| 33 |
+
|
| 34 |
+
- Name.Function is assigned to the names of mappings and queries
|
| 35 |
+
|
| 36 |
+
- Name.Builtin.Pseudo is assigned to the pre-defined variables 'this',
|
| 37 |
+
'self' and 'result'.
|
| 38 |
+
"""
|
| 39 |
+
# With obvious borrowings & inspiration from the Java, Python and C lexers
|
| 40 |
+
|
| 41 |
+
name = 'QVTO'
|
| 42 |
+
aliases = ['qvto', 'qvt']
|
| 43 |
+
filenames = ['*.qvto']
|
| 44 |
+
url = 'https://www.omg.org/spec/QVT/1.1'
|
| 45 |
+
version_added = ''
|
| 46 |
+
|
| 47 |
+
tokens = {
|
| 48 |
+
'root': [
|
| 49 |
+
(r'\n', Text),
|
| 50 |
+
(r'[^\S\n]+', Text),
|
| 51 |
+
(r'(--|//)(\s*)(directive:)?(.*)$',
|
| 52 |
+
bygroups(Comment, Comment, Comment.Preproc, Comment)),
|
| 53 |
+
# Uncomment the following if you want to distinguish between
|
| 54 |
+
# '/*' and '/**', à la javadoc
|
| 55 |
+
# (r'/[*]{2}(.|\n)*?[*]/', Comment.Multiline),
|
| 56 |
+
(r'/[*](.|\n)*?[*]/', Comment.Multiline),
|
| 57 |
+
(r'\\\n', Text),
|
| 58 |
+
(r'(and|not|or|xor|##?)\b', Operator.Word),
|
| 59 |
+
(r'(:{1,2}=|[-+]=)\b', Operator.Word),
|
| 60 |
+
(r'(@|<<|>>)\b', Keyword), # stereotypes
|
| 61 |
+
(r'!=|<>|==|=|!->|->|>=|<=|[.]{3}|[+/*%=<>&|.~]', Operator),
|
| 62 |
+
(r'[]{}:(),;[]', Punctuation),
|
| 63 |
+
(r'(true|false|unlimited|null)\b', Keyword.Constant),
|
| 64 |
+
(r'(this|self|result)\b', Name.Builtin.Pseudo),
|
| 65 |
+
(r'(var)\b', Keyword.Declaration),
|
| 66 |
+
(r'(from|import)\b', Keyword.Namespace, 'fromimport'),
|
| 67 |
+
(r'(metamodel|class|exception|primitive|enum|transformation|'
|
| 68 |
+
r'library)(\s+)(\w+)',
|
| 69 |
+
bygroups(Keyword.Word, Text, Name.Class)),
|
| 70 |
+
(r'(exception)(\s+)(\w+)',
|
| 71 |
+
bygroups(Keyword.Word, Text, Name.Exception)),
|
| 72 |
+
(r'(main)\b', Name.Function),
|
| 73 |
+
(r'(mapping|helper|query)(\s+)',
|
| 74 |
+
bygroups(Keyword.Declaration, Text), 'operation'),
|
| 75 |
+
(r'(assert)(\s+)\b', bygroups(Keyword, Text), 'assert'),
|
| 76 |
+
(r'(Bag|Collection|Dict|OrderedSet|Sequence|Set|Tuple|List)\b',
|
| 77 |
+
Keyword.Type),
|
| 78 |
+
include('keywords'),
|
| 79 |
+
('"', String, combined('stringescape', 'dqs')),
|
| 80 |
+
("'", String, combined('stringescape', 'sqs')),
|
| 81 |
+
include('name'),
|
| 82 |
+
include('numbers'),
|
| 83 |
+
# (r'([a-zA-Z_]\w*)(::)([a-zA-Z_]\w*)',
|
| 84 |
+
# bygroups(Text, Text, Text)),
|
| 85 |
+
],
|
| 86 |
+
|
| 87 |
+
'fromimport': [
|
| 88 |
+
(r'(?:[ \t]|\\\n)+', Text),
|
| 89 |
+
(r'[a-zA-Z_][\w.]*', Name.Namespace),
|
| 90 |
+
default('#pop'),
|
| 91 |
+
],
|
| 92 |
+
|
| 93 |
+
'operation': [
|
| 94 |
+
(r'::', Text),
|
| 95 |
+
(r'(.*::)([a-zA-Z_]\w*)([ \t]*)(\()',
|
| 96 |
+
bygroups(Text, Name.Function, Text, Punctuation), '#pop')
|
| 97 |
+
],
|
| 98 |
+
|
| 99 |
+
'assert': [
|
| 100 |
+
(r'(warning|error|fatal)\b', Keyword, '#pop'),
|
| 101 |
+
default('#pop'), # all else: go back
|
| 102 |
+
],
|
| 103 |
+
|
| 104 |
+
'keywords': [
|
| 105 |
+
(words((
|
| 106 |
+
'abstract', 'access', 'any', 'assert', 'blackbox', 'break',
|
| 107 |
+
'case', 'collect', 'collectNested', 'collectOne', 'collectselect',
|
| 108 |
+
'collectselectOne', 'composes', 'compute', 'configuration',
|
| 109 |
+
'constructor', 'continue', 'datatype', 'default', 'derived',
|
| 110 |
+
'disjuncts', 'do', 'elif', 'else', 'end', 'endif', 'except',
|
| 111 |
+
'exists', 'extends', 'forAll', 'forEach', 'forOne', 'from', 'if',
|
| 112 |
+
'implies', 'in', 'inherits', 'init', 'inout', 'intermediate',
|
| 113 |
+
'invresolve', 'invresolveIn', 'invresolveone', 'invresolveoneIn',
|
| 114 |
+
'isUnique', 'iterate', 'late', 'let', 'literal', 'log', 'map',
|
| 115 |
+
'merges', 'modeltype', 'new', 'object', 'one', 'ordered', 'out',
|
| 116 |
+
'package', 'population', 'property', 'raise', 'readonly',
|
| 117 |
+
'references', 'refines', 'reject', 'resolve', 'resolveIn',
|
| 118 |
+
'resolveone', 'resolveoneIn', 'return', 'select', 'selectOne',
|
| 119 |
+
'sortedBy', 'static', 'switch', 'tag', 'then', 'try', 'typedef',
|
| 120 |
+
'unlimited', 'uses', 'when', 'where', 'while', 'with', 'xcollect',
|
| 121 |
+
'xmap', 'xselect'), suffix=r'\b'), Keyword),
|
| 122 |
+
],
|
| 123 |
+
|
| 124 |
+
# There is no need to distinguish between String.Single and
|
| 125 |
+
# String.Double: 'strings' is factorised for 'dqs' and 'sqs'
|
| 126 |
+
'strings': [
|
| 127 |
+
(r'[^\\\'"\n]+', String),
|
| 128 |
+
# quotes, percents and backslashes must be parsed one at a time
|
| 129 |
+
(r'[\'"\\]', String),
|
| 130 |
+
],
|
| 131 |
+
'stringescape': [
|
| 132 |
+
(r'\\([\\btnfr"\']|u[0-3][0-7]{2}|u[0-7]{1,2})', String.Escape)
|
| 133 |
+
],
|
| 134 |
+
'dqs': [ # double-quoted string
|
| 135 |
+
(r'"', String, '#pop'),
|
| 136 |
+
(r'\\\\|\\"', String.Escape),
|
| 137 |
+
include('strings')
|
| 138 |
+
],
|
| 139 |
+
'sqs': [ # single-quoted string
|
| 140 |
+
(r"'", String, '#pop'),
|
| 141 |
+
(r"\\\\|\\'", String.Escape),
|
| 142 |
+
include('strings')
|
| 143 |
+
],
|
| 144 |
+
'name': [
|
| 145 |
+
(r'[a-zA-Z_]\w*', Name),
|
| 146 |
+
],
|
| 147 |
+
# numbers: excerpt taken from the python lexer
|
| 148 |
+
'numbers': [
|
| 149 |
+
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
| 150 |
+
(r'\d+[eE][+-]?[0-9]+', Number.Float),
|
| 151 |
+
(r'\d+', Number.Integer)
|
| 152 |
+
],
|
| 153 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/r.py
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.r
|
| 3 |
+
~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the R/S languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import Lexer, RegexLexer, include, do_insertions
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Punctuation, Generic, Whitespace
|
| 16 |
+
|
| 17 |
+
__all__ = ['RConsoleLexer', 'SLexer', 'RdLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
line_re = re.compile('.*?\n')
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class RConsoleLexer(Lexer):
|
| 24 |
+
"""
|
| 25 |
+
For R console transcripts or R CMD BATCH output files.
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
name = 'RConsole'
|
| 29 |
+
aliases = ['rconsole', 'rout']
|
| 30 |
+
filenames = ['*.Rout']
|
| 31 |
+
url = 'https://www.r-project.org'
|
| 32 |
+
version_added = ''
|
| 33 |
+
_example = "rconsole/r-console-transcript.Rout"
|
| 34 |
+
|
| 35 |
+
def get_tokens_unprocessed(self, text):
|
| 36 |
+
slexer = SLexer(**self.options)
|
| 37 |
+
|
| 38 |
+
current_code_block = ''
|
| 39 |
+
insertions = []
|
| 40 |
+
|
| 41 |
+
for match in line_re.finditer(text):
|
| 42 |
+
line = match.group()
|
| 43 |
+
if line.startswith('>') or line.startswith('+'):
|
| 44 |
+
# Colorize the prompt as such,
|
| 45 |
+
# then put rest of line into current_code_block
|
| 46 |
+
insertions.append((len(current_code_block),
|
| 47 |
+
[(0, Generic.Prompt, line[:2])]))
|
| 48 |
+
current_code_block += line[2:]
|
| 49 |
+
else:
|
| 50 |
+
# We have reached a non-prompt line!
|
| 51 |
+
# If we have stored prompt lines, need to process them first.
|
| 52 |
+
if current_code_block:
|
| 53 |
+
# Weave together the prompts and highlight code.
|
| 54 |
+
yield from do_insertions(
|
| 55 |
+
insertions, slexer.get_tokens_unprocessed(current_code_block))
|
| 56 |
+
# Reset vars for next code block.
|
| 57 |
+
current_code_block = ''
|
| 58 |
+
insertions = []
|
| 59 |
+
# Now process the actual line itself, this is output from R.
|
| 60 |
+
yield match.start(), Generic.Output, line
|
| 61 |
+
|
| 62 |
+
# If we happen to end on a code block with nothing after it, need to
|
| 63 |
+
# process the last code block. This is neither elegant nor DRY so
|
| 64 |
+
# should be changed.
|
| 65 |
+
if current_code_block:
|
| 66 |
+
yield from do_insertions(
|
| 67 |
+
insertions, slexer.get_tokens_unprocessed(current_code_block))
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
class SLexer(RegexLexer):
|
| 71 |
+
"""
|
| 72 |
+
For S, S-plus, and R source code.
|
| 73 |
+
"""
|
| 74 |
+
|
| 75 |
+
name = 'S'
|
| 76 |
+
aliases = ['splus', 's', 'r']
|
| 77 |
+
filenames = ['*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron']
|
| 78 |
+
mimetypes = ['text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r',
|
| 79 |
+
'text/x-R', 'text/x-r-history', 'text/x-r-profile']
|
| 80 |
+
url = 'https://www.r-project.org'
|
| 81 |
+
version_added = '0.10'
|
| 82 |
+
|
| 83 |
+
valid_name = r'`[^`\\]*(?:\\.[^`\\]*)*`|(?:[a-zA-Z]|\.[A-Za-z_.])[\w.]*|\.'
|
| 84 |
+
tokens = {
|
| 85 |
+
'comments': [
|
| 86 |
+
(r'#.*$', Comment.Single),
|
| 87 |
+
],
|
| 88 |
+
'valid_name': [
|
| 89 |
+
(valid_name, Name),
|
| 90 |
+
],
|
| 91 |
+
'function_name': [
|
| 92 |
+
(rf'({valid_name})\s*(?=\()', Name.Function),
|
| 93 |
+
],
|
| 94 |
+
'punctuation': [
|
| 95 |
+
(r'\[{1,2}|\]{1,2}|\(|\)|;|,', Punctuation),
|
| 96 |
+
],
|
| 97 |
+
'keywords': [
|
| 98 |
+
(r'(if|else|for|while|repeat|in|next|break|return|switch|function)'
|
| 99 |
+
r'(?![\w.])',
|
| 100 |
+
Keyword.Reserved),
|
| 101 |
+
],
|
| 102 |
+
'operators': [
|
| 103 |
+
(r'<<?-|->>?|-|==|<=|>=|\|>|<|>|&&?|!=|\|\|?|\?', Operator),
|
| 104 |
+
(r'\*|\+|\^|/|!|%[^%]*%|=|~|\$|@|:{1,3}', Operator),
|
| 105 |
+
],
|
| 106 |
+
'builtin_symbols': [
|
| 107 |
+
(r'(NULL|NA(_(integer|real|complex|character)_)?|'
|
| 108 |
+
r'letters|LETTERS|Inf|TRUE|FALSE|NaN|pi|\.\.(\.|[0-9]+))'
|
| 109 |
+
r'(?![\w.])',
|
| 110 |
+
Keyword.Constant),
|
| 111 |
+
(r'(T|F)\b', Name.Builtin.Pseudo),
|
| 112 |
+
],
|
| 113 |
+
'numbers': [
|
| 114 |
+
# hex number
|
| 115 |
+
(r'0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?', Number.Hex),
|
| 116 |
+
# decimal number
|
| 117 |
+
(r'[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[Li]?',
|
| 118 |
+
Number),
|
| 119 |
+
],
|
| 120 |
+
'statements': [
|
| 121 |
+
include('comments'),
|
| 122 |
+
# whitespaces
|
| 123 |
+
(r'\s+', Whitespace),
|
| 124 |
+
(r'\'', String, 'string_squote'),
|
| 125 |
+
(r'\"', String, 'string_dquote'),
|
| 126 |
+
include('builtin_symbols'),
|
| 127 |
+
include('keywords'),
|
| 128 |
+
include('function_name'),
|
| 129 |
+
include('valid_name'),
|
| 130 |
+
include('numbers'),
|
| 131 |
+
include('punctuation'),
|
| 132 |
+
include('operators'),
|
| 133 |
+
],
|
| 134 |
+
'root': [
|
| 135 |
+
# calls:
|
| 136 |
+
include('statements'),
|
| 137 |
+
# blocks:
|
| 138 |
+
(r'\{|\}', Punctuation),
|
| 139 |
+
# (r'\{', Punctuation, 'block'),
|
| 140 |
+
(r'.', Text),
|
| 141 |
+
],
|
| 142 |
+
# 'block': [
|
| 143 |
+
# include('statements'),
|
| 144 |
+
# ('\{', Punctuation, '#push'),
|
| 145 |
+
# ('\}', Punctuation, '#pop')
|
| 146 |
+
# ],
|
| 147 |
+
'string_squote': [
|
| 148 |
+
(r'([^\'\\]|\\.)*\'', String, '#pop'),
|
| 149 |
+
],
|
| 150 |
+
'string_dquote': [
|
| 151 |
+
(r'([^"\\]|\\.)*"', String, '#pop'),
|
| 152 |
+
],
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
def analyse_text(text):
|
| 156 |
+
if re.search(r'[a-z0-9_\])\s]<-(?!-)', text):
|
| 157 |
+
return 0.11
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
class RdLexer(RegexLexer):
|
| 161 |
+
"""
|
| 162 |
+
Pygments Lexer for R documentation (Rd) files
|
| 163 |
+
|
| 164 |
+
This is a very minimal implementation, highlighting little more
|
| 165 |
+
than the macros. A description of Rd syntax is found in `Writing R
|
| 166 |
+
Extensions <http://cran.r-project.org/doc/manuals/R-exts.html>`_
|
| 167 |
+
and `Parsing Rd files <http://developer.r-project.org/parseRd.pdf>`_.
|
| 168 |
+
"""
|
| 169 |
+
name = 'Rd'
|
| 170 |
+
aliases = ['rd']
|
| 171 |
+
filenames = ['*.Rd']
|
| 172 |
+
mimetypes = ['text/x-r-doc']
|
| 173 |
+
url = 'http://cran.r-project.org/doc/manuals/R-exts.html'
|
| 174 |
+
version_added = '1.6'
|
| 175 |
+
|
| 176 |
+
# To account for verbatim / LaTeX-like / and R-like areas
|
| 177 |
+
# would require parsing.
|
| 178 |
+
tokens = {
|
| 179 |
+
'root': [
|
| 180 |
+
# catch escaped brackets and percent sign
|
| 181 |
+
(r'\\[\\{}%]', String.Escape),
|
| 182 |
+
# comments
|
| 183 |
+
(r'%.*$', Comment),
|
| 184 |
+
# special macros with no arguments
|
| 185 |
+
(r'\\(?:cr|l?dots|R|tab)\b', Keyword.Constant),
|
| 186 |
+
# macros
|
| 187 |
+
(r'\\[a-zA-Z]+\b', Keyword),
|
| 188 |
+
# special preprocessor macros
|
| 189 |
+
(r'^\s*#(?:ifn?def|endif).*\b', Comment.Preproc),
|
| 190 |
+
# non-escaped brackets
|
| 191 |
+
(r'[{}]', Name.Builtin),
|
| 192 |
+
# everything else
|
| 193 |
+
(r'[^\\%\n{}]+', Text),
|
| 194 |
+
(r'.', Text),
|
| 195 |
+
]
|
| 196 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rdf.py
ADDED
|
@@ -0,0 +1,468 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.rdf
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for semantic web and RDF query languages and markup.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, bygroups, default
|
| 14 |
+
from pygments.token import Keyword, Punctuation, String, Number, Operator, \
|
| 15 |
+
Generic, Whitespace, Name, Literal, Comment, Text
|
| 16 |
+
|
| 17 |
+
__all__ = ['SparqlLexer', 'TurtleLexer', 'ShExCLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class SparqlLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
Lexer for SPARQL query language.
|
| 23 |
+
"""
|
| 24 |
+
name = 'SPARQL'
|
| 25 |
+
aliases = ['sparql']
|
| 26 |
+
filenames = ['*.rq', '*.sparql']
|
| 27 |
+
mimetypes = ['application/sparql-query']
|
| 28 |
+
url = 'https://www.w3.org/TR/sparql11-query'
|
| 29 |
+
version_added = '2.0'
|
| 30 |
+
|
| 31 |
+
# character group definitions ::
|
| 32 |
+
|
| 33 |
+
PN_CHARS_BASE_GRP = ('a-zA-Z'
|
| 34 |
+
'\u00c0-\u00d6'
|
| 35 |
+
'\u00d8-\u00f6'
|
| 36 |
+
'\u00f8-\u02ff'
|
| 37 |
+
'\u0370-\u037d'
|
| 38 |
+
'\u037f-\u1fff'
|
| 39 |
+
'\u200c-\u200d'
|
| 40 |
+
'\u2070-\u218f'
|
| 41 |
+
'\u2c00-\u2fef'
|
| 42 |
+
'\u3001-\ud7ff'
|
| 43 |
+
'\uf900-\ufdcf'
|
| 44 |
+
'\ufdf0-\ufffd')
|
| 45 |
+
|
| 46 |
+
PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
|
| 47 |
+
|
| 48 |
+
PN_CHARS_GRP = (PN_CHARS_U_GRP +
|
| 49 |
+
r'\-' +
|
| 50 |
+
r'0-9' +
|
| 51 |
+
'\u00b7' +
|
| 52 |
+
'\u0300-\u036f' +
|
| 53 |
+
'\u203f-\u2040')
|
| 54 |
+
|
| 55 |
+
HEX_GRP = '0-9A-Fa-f'
|
| 56 |
+
|
| 57 |
+
PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&"()*+,;=/?#@%'
|
| 58 |
+
|
| 59 |
+
# terminal productions ::
|
| 60 |
+
|
| 61 |
+
PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']'
|
| 62 |
+
|
| 63 |
+
PN_CHARS_U = '[' + PN_CHARS_U_GRP + ']'
|
| 64 |
+
|
| 65 |
+
PN_CHARS = '[' + PN_CHARS_GRP + ']'
|
| 66 |
+
|
| 67 |
+
HEX = '[' + HEX_GRP + ']'
|
| 68 |
+
|
| 69 |
+
PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']'
|
| 70 |
+
|
| 71 |
+
IRIREF = r'<(?:[^<>"{}|^`\\\x00-\x20])*>'
|
| 72 |
+
|
| 73 |
+
BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \
|
| 74 |
+
'.]*' + PN_CHARS + ')?'
|
| 75 |
+
|
| 76 |
+
PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?'
|
| 77 |
+
|
| 78 |
+
VARNAME = '[0-9' + PN_CHARS_U_GRP + '][' + PN_CHARS_U_GRP + \
|
| 79 |
+
'0-9\u00b7\u0300-\u036f\u203f-\u2040]*'
|
| 80 |
+
|
| 81 |
+
PERCENT = '%' + HEX + HEX
|
| 82 |
+
|
| 83 |
+
PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS
|
| 84 |
+
|
| 85 |
+
PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')'
|
| 86 |
+
|
| 87 |
+
PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' +
|
| 88 |
+
'(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' +
|
| 89 |
+
PN_CHARS_GRP + ':]|' + PLX + '))?')
|
| 90 |
+
|
| 91 |
+
EXPONENT = r'[eE][+-]?\d+'
|
| 92 |
+
|
| 93 |
+
# Lexer token definitions ::
|
| 94 |
+
|
| 95 |
+
tokens = {
|
| 96 |
+
'root': [
|
| 97 |
+
(r'\s+', Text),
|
| 98 |
+
# keywords ::
|
| 99 |
+
(r'(?i)(select|construct|describe|ask|where|filter|group\s+by|minus|'
|
| 100 |
+
r'distinct|reduced|from\s+named|from|order\s+by|desc|asc|limit|'
|
| 101 |
+
r'offset|values|bindings|load|into|clear|drop|create|add|move|copy|'
|
| 102 |
+
r'insert\s+data|delete\s+data|delete\s+where|with|delete|insert|'
|
| 103 |
+
r'using\s+named|using|graph|default|named|all|optional|service|'
|
| 104 |
+
r'silent|bind|undef|union|not\s+in|in|as|having|to|prefix|base)\b', Keyword),
|
| 105 |
+
(r'(a)\b', Keyword),
|
| 106 |
+
# IRIs ::
|
| 107 |
+
('(' + IRIREF + ')', Name.Label),
|
| 108 |
+
# blank nodes ::
|
| 109 |
+
('(' + BLANK_NODE_LABEL + ')', Name.Label),
|
| 110 |
+
# # variables ::
|
| 111 |
+
('[?$]' + VARNAME, Name.Variable),
|
| 112 |
+
# prefixed names ::
|
| 113 |
+
(r'(' + PN_PREFIX + r')?(\:)(' + PN_LOCAL + r')?',
|
| 114 |
+
bygroups(Name.Namespace, Punctuation, Name.Tag)),
|
| 115 |
+
# function names ::
|
| 116 |
+
(r'(?i)(str|lang|langmatches|datatype|bound|iri|uri|bnode|rand|abs|'
|
| 117 |
+
r'ceil|floor|round|concat|strlen|ucase|lcase|encode_for_uri|'
|
| 118 |
+
r'contains|strstarts|strends|strbefore|strafter|year|month|day|'
|
| 119 |
+
r'hours|minutes|seconds|timezone|tz|now|uuid|struuid|md5|sha1|sha256|sha384|'
|
| 120 |
+
r'sha512|coalesce|if|strlang|strdt|sameterm|isiri|isuri|isblank|'
|
| 121 |
+
r'isliteral|isnumeric|regex|substr|replace|exists|not\s+exists|'
|
| 122 |
+
r'count|sum|min|max|avg|sample|group_concat|separator)\b',
|
| 123 |
+
Name.Function),
|
| 124 |
+
# boolean literals ::
|
| 125 |
+
(r'(true|false)', Keyword.Constant),
|
| 126 |
+
# double literals ::
|
| 127 |
+
(r'[+\-]?(\d+\.\d*' + EXPONENT + r'|\.?\d+' + EXPONENT + ')', Number.Float),
|
| 128 |
+
# decimal literals ::
|
| 129 |
+
(r'[+\-]?(\d+\.\d*|\.\d+)', Number.Float),
|
| 130 |
+
# integer literals ::
|
| 131 |
+
(r'[+\-]?\d+', Number.Integer),
|
| 132 |
+
# operators ::
|
| 133 |
+
(r'(\|\||&&|=|\*|\-|\+|/|!=|<=|>=|!|<|>)', Operator),
|
| 134 |
+
# punctuation characters ::
|
| 135 |
+
(r'[(){}.;,:^\[\]]', Punctuation),
|
| 136 |
+
# line comments ::
|
| 137 |
+
(r'#[^\n]*', Comment),
|
| 138 |
+
# strings ::
|
| 139 |
+
(r'"""', String, 'triple-double-quoted-string'),
|
| 140 |
+
(r'"', String, 'single-double-quoted-string'),
|
| 141 |
+
(r"'''", String, 'triple-single-quoted-string'),
|
| 142 |
+
(r"'", String, 'single-single-quoted-string'),
|
| 143 |
+
],
|
| 144 |
+
'triple-double-quoted-string': [
|
| 145 |
+
(r'"""', String, 'end-of-string'),
|
| 146 |
+
(r'[^\\]+', String),
|
| 147 |
+
(r'\\', String, 'string-escape'),
|
| 148 |
+
],
|
| 149 |
+
'single-double-quoted-string': [
|
| 150 |
+
(r'"', String, 'end-of-string'),
|
| 151 |
+
(r'[^"\\\n]+', String),
|
| 152 |
+
(r'\\', String, 'string-escape'),
|
| 153 |
+
],
|
| 154 |
+
'triple-single-quoted-string': [
|
| 155 |
+
(r"'''", String, 'end-of-string'),
|
| 156 |
+
(r'[^\\]+', String),
|
| 157 |
+
(r'\\', String.Escape, 'string-escape'),
|
| 158 |
+
],
|
| 159 |
+
'single-single-quoted-string': [
|
| 160 |
+
(r"'", String, 'end-of-string'),
|
| 161 |
+
(r"[^'\\\n]+", String),
|
| 162 |
+
(r'\\', String, 'string-escape'),
|
| 163 |
+
],
|
| 164 |
+
'string-escape': [
|
| 165 |
+
(r'u' + HEX + '{4}', String.Escape, '#pop'),
|
| 166 |
+
(r'U' + HEX + '{8}', String.Escape, '#pop'),
|
| 167 |
+
(r'.', String.Escape, '#pop'),
|
| 168 |
+
],
|
| 169 |
+
'end-of-string': [
|
| 170 |
+
(r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)',
|
| 171 |
+
bygroups(Operator, Name.Function), '#pop:2'),
|
| 172 |
+
(r'\^\^', Operator, '#pop:2'),
|
| 173 |
+
default('#pop:2'),
|
| 174 |
+
],
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
class TurtleLexer(RegexLexer):
|
| 179 |
+
"""
|
| 180 |
+
Lexer for Turtle data language.
|
| 181 |
+
"""
|
| 182 |
+
name = 'Turtle'
|
| 183 |
+
aliases = ['turtle']
|
| 184 |
+
filenames = ['*.ttl']
|
| 185 |
+
mimetypes = ['text/turtle', 'application/x-turtle']
|
| 186 |
+
url = 'https://www.w3.org/TR/turtle'
|
| 187 |
+
version_added = '2.1'
|
| 188 |
+
|
| 189 |
+
# character group definitions ::
|
| 190 |
+
PN_CHARS_BASE_GRP = ('a-zA-Z'
|
| 191 |
+
'\u00c0-\u00d6'
|
| 192 |
+
'\u00d8-\u00f6'
|
| 193 |
+
'\u00f8-\u02ff'
|
| 194 |
+
'\u0370-\u037d'
|
| 195 |
+
'\u037f-\u1fff'
|
| 196 |
+
'\u200c-\u200d'
|
| 197 |
+
'\u2070-\u218f'
|
| 198 |
+
'\u2c00-\u2fef'
|
| 199 |
+
'\u3001-\ud7ff'
|
| 200 |
+
'\uf900-\ufdcf'
|
| 201 |
+
'\ufdf0-\ufffd')
|
| 202 |
+
|
| 203 |
+
PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
|
| 204 |
+
|
| 205 |
+
PN_CHARS_GRP = (PN_CHARS_U_GRP +
|
| 206 |
+
r'\-' +
|
| 207 |
+
r'0-9' +
|
| 208 |
+
'\u00b7' +
|
| 209 |
+
'\u0300-\u036f' +
|
| 210 |
+
'\u203f-\u2040')
|
| 211 |
+
|
| 212 |
+
PN_CHARS = '[' + PN_CHARS_GRP + ']'
|
| 213 |
+
|
| 214 |
+
PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']'
|
| 215 |
+
|
| 216 |
+
PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?'
|
| 217 |
+
|
| 218 |
+
HEX_GRP = '0-9A-Fa-f'
|
| 219 |
+
|
| 220 |
+
HEX = '[' + HEX_GRP + ']'
|
| 221 |
+
|
| 222 |
+
PERCENT = '%' + HEX + HEX
|
| 223 |
+
|
| 224 |
+
PN_LOCAL_ESC_CHARS_GRP = r' _~.\-!$&"()*+,;=/?#@%'
|
| 225 |
+
|
| 226 |
+
PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']'
|
| 227 |
+
|
| 228 |
+
PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS
|
| 229 |
+
|
| 230 |
+
PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')'
|
| 231 |
+
|
| 232 |
+
PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' +
|
| 233 |
+
'(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' +
|
| 234 |
+
PN_CHARS_GRP + ':]|' + PLX + '))?')
|
| 235 |
+
|
| 236 |
+
patterns = {
|
| 237 |
+
'PNAME_NS': r'((?:[a-zA-Z][\w-]*)?\:)', # Simplified character range
|
| 238 |
+
'IRIREF': r'(<[^<>"{}|^`\\\x00-\x20]*>)'
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
tokens = {
|
| 242 |
+
'root': [
|
| 243 |
+
(r'\s+', Text),
|
| 244 |
+
|
| 245 |
+
# Base / prefix
|
| 246 |
+
(r'(@base|BASE)(\s+){IRIREF}(\s*)(\.?)'.format(**patterns),
|
| 247 |
+
bygroups(Keyword, Whitespace, Name.Variable, Whitespace,
|
| 248 |
+
Punctuation)),
|
| 249 |
+
(r'(@prefix|PREFIX)(\s+){PNAME_NS}(\s+){IRIREF}(\s*)(\.?)'.format(**patterns),
|
| 250 |
+
bygroups(Keyword, Whitespace, Name.Namespace, Whitespace,
|
| 251 |
+
Name.Variable, Whitespace, Punctuation)),
|
| 252 |
+
|
| 253 |
+
# The shorthand predicate 'a'
|
| 254 |
+
(r'(?<=\s)a(?=\s)', Keyword.Type),
|
| 255 |
+
|
| 256 |
+
# IRIREF
|
| 257 |
+
(r'{IRIREF}'.format(**patterns), Name.Variable),
|
| 258 |
+
|
| 259 |
+
# PrefixedName
|
| 260 |
+
(r'(' + PN_PREFIX + r')?(\:)(' + PN_LOCAL + r')?',
|
| 261 |
+
bygroups(Name.Namespace, Punctuation, Name.Tag)),
|
| 262 |
+
|
| 263 |
+
# BlankNodeLabel
|
| 264 |
+
(r'(_)(:)([' + PN_CHARS_U_GRP + r'0-9]([' + PN_CHARS_GRP + r'.]*' + PN_CHARS + ')?)',
|
| 265 |
+
bygroups(Name.Namespace, Punctuation, Name.Tag)),
|
| 266 |
+
|
| 267 |
+
# Comment
|
| 268 |
+
(r'#([^\n]+|$)', Comment),
|
| 269 |
+
|
| 270 |
+
(r'\b(true|false)\b', Literal),
|
| 271 |
+
(r'[+\-]?\d*\.\d+', Number.Float),
|
| 272 |
+
(r'[+\-]?\d*(:?\.\d+)?E[+\-]?\d+', Number.Float),
|
| 273 |
+
(r'[+\-]?\d+', Number.Integer),
|
| 274 |
+
(r'[\[\](){}.;,:^]', Punctuation),
|
| 275 |
+
|
| 276 |
+
(r'"""', String, 'triple-double-quoted-string'),
|
| 277 |
+
(r'"', String, 'single-double-quoted-string'),
|
| 278 |
+
(r"'''", String, 'triple-single-quoted-string'),
|
| 279 |
+
(r"'", String, 'single-single-quoted-string'),
|
| 280 |
+
],
|
| 281 |
+
'triple-double-quoted-string': [
|
| 282 |
+
(r'"""', String, 'end-of-string'),
|
| 283 |
+
(r'[^\\]+(?=""")', String),
|
| 284 |
+
(r'\\', String, 'string-escape'),
|
| 285 |
+
],
|
| 286 |
+
'single-double-quoted-string': [
|
| 287 |
+
(r'"', String, 'end-of-string'),
|
| 288 |
+
(r'[^"\\\n]+', String),
|
| 289 |
+
(r'\\', String, 'string-escape'),
|
| 290 |
+
],
|
| 291 |
+
'triple-single-quoted-string': [
|
| 292 |
+
(r"'''", String, 'end-of-string'),
|
| 293 |
+
(r"[^\\]+(?=''')", String),
|
| 294 |
+
(r'\\', String, 'string-escape'),
|
| 295 |
+
],
|
| 296 |
+
'single-single-quoted-string': [
|
| 297 |
+
(r"'", String, 'end-of-string'),
|
| 298 |
+
(r"[^'\\\n]+", String),
|
| 299 |
+
(r'\\', String, 'string-escape'),
|
| 300 |
+
],
|
| 301 |
+
'string-escape': [
|
| 302 |
+
(r'.', String, '#pop'),
|
| 303 |
+
],
|
| 304 |
+
'end-of-string': [
|
| 305 |
+
(r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)',
|
| 306 |
+
bygroups(Operator, Generic.Emph), '#pop:2'),
|
| 307 |
+
|
| 308 |
+
(r'(\^\^){IRIREF}'.format(**patterns), bygroups(Operator, Generic.Emph), '#pop:2'),
|
| 309 |
+
|
| 310 |
+
default('#pop:2'),
|
| 311 |
+
|
| 312 |
+
],
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
# Turtle and Tera Term macro files share the same file extension
|
| 316 |
+
# but each has a recognizable and distinct syntax.
|
| 317 |
+
def analyse_text(text):
|
| 318 |
+
for t in ('@base ', 'BASE ', '@prefix ', 'PREFIX '):
|
| 319 |
+
if re.search(rf'^\s*{t}', text):
|
| 320 |
+
return 0.80
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
class ShExCLexer(RegexLexer):
|
| 324 |
+
"""
|
| 325 |
+
Lexer for ShExC shape expressions language syntax.
|
| 326 |
+
"""
|
| 327 |
+
name = 'ShExC'
|
| 328 |
+
aliases = ['shexc', 'shex']
|
| 329 |
+
filenames = ['*.shex']
|
| 330 |
+
mimetypes = ['text/shex']
|
| 331 |
+
url = 'https://shex.io/shex-semantics/#shexc'
|
| 332 |
+
version_added = ''
|
| 333 |
+
|
| 334 |
+
# character group definitions ::
|
| 335 |
+
|
| 336 |
+
PN_CHARS_BASE_GRP = ('a-zA-Z'
|
| 337 |
+
'\u00c0-\u00d6'
|
| 338 |
+
'\u00d8-\u00f6'
|
| 339 |
+
'\u00f8-\u02ff'
|
| 340 |
+
'\u0370-\u037d'
|
| 341 |
+
'\u037f-\u1fff'
|
| 342 |
+
'\u200c-\u200d'
|
| 343 |
+
'\u2070-\u218f'
|
| 344 |
+
'\u2c00-\u2fef'
|
| 345 |
+
'\u3001-\ud7ff'
|
| 346 |
+
'\uf900-\ufdcf'
|
| 347 |
+
'\ufdf0-\ufffd')
|
| 348 |
+
|
| 349 |
+
PN_CHARS_U_GRP = (PN_CHARS_BASE_GRP + '_')
|
| 350 |
+
|
| 351 |
+
PN_CHARS_GRP = (PN_CHARS_U_GRP +
|
| 352 |
+
r'\-' +
|
| 353 |
+
r'0-9' +
|
| 354 |
+
'\u00b7' +
|
| 355 |
+
'\u0300-\u036f' +
|
| 356 |
+
'\u203f-\u2040')
|
| 357 |
+
|
| 358 |
+
HEX_GRP = '0-9A-Fa-f'
|
| 359 |
+
|
| 360 |
+
PN_LOCAL_ESC_CHARS_GRP = r"_~.\-!$&'()*+,;=/?#@%"
|
| 361 |
+
|
| 362 |
+
# terminal productions ::
|
| 363 |
+
|
| 364 |
+
PN_CHARS_BASE = '[' + PN_CHARS_BASE_GRP + ']'
|
| 365 |
+
|
| 366 |
+
PN_CHARS_U = '[' + PN_CHARS_U_GRP + ']'
|
| 367 |
+
|
| 368 |
+
PN_CHARS = '[' + PN_CHARS_GRP + ']'
|
| 369 |
+
|
| 370 |
+
HEX = '[' + HEX_GRP + ']'
|
| 371 |
+
|
| 372 |
+
PN_LOCAL_ESC_CHARS = '[' + PN_LOCAL_ESC_CHARS_GRP + ']'
|
| 373 |
+
|
| 374 |
+
UCHAR_NO_BACKSLASH = '(?:u' + HEX + '{4}|U' + HEX + '{8})'
|
| 375 |
+
|
| 376 |
+
UCHAR = r'\\' + UCHAR_NO_BACKSLASH
|
| 377 |
+
|
| 378 |
+
IRIREF = r'<(?:[^\x00-\x20<>"{}|^`\\]|' + UCHAR + ')*>'
|
| 379 |
+
|
| 380 |
+
BLANK_NODE_LABEL = '_:[0-9' + PN_CHARS_U_GRP + '](?:[' + PN_CHARS_GRP + \
|
| 381 |
+
'.]*' + PN_CHARS + ')?'
|
| 382 |
+
|
| 383 |
+
PN_PREFIX = PN_CHARS_BASE + '(?:[' + PN_CHARS_GRP + '.]*' + PN_CHARS + ')?'
|
| 384 |
+
|
| 385 |
+
PERCENT = '%' + HEX + HEX
|
| 386 |
+
|
| 387 |
+
PN_LOCAL_ESC = r'\\' + PN_LOCAL_ESC_CHARS
|
| 388 |
+
|
| 389 |
+
PLX = '(?:' + PERCENT + ')|(?:' + PN_LOCAL_ESC + ')'
|
| 390 |
+
|
| 391 |
+
PN_LOCAL = ('(?:[' + PN_CHARS_U_GRP + ':0-9' + ']|' + PLX + ')' +
|
| 392 |
+
'(?:(?:[' + PN_CHARS_GRP + '.:]|' + PLX + ')*(?:[' +
|
| 393 |
+
PN_CHARS_GRP + ':]|' + PLX + '))?')
|
| 394 |
+
|
| 395 |
+
EXPONENT = r'[eE][+-]?\d+'
|
| 396 |
+
|
| 397 |
+
# Lexer token definitions ::
|
| 398 |
+
|
| 399 |
+
tokens = {
|
| 400 |
+
'root': [
|
| 401 |
+
(r'\s+', Text),
|
| 402 |
+
# keywords ::
|
| 403 |
+
(r'(?i)(base|prefix|start|external|'
|
| 404 |
+
r'literal|iri|bnode|nonliteral|length|minlength|maxlength|'
|
| 405 |
+
r'mininclusive|minexclusive|maxinclusive|maxexclusive|'
|
| 406 |
+
r'totaldigits|fractiondigits|'
|
| 407 |
+
r'closed|extra)\b', Keyword),
|
| 408 |
+
(r'(a)\b', Keyword),
|
| 409 |
+
# IRIs ::
|
| 410 |
+
('(' + IRIREF + ')', Name.Label),
|
| 411 |
+
# blank nodes ::
|
| 412 |
+
('(' + BLANK_NODE_LABEL + ')', Name.Label),
|
| 413 |
+
# prefixed names ::
|
| 414 |
+
(r'(' + PN_PREFIX + r')?(\:)(' + PN_LOCAL + ')?',
|
| 415 |
+
bygroups(Name.Namespace, Punctuation, Name.Tag)),
|
| 416 |
+
# boolean literals ::
|
| 417 |
+
(r'(true|false)', Keyword.Constant),
|
| 418 |
+
# double literals ::
|
| 419 |
+
(r'[+\-]?(\d+\.\d*' + EXPONENT + r'|\.?\d+' + EXPONENT + ')', Number.Float),
|
| 420 |
+
# decimal literals ::
|
| 421 |
+
(r'[+\-]?(\d+\.\d*|\.\d+)', Number.Float),
|
| 422 |
+
# integer literals ::
|
| 423 |
+
(r'[+\-]?\d+', Number.Integer),
|
| 424 |
+
# operators ::
|
| 425 |
+
(r'[@|$&=*+?^\-~]', Operator),
|
| 426 |
+
# operator keywords ::
|
| 427 |
+
(r'(?i)(and|or|not)\b', Operator.Word),
|
| 428 |
+
# punctuation characters ::
|
| 429 |
+
(r'[(){}.;,:^\[\]]', Punctuation),
|
| 430 |
+
# line comments ::
|
| 431 |
+
(r'#[^\n]*', Comment),
|
| 432 |
+
# strings ::
|
| 433 |
+
(r'"""', String, 'triple-double-quoted-string'),
|
| 434 |
+
(r'"', String, 'single-double-quoted-string'),
|
| 435 |
+
(r"'''", String, 'triple-single-quoted-string'),
|
| 436 |
+
(r"'", String, 'single-single-quoted-string'),
|
| 437 |
+
],
|
| 438 |
+
'triple-double-quoted-string': [
|
| 439 |
+
(r'"""', String, 'end-of-string'),
|
| 440 |
+
(r'[^\\]+', String),
|
| 441 |
+
(r'\\', String, 'string-escape'),
|
| 442 |
+
],
|
| 443 |
+
'single-double-quoted-string': [
|
| 444 |
+
(r'"', String, 'end-of-string'),
|
| 445 |
+
(r'[^"\\\n]+', String),
|
| 446 |
+
(r'\\', String, 'string-escape'),
|
| 447 |
+
],
|
| 448 |
+
'triple-single-quoted-string': [
|
| 449 |
+
(r"'''", String, 'end-of-string'),
|
| 450 |
+
(r'[^\\]+', String),
|
| 451 |
+
(r'\\', String.Escape, 'string-escape'),
|
| 452 |
+
],
|
| 453 |
+
'single-single-quoted-string': [
|
| 454 |
+
(r"'", String, 'end-of-string'),
|
| 455 |
+
(r"[^'\\\n]+", String),
|
| 456 |
+
(r'\\', String, 'string-escape'),
|
| 457 |
+
],
|
| 458 |
+
'string-escape': [
|
| 459 |
+
(UCHAR_NO_BACKSLASH, String.Escape, '#pop'),
|
| 460 |
+
(r'.', String.Escape, '#pop'),
|
| 461 |
+
],
|
| 462 |
+
'end-of-string': [
|
| 463 |
+
(r'(@)([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)',
|
| 464 |
+
bygroups(Operator, Name.Function), '#pop:2'),
|
| 465 |
+
(r'\^\^', Operator, '#pop:2'),
|
| 466 |
+
default('#pop:2'),
|
| 467 |
+
],
|
| 468 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rebol.py
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.rebol
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the REBOL and related languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, bygroups
|
| 14 |
+
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
|
| 15 |
+
Number, Generic, Whitespace
|
| 16 |
+
|
| 17 |
+
__all__ = ['RebolLexer', 'RedLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class RebolLexer(RegexLexer):
|
| 21 |
+
"""
|
| 22 |
+
A REBOL lexer.
|
| 23 |
+
"""
|
| 24 |
+
name = 'REBOL'
|
| 25 |
+
aliases = ['rebol']
|
| 26 |
+
filenames = ['*.r', '*.r3', '*.reb']
|
| 27 |
+
mimetypes = ['text/x-rebol']
|
| 28 |
+
url = 'http://www.rebol.com'
|
| 29 |
+
version_added = '1.1'
|
| 30 |
+
|
| 31 |
+
flags = re.IGNORECASE | re.MULTILINE
|
| 32 |
+
|
| 33 |
+
escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)'
|
| 34 |
+
|
| 35 |
+
def word_callback(lexer, match):
|
| 36 |
+
word = match.group()
|
| 37 |
+
|
| 38 |
+
if re.match(".*:$", word):
|
| 39 |
+
yield match.start(), Generic.Subheading, word
|
| 40 |
+
elif re.match(
|
| 41 |
+
r'(native|alias|all|any|as-string|as-binary|bind|bound\?|case|'
|
| 42 |
+
r'catch|checksum|comment|debase|dehex|exclude|difference|disarm|'
|
| 43 |
+
r'either|else|enbase|foreach|remove-each|form|free|get|get-env|if|'
|
| 44 |
+
r'in|intersect|loop|minimum-of|maximum-of|mold|new-line|'
|
| 45 |
+
r'new-line\?|not|now|prin|print|reduce|compose|construct|repeat|'
|
| 46 |
+
r'reverse|save|script\?|set|shift|switch|throw|to-hex|trace|try|'
|
| 47 |
+
r'type\?|union|unique|unless|unprotect|unset|until|use|value\?|'
|
| 48 |
+
r'while|compress|decompress|secure|open|close|read|read-io|'
|
| 49 |
+
r'write-io|write|update|query|wait|input\?|exp|log-10|log-2|'
|
| 50 |
+
r'log-e|square-root|cosine|sine|tangent|arccosine|arcsine|'
|
| 51 |
+
r'arctangent|protect|lowercase|uppercase|entab|detab|connected\?|'
|
| 52 |
+
r'browse|launch|stats|get-modes|set-modes|to-local-file|'
|
| 53 |
+
r'to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|'
|
| 54 |
+
r'hide|draw|show|size-text|textinfo|offset-to-caret|'
|
| 55 |
+
r'caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|'
|
| 56 |
+
r'crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|'
|
| 57 |
+
r'dsa-make-key|dsa-generate-key|dsa-make-signature|'
|
| 58 |
+
r'dsa-verify-signature|rsa-make-key|rsa-generate-key|'
|
| 59 |
+
r'rsa-encrypt)$', word):
|
| 60 |
+
yield match.start(), Name.Builtin, word
|
| 61 |
+
elif re.match(
|
| 62 |
+
r'(add|subtract|multiply|divide|remainder|power|and~|or~|xor~|'
|
| 63 |
+
r'minimum|maximum|negate|complement|absolute|random|head|tail|'
|
| 64 |
+
r'next|back|skip|at|pick|first|second|third|fourth|fifth|sixth|'
|
| 65 |
+
r'seventh|eighth|ninth|tenth|last|path|find|select|make|to|copy\*|'
|
| 66 |
+
r'insert|remove|change|poke|clear|trim|sort|min|max|abs|cp|'
|
| 67 |
+
r'copy)$', word):
|
| 68 |
+
yield match.start(), Name.Function, word
|
| 69 |
+
elif re.match(
|
| 70 |
+
r'(error|source|input|license|help|install|echo|Usage|with|func|'
|
| 71 |
+
r'throw-on-error|function|does|has|context|probe|\?\?|as-pair|'
|
| 72 |
+
r'mod|modulo|round|repend|about|set-net|append|join|rejoin|reform|'
|
| 73 |
+
r'remold|charset|array|replace|move|extract|forskip|forall|alter|'
|
| 74 |
+
r'first+|also|take|for|forever|dispatch|attempt|what-dir|'
|
| 75 |
+
r'change-dir|clean-path|list-dir|dirize|rename|split-path|delete|'
|
| 76 |
+
r'make-dir|delete-dir|in-dir|confirm|dump-obj|upgrade|what|'
|
| 77 |
+
r'build-tag|process-source|build-markup|decode-cgi|read-cgi|'
|
| 78 |
+
r'write-user|save-user|set-user-name|protect-system|parse-xml|'
|
| 79 |
+
r'cvs-date|cvs-version|do-boot|get-net-info|desktop|layout|'
|
| 80 |
+
r'scroll-para|get-face|alert|set-face|uninstall|unfocus|'
|
| 81 |
+
r'request-dir|center-face|do-events|net-error|decode-url|'
|
| 82 |
+
r'parse-header|parse-header-date|parse-email-addrs|import-email|'
|
| 83 |
+
r'send|build-attach-body|resend|show-popup|hide-popup|open-events|'
|
| 84 |
+
r'find-key-face|do-face|viewtop|confine|find-window|'
|
| 85 |
+
r'insert-event-func|remove-event-func|inform|dump-pane|dump-face|'
|
| 86 |
+
r'flag-face|deflag-face|clear-fields|read-net|vbug|path-thru|'
|
| 87 |
+
r'read-thru|load-thru|do-thru|launch-thru|load-image|'
|
| 88 |
+
r'request-download|do-face-alt|set-font|set-para|get-style|'
|
| 89 |
+
r'set-style|make-face|stylize|choose|hilight-text|hilight-all|'
|
| 90 |
+
r'unlight-text|focus|scroll-drag|clear-face|reset-face|scroll-face|'
|
| 91 |
+
r'resize-face|load-stock|load-stock-block|notify|request|flash|'
|
| 92 |
+
r'request-color|request-pass|request-text|request-list|'
|
| 93 |
+
r'request-date|request-file|dbug|editor|link-relative-path|'
|
| 94 |
+
r'emailer|parse-error)$', word):
|
| 95 |
+
yield match.start(), Keyword.Namespace, word
|
| 96 |
+
elif re.match(
|
| 97 |
+
r'(halt|quit|do|load|q|recycle|call|run|ask|parse|view|unview|'
|
| 98 |
+
r'return|exit|break)$', word):
|
| 99 |
+
yield match.start(), Name.Exception, word
|
| 100 |
+
elif re.match('REBOL$', word):
|
| 101 |
+
yield match.start(), Generic.Heading, word
|
| 102 |
+
elif re.match("to-.*", word):
|
| 103 |
+
yield match.start(), Keyword, word
|
| 104 |
+
elif re.match(r'(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$',
|
| 105 |
+
word):
|
| 106 |
+
yield match.start(), Operator, word
|
| 107 |
+
elif re.match(r".*\?$", word):
|
| 108 |
+
yield match.start(), Keyword, word
|
| 109 |
+
elif re.match(r".*\!$", word):
|
| 110 |
+
yield match.start(), Keyword.Type, word
|
| 111 |
+
elif re.match("'.*", word):
|
| 112 |
+
yield match.start(), Name.Variable.Instance, word # lit-word
|
| 113 |
+
elif re.match("#.*", word):
|
| 114 |
+
yield match.start(), Name.Label, word # issue
|
| 115 |
+
elif re.match("%.*", word):
|
| 116 |
+
yield match.start(), Name.Decorator, word # file
|
| 117 |
+
else:
|
| 118 |
+
yield match.start(), Name.Variable, word
|
| 119 |
+
|
| 120 |
+
tokens = {
|
| 121 |
+
'root': [
|
| 122 |
+
(r'\s+', Text),
|
| 123 |
+
(r'#"', String.Char, 'char'),
|
| 124 |
+
(r'#\{[0-9a-f]*\}', Number.Hex),
|
| 125 |
+
(r'2#\{', Number.Hex, 'bin2'),
|
| 126 |
+
(r'64#\{[0-9a-z+/=\s]*\}', Number.Hex),
|
| 127 |
+
(r'"', String, 'string'),
|
| 128 |
+
(r'\{', String, 'string2'),
|
| 129 |
+
(r';#+.*\n', Comment.Special),
|
| 130 |
+
(r';\*+.*\n', Comment.Preproc),
|
| 131 |
+
(r';.*\n', Comment),
|
| 132 |
+
(r'%"', Name.Decorator, 'stringFile'),
|
| 133 |
+
(r'%[^(^{")\s\[\]]+', Name.Decorator),
|
| 134 |
+
(r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money
|
| 135 |
+
(r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time
|
| 136 |
+
(r'\d+[\-/][0-9a-z]+[\-/]\d+(\/\d+\:\d+((\:\d+)?'
|
| 137 |
+
r'([.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date
|
| 138 |
+
(r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple
|
| 139 |
+
(r'\d+X\d+', Keyword.Constant), # pair
|
| 140 |
+
(r'[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+', Number.Float),
|
| 141 |
+
(r'[+-]?\d+(\'\d+)?[.,]\d*', Number.Float),
|
| 142 |
+
(r'[+-]?\d+(\'\d+)?', Number),
|
| 143 |
+
(r'[\[\]()]', Generic.Strong),
|
| 144 |
+
(r'[a-z]+[^(^{"\s:)]*://[^(^{"\s)]*', Name.Decorator), # url
|
| 145 |
+
(r'mailto:[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # url
|
| 146 |
+
(r'[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # email
|
| 147 |
+
(r'comment\s"', Comment, 'commentString1'),
|
| 148 |
+
(r'comment\s\{', Comment, 'commentString2'),
|
| 149 |
+
(r'comment\s\[', Comment, 'commentBlock'),
|
| 150 |
+
(r'comment\s[^(\s{"\[]+', Comment),
|
| 151 |
+
(r'/[^(^{")\s/[\]]*', Name.Attribute),
|
| 152 |
+
(r'([^(^{")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
|
| 153 |
+
(r'<[\w:.-]*>', Name.Tag),
|
| 154 |
+
(r'<[^(<>\s")]+', Name.Tag, 'tag'),
|
| 155 |
+
(r'([^(^{")\s]+)', Text),
|
| 156 |
+
],
|
| 157 |
+
'string': [
|
| 158 |
+
(r'[^(^")]+', String),
|
| 159 |
+
(escape_re, String.Escape),
|
| 160 |
+
(r'[(|)]+', String),
|
| 161 |
+
(r'\^.', String.Escape),
|
| 162 |
+
(r'"', String, '#pop'),
|
| 163 |
+
],
|
| 164 |
+
'string2': [
|
| 165 |
+
(r'[^(^{})]+', String),
|
| 166 |
+
(escape_re, String.Escape),
|
| 167 |
+
(r'[(|)]+', String),
|
| 168 |
+
(r'\^.', String.Escape),
|
| 169 |
+
(r'\{', String, '#push'),
|
| 170 |
+
(r'\}', String, '#pop'),
|
| 171 |
+
],
|
| 172 |
+
'stringFile': [
|
| 173 |
+
(r'[^(^")]+', Name.Decorator),
|
| 174 |
+
(escape_re, Name.Decorator),
|
| 175 |
+
(r'\^.', Name.Decorator),
|
| 176 |
+
(r'"', Name.Decorator, '#pop'),
|
| 177 |
+
],
|
| 178 |
+
'char': [
|
| 179 |
+
(escape_re + '"', String.Char, '#pop'),
|
| 180 |
+
(r'\^."', String.Char, '#pop'),
|
| 181 |
+
(r'."', String.Char, '#pop'),
|
| 182 |
+
],
|
| 183 |
+
'tag': [
|
| 184 |
+
(escape_re, Name.Tag),
|
| 185 |
+
(r'"', Name.Tag, 'tagString'),
|
| 186 |
+
(r'[^(<>\r\n")]+', Name.Tag),
|
| 187 |
+
(r'>', Name.Tag, '#pop'),
|
| 188 |
+
],
|
| 189 |
+
'tagString': [
|
| 190 |
+
(r'[^(^")]+', Name.Tag),
|
| 191 |
+
(escape_re, Name.Tag),
|
| 192 |
+
(r'[(|)]+', Name.Tag),
|
| 193 |
+
(r'\^.', Name.Tag),
|
| 194 |
+
(r'"', Name.Tag, '#pop'),
|
| 195 |
+
],
|
| 196 |
+
'tuple': [
|
| 197 |
+
(r'(\d+\.)+', Keyword.Constant),
|
| 198 |
+
(r'\d+', Keyword.Constant, '#pop'),
|
| 199 |
+
],
|
| 200 |
+
'bin2': [
|
| 201 |
+
(r'\s+', Number.Hex),
|
| 202 |
+
(r'([01]\s*){8}', Number.Hex),
|
| 203 |
+
(r'\}', Number.Hex, '#pop'),
|
| 204 |
+
],
|
| 205 |
+
'commentString1': [
|
| 206 |
+
(r'[^(^")]+', Comment),
|
| 207 |
+
(escape_re, Comment),
|
| 208 |
+
(r'[(|)]+', Comment),
|
| 209 |
+
(r'\^.', Comment),
|
| 210 |
+
(r'"', Comment, '#pop'),
|
| 211 |
+
],
|
| 212 |
+
'commentString2': [
|
| 213 |
+
(r'[^(^{})]+', Comment),
|
| 214 |
+
(escape_re, Comment),
|
| 215 |
+
(r'[(|)]+', Comment),
|
| 216 |
+
(r'\^.', Comment),
|
| 217 |
+
(r'\{', Comment, '#push'),
|
| 218 |
+
(r'\}', Comment, '#pop'),
|
| 219 |
+
],
|
| 220 |
+
'commentBlock': [
|
| 221 |
+
(r'\[', Comment, '#push'),
|
| 222 |
+
(r'\]', Comment, '#pop'),
|
| 223 |
+
(r'"', Comment, "commentString1"),
|
| 224 |
+
(r'\{', Comment, "commentString2"),
|
| 225 |
+
(r'[^(\[\]"{)]+', Comment),
|
| 226 |
+
],
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
def analyse_text(text):
|
| 230 |
+
"""
|
| 231 |
+
Check if code contains REBOL header and so it probably not R code
|
| 232 |
+
"""
|
| 233 |
+
if re.match(r'^\s*REBOL\s*\[', text, re.IGNORECASE):
|
| 234 |
+
# The code starts with REBOL header
|
| 235 |
+
return 1.0
|
| 236 |
+
elif re.search(r'\s*REBOL\s*\[', text, re.IGNORECASE):
|
| 237 |
+
# The code contains REBOL header but also some text before it
|
| 238 |
+
return 0.5
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
class RedLexer(RegexLexer):
|
| 242 |
+
"""
|
| 243 |
+
A Red-language lexer.
|
| 244 |
+
"""
|
| 245 |
+
name = 'Red'
|
| 246 |
+
aliases = ['red', 'red/system']
|
| 247 |
+
filenames = ['*.red', '*.reds']
|
| 248 |
+
mimetypes = ['text/x-red', 'text/x-red-system']
|
| 249 |
+
url = 'https://www.red-lang.org'
|
| 250 |
+
version_added = '2.0'
|
| 251 |
+
|
| 252 |
+
flags = re.IGNORECASE | re.MULTILINE
|
| 253 |
+
|
| 254 |
+
escape_re = r'(?:\^\([0-9a-f]{1,4}\)*)'
|
| 255 |
+
|
| 256 |
+
def word_callback(lexer, match):
|
| 257 |
+
word = match.group()
|
| 258 |
+
|
| 259 |
+
if re.match(".*:$", word):
|
| 260 |
+
yield match.start(), Generic.Subheading, word
|
| 261 |
+
elif re.match(r'(if|unless|either|any|all|while|until|loop|repeat|'
|
| 262 |
+
r'foreach|forall|func|function|does|has|switch|'
|
| 263 |
+
r'case|reduce|compose|get|set|print|prin|equal\?|'
|
| 264 |
+
r'not-equal\?|strict-equal\?|lesser\?|greater\?|lesser-or-equal\?|'
|
| 265 |
+
r'greater-or-equal\?|same\?|not|type\?|stats|'
|
| 266 |
+
r'bind|union|replace|charset|routine)$', word):
|
| 267 |
+
yield match.start(), Name.Builtin, word
|
| 268 |
+
elif re.match(r'(make|random|reflect|to|form|mold|absolute|add|divide|multiply|negate|'
|
| 269 |
+
r'power|remainder|round|subtract|even\?|odd\?|and~|complement|or~|xor~|'
|
| 270 |
+
r'append|at|back|change|clear|copy|find|head|head\?|index\?|insert|'
|
| 271 |
+
r'length\?|next|pick|poke|remove|reverse|select|sort|skip|swap|tail|tail\?|'
|
| 272 |
+
r'take|trim|create|close|delete|modify|open|open\?|query|read|rename|'
|
| 273 |
+
r'update|write)$', word):
|
| 274 |
+
yield match.start(), Name.Function, word
|
| 275 |
+
elif re.match(r'(yes|on|no|off|true|false|tab|cr|lf|newline|escape|slash|sp|space|null|'
|
| 276 |
+
r'none|crlf|dot|null-byte)$', word):
|
| 277 |
+
yield match.start(), Name.Builtin.Pseudo, word
|
| 278 |
+
elif re.match(r'(#system-global|#include|#enum|#define|#either|#if|#import|#export|'
|
| 279 |
+
r'#switch|#default|#get-definition)$', word):
|
| 280 |
+
yield match.start(), Keyword.Namespace, word
|
| 281 |
+
elif re.match(r'(system|halt|quit|quit-return|do|load|q|recycle|call|run|ask|parse|'
|
| 282 |
+
r'raise-error|return|exit|break|alias|push|pop|probe|\?\?|spec-of|body-of|'
|
| 283 |
+
r'quote|forever)$', word):
|
| 284 |
+
yield match.start(), Name.Exception, word
|
| 285 |
+
elif re.match(r'(action\?|block\?|char\?|datatype\?|file\?|function\?|get-path\?|zero\?|'
|
| 286 |
+
r'get-word\?|integer\?|issue\?|lit-path\?|lit-word\?|logic\?|native\?|'
|
| 287 |
+
r'op\?|paren\?|path\?|refinement\?|set-path\?|set-word\?|string\?|unset\?|'
|
| 288 |
+
r'any-struct\?|none\?|word\?|any-series\?)$', word):
|
| 289 |
+
yield match.start(), Keyword, word
|
| 290 |
+
elif re.match(r'(JNICALL|stdcall|cdecl|infix)$', word):
|
| 291 |
+
yield match.start(), Keyword.Namespace, word
|
| 292 |
+
elif re.match("to-.*", word):
|
| 293 |
+
yield match.start(), Keyword, word
|
| 294 |
+
elif re.match(r'(\+|-\*\*|-|\*\*|//|/|\*|and|or|xor|=\?|===|==|=|<>|<=|>=|'
|
| 295 |
+
r'<<<|>>>|<<|>>|<|>%)$', word):
|
| 296 |
+
yield match.start(), Operator, word
|
| 297 |
+
elif re.match(r".*\!$", word):
|
| 298 |
+
yield match.start(), Keyword.Type, word
|
| 299 |
+
elif re.match("'.*", word):
|
| 300 |
+
yield match.start(), Name.Variable.Instance, word # lit-word
|
| 301 |
+
elif re.match("#.*", word):
|
| 302 |
+
yield match.start(), Name.Label, word # issue
|
| 303 |
+
elif re.match("%.*", word):
|
| 304 |
+
yield match.start(), Name.Decorator, word # file
|
| 305 |
+
elif re.match(":.*", word):
|
| 306 |
+
yield match.start(), Generic.Subheading, word # get-word
|
| 307 |
+
else:
|
| 308 |
+
yield match.start(), Name.Variable, word
|
| 309 |
+
|
| 310 |
+
tokens = {
|
| 311 |
+
'root': [
|
| 312 |
+
(r'\s+', Text),
|
| 313 |
+
(r'#"', String.Char, 'char'),
|
| 314 |
+
(r'#\{[0-9a-f\s]*\}', Number.Hex),
|
| 315 |
+
(r'2#\{', Number.Hex, 'bin2'),
|
| 316 |
+
(r'64#\{[0-9a-z+/=\s]*\}', Number.Hex),
|
| 317 |
+
(r'([0-9a-f]+)(h)((\s)|(?=[\[\]{}"()]))',
|
| 318 |
+
bygroups(Number.Hex, Name.Variable, Whitespace)),
|
| 319 |
+
(r'"', String, 'string'),
|
| 320 |
+
(r'\{', String, 'string2'),
|
| 321 |
+
(r';#+.*\n', Comment.Special),
|
| 322 |
+
(r';\*+.*\n', Comment.Preproc),
|
| 323 |
+
(r';.*\n', Comment),
|
| 324 |
+
(r'%"', Name.Decorator, 'stringFile'),
|
| 325 |
+
(r'%[^(^{")\s\[\]]+', Name.Decorator),
|
| 326 |
+
(r'[+-]?([a-z]{1,3})?\$\d+(\.\d+)?', Number.Float), # money
|
| 327 |
+
(r'[+-]?\d+\:\d+(\:\d+)?(\.\d+)?', String.Other), # time
|
| 328 |
+
(r'\d+[\-/][0-9a-z]+[\-/]\d+(/\d+:\d+((:\d+)?'
|
| 329 |
+
r'([\.\d+]?([+-]?\d+:\d+)?)?)?)?', String.Other), # date
|
| 330 |
+
(r'\d+(\.\d+)+\.\d+', Keyword.Constant), # tuple
|
| 331 |
+
(r'\d+X\d+', Keyword.Constant), # pair
|
| 332 |
+
(r'[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+', Number.Float),
|
| 333 |
+
(r'[+-]?\d+(\'\d+)?[.,]\d*', Number.Float),
|
| 334 |
+
(r'[+-]?\d+(\'\d+)?', Number),
|
| 335 |
+
(r'[\[\]()]', Generic.Strong),
|
| 336 |
+
(r'[a-z]+[^(^{"\s:)]*://[^(^{"\s)]*', Name.Decorator), # url
|
| 337 |
+
(r'mailto:[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # url
|
| 338 |
+
(r'[^(^{"@\s)]+@[^(^{"@\s)]+', Name.Decorator), # email
|
| 339 |
+
(r'comment\s"', Comment, 'commentString1'),
|
| 340 |
+
(r'comment\s\{', Comment, 'commentString2'),
|
| 341 |
+
(r'comment\s\[', Comment, 'commentBlock'),
|
| 342 |
+
(r'comment\s[^(\s{"\[]+', Comment),
|
| 343 |
+
(r'/[^(^{^")\s/[\]]*', Name.Attribute),
|
| 344 |
+
(r'([^(^{^")\s/[\]]+)(?=[:({"\s/\[\]])', word_callback),
|
| 345 |
+
(r'<[\w:.-]*>', Name.Tag),
|
| 346 |
+
(r'<[^(<>\s")]+', Name.Tag, 'tag'),
|
| 347 |
+
(r'([^(^{")\s]+)', Text),
|
| 348 |
+
],
|
| 349 |
+
'string': [
|
| 350 |
+
(r'[^(^")]+', String),
|
| 351 |
+
(escape_re, String.Escape),
|
| 352 |
+
(r'[(|)]+', String),
|
| 353 |
+
(r'\^.', String.Escape),
|
| 354 |
+
(r'"', String, '#pop'),
|
| 355 |
+
],
|
| 356 |
+
'string2': [
|
| 357 |
+
(r'[^(^{})]+', String),
|
| 358 |
+
(escape_re, String.Escape),
|
| 359 |
+
(r'[(|)]+', String),
|
| 360 |
+
(r'\^.', String.Escape),
|
| 361 |
+
(r'\{', String, '#push'),
|
| 362 |
+
(r'\}', String, '#pop'),
|
| 363 |
+
],
|
| 364 |
+
'stringFile': [
|
| 365 |
+
(r'[^(^")]+', Name.Decorator),
|
| 366 |
+
(escape_re, Name.Decorator),
|
| 367 |
+
(r'\^.', Name.Decorator),
|
| 368 |
+
(r'"', Name.Decorator, '#pop'),
|
| 369 |
+
],
|
| 370 |
+
'char': [
|
| 371 |
+
(escape_re + '"', String.Char, '#pop'),
|
| 372 |
+
(r'\^."', String.Char, '#pop'),
|
| 373 |
+
(r'."', String.Char, '#pop'),
|
| 374 |
+
],
|
| 375 |
+
'tag': [
|
| 376 |
+
(escape_re, Name.Tag),
|
| 377 |
+
(r'"', Name.Tag, 'tagString'),
|
| 378 |
+
(r'[^(<>\r\n")]+', Name.Tag),
|
| 379 |
+
(r'>', Name.Tag, '#pop'),
|
| 380 |
+
],
|
| 381 |
+
'tagString': [
|
| 382 |
+
(r'[^(^")]+', Name.Tag),
|
| 383 |
+
(escape_re, Name.Tag),
|
| 384 |
+
(r'[(|)]+', Name.Tag),
|
| 385 |
+
(r'\^.', Name.Tag),
|
| 386 |
+
(r'"', Name.Tag, '#pop'),
|
| 387 |
+
],
|
| 388 |
+
'tuple': [
|
| 389 |
+
(r'(\d+\.)+', Keyword.Constant),
|
| 390 |
+
(r'\d+', Keyword.Constant, '#pop'),
|
| 391 |
+
],
|
| 392 |
+
'bin2': [
|
| 393 |
+
(r'\s+', Number.Hex),
|
| 394 |
+
(r'([01]\s*){8}', Number.Hex),
|
| 395 |
+
(r'\}', Number.Hex, '#pop'),
|
| 396 |
+
],
|
| 397 |
+
'commentString1': [
|
| 398 |
+
(r'[^(^")]+', Comment),
|
| 399 |
+
(escape_re, Comment),
|
| 400 |
+
(r'[(|)]+', Comment),
|
| 401 |
+
(r'\^.', Comment),
|
| 402 |
+
(r'"', Comment, '#pop'),
|
| 403 |
+
],
|
| 404 |
+
'commentString2': [
|
| 405 |
+
(r'[^(^{})]+', Comment),
|
| 406 |
+
(escape_re, Comment),
|
| 407 |
+
(r'[(|)]+', Comment),
|
| 408 |
+
(r'\^.', Comment),
|
| 409 |
+
(r'\{', Comment, '#push'),
|
| 410 |
+
(r'\}', Comment, '#pop'),
|
| 411 |
+
],
|
| 412 |
+
'commentBlock': [
|
| 413 |
+
(r'\[', Comment, '#push'),
|
| 414 |
+
(r'\]', Comment, '#pop'),
|
| 415 |
+
(r'"', Comment, "commentString1"),
|
| 416 |
+
(r'\{', Comment, "commentString2"),
|
| 417 |
+
(r'[^(\[\]"{)]+', Comment),
|
| 418 |
+
],
|
| 419 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rego.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.rego
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the Rego policy languages.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, words
|
| 12 |
+
from pygments.token import Comment, Operator, Keyword, Name, String, Number, Punctuation, Whitespace
|
| 13 |
+
|
| 14 |
+
class RegoLexer(RegexLexer):
|
| 15 |
+
"""
|
| 16 |
+
For Rego source.
|
| 17 |
+
"""
|
| 18 |
+
name = 'Rego'
|
| 19 |
+
url = 'https://www.openpolicyagent.org/docs/latest/policy-language/'
|
| 20 |
+
filenames = ['*.rego']
|
| 21 |
+
aliases = ['rego']
|
| 22 |
+
mimetypes = ['text/x-rego']
|
| 23 |
+
version_added = '2.19'
|
| 24 |
+
|
| 25 |
+
reserved_words = (
|
| 26 |
+
'as', 'contains', 'data', 'default', 'else', 'every', 'false',
|
| 27 |
+
'if', 'in', 'import', 'package', 'not', 'null',
|
| 28 |
+
'some', 'true', 'with'
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
+
builtins = (
|
| 32 |
+
# https://www.openpolicyagent.org/docs/latest/philosophy/#the-opa-document-model
|
| 33 |
+
'data', # Global variable for accessing base and virtual documents
|
| 34 |
+
'input', # Represents synchronously pushed base documents
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
tokens = {
|
| 38 |
+
'root': [
|
| 39 |
+
(r'\n', Whitespace),
|
| 40 |
+
(r'\s+', Whitespace),
|
| 41 |
+
(r'#.*?$', Comment.Single),
|
| 42 |
+
(words(reserved_words, suffix=r'\b'), Keyword),
|
| 43 |
+
(words(builtins, suffix=r'\b'), Name.Builtin),
|
| 44 |
+
(r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
|
| 45 |
+
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
| 46 |
+
(r'`[^`]*`', String.Backtick),
|
| 47 |
+
(r'-?\d+(\.\d+)?', Number),
|
| 48 |
+
(r'(==|!=|<=|>=|:=)', Operator), # Compound operators
|
| 49 |
+
(r'[=<>+\-*/%&|]', Operator), # Single-character operators
|
| 50 |
+
(r'[\[\]{}(),.:;]', Punctuation),
|
| 51 |
+
]
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
__all__ = ['RegoLexer']
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/rell.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.rell
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexers for the Rell language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, bygroups, default, words
|
| 12 |
+
from pygments.token import Comment, Keyword, Name, String, Number, \
|
| 13 |
+
Punctuation, Whitespace
|
| 14 |
+
|
| 15 |
+
__all__ = ['RellLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class RellLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
A Lexer for Rell.
|
| 21 |
+
"""
|
| 22 |
+
name = 'Rell'
|
| 23 |
+
url = 'https://docs.chromia.com/rell/rell-intro'
|
| 24 |
+
aliases = ['rell']
|
| 25 |
+
filenames = ['*.rell']
|
| 26 |
+
mimetypes = ['text/x-rell']
|
| 27 |
+
version_added = '2.20'
|
| 28 |
+
|
| 29 |
+
ident = r'[a-zA-Z_][a-zA-Z0-9_]*'
|
| 30 |
+
|
| 31 |
+
tokens = {
|
| 32 |
+
'root': [
|
| 33 |
+
(words((
|
| 34 |
+
'big_integer', 'boolean', 'byte_array', 'decimal', 'gtv',
|
| 35 |
+
'integer', 'json', 'list', 'map', 'mutable', 'set', 'text',
|
| 36 |
+
'virtual'), suffix=r'\b'),
|
| 37 |
+
Keyword.Type),
|
| 38 |
+
(r'(false|true|null)\b', Keyword.Constant),
|
| 39 |
+
(r'(entity|enum|namespace|object|struct)\b', Keyword.Declaration),
|
| 40 |
+
(r'(function|operation|query)\b', Keyword.Declaration, 'function'),
|
| 41 |
+
(words((
|
| 42 |
+
'abstract', 'and', 'break', 'continue', 'create', 'delete',
|
| 43 |
+
'else', 'for', 'if', 'import', 'in', 'index', 'key', 'limit',
|
| 44 |
+
'module', 'not', 'offset', 'or', 'override', 'return', 'update',
|
| 45 |
+
'val', 'var', 'when', 'while'), suffix=r'\b'),
|
| 46 |
+
Keyword.Reserved),
|
| 47 |
+
(r'//.*?$', Comment.Single),
|
| 48 |
+
(r'/\*(.|\n|\r)*?\*/', Comment.Multiline),
|
| 49 |
+
(r'"(\\\\|\\"|[^"])*"', String.Double),
|
| 50 |
+
(r'\'(\\\\|\\\'|[^\\\'])*\'', String.Single),
|
| 51 |
+
(r'-?[0-9]*\.[0-9]+([eE][+-][0-9]+)?', Number.Float),
|
| 52 |
+
(r'-?[0-9]+([eE][+-][0-9]+|[lL])?', Number.Integer),
|
| 53 |
+
(r'x(\'[a-fA-F0-9]*\'|"[a-fA-F0-9]*")', String.Binary),
|
| 54 |
+
(r'(\.)([ \n\t\r]*)(' + ident + ')',
|
| 55 |
+
bygroups(Punctuation, Whitespace, Name.Attribute)),
|
| 56 |
+
(r'[{}():;,]+', Punctuation),
|
| 57 |
+
(r'[ \n\t\r]+', Whitespace),
|
| 58 |
+
(r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Decorator),
|
| 59 |
+
(r'[~^*!%&\[\]<>|+=/?\-@\$]', Punctuation.Marker),
|
| 60 |
+
(ident, Name),
|
| 61 |
+
(r'(\.)+', Punctuation),
|
| 62 |
+
],
|
| 63 |
+
'function': [
|
| 64 |
+
(r'[ \n\t\r]+', Whitespace),
|
| 65 |
+
(ident, Name.Function, '#pop'),
|
| 66 |
+
default('#pop'),
|
| 67 |
+
],
|
| 68 |
+
}
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/resource.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.resource
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for resource definition files.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import re
|
| 12 |
+
|
| 13 |
+
from pygments.lexer import RegexLexer, bygroups, words
|
| 14 |
+
from pygments.token import Comment, String, Number, Operator, Text, \
|
| 15 |
+
Keyword, Name
|
| 16 |
+
|
| 17 |
+
__all__ = ['ResourceLexer']
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class ResourceLexer(RegexLexer):
|
| 21 |
+
"""Lexer for ICU Resource bundles.
|
| 22 |
+
"""
|
| 23 |
+
name = 'ResourceBundle'
|
| 24 |
+
aliases = ['resourcebundle', 'resource']
|
| 25 |
+
filenames = []
|
| 26 |
+
url = 'https://unicode-org.github.io/icu/userguide/locale/resources.html'
|
| 27 |
+
version_added = '2.0'
|
| 28 |
+
|
| 29 |
+
_types = (':table', ':array', ':string', ':bin', ':import', ':intvector',
|
| 30 |
+
':int', ':alias')
|
| 31 |
+
|
| 32 |
+
flags = re.MULTILINE | re.IGNORECASE
|
| 33 |
+
tokens = {
|
| 34 |
+
'root': [
|
| 35 |
+
(r'//.*?$', Comment),
|
| 36 |
+
(r'"', String, 'string'),
|
| 37 |
+
(r'-?\d+', Number.Integer),
|
| 38 |
+
(r'[,{}]', Operator),
|
| 39 |
+
(r'([^\s{{:]+)(\s*)({}?)'.format('|'.join(_types)),
|
| 40 |
+
bygroups(Name, Text, Keyword)),
|
| 41 |
+
(r'\s+', Text),
|
| 42 |
+
(words(_types), Keyword),
|
| 43 |
+
],
|
| 44 |
+
'string': [
|
| 45 |
+
(r'(\\x[0-9a-f]{2}|\\u[0-9a-f]{4}|\\U00[0-9a-f]{6}|'
|
| 46 |
+
r'\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\\{|[^"{\\])+', String),
|
| 47 |
+
(r'\{', String.Escape, 'msgname'),
|
| 48 |
+
(r'"', String, '#pop')
|
| 49 |
+
],
|
| 50 |
+
'msgname': [
|
| 51 |
+
(r'([^{},]+)(\s*)', bygroups(Name, String.Escape), ('#pop', 'message'))
|
| 52 |
+
],
|
| 53 |
+
'message': [
|
| 54 |
+
(r'\{', String.Escape, 'msgname'),
|
| 55 |
+
(r'\}', String.Escape, '#pop'),
|
| 56 |
+
(r'(,)(\s*)([a-z]+)(\s*\})',
|
| 57 |
+
bygroups(Operator, String.Escape, Keyword, String.Escape), '#pop'),
|
| 58 |
+
(r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)(offset)(\s*)(:)(\s*)(-?\d+)(\s*)',
|
| 59 |
+
bygroups(Operator, String.Escape, Keyword, String.Escape, Operator,
|
| 60 |
+
String.Escape, Operator.Word, String.Escape, Operator,
|
| 61 |
+
String.Escape, Number.Integer, String.Escape), 'choice'),
|
| 62 |
+
(r'(,)(\s*)([a-z]+)(\s*)(,)(\s*)',
|
| 63 |
+
bygroups(Operator, String.Escape, Keyword, String.Escape, Operator,
|
| 64 |
+
String.Escape), 'choice'),
|
| 65 |
+
(r'\s+', String.Escape)
|
| 66 |
+
],
|
| 67 |
+
'choice': [
|
| 68 |
+
(r'(=|<|>|<=|>=|!=)(-?\d+)(\s*\{)',
|
| 69 |
+
bygroups(Operator, Number.Integer, String.Escape), 'message'),
|
| 70 |
+
(r'([a-z]+)(\s*\{)', bygroups(Keyword.Type, String.Escape), 'str'),
|
| 71 |
+
(r'\}', String.Escape, ('#pop', '#pop')),
|
| 72 |
+
(r'\s+', String.Escape)
|
| 73 |
+
],
|
| 74 |
+
'str': [
|
| 75 |
+
(r'\}', String.Escape, '#pop'),
|
| 76 |
+
(r'\{', String.Escape, 'msgname'),
|
| 77 |
+
(r'[^{}]+', String)
|
| 78 |
+
]
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
def analyse_text(text):
|
| 82 |
+
if text.startswith('root:table'):
|
| 83 |
+
return 1.0
|
hai-mcp-pr7/.venv/lib/python3.13/site-packages/pygments/lexers/ride.py
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
pygments.lexers.ride
|
| 3 |
+
~~~~~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Lexer for the Ride programming language.
|
| 6 |
+
|
| 7 |
+
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
|
| 8 |
+
:license: BSD, see LICENSE for details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from pygments.lexer import RegexLexer, words, include
|
| 12 |
+
from pygments.token import Comment, Keyword, Name, Number, Punctuation, \
|
| 13 |
+
String, Text
|
| 14 |
+
|
| 15 |
+
__all__ = ['RideLexer']
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class RideLexer(RegexLexer):
|
| 19 |
+
"""
|
| 20 |
+
For Ride source code.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
name = 'Ride'
|
| 24 |
+
aliases = ['ride']
|
| 25 |
+
filenames = ['*.ride']
|
| 26 |
+
mimetypes = ['text/x-ride']
|
| 27 |
+
url = 'https://docs.waves.tech/en/ride'
|
| 28 |
+
version_added = '2.6'
|
| 29 |
+
|
| 30 |
+
validName = r'[a-zA-Z_][a-zA-Z0-9_\']*'
|
| 31 |
+
|
| 32 |
+
builtinOps = (
|
| 33 |
+
'||', '|', '>=', '>', '==', '!',
|
| 34 |
+
'=', '<=', '<', '::', ':+', ':', '!=', '/',
|
| 35 |
+
'.', '=>', '-', '+', '*', '&&', '%', '++',
|
| 36 |
+
)
|
| 37 |
+
|
| 38 |
+
globalVariablesName = (
|
| 39 |
+
'NOALG', 'MD5', 'SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512',
|
| 40 |
+
'SHA3224', 'SHA3256', 'SHA3384', 'SHA3512', 'nil', 'this', 'unit',
|
| 41 |
+
'height', 'lastBlock', 'Buy', 'Sell', 'CEILING', 'FLOOR', 'DOWN',
|
| 42 |
+
'HALFDOWN', 'HALFEVEN', 'HALFUP', 'UP',
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
typesName = (
|
| 46 |
+
'Unit', 'Int', 'Boolean', 'ByteVector', 'String', 'Address', 'Alias',
|
| 47 |
+
'Transfer', 'AssetPair', 'DataEntry', 'Order', 'Transaction',
|
| 48 |
+
'GenesisTransaction', 'PaymentTransaction', 'ReissueTransaction',
|
| 49 |
+
'BurnTransaction', 'MassTransferTransaction', 'ExchangeTransaction',
|
| 50 |
+
'TransferTransaction', 'SetAssetScriptTransaction',
|
| 51 |
+
'InvokeScriptTransaction', 'IssueTransaction', 'LeaseTransaction',
|
| 52 |
+
'LeaseCancelTransaction', 'CreateAliasTransaction',
|
| 53 |
+
'SetScriptTransaction', 'SponsorFeeTransaction', 'DataTransaction',
|
| 54 |
+
'WriteSet', 'AttachedPayment', 'ScriptTransfer', 'TransferSet',
|
| 55 |
+
'ScriptResult', 'Invocation', 'Asset', 'BlockInfo', 'Issue', 'Reissue',
|
| 56 |
+
'Burn', 'NoAlg', 'Md5', 'Sha1', 'Sha224', 'Sha256', 'Sha384', 'Sha512',
|
| 57 |
+
'Sha3224', 'Sha3256', 'Sha3384', 'Sha3512', 'BinaryEntry',
|
| 58 |
+
'BooleanEntry', 'IntegerEntry', 'StringEntry', 'List', 'Ceiling',
|
| 59 |
+
'Down', 'Floor', 'HalfDown', 'HalfEven', 'HalfUp', 'Up',
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
functionsName = (
|
| 63 |
+
'fraction', 'size', 'toBytes', 'take', 'drop', 'takeRight', 'dropRight',
|
| 64 |
+
'toString', 'isDefined', 'extract', 'throw', 'getElement', 'value',
|
| 65 |
+
'cons', 'toUtf8String', 'toInt', 'indexOf', 'lastIndexOf', 'split',
|
| 66 |
+
'parseInt', 'parseIntValue', 'keccak256', 'blake2b256', 'sha256',
|
| 67 |
+
'sigVerify', 'toBase58String', 'fromBase58String', 'toBase64String',
|
| 68 |
+
'fromBase64String', 'transactionById', 'transactionHeightById',
|
| 69 |
+
'getInteger', 'getBoolean', 'getBinary', 'getString',
|
| 70 |
+
'addressFromPublicKey', 'addressFromString', 'addressFromRecipient',
|
| 71 |
+
'assetBalance', 'wavesBalance', 'getIntegerValue', 'getBooleanValue',
|
| 72 |
+
'getBinaryValue', 'getStringValue', 'addressFromStringValue',
|
| 73 |
+
'assetInfo', 'rsaVerify', 'checkMerkleProof', 'median',
|
| 74 |
+
'valueOrElse', 'valueOrErrorMessage', 'contains', 'log', 'pow',
|
| 75 |
+
'toBase16String', 'fromBase16String', 'blockInfoByHeight',
|
| 76 |
+
'transferTransactionById',
|
| 77 |
+
)
|
| 78 |
+
|
| 79 |
+
reservedWords = words((
|
| 80 |
+
'match', 'case', 'else', 'func', 'if',
|
| 81 |
+
'let', 'then', '@Callable', '@Verifier',
|
| 82 |
+
), suffix=r'\b')
|
| 83 |
+
|
| 84 |
+
tokens = {
|
| 85 |
+
'root': [
|
| 86 |
+
# Comments
|
| 87 |
+
(r'#.*', Comment.Single),
|
| 88 |
+
# Whitespace
|
| 89 |
+
(r'\s+', Text),
|
| 90 |
+
# Strings
|
| 91 |
+
(r'"', String, 'doublequote'),
|
| 92 |
+
(r'utf8\'', String, 'utf8quote'),
|
| 93 |
+
(r'base(58|64|16)\'', String, 'singlequote'),
|
| 94 |
+
# Keywords
|
| 95 |
+
(reservedWords, Keyword.Reserved),
|
| 96 |
+
(r'\{-#.*?#-\}', Keyword.Reserved),
|
| 97 |
+
(r'FOLD<\d+>', Keyword.Reserved),
|
| 98 |
+
# Types
|
| 99 |
+
(words(typesName), Keyword.Type),
|
| 100 |
+
# Main
|
| 101 |
+
# (specialName, Keyword.Reserved),
|
| 102 |
+
# Prefix Operators
|
| 103 |
+
(words(builtinOps, prefix=r'\(', suffix=r'\)'), Name.Function),
|
| 104 |
+
# Infix Operators
|
| 105 |
+
(words(builtinOps), Name.Function),
|
| 106 |
+
(words(globalVariablesName), Name.Function),
|
| 107 |
+
(words(functionsName), Name.Function),
|
| 108 |
+
# Numbers
|
| 109 |
+
include('numbers'),
|
| 110 |
+
# Variable Names
|
| 111 |
+
(validName, Name.Variable),
|
| 112 |
+
# Parens
|
| 113 |
+
(r'[,()\[\]{}]', Punctuation),
|
| 114 |
+
],
|
| 115 |
+
|
| 116 |
+
'doublequote': [
|
| 117 |
+
(r'\\u[0-9a-fA-F]{4}', String.Escape),
|
| 118 |
+
(r'\\[nrfvb\\"]', String.Escape),
|
| 119 |
+
(r'[^"]', String),
|
| 120 |
+
(r'"', String, '#pop'),
|
| 121 |
+
],
|
| 122 |
+
|
| 123 |
+
'utf8quote': [
|
| 124 |
+
(r'\\u[0-9a-fA-F]{4}', String.Escape),
|
| 125 |
+
(r'\\[nrfvb\\\']', String.Escape),
|
| 126 |
+
(r'[^\']', String),
|
| 127 |
+
(r'\'', String, '#pop'),
|
| 128 |
+
],
|
| 129 |
+
|
| 130 |
+
'singlequote': [
|
| 131 |
+
(r'[^\']', String),
|
| 132 |
+
(r'\'', String, '#pop'),
|
| 133 |
+
],
|
| 134 |
+
|
| 135 |
+
'numbers': [
|
| 136 |
+
(r'_?\d+', Number.Integer),
|
| 137 |
+
],
|
| 138 |
+
}
|