eval'i,s,S= ARGF.read,[],/" (?:\\\\ ["\\\\\ /bfnrtu ]|[^"\\\\]) *"/;while i[S];s<< $`<<$&;i=$\'; end;s<\{(?: \g(?:,\g)*)?\ }){0}(? \g:\g){0}(?\[(? :\g(?:,\g )*) ?\]){0}( ?-?(?: 0|[1-9] \d*)(?: \.\d+)? (?:[eE] [+-]?\d +)?|true|fal se|null |\g|\g |\g){0}(? #{S}){0} /;R,M=G .names. map{|n|[n,/#{ G}\G\g< #{n}>/] }.to_h, G.to_s;C,Q,H,T =/(\\\\ ?[^()|g]*)/, /(?:\(\ ?:)?/,/ \\\\g<( \w+)>/,/\)\*\ )\?/;@i ,L=0,-> s{@i+=s.tr( "\\\\", "").siz e;nil}; def m(n)I.in dex(R[n ],@i) o r retur n;a=$&; M[/\(\? <#{n}># {C}#{Q}#{H} #{Q}#{C} #{H}#{T} ?#{C}/] ;if$2&&$ 2==$4;L[ $1];a,k =[],m($2); a< .+?\{0\ }/].scan (H){|z,|z=m(z )and return z};@i+ =a.size;eval" null=ni l;#{a}" ;end;end; pp m("val")'. gsub(/\s \s++|\n /x,'')