From 5ee17542490939859843362c9d8047290b284ed1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 11 Nov 2020 18:36:44 +0100 Subject: [PATCH] json: deprecate BareJsonObjectLexer fixes #1600 --- CHANGES | 3 +++ pygments/lexers/_mapping.py | 4 ++-- pygments/lexers/data.py | 12 ++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 8a3c179c3a..33c54bf3d7 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 5daf20ce16..a658c0b965 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -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')), diff --git a/pygments/lexers/data.py b/pygments/lexers/data.py index 96594a557d..626c7c6a78 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):