summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Trudeau <ctrudeau@arsensa.com>2021-06-21 16:25:58 -0400
committerChristopher Trudeau <ctrudeau@arsensa.com>2021-06-21 16:25:58 -0400
commitfbdcfa8066f98d896c2a746aa4fc6d5869f7e8d2 (patch)
tree7a470bdef2d0a36d0bd7ca1d9ae9df116d0717e2
parent18a7fdb2ce1695e471071f7d635cb98de6080ee8 (diff)
downloadpygments-git-fbdcfa8066f98d896c2a746aa4fc6d5869f7e8d2.tar.gz
Changes from code review:
- renamed nodecon to nodejsrepl - removed bad mimetypes
-rw-r--r--pygments/lexers/_mapping.py2
-rw-r--r--pygments/lexers/javascript.py13
-rw-r--r--tests/examplefiles/nodejsrepl/nodejsrepl_test.nodejsrepl (renamed from tests/examplefiles/nodecon/nodecod_test.nodecon)2
-rw-r--r--tests/examplefiles/nodejsrepl/nodejsrepl_test.nodejsrepl.output (renamed from tests/examplefiles/nodecon/nodecod_test.nodecon.output)2
4 files changed, 10 insertions, 9 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index 67c8df89..d2486b4c 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -320,7 +320,7 @@ LEXERS = {
'NimrodLexer': ('pygments.lexers.nimrod', 'Nimrod', ('nimrod', 'nim'), ('*.nim', '*.nimrod'), ('text/x-nim',)),
'NitLexer': ('pygments.lexers.nit', 'Nit', ('nit',), ('*.nit',), ()),
'NixLexer': ('pygments.lexers.nix', 'Nix', ('nixos', 'nix'), ('*.nix',), ('text/x-nix',)),
- 'NodeConsoleLexer': ('pygments.lexers.javascript', 'JavaScript Node.js console session', ('nodecon',), (), ('text/x-nodecon',)),
+ 'NodeConsoleLexer': ('pygments.lexers.javascript', 'Node.js REPL console session', ('nodejsrepl',), (), ('text/x-nodejsrepl',)),
'NotmuchLexer': ('pygments.lexers.textfmts', 'Notmuch', ('notmuch',), (), ()),
'NuSMVLexer': ('pygments.lexers.smv', 'NuSMV', ('nusmv',), ('*.smv',), ()),
'NumPyLexer': ('pygments.lexers.python', 'NumPy', ('numpy',), (), ()),
diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py
index 1ea1f553..501ccfe9 100644
--- a/pygments/lexers/javascript.py
+++ b/pygments/lexers/javascript.py
@@ -1540,9 +1540,9 @@ class JuttleLexer(RegexLexer):
class NodeConsoleLexer(Lexer):
"""
- For parsing JavaScript within an interactive Node.js shell, such as:
+ For parsing within an interactive Node.js REPL, such as:
- .. sourcecode:: nodejs
+ .. sourcecode:: nodejsrepl
> let a = 3
undefined
@@ -1554,11 +1554,12 @@ class NodeConsoleLexer(Lexer):
'4'
> b == a
false
+
+ .. versionadded: 2.10
"""
- name = 'JavaScript Node.js console session'
- aliases = ['nodejs', 'nodecon']
- mimetypes = ['application/javascript', 'application/x-javascript',
- 'text/x-javascript', 'text/javascript']
+ name = 'Node.js REPL console session'
+ aliases = ['nodejsrepl', ]
+ mimetypes = ['text/x-nodejsrepl', ]
def get_tokens_unprocessed(self, text):
jslexer = JavascriptLexer(**self.options)
diff --git a/tests/examplefiles/nodecon/nodecod_test.nodecon b/tests/examplefiles/nodejsrepl/nodejsrepl_test.nodejsrepl
index 1442b6f5..7679d9ce 100644
--- a/tests/examplefiles/nodecon/nodecod_test.nodecon
+++ b/tests/examplefiles/nodejsrepl/nodejsrepl_test.nodejsrepl
@@ -1,4 +1,4 @@
-// Node.js Console Session
+// Node.js REPL Session
> let a = 3
undefined
> a
diff --git a/tests/examplefiles/nodecon/nodecod_test.nodecon.output b/tests/examplefiles/nodejsrepl/nodejsrepl_test.nodejsrepl.output
index a812407a..28c5c3a5 100644
--- a/tests/examplefiles/nodecon/nodecod_test.nodecon.output
+++ b/tests/examplefiles/nodejsrepl/nodejsrepl_test.nodejsrepl.output
@@ -1,5 +1,5 @@
'' Text
-'// Node.js Console Session\n' Comment.Single
+'// Node.js REPL Session\n' Comment.Single
'> ' Generic.Prompt
'let' Keyword.Declaration