Skip to content

Commit

Permalink
json: deprecate BareJsonObjectLexer
Browse files Browse the repository at this point in the history
fixes #1600
  • Loading branch information
birkenfeld committed Nov 11, 2020
1 parent fb40b71 commit 5ee1754
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Expand Up @@ -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
-------------
Expand Down
4 changes: 2 additions & 2 deletions pygments/lexers/_mapping.py
Expand Up @@ -228,9 +228,9 @@
'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')),
Expand Down
12 changes: 8 additions & 4 deletions pygments/lexers/data.py
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 5ee1754

Please sign in to comment.