diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-05-20 07:58:40 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-05-20 08:05:00 +0300 |
commit | bcd5bcc390793791d293d386b2ebefbe683fb4e1 (patch) | |
tree | c93e3b8c847237e7e7626f4a07f1b657bb34f04d /contrib/python/Pygments/py3/pygments/lexers/asm.py | |
parent | 1a9f1508fe9c8c5927ffebf33197a6108e70501d (diff) | |
download | ydb-bcd5bcc390793791d293d386b2ebefbe683fb4e1.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/asm.py')
-rw-r--r-- | contrib/python/Pygments/py3/pygments/lexers/asm.py | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/asm.py b/contrib/python/Pygments/py3/pygments/lexers/asm.py index 0035c723f0..a049370bd7 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/asm.py +++ b/contrib/python/Pygments/py3/pygments/lexers/asm.py @@ -4,7 +4,7 @@ Lexers for assembly languages. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -31,6 +31,8 @@ class GasLexer(RegexLexer): aliases = ['gas', 'asm'] filenames = ['*.s', '*.S'] mimetypes = ['text/x-gas'] + url = 'https://www.gnu.org/software/binutils' + version_added = '' #: optional Comment or Whitespace string = r'"(\\"|[^"])*"' @@ -167,6 +169,8 @@ class ObjdumpLexer(RegexLexer): aliases = ['objdump'] filenames = ['*.objdump'] mimetypes = ['text/x-objdump'] + url = 'https://www.gnu.org/software/binutils' + version_added = '' tokens = _objdump_lexer_tokens(GasLexer) @@ -179,6 +183,8 @@ class DObjdumpLexer(DelegatingLexer): aliases = ['d-objdump'] filenames = ['*.d-objdump'] mimetypes = ['text/x-d-objdump'] + url = 'https://www.gnu.org/software/binutils' + version_added = '' def __init__(self, **options): super().__init__(DLexer, ObjdumpLexer, **options) @@ -192,6 +198,8 @@ class CppObjdumpLexer(DelegatingLexer): aliases = ['cpp-objdump', 'c++-objdumb', 'cxx-objdump'] filenames = ['*.cpp-objdump', '*.c++-objdump', '*.cxx-objdump'] mimetypes = ['text/x-cpp-objdump'] + url = 'https://www.gnu.org/software/binutils' + version_added = '' def __init__(self, **options): super().__init__(CppLexer, ObjdumpLexer, **options) @@ -205,6 +213,9 @@ class CObjdumpLexer(DelegatingLexer): aliases = ['c-objdump'] filenames = ['*.c-objdump'] mimetypes = ['text/x-c-objdump'] + url = 'https://www.gnu.org/software/binutils' + version_added = '' + def __init__(self, **options): super().__init__(CLexer, ObjdumpLexer, **options) @@ -213,13 +224,13 @@ class CObjdumpLexer(DelegatingLexer): class HsailLexer(RegexLexer): """ For HSAIL assembly code. - - .. versionadded:: 2.2 """ name = 'HSAIL' aliases = ['hsail', 'hsa'] filenames = ['*.hsail'] mimetypes = ['text/x-hsail'] + url = 'https://en.wikipedia.org/wiki/Heterogeneous_System_Architecture#HSA_Intermediate_Layer' + version_added = '2.2' string = r'"[^"]*?"' identifier = r'[a-zA-Z_][\w.]*' @@ -354,6 +365,7 @@ class LlvmLexer(RegexLexer): aliases = ['llvm'] filenames = ['*.ll'] mimetypes = ['text/x-llvm'] + version_added = '' #: optional Comment or Whitespace string = r'"[^"]*?"' @@ -490,14 +502,13 @@ class LlvmLexer(RegexLexer): class LlvmMirBodyLexer(RegexLexer): """ For LLVM MIR examples without the YAML wrapper. - - .. versionadded:: 2.6 """ name = 'LLVM-MIR Body' url = 'https://llvm.org/docs/MIRLangRef.html' aliases = ['llvm-mir-body'] filenames = [] mimetypes = [] + version_added = '2.6' tokens = { 'root': [ @@ -635,13 +646,12 @@ class LlvmMirLexer(RegexLexer): machine specific intermediate representation. It allows LLVM's developers to see the state of the compilation process at various points, as well as test individual pieces of the compiler. - - .. versionadded:: 2.6 """ name = 'LLVM-MIR' url = 'https://llvm.org/docs/MIRLangRef.html' aliases = ['llvm-mir'] filenames = ['*.mir'] + version_added = '2.6' tokens = { 'root': [ @@ -715,6 +725,8 @@ class NasmLexer(RegexLexer): aliases = ['nasm'] filenames = ['*.asm', '*.ASM', '*.nasm'] mimetypes = ['text/x-nasm'] + url = 'https://nasm.us' + version_added = '' # Tasm uses the same file endings, but TASM is not as common as NASM, so # we prioritize NASM higher by default @@ -746,7 +758,7 @@ class NasmLexer(RegexLexer): (r'^\s*%', Comment.Preproc, 'preproc'), include('whitespace'), (identifier + ':', Name.Label), - (r'(%s)(\s+)(equ)' % identifier, + (rf'({identifier})(\s+)(equ)', bygroups(Name.Constant, Whitespace, Keyword.Declaration), 'instruction-args'), (directives, Keyword, 'instruction-args'), @@ -796,13 +808,13 @@ class NasmLexer(RegexLexer): class NasmObjdumpLexer(ObjdumpLexer): """ For the output of ``objdump -d -M intel``. - - .. versionadded:: 2.0 """ name = 'objdump-nasm' aliases = ['objdump-nasm'] filenames = ['*.objdump-intel'] mimetypes = ['text/x-nasm-objdump'] + url = 'https://www.gnu.org/software/binutils' + version_added = '2.0' tokens = _objdump_lexer_tokens(NasmLexer) @@ -815,6 +827,8 @@ class TasmLexer(RegexLexer): aliases = ['tasm'] filenames = ['*.asm', '*.ASM', '*.tasm'] mimetypes = ['text/x-tasm'] + url = 'https://en.wikipedia.org/wiki/Turbo_Assembler' + version_added = '' identifier = r'[@a-z$._?][\w$.?#@~]*' hexn = r'(?:0x[0-9a-f]+|$0[0-9a-f]*|[0-9]+[0-9a-f]*h)' @@ -844,7 +858,7 @@ class TasmLexer(RegexLexer): include('whitespace'), (identifier + ':', Name.Label), (directives, Keyword, 'instruction-args'), - (r'(%s)(\s+)(%s)' % (identifier, datatype), + (rf'({identifier})(\s+)({datatype})', bygroups(Name.Constant, Whitespace, Keyword.Declaration), 'instruction-args'), (declkw, Keyword.Declaration, 'instruction-args'), @@ -896,12 +910,12 @@ class TasmLexer(RegexLexer): class Ca65Lexer(RegexLexer): """ For ca65 assembler sources. - - .. versionadded:: 1.6 """ name = 'ca65 assembler' aliases = ['ca65'] filenames = ['*.s'] + url = 'https://cc65.github.io' + version_added = '1.6' flags = re.IGNORECASE @@ -935,14 +949,13 @@ class Ca65Lexer(RegexLexer): class Dasm16Lexer(RegexLexer): """ For DCPU-16 Assembly. - - .. versionadded:: 2.4 """ name = 'DASM16' url = 'http://0x10c.com/doc/dcpu-16.txt' aliases = ['dasm16'] filenames = ['*.dasm16', '*.dasm'] mimetypes = ['text/x-dasm16'] + version_added = '2.4' INSTRUCTIONS = [ 'SET', |