aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Pygments/py3/pygments/lexers/r.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-05-20 07:58:40 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-05-20 08:05:00 +0300
commitbcd5bcc390793791d293d386b2ebefbe683fb4e1 (patch)
treec93e3b8c847237e7e7626f4a07f1b657bb34f04d /contrib/python/Pygments/py3/pygments/lexers/r.py
parent1a9f1508fe9c8c5927ffebf33197a6108e70501d (diff)
downloadydb-bcd5bcc390793791d293d386b2ebefbe683fb4e1.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/Pygments/py3/pygments/lexers/r.py')
-rw-r--r--contrib/python/Pygments/py3/pygments/lexers/r.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/python/Pygments/py3/pygments/lexers/r.py b/contrib/python/Pygments/py3/pygments/lexers/r.py
index ed62fa2e3f..8d7e4a8dfa 100644
--- a/contrib/python/Pygments/py3/pygments/lexers/r.py
+++ b/contrib/python/Pygments/py3/pygments/lexers/r.py
@@ -4,7 +4,7 @@
Lexers for the R/S 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.
"""
@@ -28,6 +28,8 @@ class RConsoleLexer(Lexer):
name = 'RConsole'
aliases = ['rconsole', 'rout']
filenames = ['*.Rout']
+ url = 'https://www.r-project.org'
+ version_added = ''
def get_tokens_unprocessed(self, text):
slexer = SLexer(**self.options)
@@ -67,8 +69,6 @@ class RConsoleLexer(Lexer):
class SLexer(RegexLexer):
"""
For S, S-plus, and R source code.
-
- .. versionadded:: 0.10
"""
name = 'S'
@@ -76,6 +76,8 @@ class SLexer(RegexLexer):
filenames = ['*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron']
mimetypes = ['text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r',
'text/x-R', 'text/x-r-history', 'text/x-r-profile']
+ url = 'https://www.r-project.org'
+ version_added = '0.10'
valid_name = r'`[^`\\]*(?:\\.[^`\\]*)*`|(?:[a-zA-Z]|\.[A-Za-z_.])[\w.]*|\.'
tokens = {
@@ -126,7 +128,7 @@ class SLexer(RegexLexer):
],
'root': [
# calls:
- (r'(%s)\s*(?=\()' % valid_name, Name.Function),
+ (rf'({valid_name})\s*(?=\()', Name.Function),
include('statements'),
# blocks:
(r'\{|\}', Punctuation),
@@ -159,13 +161,13 @@ class RdLexer(RegexLexer):
than the macros. A description of Rd syntax is found in `Writing R
Extensions <http://cran.r-project.org/doc/manuals/R-exts.html>`_
and `Parsing Rd files <http://developer.r-project.org/parseRd.pdf>`_.
-
- .. versionadded:: 1.6
"""
name = 'Rd'
aliases = ['rd']
filenames = ['*.Rd']
mimetypes = ['text/x-r-doc']
+ url = 'http://cran.r-project.org/doc/manuals/R-exts.html'
+ version_added = '1.6'
# To account for verbatim / LaTeX-like / and R-like areas
# would require parsing.