Skip to content

Commit

Permalink
Update state names in json-doc lexer (#1364)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MaximeKjaer authored and pyrmont committed Nov 17, 2019
1 parent 374ee22 commit c75ec1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/rouge/lexers/json_doc.rb
Expand Up @@ -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
Expand Down

0 comments on commit c75ec1a

Please sign in to comment.