Sha256: 8c9db3051ce8b43a9cc95ca6d32bd6473ae599bf2b9a8caeca09fbe9bcf9f635
Contents?: true
Size: 785 Bytes
Versions: 14
Compression:
Stored size: 785 Bytes
Contents
# -*- coding: utf-8 -*- # module Rouge module Lexers class JSON < RegexLexer title 'JSON' desc "JavaScript Object Notation (json.org)" tag 'json' filenames '*.json' mimetypes 'application/json', 'application/vnd.api+json', 'application/hal+json' state :root do rule /\s+/m, Text::Whitespace rule /"/, Str::Double, :string rule /(?:true|false|null)\b/, Keyword::Constant rule /[{},:\[\]]/, Punctuation rule /-?(?:0|[1-9]\d*)\.\d+(?:e[+-]?\d+)?/i, Num::Float rule /-?(?:0|[1-9]\d*)(?:e[+-]?\d+)?/i, Num::Integer end state :string do rule /[^\\"]+/, Str::Double rule /\\./, Str::Escape rule /"/, Str::Double, :pop! end end end end
Version data entries
14 entries across 14 versions & 5 rubygems