summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2020-11-11 18:36:44 +0100
committerGeorg Brandl <georg@python.org>2020-11-11 18:40:14 +0100
commit5ee17542490939859843362c9d8047290b284ed1 (patch)
treefbdd7edf2920c684c3301b7642f6e7baab4ae1da
parentfb40b7113e6c71f29c110cc9c32077a0883b732b (diff)
downloadpygments-git-5ee17542490939859843362c9d8047290b284ed1.tar.gz
json: deprecate BareJsonObjectLexer
fixes #1600
-rw-r--r--CHANGES3
-rw-r--r--pygments/lexers/_mapping.py4
-rw-r--r--pygments/lexers/data.py12
3 files changed, 13 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 8a3c179c..33c54bf3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,9 @@ Version 2.8.0
-------------
(not released yet)
+- Deprecate JsonBareObjectLexer, which is identical to JsonLexer
+ since 2.7 (#1600)
+
Version 2.7.2
-------------
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index 5daf20ce..a658c0b9 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -228,9 +228,9 @@ LEXERS = {
'JavascriptSmartyLexer': ('pygments.lexers.templates', 'JavaScript+Smarty', ('js+smarty', 'javascript+smarty'), (), ('application/x-javascript+smarty', 'text/x-javascript+smarty', 'text/javascript+smarty')),
'JclLexer': ('pygments.lexers.scripting', 'JCL', ('jcl',), ('*.jcl',), ('text/x-jcl',)),
'JsgfLexer': ('pygments.lexers.grammar_notation', 'JSGF', ('jsgf',), ('*.jsgf',), ('application/jsgf', 'application/x-jsgf', 'text/jsgf')),
- 'JsonBareObjectLexer': ('pygments.lexers.data', 'JSONBareObject', ('json-object',), (), ('application/json-object',)),
+ 'JsonBareObjectLexer': ('pygments.lexers.data', 'JSONBareObject', (), (), ()),
'JsonLdLexer': ('pygments.lexers.data', 'JSON-LD', ('jsonld', 'json-ld'), ('*.jsonld',), ('application/ld+json',)),
- 'JsonLexer': ('pygments.lexers.data', 'JSON', ('json',), ('*.json', 'Pipfile.lock'), ('application/json',)),
+ 'JsonLexer': ('pygments.lexers.data', 'JSON', ('json', 'json-object'), ('*.json', 'Pipfile.lock'), ('application/json', 'application/json-object')),
'JspLexer': ('pygments.lexers.templates', 'Java Server Page', ('jsp',), ('*.jsp',), ('application/x-jsp',)),
'JuliaConsoleLexer': ('pygments.lexers.julia', 'Julia console', ('jlcon',), (), ()),
'JuliaLexer': ('pygments.lexers.julia', 'Julia', ('julia', 'jl'), ('*.jl',), ('text/x-julia', 'application/x-julia')),
diff --git a/pygments/lexers/data.py b/pygments/lexers/data.py
index 96594a55..626c7c6a 100644
--- a/pygments/lexers/data.py
+++ b/pygments/lexers/data.py
@@ -444,9 +444,9 @@ class JsonLexer(Lexer):
"""
name = 'JSON'
- aliases = ['json']
+ aliases = ['json', 'json-object']
filenames = ['*.json', 'Pipfile.lock']
- mimetypes = ['application/json']
+ mimetypes = ['application/json', 'application/json-object']
# No validation of integers, floats, or constants is done.
# As long as the characters are members of the following
@@ -637,12 +637,16 @@ class JsonBareObjectLexer(JsonLexer):
For JSON data structures (with missing object curly braces).
.. versionadded:: 2.2
+
+ .. deprecated:: 2.8.0
+
+ Behaves the same as `JsonLexer` now.
"""
name = 'JSONBareObject'
- aliases = ['json-object']
+ aliases = []
filenames = []
- mimetypes = ['application/json-object']
+ mimetypes = []
class JsonLdLexer(JsonLexer):