From c75ec1a01d88c7f287a1c8f1b7c69b69cb793651 Mon Sep 17 00:00:00 2001 From: Maxime Kjaer Date: Sun, 17 Nov 2019 18:43:01 +0100 Subject: [PATCH] Update state names in json-doc lexer (#1364) The json-doc lexer inherits from the JSON lexet. As a consequence, an earlier refactoring of the JSON lexer that, among other things, introduced two new states broke the json-doc lexer. This commit corrects the references to these states. --- lib/rouge/lexers/json_doc.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rouge/lexers/json_doc.rb b/lib/rouge/lexers/json_doc.rb index e545a6d8b9..d27bd7bac8 100644 --- a/lib/rouge/lexers/json_doc.rb +++ b/lib/rouge/lexers/json_doc.rb @@ -6,16 +6,17 @@ module Lexers load_lexer 'json.rb' class JSONDOC < JSON - desc "JavaScript Object Notation with extenstions for documentation" + desc "JavaScript Object Notation with extensions for documentation" tag 'json-doc' - prepend :root do + prepend :name do rule %r/([$\w]+)(\s*)(:)/ do groups Name::Attribute, Text, Punctuation end + end + prepend :value do rule %r(/[*].*?[*]/), Comment - rule %r(//.*?$), Comment::Single rule %r/(\.\.\.)/, Comment::Single end