Skip to content
Snippets Groups Projects
Commit 5abf3c96 authored by http://jayferd.us/'s avatar http://jayferd.us/
Browse files

perf tweaks and bugfixes for the json parser

parent fb0c2ab3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -178,12 +178,12 @@ module Rouge
state :root do
mixin :whitespace
# special case for empty objects
rule /(\{)(\s*)(\})/ do
rule /(\{)(\s*)(\})/m do
group Punctuation
group Text::Whitespace
group Punctuation
end
rule /true|false/, Keyword::Constant
rule /(?:true|false)\b/, Keyword::Constant
rule /{/, Punctuation, :object_key
rule /\[/, Punctuation, :array
rule /-?(?:0|[1-9]\d*)\.\d+(?:e[+-]\d+)?/i, Num::Float
Loading
Loading
@@ -201,9 +201,9 @@ module Rouge
 
state :object_key do
mixin :whitespace
mixin :has_string
rule /:/, Punctuation, :object_val
rule /}/, Error, :pop!
mixin :has_string
end
 
state :object_val do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment