nutshell-crm 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/README +0 -0
- data/Rakefile +2 -0
- data/lib/nutshell-crm.rb +78 -0
- data/lib/nutshell-crm/version.rb +3 -0
- data/nutshell-crm.gemspec +28 -0
- data/spec/nutshell-crm_spec.rb +212 -0
- data/spec/spec_helper.rb +8 -0
- data/vendor/bundle/bin/autospec +19 -0
- data/vendor/bundle/bin/htmldiff +21 -0
- data/vendor/bundle/bin/httparty +19 -0
- data/vendor/bundle/bin/ldiff +21 -0
- data/vendor/bundle/bin/rspec +19 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/.gemtest +0 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/History.rdoc +54 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/License.rdoc +38 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/Manifest.txt +27 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/README.rdoc +72 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/Rakefile +26 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/bin/htmldiff +32 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/bin/ldiff +6 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/diff-lcs.gemspec +51 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/docs/COPYING.txt +340 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/docs/artistic.html +289 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff-lcs.rb +5 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs.rb +1105 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/array.rb +21 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/block.rb +51 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/callbacks.rb +322 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/change.rb +169 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/htmldiff.rb +151 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/hunk.rb +242 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/ldiff.rb +210 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/lib/diff/lcs/string.rb +19 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/diff_spec.rb +35 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/lcs_spec.rb +36 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/patch_spec.rb +390 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/sdiff_spec.rb +204 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/spec_helper.rb +284 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/traverse_balanced_spec.rb +286 -0
- data/vendor/bundle/gems/diff-lcs-1.1.3/spec/traverse_sequences_spec.rb +83 -0
- data/vendor/bundle/gems/httparty-0.8.1/.gitignore +9 -0
- data/vendor/bundle/gems/httparty-0.8.1/Gemfile +8 -0
- data/vendor/bundle/gems/httparty-0.8.1/History +259 -0
- data/vendor/bundle/gems/httparty-0.8.1/MIT-LICENSE +20 -0
- data/vendor/bundle/gems/httparty-0.8.1/README.rdoc +54 -0
- data/vendor/bundle/gems/httparty-0.8.1/Rakefile +15 -0
- data/vendor/bundle/gems/httparty-0.8.1/bin/httparty +108 -0
- data/vendor/bundle/gems/httparty-0.8.1/cucumber.yml +1 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/aaws.rb +32 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/basic.rb +32 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/crack.rb +19 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/custom_parsers.rb +67 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/delicious.rb +37 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/google.rb +16 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/rubyurl.rb +14 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/tripit_sign_in.rb +33 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/twitter.rb +31 -0
- data/vendor/bundle/gems/httparty-0.8.1/examples/whoismyrep.rb +10 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/basic_authentication.feature +20 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/command_line.feature +7 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/deals_with_http_error_codes.feature +26 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/digest_authentication.feature +20 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/handles_compressed_responses.feature +19 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/handles_multiple_formats.feature +34 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/env.rb +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/httparty_response_steps.rb +26 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/httparty_steps.rb +27 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/mongrel_helper.rb +94 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/steps/remote_service_steps.rb +69 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/supports_redirection.feature +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/features/supports_timeout_option.feature +13 -0
- data/vendor/bundle/gems/httparty-0.8.1/httparty.gemspec +24 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty.rb +452 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/cookie_hash.rb +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/core_extensions.rb +9 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/exceptions.rb +26 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/hash_conversions.rb +51 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/module_inheritable_attributes.rb +34 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/net_digest_auth.rb +71 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/parser.rb +141 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/request.rb +257 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/response.rb +85 -0
- data/vendor/bundle/gems/httparty-0.8.1/lib/httparty/version.rb +3 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/delicious.xml +23 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/empty.xml +0 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/google.html +3 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generate.sh +29 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/1fe462c2.0 +16 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/bogushost.crt +13 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/ca.crt +16 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/ca.key +15 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/selfsigned.crt +14 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/server.crt +13 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/generated/server.key +15 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/ssl/openssl-exts.cnf +9 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/twitter.json +1 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/twitter.xml +403 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/fixtures/undefined_method_add_node_for_nil.xml +2 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/cookie_hash_spec.rb +71 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/net_digest_auth_spec.rb +93 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/parser_spec.rb +155 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/request_spec.rb +544 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/response_spec.rb +193 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty/ssl_spec.rb +54 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/httparty_spec.rb +621 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/spec.opts +3 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/spec_helper.rb +22 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_helper.rb +25 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/support/ssl_test_server.rb +69 -0
- data/vendor/bundle/gems/httparty-0.8.1/spec/support/stub_response.rb +30 -0
- data/vendor/bundle/gems/httparty-0.8.1/website/css/common.css +47 -0
- data/vendor/bundle/gems/httparty-0.8.1/website/index.html +73 -0
- data/vendor/bundle/gems/json-1.6.3/.gitignore +8 -0
- data/vendor/bundle/gems/json-1.6.3/.travis.yml +15 -0
- data/vendor/bundle/gems/json-1.6.3/CHANGES +223 -0
- data/vendor/bundle/gems/json-1.6.3/COPYING +58 -0
- data/vendor/bundle/gems/json-1.6.3/COPYING-json-jruby +57 -0
- data/vendor/bundle/gems/json-1.6.3/GPL +340 -0
- data/vendor/bundle/gems/json-1.6.3/Gemfile +11 -0
- data/vendor/bundle/gems/json-1.6.3/README-json-jruby.markdown +33 -0
- data/vendor/bundle/gems/json-1.6.3/README.rdoc +358 -0
- data/vendor/bundle/gems/json-1.6.3/Rakefile +408 -0
- data/vendor/bundle/gems/json-1.6.3/TODO +1 -0
- data/vendor/bundle/gems/json-1.6.3/VERSION +1 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/data/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/generator2_benchmark.rb +222 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/generator_benchmark.rb +224 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/ohai.json +1216 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/ohai.ruby +1 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/parser2_benchmark.rb +251 -0
- data/vendor/bundle/gems/json-1.6.3/benchmarks/parser_benchmark.rb +259 -0
- data/vendor/bundle/gems/json-1.6.3/data/example.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/data/index.html +38 -0
- data/vendor/bundle/gems/json-1.6.3/data/prototype.js +4184 -0
- data/vendor/bundle/gems/json-1.6.3/diagrams/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/fbuffer/fbuffer.h +156 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/Makefile +187 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/extconf.rb +13 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.c +1384 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.h +161 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/generator/generator.o +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/json/ext/generator.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/json/ext/parser.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/Makefile +187 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/extconf.rb +13 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.bundle +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.c +2197 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.h +77 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.o +0 -0
- data/vendor/bundle/gems/json-1.6.3/ext/json/ext/parser/parser.rl +920 -0
- data/vendor/bundle/gems/json-1.6.3/install.rb +19 -0
- data/vendor/bundle/gems/json-1.6.3/java/lib/bytelist-1.0.6.jar +0 -0
- data/vendor/bundle/gems/json-1.6.3/java/lib/jcodings.jar +0 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/ByteListTranscoder.java +167 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Generator.java +437 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorMethods.java +232 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorService.java +43 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/GeneratorState.java +522 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/OptionsReader.java +119 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Parser.java +2589 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Parser.rl +913 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/ParserService.java +35 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/RuntimeInfo.java +121 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/StringDecoder.java +166 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/StringEncoder.java +106 -0
- data/vendor/bundle/gems/json-1.6.3/java/src/json/ext/Utils.java +89 -0
- data/vendor/bundle/gems/json-1.6.3/json-java.gemspec +22 -0
- data/vendor/bundle/gems/json-1.6.3/json.gemspec +40 -0
- data/vendor/bundle/gems/json-1.6.3/json_pure.gemspec +42 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json.rb +62 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/bigdecimal.rb +21 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/complex.rb +22 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/core.rb +11 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/date.rb +34 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/date_time.rb +50 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/exception.rb +31 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/ostruct.rb +31 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/range.rb +29 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/rational.rb +22 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/regexp.rb +30 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/struct.rb +30 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/symbol.rb +25 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/add/time.rb +35 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/common.rb +470 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/ext.rb +21 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/ext/.keep +0 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/pure.rb +21 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/pure/generator.rb +468 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/pure/parser.rb +359 -0
- data/vendor/bundle/gems/json-1.6.3/lib/json/version.rb +8 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail1.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail10.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail11.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail12.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail13.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail14.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail18.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail19.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail2.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail20.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail21.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail22.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail23.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail24.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail25.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail27.json +2 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail28.json +2 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail3.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail4.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail5.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail6.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail7.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail8.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/fail9.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass1.json +56 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass15.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass16.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass17.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass2.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass26.json +1 -0
- data/vendor/bundle/gems/json-1.6.3/tests/fixtures/pass3.json +6 -0
- data/vendor/bundle/gems/json-1.6.3/tests/setup_variant.rb +11 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json.rb +476 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_addition.rb +188 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_encoding.rb +65 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_fixtures.rb +35 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_generate.rb +249 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_string_matching.rb +40 -0
- data/vendor/bundle/gems/json-1.6.3/tests/test_json_unicode.rb +72 -0
- data/vendor/bundle/gems/json-1.6.3/tools/fuzz.rb +139 -0
- data/vendor/bundle/gems/json-1.6.3/tools/server.rb +62 -0
- data/vendor/bundle/gems/multi_json-1.0.4/.document +5 -0
- data/vendor/bundle/gems/multi_json-1.0.4/.rspec +3 -0
- data/vendor/bundle/gems/multi_json-1.0.4/.travis.yml +7 -0
- data/vendor/bundle/gems/multi_json-1.0.4/Gemfile +6 -0
- data/vendor/bundle/gems/multi_json-1.0.4/LICENSE.md +20 -0
- data/vendor/bundle/gems/multi_json-1.0.4/README.md +94 -0
- data/vendor/bundle/gems/multi_json-1.0.4/Rakefile +25 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json.rb +85 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_common.rb +27 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_gem.rb +12 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/json_pure.rb +12 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/ok_json.rb +48 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/engines/yajl.rb +18 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/vendor/ok_json.rb +587 -0
- data/vendor/bundle/gems/multi_json-1.0.4/lib/multi_json/version.rb +3 -0
- data/vendor/bundle/gems/multi_json-1.0.4/multi_json.gemspec +22 -0
- data/vendor/bundle/gems/multi_json-1.0.4/spec/helper.rb +35 -0
- data/vendor/bundle/gems/multi_json-1.0.4/spec/multi_json_spec.rb +178 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.gemtest +0 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.gitignore +10 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.rspec +3 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.travis.yml +7 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/.yardopts +5 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/Gemfile +9 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/LICENSE.md +20 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/README.md +113 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/Rakefile +23 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml.rb +237 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/libxml.rb +30 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/libxml2_parser.rb +66 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/nokogiri.rb +32 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/ox.rb +97 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/parsers/rexml.rb +113 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/lib/multi_xml/version.rb +3 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/multi_xml.gemspec +24 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/helper.rb +3 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/multi_xml_spec.rb +41 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/parser_shared_example.rb +552 -0
- data/vendor/bundle/gems/multi_xml-0.4.1/spec/speed.rb +63 -0
- data/vendor/bundle/gems/rspec-2.7.0/.document +2 -0
- data/vendor/bundle/gems/rspec-2.7.0/.gitignore +8 -0
- data/vendor/bundle/gems/rspec-2.7.0/Gemfile +7 -0
- data/vendor/bundle/gems/rspec-2.7.0/License.txt +22 -0
- data/vendor/bundle/gems/rspec-2.7.0/README.markdown +47 -0
- data/vendor/bundle/gems/rspec-2.7.0/Rakefile +30 -0
- data/vendor/bundle/gems/rspec-2.7.0/lib/rspec.rb +4 -0
- data/vendor/bundle/gems/rspec-2.7.0/lib/rspec/version.rb +5 -0
- data/vendor/bundle/gems/rspec-2.7.0/rspec.gemspec +33 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/README.md +68 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/exe/autospec +13 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/exe/rspec +25 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/Autotest.md +38 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/README.md +17 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/Upgrade.md +364 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/README.md +28 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/configure.feature +22 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/example_name_option.feature +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/exit_status.feature +83 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/format_option.feature +81 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_appended_to_path.feature +140 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature +58 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/pattern_option.feature +31 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/rake_task.feature +68 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/ruby.feature +22 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/command_line/tag.feature +90 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/alias_example_to.feature +48 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/custom_settings.feature +84 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/default_path.feature +38 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/fail_fast.feature +77 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/configuration/read_options_from_file.feature +87 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/basic_structure.feature +55 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/shared_context.feature +74 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/example_groups/shared_examples.feature +204 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/expectation_framework_integration/configure_expectation_framework.feature +73 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/exclusion_filters.feature +139 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/if_and_unless.feature +168 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/inclusion_filters.feature +105 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/filtering/run_all_when_everything_filtered.feature +46 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/formatters/custom_formatter.feature +36 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/formatters/text_formatter.feature +46 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/arbitrary_methods.feature +40 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/let.feature +50 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/helper_methods/modules.feature +149 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/around_hooks.feature +343 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/before_and_after_hooks.feature +423 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/hooks/filtering.feature +234 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/current_example.feature +17 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/described_class.feature +17 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/metadata/user_defined.feature +113 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_any_framework.feature +106 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_flexmock.feature +96 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_mocha.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_rr.feature +98 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/mock_framework_integration/use_rspec.feature +97 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/pending/pending_examples.feature +229 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/spec_files/arbitrary_file_suffix.feature +13 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/step_definitions/additional_cli_steps.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/attribute_of_subject.feature +122 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/explicit_subject.feature +78 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_receiver.feature +29 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/subject/implicit_subject.feature +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/features/support/env.rb +5 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/autotest/discover.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/autotest/rspec2.rb +73 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/autorun.rb +2 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core.rb +81 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/backward_compatibility.rb +63 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb +32 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/command_line_configuration.rb +62 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb +558 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/configuration_options.rb +139 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/deprecation.rb +48 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/drb_command_line.rb +23 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/dsl.rb +11 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/errors.rb +13 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/example.rb +178 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/example_group.rb +348 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/expecting/with_rspec.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/expecting/with_stdlib.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions.rb +3 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/instance_eval_with_args.rb +39 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/kernel.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/extensions/module_eval_with_args.rb +34 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/base_formatter.rb +172 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/base_text_formatter.rb +185 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/documentation_formatter.rb +71 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/helpers.rb +24 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/html_formatter.rb +458 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/progress_formatter.rb +32 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/snippet_extractor.rb +58 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/formatters/text_mate_formatter.rb +34 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/hooks.rb +160 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/let.rb +101 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/load_path.rb +3 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/metadata.rb +229 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/metadata_hash_builder.rb +93 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_absolutely_nothing.rb +11 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_flexmock.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_mocha.rb +23 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_rr.rb +27 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/mocking/with_rspec.rb +23 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/option_parser.rb +147 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/pending.rb +38 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/rake_task.rb +201 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/reporter.rb +78 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/ruby_project.rb +44 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/shared_context.rb +16 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/shared_example_group.rb +67 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/subject.rb +175 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/version.rb +7 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/core/world.rb +150 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/monkey.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/lib/rspec/monkey/spork/test_framework/rspec.rb +8 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/discover_spec.rb +19 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/failed_results_re_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/autotest/rspec_spec.rb +123 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_configuration_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_spec.rb +169 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/configuration_options_spec.rb +437 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/configuration_spec.rb +920 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/deprecations_spec.rb +66 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/drb_command_line_spec.rb +124 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/example_group_spec.rb +1046 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/example_spec.rb +289 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/base_formatter_spec.rb +80 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/base_text_formatter_spec.rb +344 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/documentation_formatter_spec.rb +66 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/helpers_spec.rb +46 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.8.7-jruby.html +462 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.8.7.html +399 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.9.2.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatted-1.9.3.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/html_formatter_spec.rb +81 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/progress_formatter_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7-jruby.html +462 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +399 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.9.2.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatted-1.9.3.html +406 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/formatters/text_mate_formatter_spec.rb +84 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/hooks_filtering_spec.rb +227 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/hooks_spec.rb +143 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/kernel_extensions_spec.rb +9 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/let_spec.rb +55 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/metadata_spec.rb +383 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/option_parser_spec.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/pending_example_spec.rb +187 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/rake_task_spec.rb +138 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/reporter_spec.rb +86 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_bar.rb +0 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_foo.rb +0 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/a_spec.rb +1 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/custom_example_group_runner.rb +14 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/formatter_specs.rb +60 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/resources/utf8_encoded.rb +8 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/rspec_matchers_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/ruby_project_spec.rb +24 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/runner_spec.rb +82 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/shared_context_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/shared_example_group_spec.rb +84 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/subject_spec.rb +199 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core/world_spec.rb +315 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/rspec/core_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/spec_helper.rb +92 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/matchers.rb +75 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/shared_example_groups.rb +41 -0
- data/vendor/bundle/gems/rspec-core-2.7.1/spec/support/spec_files.rb +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/README.md +24 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/README.markdown +49 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/Upgrade.md +53 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/README.md +73 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/be.feature +135 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/be_within.feature +43 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/cover.feature +45 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/equality.feature +145 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/exist.feature +43 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/expect_change.feature +59 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/expect_error.feature +138 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/have.feature +103 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/include.feature +121 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/match.feature +50 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/operators.feature +221 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/predicates.feature +128 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/respond_to.feature +78 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/satisfy.feature +31 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/throw_symbol.feature +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/built_in_matchers/types.feature +114 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/access_running_example.feature +53 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_diffable_matcher.feature +27 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher.feature +340 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher_outside_rspec.feature +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/custom_matchers/define_matcher_with_fluent_interface.feature +24 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/customized_message.feature +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/diffing.feature +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/implicit_docstrings.feature +52 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/step_definitions/additional_cli_steps.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/support/env.rb +5 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/features/test_frameworks/test_unit.feature +46 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec-expectations.rb +1 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/deprecation.rb +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/differ.rb +62 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/errors.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions.rb +3 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/array.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/kernel.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/extensions/object.rb +39 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/fail_with.rb +54 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/handler.rb +50 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/expectations/version.rb +8 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers.rb +206 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be.rb +213 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_close.rb +9 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_kind_of.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_within.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/block_aliases.rb +19 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/change.rb +197 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/compatibility.rb +14 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/cover.rb +35 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/dsl.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eq.rb +46 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb +41 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/equal.rb +48 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/errors.rb +5 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/exist.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/extensions/instance_eval_with_args.rb +39 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/generated_descriptions.rb +36 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/has.rb +44 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/have.rb +168 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/include.rb +54 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/match.rb +21 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/match_array.rb +71 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/matcher.rb +165 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/method_missing.rb +12 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/operator_matcher.rb +87 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/pretty.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/raise_error.rb +130 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/respond_to.rb +85 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/satisfy.rb +51 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/throw_symbol.rb +121 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/differ_spec.rb +96 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/extensions/kernel_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/fail_with_spec.rb +70 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/expectations/handler_spec.rb +206 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_close_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_instance_of_spec.rb +36 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_kind_of_spec.rb +33 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_spec.rb +452 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/be_within_spec.rb +64 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/change_spec.rb +522 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/compatibility_spec.rb +28 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/cover_spec.rb +65 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/description_generation_spec.rb +176 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/dsl_spec.rb +25 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eq_spec.rb +38 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/eql_spec.rb +37 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/equal_spec.rb +57 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/exist_spec.rb +104 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/has_spec.rb +113 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/have_spec.rb +458 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/include_spec.rb +341 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/match_array_spec.rb +108 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/match_spec.rb +57 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/matcher_spec.rb +420 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/matchers_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/method_missing_spec.rb +23 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/operator_matcher_spec.rb +221 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/raise_error_spec.rb +339 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/respond_to_spec.rb +292 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/satisfy_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/rspec/matchers/throw_symbol_spec.rb +113 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/spec_helper.rb +26 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/classes.rb +56 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/matchers.rb +22 -0
- data/vendor/bundle/gems/rspec-expectations-2.7.0/spec/support/ruby_version.rb +10 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/README.md +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/README.markdown +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/Scope.md +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/Upgrade.md +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/README.md +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/explicit.feature +60 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/general_matchers.feature +85 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/argument_matchers/type_matchers.feature +25 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/README.md +58 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/any_instance.feature +21 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/block_local_expectations.feature.pending +55 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/expect_message.feature +94 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/receive_counts.feature +209 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/message_expectations/warn_when_expectation_is_set_on_nil.feature +50 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/README.md +43 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/any_instance.feature +133 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/as_null_object.feature +36 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/simple_return_value.feature +64 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/stub_chain.feature +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/stub_implementation.feature +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/method_stubs/to_ary.feature +47 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/outside_rspec/configuration.feature +82 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/outside_rspec/standalone.feature +32 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/step_definitions/additional_cli_steps.rb +4 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/features/support/env.rb +6 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks.rb +196 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance.rb +29 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/chain.rb +49 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/expectation_chain.rb +33 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/message_chains.rb +48 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/recorder.rb +168 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/stub_chain.rb +35 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/any_instance/stub_chain_chain.rb +34 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/argument_expectation.rb +54 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/argument_matchers.rb +227 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/error_generator.rb +97 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/errors.rb +10 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/instance_exec.rb +31 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/marshal.rb +23 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb +23 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/framework.rb +18 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/message_expectation.rb +357 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/method_double.rb +165 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/methods.rb +98 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/mock.rb +79 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/order_group.rb +29 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/proxy.rb +158 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/serialization.rb +28 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/space.rb +28 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/spec_methods.rb +53 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/standalone.rb +3 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/version.rb +7 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/lib/spec/mocks.rb +2 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/and_yield_spec.rb +114 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_instance/message_chains_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_instance_spec.rb +785 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/any_number_of_times_spec.rb +30 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/argument_expectation_spec.rb +37 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/at_least_spec.rb +103 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/at_most_spec.rb +99 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/block_return_value_spec.rb +45 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_10260_spec.rb +8 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_10263_spec.rb +25 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_11545_spec.rb +32 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_496_spec.rb +17 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_600_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_7611_spec.rb +16 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_8165_spec.rb +31 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_830_spec.rb +21 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/bug_report_957_spec.rb +22 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/double_spec.rb +12 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/failing_argument_matchers_spec.rb +95 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/hash_including_matcher_spec.rb +90 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/hash_not_including_matcher_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_ordering_spec.rb +94 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_space_spec.rb +54 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/mock_spec.rb +702 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/multiple_return_value_spec.rb +191 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/nil_expectation_warning_spec.rb +62 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/null_object_mock_spec.rb +78 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/once_counts_spec.rb +53 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/options_hash_spec.rb +35 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/partial_mock_spec.rb +156 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb +95 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/passing_argument_matchers_spec.rb +142 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/precise_counts_spec.rb +58 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/record_messages_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/serialization_spec.rb +111 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stash_spec.rb +27 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_chain_spec.rb +149 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_implementation_spec.rb +68 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stub_spec.rb +235 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/stubbed_message_expectations_spec.rb +26 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/to_ary_spec.rb +40 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks/twice_counts_spec.rb +67 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/rspec/mocks_spec.rb +51 -0
- data/vendor/bundle/gems/rspec-mocks-2.7.0/spec/spec_helper.rb +52 -0
- data/vendor/bundle/specifications/diff-lcs-1.1.3.gemspec +35 -0
- data/vendor/bundle/specifications/httparty-0.8.1.gemspec +34 -0
- data/vendor/bundle/specifications/json-1.6.3.gemspec +39 -0
- data/vendor/bundle/specifications/multi_json-1.0.4.gemspec +40 -0
- data/vendor/bundle/specifications/multi_xml-0.4.1.gemspec +49 -0
- data/vendor/bundle/specifications/rspec-2.7.0.gemspec +38 -0
- data/vendor/bundle/specifications/rspec-core-2.7.1.gemspec +31 -0
- data/vendor/bundle/specifications/rspec-expectations-2.7.0.gemspec +32 -0
- data/vendor/bundle/specifications/rspec-mocks-2.7.0.gemspec +29 -0
- metadata +771 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
|
|
3
|
+
*
|
|
4
|
+
* Distributed under the Ruby and GPLv2 licenses; see COPYING and GPL files
|
|
5
|
+
* for details.
|
|
6
|
+
*/
|
|
7
|
+
package json.ext;
|
|
8
|
+
|
|
9
|
+
import org.jruby.Ruby;
|
|
10
|
+
import org.jruby.RubyClass;
|
|
11
|
+
import org.jruby.RubyHash;
|
|
12
|
+
import org.jruby.RubyNumeric;
|
|
13
|
+
import org.jruby.RubyString;
|
|
14
|
+
import org.jruby.runtime.ThreadContext;
|
|
15
|
+
import org.jruby.runtime.builtin.IRubyObject;
|
|
16
|
+
import org.jruby.util.ByteList;
|
|
17
|
+
|
|
18
|
+
final class OptionsReader {
|
|
19
|
+
private final ThreadContext context;
|
|
20
|
+
private final Ruby runtime;
|
|
21
|
+
private final RubyHash opts;
|
|
22
|
+
private RuntimeInfo info;
|
|
23
|
+
|
|
24
|
+
OptionsReader(ThreadContext context, IRubyObject vOpts) {
|
|
25
|
+
this.context = context;
|
|
26
|
+
this.runtime = context.getRuntime();
|
|
27
|
+
|
|
28
|
+
if (vOpts == null || vOpts.isNil()) {
|
|
29
|
+
opts = null;
|
|
30
|
+
} else if (vOpts.respondsTo("to_hash")) {
|
|
31
|
+
opts = vOpts.convertToHash();
|
|
32
|
+
} else {
|
|
33
|
+
opts = vOpts.callMethod(context, "to_h").convertToHash();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private RuntimeInfo getRuntimeInfo() {
|
|
38
|
+
if (info != null) return info;
|
|
39
|
+
info = RuntimeInfo.forRuntime(runtime);
|
|
40
|
+
return info;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Efficiently looks up items with a {@link RubySymbol Symbol} key
|
|
45
|
+
* @param key The Symbol name to look up for
|
|
46
|
+
* @return The item in the {@link RubyHash Hash}, or <code>null</code>
|
|
47
|
+
* if not found
|
|
48
|
+
*/
|
|
49
|
+
IRubyObject get(String key) {
|
|
50
|
+
return opts == null ? null : opts.fastARef(runtime.newSymbol(key));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
boolean getBool(String key, boolean defaultValue) {
|
|
54
|
+
IRubyObject value = get(key);
|
|
55
|
+
return value == null ? defaultValue : value.isTrue();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
int getInt(String key, int defaultValue) {
|
|
59
|
+
IRubyObject value = get(key);
|
|
60
|
+
if (value == null) return defaultValue;
|
|
61
|
+
if (!value.isTrue()) return 0;
|
|
62
|
+
return RubyNumeric.fix2int(value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Reads the setting from the options hash. If no entry is set for this
|
|
67
|
+
* key or if it evaluates to <code>false</code>, returns null; attempts to
|
|
68
|
+
* coerce the value to {@link RubyString String} otherwise.
|
|
69
|
+
* @param key The Symbol name to look up for
|
|
70
|
+
* @return <code>null</code> if the key is not in the Hash or if
|
|
71
|
+
* its value evaluates to <code>false</code>
|
|
72
|
+
* @throws RaiseException <code>TypeError</code> if the value does not
|
|
73
|
+
* evaluate to <code>false</code> and can't be
|
|
74
|
+
* converted to string
|
|
75
|
+
*/
|
|
76
|
+
ByteList getString(String key) {
|
|
77
|
+
RubyString str = getString(key, null);
|
|
78
|
+
return str == null ? null : str.getByteList().dup();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
RubyString getString(String key, RubyString defaultValue) {
|
|
82
|
+
IRubyObject value = get(key);
|
|
83
|
+
if (value == null || !value.isTrue()) return defaultValue;
|
|
84
|
+
|
|
85
|
+
RubyString str = value.convertToString();
|
|
86
|
+
RuntimeInfo info = getRuntimeInfo();
|
|
87
|
+
if (info.encodingsSupported() && str.encoding(context) != info.utf8.get()) {
|
|
88
|
+
str = (RubyString)str.encode(context, info.utf8.get());
|
|
89
|
+
}
|
|
90
|
+
return str;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Reads the setting from the options hash. If it is <code>nil</code> or
|
|
95
|
+
* undefined, returns the default value given.
|
|
96
|
+
* If not, ensures it is a RubyClass instance and shares the same
|
|
97
|
+
* allocator as the default value (i.e. for the basic types which have
|
|
98
|
+
* their specific allocators, this ensures the passed value is
|
|
99
|
+
* a subclass of them).
|
|
100
|
+
*/
|
|
101
|
+
RubyClass getClass(String key, RubyClass defaultValue) {
|
|
102
|
+
IRubyObject value = get(key);
|
|
103
|
+
|
|
104
|
+
if (value == null || value.isNil()) return defaultValue;
|
|
105
|
+
|
|
106
|
+
if (value instanceof RubyClass &&
|
|
107
|
+
((RubyClass)value).getAllocator() == defaultValue.getAllocator()) {
|
|
108
|
+
return (RubyClass)value;
|
|
109
|
+
}
|
|
110
|
+
throw runtime.newTypeError(key + " option must be a subclass of "
|
|
111
|
+
+ defaultValue);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public RubyHash getHash(String key) {
|
|
115
|
+
IRubyObject value = get(key);
|
|
116
|
+
if (value == null || value.isNil()) return new RubyHash(runtime);
|
|
117
|
+
return (RubyHash) value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,2589 @@
|
|
|
1
|
+
|
|
2
|
+
// line 1 "Parser.rl"
|
|
3
|
+
/*
|
|
4
|
+
* This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
|
|
5
|
+
*
|
|
6
|
+
* Distributed under the Ruby and GPLv2 licenses; see COPYING and GPL files
|
|
7
|
+
* for details.
|
|
8
|
+
*/
|
|
9
|
+
package json.ext;
|
|
10
|
+
|
|
11
|
+
import org.jruby.Ruby;
|
|
12
|
+
import org.jruby.RubyArray;
|
|
13
|
+
import org.jruby.RubyClass;
|
|
14
|
+
import org.jruby.RubyEncoding;
|
|
15
|
+
import org.jruby.RubyFloat;
|
|
16
|
+
import org.jruby.RubyHash;
|
|
17
|
+
import org.jruby.RubyInteger;
|
|
18
|
+
import org.jruby.RubyModule;
|
|
19
|
+
import org.jruby.RubyNumeric;
|
|
20
|
+
import org.jruby.RubyObject;
|
|
21
|
+
import org.jruby.RubyString;
|
|
22
|
+
import org.jruby.anno.JRubyMethod;
|
|
23
|
+
import org.jruby.exceptions.JumpException;
|
|
24
|
+
import org.jruby.exceptions.RaiseException;
|
|
25
|
+
import org.jruby.runtime.Block;
|
|
26
|
+
import org.jruby.runtime.ObjectAllocator;
|
|
27
|
+
import org.jruby.runtime.ThreadContext;
|
|
28
|
+
import org.jruby.runtime.Visibility;
|
|
29
|
+
import org.jruby.runtime.builtin.IRubyObject;
|
|
30
|
+
import org.jruby.util.ByteList;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The <code>JSON::Ext::Parser</code> class.
|
|
34
|
+
*
|
|
35
|
+
* <p>This is the JSON parser implemented as a Java class. To use it as the
|
|
36
|
+
* standard parser, set
|
|
37
|
+
* <pre>JSON.parser = JSON::Ext::Parser</pre>
|
|
38
|
+
* This is performed for you when you <code>include "json/ext"</code>.
|
|
39
|
+
*
|
|
40
|
+
* <p>This class does not perform the actual parsing, just acts as an interface
|
|
41
|
+
* to Ruby code. When the {@link #parse()} method is invoked, a
|
|
42
|
+
* Parser.ParserSession object is instantiated, which handles the process.
|
|
43
|
+
*
|
|
44
|
+
* @author mernen
|
|
45
|
+
*/
|
|
46
|
+
public class Parser extends RubyObject {
|
|
47
|
+
private final RuntimeInfo info;
|
|
48
|
+
private RubyString vSource;
|
|
49
|
+
private RubyString createId;
|
|
50
|
+
private boolean createAdditions;
|
|
51
|
+
private int maxNesting;
|
|
52
|
+
private boolean allowNaN;
|
|
53
|
+
private boolean symbolizeNames;
|
|
54
|
+
private boolean quirksMode;
|
|
55
|
+
private RubyClass objectClass;
|
|
56
|
+
private RubyClass arrayClass;
|
|
57
|
+
private RubyHash match_string;
|
|
58
|
+
|
|
59
|
+
private static final int DEFAULT_MAX_NESTING = 19;
|
|
60
|
+
|
|
61
|
+
private static final String JSON_MINUS_INFINITY = "-Infinity";
|
|
62
|
+
// constant names in the JSON module containing those values
|
|
63
|
+
private static final String CONST_NAN = "NaN";
|
|
64
|
+
private static final String CONST_INFINITY = "Infinity";
|
|
65
|
+
private static final String CONST_MINUS_INFINITY = "MinusInfinity";
|
|
66
|
+
|
|
67
|
+
static final ObjectAllocator ALLOCATOR = new ObjectAllocator() {
|
|
68
|
+
public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
|
|
69
|
+
return new Parser(runtime, klazz);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Multiple-value return for internal parser methods.
|
|
75
|
+
*
|
|
76
|
+
* <p>All the <code>parse<var>Stuff</var></code> methods return instances of
|
|
77
|
+
* <code>ParserResult</code> when successful, or <code>null</code> when
|
|
78
|
+
* there's a problem with the input data.
|
|
79
|
+
*/
|
|
80
|
+
static final class ParserResult {
|
|
81
|
+
/**
|
|
82
|
+
* The result of the successful parsing. Should never be
|
|
83
|
+
* <code>null</code>.
|
|
84
|
+
*/
|
|
85
|
+
final IRubyObject result;
|
|
86
|
+
/**
|
|
87
|
+
* The point where the parser returned.
|
|
88
|
+
*/
|
|
89
|
+
final int p;
|
|
90
|
+
|
|
91
|
+
ParserResult(IRubyObject result, int p) {
|
|
92
|
+
this.result = result;
|
|
93
|
+
this.p = p;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public Parser(Ruby runtime, RubyClass metaClass) {
|
|
98
|
+
super(runtime, metaClass);
|
|
99
|
+
info = RuntimeInfo.forRuntime(runtime);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* <code>Parser.new(source, opts = {})</code>
|
|
104
|
+
*
|
|
105
|
+
* <p>Creates a new <code>JSON::Ext::Parser</code> instance for the string
|
|
106
|
+
* <code>source</code>.
|
|
107
|
+
* It will be configured by the <code>opts</code> Hash.
|
|
108
|
+
* <code>opts</code> can have the following keys:
|
|
109
|
+
*
|
|
110
|
+
* <dl>
|
|
111
|
+
* <dt><code>:max_nesting</code>
|
|
112
|
+
* <dd>The maximum depth of nesting allowed in the parsed data
|
|
113
|
+
* structures. Disable depth checking with <code>:max_nesting => false|nil|0</code>,
|
|
114
|
+
* it defaults to 19.
|
|
115
|
+
*
|
|
116
|
+
* <dt><code>:allow_nan</code>
|
|
117
|
+
* <dd>If set to <code>true</code>, allow <code>NaN</code>,
|
|
118
|
+
* <code>Infinity</code> and <code>-Infinity</code> in defiance of RFC 4627
|
|
119
|
+
* to be parsed by the Parser. This option defaults to <code>false</code>.
|
|
120
|
+
*
|
|
121
|
+
* <dt><code>:symbolize_names</code>
|
|
122
|
+
* <dd>If set to <code>true</code>, returns symbols for the names (keys) in
|
|
123
|
+
* a JSON object. Otherwise strings are returned, which is also the default.
|
|
124
|
+
*
|
|
125
|
+
* <dt><code>:quirks_mode?</code>
|
|
126
|
+
* <dd>If set to <code>true</code>, if the parse is in quirks_mode, false
|
|
127
|
+
* otherwise.
|
|
128
|
+
*
|
|
129
|
+
* <dt><code>:create_additions</code>
|
|
130
|
+
* <dd>If set to <code>false</code>, the Parser doesn't create additions
|
|
131
|
+
* even if a matchin class and <code>create_id</code> was found. This option
|
|
132
|
+
* defaults to <code>true</code>.
|
|
133
|
+
*
|
|
134
|
+
* <dt><code>:object_class</code>
|
|
135
|
+
* <dd>Defaults to Hash.
|
|
136
|
+
*
|
|
137
|
+
* <dt><code>:array_class</code>
|
|
138
|
+
* <dd>Defaults to Array.
|
|
139
|
+
*
|
|
140
|
+
* <dt><code>:quirks_mode</code>
|
|
141
|
+
* <dd>Enables quirks_mode for parser, that is for example parsing single
|
|
142
|
+
* JSON values instead of documents is possible.
|
|
143
|
+
* </dl>
|
|
144
|
+
*/
|
|
145
|
+
@JRubyMethod(name = "new", required = 1, optional = 1, meta = true)
|
|
146
|
+
public static IRubyObject newInstance(IRubyObject clazz, IRubyObject[] args, Block block) {
|
|
147
|
+
Parser parser = (Parser)((RubyClass)clazz).allocate();
|
|
148
|
+
|
|
149
|
+
parser.callInit(args, block);
|
|
150
|
+
|
|
151
|
+
return parser;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@JRubyMethod(required = 1, optional = 1, visibility = Visibility.PRIVATE)
|
|
155
|
+
public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
|
|
156
|
+
Ruby runtime = context.getRuntime();
|
|
157
|
+
if (this.vSource != null) {
|
|
158
|
+
throw runtime.newTypeError("already initialized instance");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
OptionsReader opts = new OptionsReader(context, args.length > 1 ? args[1] : null);
|
|
162
|
+
this.maxNesting = opts.getInt("max_nesting", DEFAULT_MAX_NESTING);
|
|
163
|
+
this.allowNaN = opts.getBool("allow_nan", false);
|
|
164
|
+
this.symbolizeNames = opts.getBool("symbolize_names", false);
|
|
165
|
+
this.quirksMode = opts.getBool("quirks_mode", false);
|
|
166
|
+
this.createId = opts.getString("create_id", getCreateId(context));
|
|
167
|
+
this.createAdditions = opts.getBool("create_additions", true);
|
|
168
|
+
this.objectClass = opts.getClass("object_class", runtime.getHash());
|
|
169
|
+
this.arrayClass = opts.getClass("array_class", runtime.getArray());
|
|
170
|
+
this.match_string = opts.getHash("match_string");
|
|
171
|
+
|
|
172
|
+
this.vSource = args[0].convertToString();
|
|
173
|
+
if (!quirksMode) this.vSource = convertEncoding(context, vSource);
|
|
174
|
+
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Checks the given string's encoding. If a non-UTF-8 encoding is detected,
|
|
180
|
+
* a converted copy is returned.
|
|
181
|
+
* Returns the source string if no conversion is needed.
|
|
182
|
+
*/
|
|
183
|
+
private RubyString convertEncoding(ThreadContext context, RubyString source) {
|
|
184
|
+
ByteList bl = source.getByteList();
|
|
185
|
+
int len = bl.length();
|
|
186
|
+
if (len < 2) {
|
|
187
|
+
throw Utils.newException(context, Utils.M_PARSER_ERROR,
|
|
188
|
+
"A JSON text must at least contain two octets!");
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (info.encodingsSupported()) {
|
|
192
|
+
RubyEncoding encoding = (RubyEncoding)source.encoding(context);
|
|
193
|
+
if (encoding != info.ascii8bit.get()) {
|
|
194
|
+
return (RubyString)source.encode(context, info.utf8.get());
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
String sniffedEncoding = sniffByteList(bl);
|
|
198
|
+
if (sniffedEncoding == null) return source; // assume UTF-8
|
|
199
|
+
return reinterpretEncoding(context, source, sniffedEncoding);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
String sniffedEncoding = sniffByteList(bl);
|
|
203
|
+
if (sniffedEncoding == null) return source; // assume UTF-8
|
|
204
|
+
Ruby runtime = context.getRuntime();
|
|
205
|
+
return (RubyString)info.jsonModule.get().
|
|
206
|
+
callMethod(context, "iconv",
|
|
207
|
+
new IRubyObject[] {
|
|
208
|
+
runtime.newString("utf-8"),
|
|
209
|
+
runtime.newString(sniffedEncoding),
|
|
210
|
+
source});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Checks the first four bytes of the given ByteList to infer its encoding,
|
|
215
|
+
* using the principle demonstrated on section 3 of RFC 4627 (JSON).
|
|
216
|
+
*/
|
|
217
|
+
private static String sniffByteList(ByteList bl) {
|
|
218
|
+
if (bl.length() < 4) return null;
|
|
219
|
+
if (bl.get(0) == 0 && bl.get(2) == 0) {
|
|
220
|
+
return bl.get(1) == 0 ? "utf-32be" : "utf-16be";
|
|
221
|
+
}
|
|
222
|
+
if (bl.get(1) == 0 && bl.get(3) == 0) {
|
|
223
|
+
return bl.get(2) == 0 ? "utf-32le" : "utf-16le";
|
|
224
|
+
}
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Assumes the given (binary) RubyString to be in the given encoding, then
|
|
230
|
+
* converts it to UTF-8.
|
|
231
|
+
*/
|
|
232
|
+
private RubyString reinterpretEncoding(ThreadContext context,
|
|
233
|
+
RubyString str, String sniffedEncoding) {
|
|
234
|
+
RubyEncoding actualEncoding = info.getEncoding(context, sniffedEncoding);
|
|
235
|
+
RubyEncoding targetEncoding = info.utf8.get();
|
|
236
|
+
RubyString dup = (RubyString)str.dup();
|
|
237
|
+
dup.force_encoding(context, actualEncoding);
|
|
238
|
+
return (RubyString)dup.encode_bang(context, targetEncoding);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* <code>Parser#parse()</code>
|
|
243
|
+
*
|
|
244
|
+
* <p>Parses the current JSON text <code>source</code> and returns the
|
|
245
|
+
* complete data structure as a result.
|
|
246
|
+
*/
|
|
247
|
+
@JRubyMethod
|
|
248
|
+
public IRubyObject parse(ThreadContext context) {
|
|
249
|
+
return new ParserSession(this, context).parse();
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* <code>Parser#source()</code>
|
|
254
|
+
*
|
|
255
|
+
* <p>Returns a copy of the current <code>source</code> string, that was
|
|
256
|
+
* used to construct this Parser.
|
|
257
|
+
*/
|
|
258
|
+
@JRubyMethod(name = "source")
|
|
259
|
+
public IRubyObject source_get() {
|
|
260
|
+
return checkAndGetSource().dup();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* <code>Parser#quirks_mode?()</code>
|
|
265
|
+
*
|
|
266
|
+
* <p>If set to <code>true</code>, if the parse is in quirks_mode, false
|
|
267
|
+
* otherwise.
|
|
268
|
+
*/
|
|
269
|
+
@JRubyMethod(name = "quirks_mode?")
|
|
270
|
+
public IRubyObject quirks_mode_p(ThreadContext context) {
|
|
271
|
+
return context.getRuntime().newBoolean(quirksMode);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
public RubyString checkAndGetSource() {
|
|
275
|
+
if (vSource != null) {
|
|
276
|
+
return vSource;
|
|
277
|
+
} else {
|
|
278
|
+
throw getRuntime().newTypeError("uninitialized instance");
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Queries <code>JSON.create_id</code>. Returns <code>null</code> if it is
|
|
284
|
+
* set to <code>nil</code> or <code>false</code>, and a String if not.
|
|
285
|
+
*/
|
|
286
|
+
private RubyString getCreateId(ThreadContext context) {
|
|
287
|
+
IRubyObject v = info.jsonModule.get().callMethod(context, "create_id");
|
|
288
|
+
return v.isTrue() ? v.convertToString() : null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* A string parsing session.
|
|
293
|
+
*
|
|
294
|
+
* <p>Once a ParserSession is instantiated, the source string should not
|
|
295
|
+
* change until the parsing is complete. The ParserSession object assumes
|
|
296
|
+
* the source {@link RubyString} is still associated to its original
|
|
297
|
+
* {@link ByteList}, which in turn must still be bound to the same
|
|
298
|
+
* <code>byte[]</code> value (and on the same offset).
|
|
299
|
+
*/
|
|
300
|
+
// Ragel uses lots of fall-through
|
|
301
|
+
@SuppressWarnings("fallthrough")
|
|
302
|
+
private static class ParserSession {
|
|
303
|
+
private final Parser parser;
|
|
304
|
+
private final ThreadContext context;
|
|
305
|
+
private final ByteList byteList;
|
|
306
|
+
private final byte[] data;
|
|
307
|
+
private final StringDecoder decoder;
|
|
308
|
+
private int currentNesting = 0;
|
|
309
|
+
|
|
310
|
+
// initialization value for all state variables.
|
|
311
|
+
// no idea about the origins of this value, ask Flori ;)
|
|
312
|
+
private static final int EVIL = 0x666;
|
|
313
|
+
|
|
314
|
+
private ParserSession(Parser parser, ThreadContext context) {
|
|
315
|
+
this.parser = parser;
|
|
316
|
+
this.context = context;
|
|
317
|
+
this.byteList = parser.checkAndGetSource().getByteList();
|
|
318
|
+
this.data = byteList.unsafeBytes();
|
|
319
|
+
this.decoder = new StringDecoder(context);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
private RaiseException unexpectedToken(int absStart, int absEnd) {
|
|
323
|
+
RubyString msg = getRuntime().newString("unexpected token at '")
|
|
324
|
+
.cat(data, absStart, absEnd - absStart)
|
|
325
|
+
.cat((byte)'\'');
|
|
326
|
+
return newException(Utils.M_PARSER_ERROR, msg);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
private Ruby getRuntime() {
|
|
330
|
+
return context.getRuntime();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
// line 357 "Parser.rl"
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
// line 339 "Parser.java"
|
|
339
|
+
private static byte[] init__JSON_value_actions_0()
|
|
340
|
+
{
|
|
341
|
+
return new byte [] {
|
|
342
|
+
0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1,
|
|
343
|
+
5, 1, 6, 1, 7, 1, 8, 1, 9
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
private static final byte _JSON_value_actions[] = init__JSON_value_actions_0();
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
private static byte[] init__JSON_value_key_offsets_0()
|
|
351
|
+
{
|
|
352
|
+
return new byte [] {
|
|
353
|
+
0, 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
354
|
+
21, 22, 23, 24, 25, 26, 27, 28, 29, 30
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
private static final byte _JSON_value_key_offsets[] = init__JSON_value_key_offsets_0();
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
private static char[] init__JSON_value_trans_keys_0()
|
|
362
|
+
{
|
|
363
|
+
return new char [] {
|
|
364
|
+
34, 45, 73, 78, 91, 102, 110, 116, 123, 48, 57, 110,
|
|
365
|
+
102, 105, 110, 105, 116, 121, 97, 78, 97, 108, 115, 101,
|
|
366
|
+
117, 108, 108, 114, 117, 101, 0
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
private static final char _JSON_value_trans_keys[] = init__JSON_value_trans_keys_0();
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
private static byte[] init__JSON_value_single_lengths_0()
|
|
374
|
+
{
|
|
375
|
+
return new byte [] {
|
|
376
|
+
0, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
377
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 0
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
private static final byte _JSON_value_single_lengths[] = init__JSON_value_single_lengths_0();
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
private static byte[] init__JSON_value_range_lengths_0()
|
|
385
|
+
{
|
|
386
|
+
return new byte [] {
|
|
387
|
+
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
388
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
private static final byte _JSON_value_range_lengths[] = init__JSON_value_range_lengths_0();
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
private static byte[] init__JSON_value_index_offsets_0()
|
|
396
|
+
{
|
|
397
|
+
return new byte [] {
|
|
398
|
+
0, 0, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29,
|
|
399
|
+
31, 33, 35, 37, 39, 41, 43, 45, 47, 49
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
private static final byte _JSON_value_index_offsets[] = init__JSON_value_index_offsets_0();
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
private static byte[] init__JSON_value_trans_targs_0()
|
|
407
|
+
{
|
|
408
|
+
return new byte [] {
|
|
409
|
+
21, 21, 2, 9, 21, 11, 15, 18, 21, 21, 0, 3,
|
|
410
|
+
0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 21,
|
|
411
|
+
0, 10, 0, 21, 0, 12, 0, 13, 0, 14, 0, 21,
|
|
412
|
+
0, 16, 0, 17, 0, 21, 0, 19, 0, 20, 0, 21,
|
|
413
|
+
0, 0, 0
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
private static final byte _JSON_value_trans_targs[] = init__JSON_value_trans_targs_0();
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
private static byte[] init__JSON_value_trans_actions_0()
|
|
421
|
+
{
|
|
422
|
+
return new byte [] {
|
|
423
|
+
13, 11, 0, 0, 15, 0, 0, 0, 17, 11, 0, 0,
|
|
424
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
|
|
425
|
+
0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 3,
|
|
426
|
+
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 5,
|
|
427
|
+
0, 0, 0
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
private static final byte _JSON_value_trans_actions[] = init__JSON_value_trans_actions_0();
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
private static byte[] init__JSON_value_from_state_actions_0()
|
|
435
|
+
{
|
|
436
|
+
return new byte [] {
|
|
437
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
438
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 19
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
private static final byte _JSON_value_from_state_actions[] = init__JSON_value_from_state_actions_0();
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
static final int JSON_value_start = 1;
|
|
446
|
+
static final int JSON_value_first_final = 21;
|
|
447
|
+
static final int JSON_value_error = 0;
|
|
448
|
+
|
|
449
|
+
static final int JSON_value_en_main = 1;
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
// line 463 "Parser.rl"
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
ParserResult parseValue(int p, int pe) {
|
|
456
|
+
int cs = EVIL;
|
|
457
|
+
IRubyObject result = null;
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
// line 461 "Parser.java"
|
|
461
|
+
{
|
|
462
|
+
cs = JSON_value_start;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// line 470 "Parser.rl"
|
|
466
|
+
|
|
467
|
+
// line 468 "Parser.java"
|
|
468
|
+
{
|
|
469
|
+
int _klen;
|
|
470
|
+
int _trans = 0;
|
|
471
|
+
int _acts;
|
|
472
|
+
int _nacts;
|
|
473
|
+
int _keys;
|
|
474
|
+
int _goto_targ = 0;
|
|
475
|
+
|
|
476
|
+
_goto: while (true) {
|
|
477
|
+
switch ( _goto_targ ) {
|
|
478
|
+
case 0:
|
|
479
|
+
if ( p == pe ) {
|
|
480
|
+
_goto_targ = 4;
|
|
481
|
+
continue _goto;
|
|
482
|
+
}
|
|
483
|
+
if ( cs == 0 ) {
|
|
484
|
+
_goto_targ = 5;
|
|
485
|
+
continue _goto;
|
|
486
|
+
}
|
|
487
|
+
case 1:
|
|
488
|
+
_acts = _JSON_value_from_state_actions[cs];
|
|
489
|
+
_nacts = (int) _JSON_value_actions[_acts++];
|
|
490
|
+
while ( _nacts-- > 0 ) {
|
|
491
|
+
switch ( _JSON_value_actions[_acts++] ) {
|
|
492
|
+
case 9:
|
|
493
|
+
// line 448 "Parser.rl"
|
|
494
|
+
{
|
|
495
|
+
p--;
|
|
496
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
497
|
+
}
|
|
498
|
+
break;
|
|
499
|
+
// line 500 "Parser.java"
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
_match: do {
|
|
504
|
+
_keys = _JSON_value_key_offsets[cs];
|
|
505
|
+
_trans = _JSON_value_index_offsets[cs];
|
|
506
|
+
_klen = _JSON_value_single_lengths[cs];
|
|
507
|
+
if ( _klen > 0 ) {
|
|
508
|
+
int _lower = _keys;
|
|
509
|
+
int _mid;
|
|
510
|
+
int _upper = _keys + _klen - 1;
|
|
511
|
+
while (true) {
|
|
512
|
+
if ( _upper < _lower )
|
|
513
|
+
break;
|
|
514
|
+
|
|
515
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
516
|
+
if ( data[p] < _JSON_value_trans_keys[_mid] )
|
|
517
|
+
_upper = _mid - 1;
|
|
518
|
+
else if ( data[p] > _JSON_value_trans_keys[_mid] )
|
|
519
|
+
_lower = _mid + 1;
|
|
520
|
+
else {
|
|
521
|
+
_trans += (_mid - _keys);
|
|
522
|
+
break _match;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
_keys += _klen;
|
|
526
|
+
_trans += _klen;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
_klen = _JSON_value_range_lengths[cs];
|
|
530
|
+
if ( _klen > 0 ) {
|
|
531
|
+
int _lower = _keys;
|
|
532
|
+
int _mid;
|
|
533
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
534
|
+
while (true) {
|
|
535
|
+
if ( _upper < _lower )
|
|
536
|
+
break;
|
|
537
|
+
|
|
538
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
539
|
+
if ( data[p] < _JSON_value_trans_keys[_mid] )
|
|
540
|
+
_upper = _mid - 2;
|
|
541
|
+
else if ( data[p] > _JSON_value_trans_keys[_mid+1] )
|
|
542
|
+
_lower = _mid + 2;
|
|
543
|
+
else {
|
|
544
|
+
_trans += ((_mid - _keys)>>1);
|
|
545
|
+
break _match;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
_trans += _klen;
|
|
549
|
+
}
|
|
550
|
+
} while (false);
|
|
551
|
+
|
|
552
|
+
cs = _JSON_value_trans_targs[_trans];
|
|
553
|
+
|
|
554
|
+
if ( _JSON_value_trans_actions[_trans] != 0 ) {
|
|
555
|
+
_acts = _JSON_value_trans_actions[_trans];
|
|
556
|
+
_nacts = (int) _JSON_value_actions[_acts++];
|
|
557
|
+
while ( _nacts-- > 0 )
|
|
558
|
+
{
|
|
559
|
+
switch ( _JSON_value_actions[_acts++] )
|
|
560
|
+
{
|
|
561
|
+
case 0:
|
|
562
|
+
// line 365 "Parser.rl"
|
|
563
|
+
{
|
|
564
|
+
result = getRuntime().getNil();
|
|
565
|
+
}
|
|
566
|
+
break;
|
|
567
|
+
case 1:
|
|
568
|
+
// line 368 "Parser.rl"
|
|
569
|
+
{
|
|
570
|
+
result = getRuntime().getFalse();
|
|
571
|
+
}
|
|
572
|
+
break;
|
|
573
|
+
case 2:
|
|
574
|
+
// line 371 "Parser.rl"
|
|
575
|
+
{
|
|
576
|
+
result = getRuntime().getTrue();
|
|
577
|
+
}
|
|
578
|
+
break;
|
|
579
|
+
case 3:
|
|
580
|
+
// line 374 "Parser.rl"
|
|
581
|
+
{
|
|
582
|
+
if (parser.allowNaN) {
|
|
583
|
+
result = getConstant(CONST_NAN);
|
|
584
|
+
} else {
|
|
585
|
+
throw unexpectedToken(p - 2, pe);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
break;
|
|
589
|
+
case 4:
|
|
590
|
+
// line 381 "Parser.rl"
|
|
591
|
+
{
|
|
592
|
+
if (parser.allowNaN) {
|
|
593
|
+
result = getConstant(CONST_INFINITY);
|
|
594
|
+
} else {
|
|
595
|
+
throw unexpectedToken(p - 7, pe);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
break;
|
|
599
|
+
case 5:
|
|
600
|
+
// line 388 "Parser.rl"
|
|
601
|
+
{
|
|
602
|
+
if (pe > p + 9 - (parser.quirksMode ? 1 : 0) &&
|
|
603
|
+
absSubSequence(p, p + 9).toString().equals(JSON_MINUS_INFINITY)) {
|
|
604
|
+
|
|
605
|
+
if (parser.allowNaN) {
|
|
606
|
+
result = getConstant(CONST_MINUS_INFINITY);
|
|
607
|
+
{p = (( p + 10))-1;}
|
|
608
|
+
p--;
|
|
609
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
610
|
+
} else {
|
|
611
|
+
throw unexpectedToken(p, pe);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
ParserResult res = parseFloat(p, pe);
|
|
615
|
+
if (res != null) {
|
|
616
|
+
result = res.result;
|
|
617
|
+
{p = (( res.p))-1;}
|
|
618
|
+
}
|
|
619
|
+
res = parseInteger(p, pe);
|
|
620
|
+
if (res != null) {
|
|
621
|
+
result = res.result;
|
|
622
|
+
{p = (( res.p))-1;}
|
|
623
|
+
}
|
|
624
|
+
p--;
|
|
625
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
626
|
+
}
|
|
627
|
+
break;
|
|
628
|
+
case 6:
|
|
629
|
+
// line 414 "Parser.rl"
|
|
630
|
+
{
|
|
631
|
+
ParserResult res = parseString(p, pe);
|
|
632
|
+
if (res == null) {
|
|
633
|
+
p--;
|
|
634
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
635
|
+
} else {
|
|
636
|
+
result = res.result;
|
|
637
|
+
{p = (( res.p))-1;}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
break;
|
|
641
|
+
case 7:
|
|
642
|
+
// line 424 "Parser.rl"
|
|
643
|
+
{
|
|
644
|
+
currentNesting++;
|
|
645
|
+
ParserResult res = parseArray(p, pe);
|
|
646
|
+
currentNesting--;
|
|
647
|
+
if (res == null) {
|
|
648
|
+
p--;
|
|
649
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
650
|
+
} else {
|
|
651
|
+
result = res.result;
|
|
652
|
+
{p = (( res.p))-1;}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
break;
|
|
656
|
+
case 8:
|
|
657
|
+
// line 436 "Parser.rl"
|
|
658
|
+
{
|
|
659
|
+
currentNesting++;
|
|
660
|
+
ParserResult res = parseObject(p, pe);
|
|
661
|
+
currentNesting--;
|
|
662
|
+
if (res == null) {
|
|
663
|
+
p--;
|
|
664
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
665
|
+
} else {
|
|
666
|
+
result = res.result;
|
|
667
|
+
{p = (( res.p))-1;}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
break;
|
|
671
|
+
// line 672 "Parser.java"
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
case 2:
|
|
677
|
+
if ( cs == 0 ) {
|
|
678
|
+
_goto_targ = 5;
|
|
679
|
+
continue _goto;
|
|
680
|
+
}
|
|
681
|
+
if ( ++p != pe ) {
|
|
682
|
+
_goto_targ = 1;
|
|
683
|
+
continue _goto;
|
|
684
|
+
}
|
|
685
|
+
case 4:
|
|
686
|
+
case 5:
|
|
687
|
+
}
|
|
688
|
+
break; }
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// line 471 "Parser.rl"
|
|
692
|
+
|
|
693
|
+
if (cs >= JSON_value_first_final && result != null) {
|
|
694
|
+
return new ParserResult(result, p);
|
|
695
|
+
} else {
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
// line 702 "Parser.java"
|
|
702
|
+
private static byte[] init__JSON_integer_actions_0()
|
|
703
|
+
{
|
|
704
|
+
return new byte [] {
|
|
705
|
+
0, 1, 0
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
private static final byte _JSON_integer_actions[] = init__JSON_integer_actions_0();
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
private static byte[] init__JSON_integer_key_offsets_0()
|
|
713
|
+
{
|
|
714
|
+
return new byte [] {
|
|
715
|
+
0, 0, 4, 7, 9, 9
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
private static final byte _JSON_integer_key_offsets[] = init__JSON_integer_key_offsets_0();
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
private static char[] init__JSON_integer_trans_keys_0()
|
|
723
|
+
{
|
|
724
|
+
return new char [] {
|
|
725
|
+
45, 48, 49, 57, 48, 49, 57, 48, 57, 48, 57, 0
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
private static final char _JSON_integer_trans_keys[] = init__JSON_integer_trans_keys_0();
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
private static byte[] init__JSON_integer_single_lengths_0()
|
|
733
|
+
{
|
|
734
|
+
return new byte [] {
|
|
735
|
+
0, 2, 1, 0, 0, 0
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
private static final byte _JSON_integer_single_lengths[] = init__JSON_integer_single_lengths_0();
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
private static byte[] init__JSON_integer_range_lengths_0()
|
|
743
|
+
{
|
|
744
|
+
return new byte [] {
|
|
745
|
+
0, 1, 1, 1, 0, 1
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
private static final byte _JSON_integer_range_lengths[] = init__JSON_integer_range_lengths_0();
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
private static byte[] init__JSON_integer_index_offsets_0()
|
|
753
|
+
{
|
|
754
|
+
return new byte [] {
|
|
755
|
+
0, 0, 4, 7, 9, 10
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
private static final byte _JSON_integer_index_offsets[] = init__JSON_integer_index_offsets_0();
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
private static byte[] init__JSON_integer_indicies_0()
|
|
763
|
+
{
|
|
764
|
+
return new byte [] {
|
|
765
|
+
0, 2, 3, 1, 2, 3, 1, 1, 4, 1, 3, 4,
|
|
766
|
+
0
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
private static final byte _JSON_integer_indicies[] = init__JSON_integer_indicies_0();
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
private static byte[] init__JSON_integer_trans_targs_0()
|
|
774
|
+
{
|
|
775
|
+
return new byte [] {
|
|
776
|
+
2, 0, 3, 5, 4
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
private static final byte _JSON_integer_trans_targs[] = init__JSON_integer_trans_targs_0();
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
private static byte[] init__JSON_integer_trans_actions_0()
|
|
784
|
+
{
|
|
785
|
+
return new byte [] {
|
|
786
|
+
0, 0, 0, 0, 1
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
private static final byte _JSON_integer_trans_actions[] = init__JSON_integer_trans_actions_0();
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
static final int JSON_integer_start = 1;
|
|
794
|
+
static final int JSON_integer_first_final = 3;
|
|
795
|
+
static final int JSON_integer_error = 0;
|
|
796
|
+
|
|
797
|
+
static final int JSON_integer_en_main = 1;
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
// line 490 "Parser.rl"
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
ParserResult parseInteger(int p, int pe) {
|
|
804
|
+
int cs = EVIL;
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
// line 808 "Parser.java"
|
|
808
|
+
{
|
|
809
|
+
cs = JSON_integer_start;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// line 496 "Parser.rl"
|
|
813
|
+
int memo = p;
|
|
814
|
+
|
|
815
|
+
// line 816 "Parser.java"
|
|
816
|
+
{
|
|
817
|
+
int _klen;
|
|
818
|
+
int _trans = 0;
|
|
819
|
+
int _acts;
|
|
820
|
+
int _nacts;
|
|
821
|
+
int _keys;
|
|
822
|
+
int _goto_targ = 0;
|
|
823
|
+
|
|
824
|
+
_goto: while (true) {
|
|
825
|
+
switch ( _goto_targ ) {
|
|
826
|
+
case 0:
|
|
827
|
+
if ( p == pe ) {
|
|
828
|
+
_goto_targ = 4;
|
|
829
|
+
continue _goto;
|
|
830
|
+
}
|
|
831
|
+
if ( cs == 0 ) {
|
|
832
|
+
_goto_targ = 5;
|
|
833
|
+
continue _goto;
|
|
834
|
+
}
|
|
835
|
+
case 1:
|
|
836
|
+
_match: do {
|
|
837
|
+
_keys = _JSON_integer_key_offsets[cs];
|
|
838
|
+
_trans = _JSON_integer_index_offsets[cs];
|
|
839
|
+
_klen = _JSON_integer_single_lengths[cs];
|
|
840
|
+
if ( _klen > 0 ) {
|
|
841
|
+
int _lower = _keys;
|
|
842
|
+
int _mid;
|
|
843
|
+
int _upper = _keys + _klen - 1;
|
|
844
|
+
while (true) {
|
|
845
|
+
if ( _upper < _lower )
|
|
846
|
+
break;
|
|
847
|
+
|
|
848
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
849
|
+
if ( data[p] < _JSON_integer_trans_keys[_mid] )
|
|
850
|
+
_upper = _mid - 1;
|
|
851
|
+
else if ( data[p] > _JSON_integer_trans_keys[_mid] )
|
|
852
|
+
_lower = _mid + 1;
|
|
853
|
+
else {
|
|
854
|
+
_trans += (_mid - _keys);
|
|
855
|
+
break _match;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
_keys += _klen;
|
|
859
|
+
_trans += _klen;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
_klen = _JSON_integer_range_lengths[cs];
|
|
863
|
+
if ( _klen > 0 ) {
|
|
864
|
+
int _lower = _keys;
|
|
865
|
+
int _mid;
|
|
866
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
867
|
+
while (true) {
|
|
868
|
+
if ( _upper < _lower )
|
|
869
|
+
break;
|
|
870
|
+
|
|
871
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
872
|
+
if ( data[p] < _JSON_integer_trans_keys[_mid] )
|
|
873
|
+
_upper = _mid - 2;
|
|
874
|
+
else if ( data[p] > _JSON_integer_trans_keys[_mid+1] )
|
|
875
|
+
_lower = _mid + 2;
|
|
876
|
+
else {
|
|
877
|
+
_trans += ((_mid - _keys)>>1);
|
|
878
|
+
break _match;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
_trans += _klen;
|
|
882
|
+
}
|
|
883
|
+
} while (false);
|
|
884
|
+
|
|
885
|
+
_trans = _JSON_integer_indicies[_trans];
|
|
886
|
+
cs = _JSON_integer_trans_targs[_trans];
|
|
887
|
+
|
|
888
|
+
if ( _JSON_integer_trans_actions[_trans] != 0 ) {
|
|
889
|
+
_acts = _JSON_integer_trans_actions[_trans];
|
|
890
|
+
_nacts = (int) _JSON_integer_actions[_acts++];
|
|
891
|
+
while ( _nacts-- > 0 )
|
|
892
|
+
{
|
|
893
|
+
switch ( _JSON_integer_actions[_acts++] )
|
|
894
|
+
{
|
|
895
|
+
case 0:
|
|
896
|
+
// line 484 "Parser.rl"
|
|
897
|
+
{
|
|
898
|
+
p--;
|
|
899
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
900
|
+
}
|
|
901
|
+
break;
|
|
902
|
+
// line 903 "Parser.java"
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
case 2:
|
|
908
|
+
if ( cs == 0 ) {
|
|
909
|
+
_goto_targ = 5;
|
|
910
|
+
continue _goto;
|
|
911
|
+
}
|
|
912
|
+
if ( ++p != pe ) {
|
|
913
|
+
_goto_targ = 1;
|
|
914
|
+
continue _goto;
|
|
915
|
+
}
|
|
916
|
+
case 4:
|
|
917
|
+
case 5:
|
|
918
|
+
}
|
|
919
|
+
break; }
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
// line 498 "Parser.rl"
|
|
923
|
+
|
|
924
|
+
if (cs < JSON_integer_first_final) {
|
|
925
|
+
return null;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
ByteList num = absSubSequence(memo, p);
|
|
929
|
+
// note: this is actually a shared string, but since it is temporary and
|
|
930
|
+
// read-only, it doesn't really matter
|
|
931
|
+
RubyString expr = RubyString.newStringLight(getRuntime(), num);
|
|
932
|
+
RubyInteger number = RubyNumeric.str2inum(getRuntime(), expr, 10, true);
|
|
933
|
+
return new ParserResult(number, p + 1);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
// line 938 "Parser.java"
|
|
938
|
+
private static byte[] init__JSON_float_actions_0()
|
|
939
|
+
{
|
|
940
|
+
return new byte [] {
|
|
941
|
+
0, 1, 0
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
private static final byte _JSON_float_actions[] = init__JSON_float_actions_0();
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
private static byte[] init__JSON_float_key_offsets_0()
|
|
949
|
+
{
|
|
950
|
+
return new byte [] {
|
|
951
|
+
0, 0, 4, 7, 10, 12, 16, 18, 23, 29, 29
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
private static final byte _JSON_float_key_offsets[] = init__JSON_float_key_offsets_0();
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
private static char[] init__JSON_float_trans_keys_0()
|
|
959
|
+
{
|
|
960
|
+
return new char [] {
|
|
961
|
+
45, 48, 49, 57, 48, 49, 57, 46, 69, 101, 48, 57,
|
|
962
|
+
43, 45, 48, 57, 48, 57, 46, 69, 101, 48, 57, 69,
|
|
963
|
+
101, 45, 46, 48, 57, 69, 101, 45, 46, 48, 57, 0
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
private static final char _JSON_float_trans_keys[] = init__JSON_float_trans_keys_0();
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
private static byte[] init__JSON_float_single_lengths_0()
|
|
971
|
+
{
|
|
972
|
+
return new byte [] {
|
|
973
|
+
0, 2, 1, 3, 0, 2, 0, 3, 2, 0, 2
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
private static final byte _JSON_float_single_lengths[] = init__JSON_float_single_lengths_0();
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
private static byte[] init__JSON_float_range_lengths_0()
|
|
981
|
+
{
|
|
982
|
+
return new byte [] {
|
|
983
|
+
0, 1, 1, 0, 1, 1, 1, 1, 2, 0, 2
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
private static final byte _JSON_float_range_lengths[] = init__JSON_float_range_lengths_0();
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
private static byte[] init__JSON_float_index_offsets_0()
|
|
991
|
+
{
|
|
992
|
+
return new byte [] {
|
|
993
|
+
0, 0, 4, 7, 11, 13, 17, 19, 24, 29, 30
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
private static final byte _JSON_float_index_offsets[] = init__JSON_float_index_offsets_0();
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
private static byte[] init__JSON_float_indicies_0()
|
|
1001
|
+
{
|
|
1002
|
+
return new byte [] {
|
|
1003
|
+
0, 2, 3, 1, 2, 3, 1, 4, 5, 5, 1, 6,
|
|
1004
|
+
1, 7, 7, 8, 1, 8, 1, 4, 5, 5, 3, 1,
|
|
1005
|
+
5, 5, 1, 6, 9, 1, 1, 1, 1, 8, 9, 0
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
private static final byte _JSON_float_indicies[] = init__JSON_float_indicies_0();
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
private static byte[] init__JSON_float_trans_targs_0()
|
|
1013
|
+
{
|
|
1014
|
+
return new byte [] {
|
|
1015
|
+
2, 0, 3, 7, 4, 5, 8, 6, 10, 9
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
private static final byte _JSON_float_trans_targs[] = init__JSON_float_trans_targs_0();
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
private static byte[] init__JSON_float_trans_actions_0()
|
|
1023
|
+
{
|
|
1024
|
+
return new byte [] {
|
|
1025
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 1
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
private static final byte _JSON_float_trans_actions[] = init__JSON_float_trans_actions_0();
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
static final int JSON_float_start = 1;
|
|
1033
|
+
static final int JSON_float_first_final = 8;
|
|
1034
|
+
static final int JSON_float_error = 0;
|
|
1035
|
+
|
|
1036
|
+
static final int JSON_float_en_main = 1;
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
// line 526 "Parser.rl"
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
ParserResult parseFloat(int p, int pe) {
|
|
1043
|
+
int cs = EVIL;
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
// line 1047 "Parser.java"
|
|
1047
|
+
{
|
|
1048
|
+
cs = JSON_float_start;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
// line 532 "Parser.rl"
|
|
1052
|
+
int memo = p;
|
|
1053
|
+
|
|
1054
|
+
// line 1055 "Parser.java"
|
|
1055
|
+
{
|
|
1056
|
+
int _klen;
|
|
1057
|
+
int _trans = 0;
|
|
1058
|
+
int _acts;
|
|
1059
|
+
int _nacts;
|
|
1060
|
+
int _keys;
|
|
1061
|
+
int _goto_targ = 0;
|
|
1062
|
+
|
|
1063
|
+
_goto: while (true) {
|
|
1064
|
+
switch ( _goto_targ ) {
|
|
1065
|
+
case 0:
|
|
1066
|
+
if ( p == pe ) {
|
|
1067
|
+
_goto_targ = 4;
|
|
1068
|
+
continue _goto;
|
|
1069
|
+
}
|
|
1070
|
+
if ( cs == 0 ) {
|
|
1071
|
+
_goto_targ = 5;
|
|
1072
|
+
continue _goto;
|
|
1073
|
+
}
|
|
1074
|
+
case 1:
|
|
1075
|
+
_match: do {
|
|
1076
|
+
_keys = _JSON_float_key_offsets[cs];
|
|
1077
|
+
_trans = _JSON_float_index_offsets[cs];
|
|
1078
|
+
_klen = _JSON_float_single_lengths[cs];
|
|
1079
|
+
if ( _klen > 0 ) {
|
|
1080
|
+
int _lower = _keys;
|
|
1081
|
+
int _mid;
|
|
1082
|
+
int _upper = _keys + _klen - 1;
|
|
1083
|
+
while (true) {
|
|
1084
|
+
if ( _upper < _lower )
|
|
1085
|
+
break;
|
|
1086
|
+
|
|
1087
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
1088
|
+
if ( data[p] < _JSON_float_trans_keys[_mid] )
|
|
1089
|
+
_upper = _mid - 1;
|
|
1090
|
+
else if ( data[p] > _JSON_float_trans_keys[_mid] )
|
|
1091
|
+
_lower = _mid + 1;
|
|
1092
|
+
else {
|
|
1093
|
+
_trans += (_mid - _keys);
|
|
1094
|
+
break _match;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
_keys += _klen;
|
|
1098
|
+
_trans += _klen;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
_klen = _JSON_float_range_lengths[cs];
|
|
1102
|
+
if ( _klen > 0 ) {
|
|
1103
|
+
int _lower = _keys;
|
|
1104
|
+
int _mid;
|
|
1105
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
1106
|
+
while (true) {
|
|
1107
|
+
if ( _upper < _lower )
|
|
1108
|
+
break;
|
|
1109
|
+
|
|
1110
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
1111
|
+
if ( data[p] < _JSON_float_trans_keys[_mid] )
|
|
1112
|
+
_upper = _mid - 2;
|
|
1113
|
+
else if ( data[p] > _JSON_float_trans_keys[_mid+1] )
|
|
1114
|
+
_lower = _mid + 2;
|
|
1115
|
+
else {
|
|
1116
|
+
_trans += ((_mid - _keys)>>1);
|
|
1117
|
+
break _match;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
_trans += _klen;
|
|
1121
|
+
}
|
|
1122
|
+
} while (false);
|
|
1123
|
+
|
|
1124
|
+
_trans = _JSON_float_indicies[_trans];
|
|
1125
|
+
cs = _JSON_float_trans_targs[_trans];
|
|
1126
|
+
|
|
1127
|
+
if ( _JSON_float_trans_actions[_trans] != 0 ) {
|
|
1128
|
+
_acts = _JSON_float_trans_actions[_trans];
|
|
1129
|
+
_nacts = (int) _JSON_float_actions[_acts++];
|
|
1130
|
+
while ( _nacts-- > 0 )
|
|
1131
|
+
{
|
|
1132
|
+
switch ( _JSON_float_actions[_acts++] )
|
|
1133
|
+
{
|
|
1134
|
+
case 0:
|
|
1135
|
+
// line 517 "Parser.rl"
|
|
1136
|
+
{
|
|
1137
|
+
p--;
|
|
1138
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1139
|
+
}
|
|
1140
|
+
break;
|
|
1141
|
+
// line 1142 "Parser.java"
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
case 2:
|
|
1147
|
+
if ( cs == 0 ) {
|
|
1148
|
+
_goto_targ = 5;
|
|
1149
|
+
continue _goto;
|
|
1150
|
+
}
|
|
1151
|
+
if ( ++p != pe ) {
|
|
1152
|
+
_goto_targ = 1;
|
|
1153
|
+
continue _goto;
|
|
1154
|
+
}
|
|
1155
|
+
case 4:
|
|
1156
|
+
case 5:
|
|
1157
|
+
}
|
|
1158
|
+
break; }
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
// line 534 "Parser.rl"
|
|
1162
|
+
|
|
1163
|
+
if (cs < JSON_float_first_final) {
|
|
1164
|
+
return null;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
ByteList num = absSubSequence(memo, p);
|
|
1168
|
+
// note: this is actually a shared string, but since it is temporary and
|
|
1169
|
+
// read-only, it doesn't really matter
|
|
1170
|
+
RubyString expr = RubyString.newStringLight(getRuntime(), num);
|
|
1171
|
+
RubyFloat number = RubyNumeric.str2fnum(getRuntime(), expr, true);
|
|
1172
|
+
return new ParserResult(number, p + 1);
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
// line 1177 "Parser.java"
|
|
1177
|
+
private static byte[] init__JSON_string_actions_0()
|
|
1178
|
+
{
|
|
1179
|
+
return new byte [] {
|
|
1180
|
+
0, 2, 0, 1
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
private static final byte _JSON_string_actions[] = init__JSON_string_actions_0();
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
private static byte[] init__JSON_string_key_offsets_0()
|
|
1188
|
+
{
|
|
1189
|
+
return new byte [] {
|
|
1190
|
+
0, 0, 1, 5, 8, 14, 20, 26, 32
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
private static final byte _JSON_string_key_offsets[] = init__JSON_string_key_offsets_0();
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
private static char[] init__JSON_string_trans_keys_0()
|
|
1198
|
+
{
|
|
1199
|
+
return new char [] {
|
|
1200
|
+
34, 34, 92, 0, 31, 117, 0, 31, 48, 57, 65, 70,
|
|
1201
|
+
97, 102, 48, 57, 65, 70, 97, 102, 48, 57, 65, 70,
|
|
1202
|
+
97, 102, 48, 57, 65, 70, 97, 102, 0
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
private static final char _JSON_string_trans_keys[] = init__JSON_string_trans_keys_0();
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
private static byte[] init__JSON_string_single_lengths_0()
|
|
1210
|
+
{
|
|
1211
|
+
return new byte [] {
|
|
1212
|
+
0, 1, 2, 1, 0, 0, 0, 0, 0
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
private static final byte _JSON_string_single_lengths[] = init__JSON_string_single_lengths_0();
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
private static byte[] init__JSON_string_range_lengths_0()
|
|
1220
|
+
{
|
|
1221
|
+
return new byte [] {
|
|
1222
|
+
0, 0, 1, 1, 3, 3, 3, 3, 0
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
private static final byte _JSON_string_range_lengths[] = init__JSON_string_range_lengths_0();
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
private static byte[] init__JSON_string_index_offsets_0()
|
|
1230
|
+
{
|
|
1231
|
+
return new byte [] {
|
|
1232
|
+
0, 0, 2, 6, 9, 13, 17, 21, 25
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
private static final byte _JSON_string_index_offsets[] = init__JSON_string_index_offsets_0();
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
private static byte[] init__JSON_string_indicies_0()
|
|
1240
|
+
{
|
|
1241
|
+
return new byte [] {
|
|
1242
|
+
0, 1, 2, 3, 1, 0, 4, 1, 0, 5, 5, 5,
|
|
1243
|
+
1, 6, 6, 6, 1, 7, 7, 7, 1, 0, 0, 0,
|
|
1244
|
+
1, 1, 0
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
private static final byte _JSON_string_indicies[] = init__JSON_string_indicies_0();
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
private static byte[] init__JSON_string_trans_targs_0()
|
|
1252
|
+
{
|
|
1253
|
+
return new byte [] {
|
|
1254
|
+
2, 0, 8, 3, 4, 5, 6, 7
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
private static final byte _JSON_string_trans_targs[] = init__JSON_string_trans_targs_0();
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
private static byte[] init__JSON_string_trans_actions_0()
|
|
1262
|
+
{
|
|
1263
|
+
return new byte [] {
|
|
1264
|
+
0, 0, 1, 0, 0, 0, 0, 0
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
private static final byte _JSON_string_trans_actions[] = init__JSON_string_trans_actions_0();
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
static final int JSON_string_start = 1;
|
|
1272
|
+
static final int JSON_string_first_final = 8;
|
|
1273
|
+
static final int JSON_string_error = 0;
|
|
1274
|
+
|
|
1275
|
+
static final int JSON_string_en_main = 1;
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
// line 578 "Parser.rl"
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
ParserResult parseString(int p, int pe) {
|
|
1282
|
+
int cs = EVIL;
|
|
1283
|
+
IRubyObject result = null;
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
// line 1287 "Parser.java"
|
|
1287
|
+
{
|
|
1288
|
+
cs = JSON_string_start;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
// line 585 "Parser.rl"
|
|
1292
|
+
int memo = p;
|
|
1293
|
+
|
|
1294
|
+
// line 1295 "Parser.java"
|
|
1295
|
+
{
|
|
1296
|
+
int _klen;
|
|
1297
|
+
int _trans = 0;
|
|
1298
|
+
int _acts;
|
|
1299
|
+
int _nacts;
|
|
1300
|
+
int _keys;
|
|
1301
|
+
int _goto_targ = 0;
|
|
1302
|
+
|
|
1303
|
+
_goto: while (true) {
|
|
1304
|
+
switch ( _goto_targ ) {
|
|
1305
|
+
case 0:
|
|
1306
|
+
if ( p == pe ) {
|
|
1307
|
+
_goto_targ = 4;
|
|
1308
|
+
continue _goto;
|
|
1309
|
+
}
|
|
1310
|
+
if ( cs == 0 ) {
|
|
1311
|
+
_goto_targ = 5;
|
|
1312
|
+
continue _goto;
|
|
1313
|
+
}
|
|
1314
|
+
case 1:
|
|
1315
|
+
_match: do {
|
|
1316
|
+
_keys = _JSON_string_key_offsets[cs];
|
|
1317
|
+
_trans = _JSON_string_index_offsets[cs];
|
|
1318
|
+
_klen = _JSON_string_single_lengths[cs];
|
|
1319
|
+
if ( _klen > 0 ) {
|
|
1320
|
+
int _lower = _keys;
|
|
1321
|
+
int _mid;
|
|
1322
|
+
int _upper = _keys + _klen - 1;
|
|
1323
|
+
while (true) {
|
|
1324
|
+
if ( _upper < _lower )
|
|
1325
|
+
break;
|
|
1326
|
+
|
|
1327
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
1328
|
+
if ( data[p] < _JSON_string_trans_keys[_mid] )
|
|
1329
|
+
_upper = _mid - 1;
|
|
1330
|
+
else if ( data[p] > _JSON_string_trans_keys[_mid] )
|
|
1331
|
+
_lower = _mid + 1;
|
|
1332
|
+
else {
|
|
1333
|
+
_trans += (_mid - _keys);
|
|
1334
|
+
break _match;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
_keys += _klen;
|
|
1338
|
+
_trans += _klen;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
_klen = _JSON_string_range_lengths[cs];
|
|
1342
|
+
if ( _klen > 0 ) {
|
|
1343
|
+
int _lower = _keys;
|
|
1344
|
+
int _mid;
|
|
1345
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
1346
|
+
while (true) {
|
|
1347
|
+
if ( _upper < _lower )
|
|
1348
|
+
break;
|
|
1349
|
+
|
|
1350
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
1351
|
+
if ( data[p] < _JSON_string_trans_keys[_mid] )
|
|
1352
|
+
_upper = _mid - 2;
|
|
1353
|
+
else if ( data[p] > _JSON_string_trans_keys[_mid+1] )
|
|
1354
|
+
_lower = _mid + 2;
|
|
1355
|
+
else {
|
|
1356
|
+
_trans += ((_mid - _keys)>>1);
|
|
1357
|
+
break _match;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
_trans += _klen;
|
|
1361
|
+
}
|
|
1362
|
+
} while (false);
|
|
1363
|
+
|
|
1364
|
+
_trans = _JSON_string_indicies[_trans];
|
|
1365
|
+
cs = _JSON_string_trans_targs[_trans];
|
|
1366
|
+
|
|
1367
|
+
if ( _JSON_string_trans_actions[_trans] != 0 ) {
|
|
1368
|
+
_acts = _JSON_string_trans_actions[_trans];
|
|
1369
|
+
_nacts = (int) _JSON_string_actions[_acts++];
|
|
1370
|
+
while ( _nacts-- > 0 )
|
|
1371
|
+
{
|
|
1372
|
+
switch ( _JSON_string_actions[_acts++] )
|
|
1373
|
+
{
|
|
1374
|
+
case 0:
|
|
1375
|
+
// line 553 "Parser.rl"
|
|
1376
|
+
{
|
|
1377
|
+
int offset = byteList.begin();
|
|
1378
|
+
ByteList decoded = decoder.decode(byteList, memo + 1 - offset,
|
|
1379
|
+
p - offset);
|
|
1380
|
+
result = getRuntime().newString(decoded);
|
|
1381
|
+
if (result == null) {
|
|
1382
|
+
p--;
|
|
1383
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1384
|
+
} else {
|
|
1385
|
+
{p = (( p + 1))-1;}
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
break;
|
|
1389
|
+
case 1:
|
|
1390
|
+
// line 566 "Parser.rl"
|
|
1391
|
+
{
|
|
1392
|
+
p--;
|
|
1393
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1394
|
+
}
|
|
1395
|
+
break;
|
|
1396
|
+
// line 1397 "Parser.java"
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
case 2:
|
|
1402
|
+
if ( cs == 0 ) {
|
|
1403
|
+
_goto_targ = 5;
|
|
1404
|
+
continue _goto;
|
|
1405
|
+
}
|
|
1406
|
+
if ( ++p != pe ) {
|
|
1407
|
+
_goto_targ = 1;
|
|
1408
|
+
continue _goto;
|
|
1409
|
+
}
|
|
1410
|
+
case 4:
|
|
1411
|
+
case 5:
|
|
1412
|
+
}
|
|
1413
|
+
break; }
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// line 587 "Parser.rl"
|
|
1417
|
+
|
|
1418
|
+
if (parser.createAdditions) {
|
|
1419
|
+
RubyHash match_string = parser.match_string;
|
|
1420
|
+
if (match_string != null) {
|
|
1421
|
+
final IRubyObject[] memoArray = { result, null };
|
|
1422
|
+
try {
|
|
1423
|
+
match_string.visitAll(new RubyHash.Visitor() {
|
|
1424
|
+
@Override
|
|
1425
|
+
public void visit(IRubyObject pattern, IRubyObject klass) {
|
|
1426
|
+
if (pattern.callMethod(context, "===", memoArray[0]).isTrue()) {
|
|
1427
|
+
memoArray[1] = klass;
|
|
1428
|
+
throw JumpException.SPECIAL_JUMP;
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
} catch (JumpException e) { }
|
|
1433
|
+
if (memoArray[1] != null) {
|
|
1434
|
+
RubyClass klass = (RubyClass) memoArray[1];
|
|
1435
|
+
if (klass.respondsTo("json_creatable?") &&
|
|
1436
|
+
klass.callMethod(context, "json_creatable?").isTrue()) {
|
|
1437
|
+
result = klass.callMethod(context, "json_create", result);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
if (cs >= JSON_string_first_final && result != null) {
|
|
1444
|
+
return new ParserResult(result, p + 1);
|
|
1445
|
+
} else {
|
|
1446
|
+
return null;
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
// line 1452 "Parser.java"
|
|
1452
|
+
private static byte[] init__JSON_array_actions_0()
|
|
1453
|
+
{
|
|
1454
|
+
return new byte [] {
|
|
1455
|
+
0, 1, 0, 1, 1
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
private static final byte _JSON_array_actions[] = init__JSON_array_actions_0();
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
private static byte[] init__JSON_array_key_offsets_0()
|
|
1463
|
+
{
|
|
1464
|
+
return new byte [] {
|
|
1465
|
+
0, 0, 1, 18, 25, 41, 43, 44, 46, 47, 49, 50,
|
|
1466
|
+
52, 53, 55, 56, 58, 59
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
private static final byte _JSON_array_key_offsets[] = init__JSON_array_key_offsets_0();
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
private static char[] init__JSON_array_trans_keys_0()
|
|
1474
|
+
{
|
|
1475
|
+
return new char [] {
|
|
1476
|
+
91, 13, 32, 34, 45, 47, 73, 78, 91, 93, 102, 110,
|
|
1477
|
+
116, 123, 9, 10, 48, 57, 13, 32, 44, 47, 93, 9,
|
|
1478
|
+
10, 13, 32, 34, 45, 47, 73, 78, 91, 102, 110, 116,
|
|
1479
|
+
123, 9, 10, 48, 57, 42, 47, 42, 42, 47, 10, 42,
|
|
1480
|
+
47, 42, 42, 47, 10, 42, 47, 42, 42, 47, 10, 0
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
private static final char _JSON_array_trans_keys[] = init__JSON_array_trans_keys_0();
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
private static byte[] init__JSON_array_single_lengths_0()
|
|
1488
|
+
{
|
|
1489
|
+
return new byte [] {
|
|
1490
|
+
0, 1, 13, 5, 12, 2, 1, 2, 1, 2, 1, 2,
|
|
1491
|
+
1, 2, 1, 2, 1, 0
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
private static final byte _JSON_array_single_lengths[] = init__JSON_array_single_lengths_0();
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
private static byte[] init__JSON_array_range_lengths_0()
|
|
1499
|
+
{
|
|
1500
|
+
return new byte [] {
|
|
1501
|
+
0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0,
|
|
1502
|
+
0, 0, 0, 0, 0, 0
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
private static final byte _JSON_array_range_lengths[] = init__JSON_array_range_lengths_0();
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
private static byte[] init__JSON_array_index_offsets_0()
|
|
1510
|
+
{
|
|
1511
|
+
return new byte [] {
|
|
1512
|
+
0, 0, 2, 18, 25, 40, 43, 45, 48, 50, 53, 55,
|
|
1513
|
+
58, 60, 63, 65, 68, 70
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
private static final byte _JSON_array_index_offsets[] = init__JSON_array_index_offsets_0();
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
private static byte[] init__JSON_array_indicies_0()
|
|
1521
|
+
{
|
|
1522
|
+
return new byte [] {
|
|
1523
|
+
0, 1, 0, 0, 2, 2, 3, 2, 2, 2, 4, 2,
|
|
1524
|
+
2, 2, 2, 0, 2, 1, 5, 5, 6, 7, 4, 5,
|
|
1525
|
+
1, 6, 6, 2, 2, 8, 2, 2, 2, 2, 2, 2,
|
|
1526
|
+
2, 6, 2, 1, 9, 10, 1, 11, 9, 11, 6, 9,
|
|
1527
|
+
6, 10, 12, 13, 1, 14, 12, 14, 5, 12, 5, 13,
|
|
1528
|
+
15, 16, 1, 17, 15, 17, 0, 15, 0, 16, 1, 0
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
private static final byte _JSON_array_indicies[] = init__JSON_array_indicies_0();
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
private static byte[] init__JSON_array_trans_targs_0()
|
|
1536
|
+
{
|
|
1537
|
+
return new byte [] {
|
|
1538
|
+
2, 0, 3, 13, 17, 3, 4, 9, 5, 6, 8, 7,
|
|
1539
|
+
10, 12, 11, 14, 16, 15
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
private static final byte _JSON_array_trans_targs[] = init__JSON_array_trans_targs_0();
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
private static byte[] init__JSON_array_trans_actions_0()
|
|
1547
|
+
{
|
|
1548
|
+
return new byte [] {
|
|
1549
|
+
0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0,
|
|
1550
|
+
0, 0, 0, 0, 0, 0
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
private static final byte _JSON_array_trans_actions[] = init__JSON_array_trans_actions_0();
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
static final int JSON_array_start = 1;
|
|
1558
|
+
static final int JSON_array_first_final = 17;
|
|
1559
|
+
static final int JSON_array_error = 0;
|
|
1560
|
+
|
|
1561
|
+
static final int JSON_array_en_main = 1;
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
// line 657 "Parser.rl"
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
ParserResult parseArray(int p, int pe) {
|
|
1568
|
+
int cs = EVIL;
|
|
1569
|
+
|
|
1570
|
+
if (parser.maxNesting > 0 && currentNesting > parser.maxNesting) {
|
|
1571
|
+
throw newException(Utils.M_NESTING_ERROR,
|
|
1572
|
+
"nesting of " + currentNesting + " is too deep");
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
// this is guaranteed to be a RubyArray due to the earlier
|
|
1576
|
+
// allocator test at OptionsReader#getClass
|
|
1577
|
+
RubyArray result =
|
|
1578
|
+
(RubyArray)parser.arrayClass.newInstance(context,
|
|
1579
|
+
IRubyObject.NULL_ARRAY, Block.NULL_BLOCK);
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
// line 1583 "Parser.java"
|
|
1583
|
+
{
|
|
1584
|
+
cs = JSON_array_start;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
// line 674 "Parser.rl"
|
|
1588
|
+
|
|
1589
|
+
// line 1590 "Parser.java"
|
|
1590
|
+
{
|
|
1591
|
+
int _klen;
|
|
1592
|
+
int _trans = 0;
|
|
1593
|
+
int _acts;
|
|
1594
|
+
int _nacts;
|
|
1595
|
+
int _keys;
|
|
1596
|
+
int _goto_targ = 0;
|
|
1597
|
+
|
|
1598
|
+
_goto: while (true) {
|
|
1599
|
+
switch ( _goto_targ ) {
|
|
1600
|
+
case 0:
|
|
1601
|
+
if ( p == pe ) {
|
|
1602
|
+
_goto_targ = 4;
|
|
1603
|
+
continue _goto;
|
|
1604
|
+
}
|
|
1605
|
+
if ( cs == 0 ) {
|
|
1606
|
+
_goto_targ = 5;
|
|
1607
|
+
continue _goto;
|
|
1608
|
+
}
|
|
1609
|
+
case 1:
|
|
1610
|
+
_match: do {
|
|
1611
|
+
_keys = _JSON_array_key_offsets[cs];
|
|
1612
|
+
_trans = _JSON_array_index_offsets[cs];
|
|
1613
|
+
_klen = _JSON_array_single_lengths[cs];
|
|
1614
|
+
if ( _klen > 0 ) {
|
|
1615
|
+
int _lower = _keys;
|
|
1616
|
+
int _mid;
|
|
1617
|
+
int _upper = _keys + _klen - 1;
|
|
1618
|
+
while (true) {
|
|
1619
|
+
if ( _upper < _lower )
|
|
1620
|
+
break;
|
|
1621
|
+
|
|
1622
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
1623
|
+
if ( data[p] < _JSON_array_trans_keys[_mid] )
|
|
1624
|
+
_upper = _mid - 1;
|
|
1625
|
+
else if ( data[p] > _JSON_array_trans_keys[_mid] )
|
|
1626
|
+
_lower = _mid + 1;
|
|
1627
|
+
else {
|
|
1628
|
+
_trans += (_mid - _keys);
|
|
1629
|
+
break _match;
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
_keys += _klen;
|
|
1633
|
+
_trans += _klen;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
_klen = _JSON_array_range_lengths[cs];
|
|
1637
|
+
if ( _klen > 0 ) {
|
|
1638
|
+
int _lower = _keys;
|
|
1639
|
+
int _mid;
|
|
1640
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
1641
|
+
while (true) {
|
|
1642
|
+
if ( _upper < _lower )
|
|
1643
|
+
break;
|
|
1644
|
+
|
|
1645
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
1646
|
+
if ( data[p] < _JSON_array_trans_keys[_mid] )
|
|
1647
|
+
_upper = _mid - 2;
|
|
1648
|
+
else if ( data[p] > _JSON_array_trans_keys[_mid+1] )
|
|
1649
|
+
_lower = _mid + 2;
|
|
1650
|
+
else {
|
|
1651
|
+
_trans += ((_mid - _keys)>>1);
|
|
1652
|
+
break _match;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
_trans += _klen;
|
|
1656
|
+
}
|
|
1657
|
+
} while (false);
|
|
1658
|
+
|
|
1659
|
+
_trans = _JSON_array_indicies[_trans];
|
|
1660
|
+
cs = _JSON_array_trans_targs[_trans];
|
|
1661
|
+
|
|
1662
|
+
if ( _JSON_array_trans_actions[_trans] != 0 ) {
|
|
1663
|
+
_acts = _JSON_array_trans_actions[_trans];
|
|
1664
|
+
_nacts = (int) _JSON_array_actions[_acts++];
|
|
1665
|
+
while ( _nacts-- > 0 )
|
|
1666
|
+
{
|
|
1667
|
+
switch ( _JSON_array_actions[_acts++] )
|
|
1668
|
+
{
|
|
1669
|
+
case 0:
|
|
1670
|
+
// line 626 "Parser.rl"
|
|
1671
|
+
{
|
|
1672
|
+
ParserResult res = parseValue(p, pe);
|
|
1673
|
+
if (res == null) {
|
|
1674
|
+
p--;
|
|
1675
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1676
|
+
} else {
|
|
1677
|
+
if (!parser.arrayClass.getName().equals("Array")) {
|
|
1678
|
+
result.callMethod(context, "<<", res.result);
|
|
1679
|
+
} else {
|
|
1680
|
+
result.append(res.result);
|
|
1681
|
+
}
|
|
1682
|
+
{p = (( res.p))-1;}
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
break;
|
|
1686
|
+
case 1:
|
|
1687
|
+
// line 641 "Parser.rl"
|
|
1688
|
+
{
|
|
1689
|
+
p--;
|
|
1690
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1691
|
+
}
|
|
1692
|
+
break;
|
|
1693
|
+
// line 1694 "Parser.java"
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
case 2:
|
|
1699
|
+
if ( cs == 0 ) {
|
|
1700
|
+
_goto_targ = 5;
|
|
1701
|
+
continue _goto;
|
|
1702
|
+
}
|
|
1703
|
+
if ( ++p != pe ) {
|
|
1704
|
+
_goto_targ = 1;
|
|
1705
|
+
continue _goto;
|
|
1706
|
+
}
|
|
1707
|
+
case 4:
|
|
1708
|
+
case 5:
|
|
1709
|
+
}
|
|
1710
|
+
break; }
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
// line 675 "Parser.rl"
|
|
1714
|
+
|
|
1715
|
+
if (cs >= JSON_array_first_final) {
|
|
1716
|
+
return new ParserResult(result, p + 1);
|
|
1717
|
+
} else {
|
|
1718
|
+
throw unexpectedToken(p, pe);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
// line 1724 "Parser.java"
|
|
1724
|
+
private static byte[] init__JSON_object_actions_0()
|
|
1725
|
+
{
|
|
1726
|
+
return new byte [] {
|
|
1727
|
+
0, 1, 0, 1, 1, 1, 2
|
|
1728
|
+
};
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
private static final byte _JSON_object_actions[] = init__JSON_object_actions_0();
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
private static byte[] init__JSON_object_key_offsets_0()
|
|
1735
|
+
{
|
|
1736
|
+
return new byte [] {
|
|
1737
|
+
0, 0, 1, 8, 14, 16, 17, 19, 20, 36, 43, 49,
|
|
1738
|
+
51, 52, 54, 55, 57, 58, 60, 61, 63, 64, 66, 67,
|
|
1739
|
+
69, 70, 72, 73
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
private static final byte _JSON_object_key_offsets[] = init__JSON_object_key_offsets_0();
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
private static char[] init__JSON_object_trans_keys_0()
|
|
1747
|
+
{
|
|
1748
|
+
return new char [] {
|
|
1749
|
+
123, 13, 32, 34, 47, 125, 9, 10, 13, 32, 47, 58,
|
|
1750
|
+
9, 10, 42, 47, 42, 42, 47, 10, 13, 32, 34, 45,
|
|
1751
|
+
47, 73, 78, 91, 102, 110, 116, 123, 9, 10, 48, 57,
|
|
1752
|
+
13, 32, 44, 47, 125, 9, 10, 13, 32, 34, 47, 9,
|
|
1753
|
+
10, 42, 47, 42, 42, 47, 10, 42, 47, 42, 42, 47,
|
|
1754
|
+
10, 42, 47, 42, 42, 47, 10, 42, 47, 42, 42, 47,
|
|
1755
|
+
10, 0
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
private static final char _JSON_object_trans_keys[] = init__JSON_object_trans_keys_0();
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
private static byte[] init__JSON_object_single_lengths_0()
|
|
1763
|
+
{
|
|
1764
|
+
return new byte [] {
|
|
1765
|
+
0, 1, 5, 4, 2, 1, 2, 1, 12, 5, 4, 2,
|
|
1766
|
+
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
|
|
1767
|
+
1, 2, 1, 0
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
private static final byte _JSON_object_single_lengths[] = init__JSON_object_single_lengths_0();
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
private static byte[] init__JSON_object_range_lengths_0()
|
|
1775
|
+
{
|
|
1776
|
+
return new byte [] {
|
|
1777
|
+
0, 0, 1, 1, 0, 0, 0, 0, 2, 1, 1, 0,
|
|
1778
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
1779
|
+
0, 0, 0, 0
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
private static final byte _JSON_object_range_lengths[] = init__JSON_object_range_lengths_0();
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
private static byte[] init__JSON_object_index_offsets_0()
|
|
1787
|
+
{
|
|
1788
|
+
return new byte [] {
|
|
1789
|
+
0, 0, 2, 9, 15, 18, 20, 23, 25, 40, 47, 53,
|
|
1790
|
+
56, 58, 61, 63, 66, 68, 71, 73, 76, 78, 81, 83,
|
|
1791
|
+
86, 88, 91, 93
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
private static final byte _JSON_object_index_offsets[] = init__JSON_object_index_offsets_0();
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
private static byte[] init__JSON_object_indicies_0()
|
|
1799
|
+
{
|
|
1800
|
+
return new byte [] {
|
|
1801
|
+
0, 1, 0, 0, 2, 3, 4, 0, 1, 5, 5, 6,
|
|
1802
|
+
7, 5, 1, 8, 9, 1, 10, 8, 10, 5, 8, 5,
|
|
1803
|
+
9, 7, 7, 11, 11, 12, 11, 11, 11, 11, 11, 11,
|
|
1804
|
+
11, 7, 11, 1, 13, 13, 14, 15, 4, 13, 1, 14,
|
|
1805
|
+
14, 2, 16, 14, 1, 17, 18, 1, 19, 17, 19, 14,
|
|
1806
|
+
17, 14, 18, 20, 21, 1, 22, 20, 22, 13, 20, 13,
|
|
1807
|
+
21, 23, 24, 1, 25, 23, 25, 7, 23, 7, 24, 26,
|
|
1808
|
+
27, 1, 28, 26, 28, 0, 26, 0, 27, 1, 0
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
private static final byte _JSON_object_indicies[] = init__JSON_object_indicies_0();
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
private static byte[] init__JSON_object_trans_targs_0()
|
|
1816
|
+
{
|
|
1817
|
+
return new byte [] {
|
|
1818
|
+
2, 0, 3, 23, 27, 3, 4, 8, 5, 7, 6, 9,
|
|
1819
|
+
19, 9, 10, 15, 11, 12, 14, 13, 16, 18, 17, 20,
|
|
1820
|
+
22, 21, 24, 26, 25
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
private static final byte _JSON_object_trans_targs[] = init__JSON_object_trans_targs_0();
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
private static byte[] init__JSON_object_trans_actions_0()
|
|
1828
|
+
{
|
|
1829
|
+
return new byte [] {
|
|
1830
|
+
0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 0, 1,
|
|
1831
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
1832
|
+
0, 0, 0, 0, 0
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
private static final byte _JSON_object_trans_actions[] = init__JSON_object_trans_actions_0();
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
static final int JSON_object_start = 1;
|
|
1840
|
+
static final int JSON_object_first_final = 27;
|
|
1841
|
+
static final int JSON_object_error = 0;
|
|
1842
|
+
|
|
1843
|
+
static final int JSON_object_en_main = 1;
|
|
1844
|
+
|
|
1845
|
+
|
|
1846
|
+
// line 734 "Parser.rl"
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
ParserResult parseObject(int p, int pe) {
|
|
1850
|
+
int cs = EVIL;
|
|
1851
|
+
IRubyObject lastName = null;
|
|
1852
|
+
|
|
1853
|
+
if (parser.maxNesting > 0 && currentNesting > parser.maxNesting) {
|
|
1854
|
+
throw newException(Utils.M_NESTING_ERROR,
|
|
1855
|
+
"nesting of " + currentNesting + " is too deep");
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
// this is guaranteed to be a RubyHash due to the earlier
|
|
1859
|
+
// allocator test at OptionsReader#getClass
|
|
1860
|
+
RubyHash result =
|
|
1861
|
+
(RubyHash)parser.objectClass.newInstance(context,
|
|
1862
|
+
IRubyObject.NULL_ARRAY, Block.NULL_BLOCK);
|
|
1863
|
+
|
|
1864
|
+
|
|
1865
|
+
// line 1866 "Parser.java"
|
|
1866
|
+
{
|
|
1867
|
+
cs = JSON_object_start;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
// line 752 "Parser.rl"
|
|
1871
|
+
|
|
1872
|
+
// line 1873 "Parser.java"
|
|
1873
|
+
{
|
|
1874
|
+
int _klen;
|
|
1875
|
+
int _trans = 0;
|
|
1876
|
+
int _acts;
|
|
1877
|
+
int _nacts;
|
|
1878
|
+
int _keys;
|
|
1879
|
+
int _goto_targ = 0;
|
|
1880
|
+
|
|
1881
|
+
_goto: while (true) {
|
|
1882
|
+
switch ( _goto_targ ) {
|
|
1883
|
+
case 0:
|
|
1884
|
+
if ( p == pe ) {
|
|
1885
|
+
_goto_targ = 4;
|
|
1886
|
+
continue _goto;
|
|
1887
|
+
}
|
|
1888
|
+
if ( cs == 0 ) {
|
|
1889
|
+
_goto_targ = 5;
|
|
1890
|
+
continue _goto;
|
|
1891
|
+
}
|
|
1892
|
+
case 1:
|
|
1893
|
+
_match: do {
|
|
1894
|
+
_keys = _JSON_object_key_offsets[cs];
|
|
1895
|
+
_trans = _JSON_object_index_offsets[cs];
|
|
1896
|
+
_klen = _JSON_object_single_lengths[cs];
|
|
1897
|
+
if ( _klen > 0 ) {
|
|
1898
|
+
int _lower = _keys;
|
|
1899
|
+
int _mid;
|
|
1900
|
+
int _upper = _keys + _klen - 1;
|
|
1901
|
+
while (true) {
|
|
1902
|
+
if ( _upper < _lower )
|
|
1903
|
+
break;
|
|
1904
|
+
|
|
1905
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
1906
|
+
if ( data[p] < _JSON_object_trans_keys[_mid] )
|
|
1907
|
+
_upper = _mid - 1;
|
|
1908
|
+
else if ( data[p] > _JSON_object_trans_keys[_mid] )
|
|
1909
|
+
_lower = _mid + 1;
|
|
1910
|
+
else {
|
|
1911
|
+
_trans += (_mid - _keys);
|
|
1912
|
+
break _match;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
_keys += _klen;
|
|
1916
|
+
_trans += _klen;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
_klen = _JSON_object_range_lengths[cs];
|
|
1920
|
+
if ( _klen > 0 ) {
|
|
1921
|
+
int _lower = _keys;
|
|
1922
|
+
int _mid;
|
|
1923
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
1924
|
+
while (true) {
|
|
1925
|
+
if ( _upper < _lower )
|
|
1926
|
+
break;
|
|
1927
|
+
|
|
1928
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
1929
|
+
if ( data[p] < _JSON_object_trans_keys[_mid] )
|
|
1930
|
+
_upper = _mid - 2;
|
|
1931
|
+
else if ( data[p] > _JSON_object_trans_keys[_mid+1] )
|
|
1932
|
+
_lower = _mid + 2;
|
|
1933
|
+
else {
|
|
1934
|
+
_trans += ((_mid - _keys)>>1);
|
|
1935
|
+
break _match;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
_trans += _klen;
|
|
1939
|
+
}
|
|
1940
|
+
} while (false);
|
|
1941
|
+
|
|
1942
|
+
_trans = _JSON_object_indicies[_trans];
|
|
1943
|
+
cs = _JSON_object_trans_targs[_trans];
|
|
1944
|
+
|
|
1945
|
+
if ( _JSON_object_trans_actions[_trans] != 0 ) {
|
|
1946
|
+
_acts = _JSON_object_trans_actions[_trans];
|
|
1947
|
+
_nacts = (int) _JSON_object_actions[_acts++];
|
|
1948
|
+
while ( _nacts-- > 0 )
|
|
1949
|
+
{
|
|
1950
|
+
switch ( _JSON_object_actions[_acts++] )
|
|
1951
|
+
{
|
|
1952
|
+
case 0:
|
|
1953
|
+
// line 689 "Parser.rl"
|
|
1954
|
+
{
|
|
1955
|
+
ParserResult res = parseValue(p, pe);
|
|
1956
|
+
if (res == null) {
|
|
1957
|
+
p--;
|
|
1958
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1959
|
+
} else {
|
|
1960
|
+
if (!parser.objectClass.getName().equals("Hash")) {
|
|
1961
|
+
result.callMethod(context, "[]=", new IRubyObject[] { lastName, res.result });
|
|
1962
|
+
} else {
|
|
1963
|
+
result.op_aset(context, lastName, res.result);
|
|
1964
|
+
}
|
|
1965
|
+
{p = (( res.p))-1;}
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
break;
|
|
1969
|
+
case 1:
|
|
1970
|
+
// line 704 "Parser.rl"
|
|
1971
|
+
{
|
|
1972
|
+
ParserResult res = parseString(p, pe);
|
|
1973
|
+
if (res == null) {
|
|
1974
|
+
p--;
|
|
1975
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1976
|
+
} else {
|
|
1977
|
+
RubyString name = (RubyString)res.result;
|
|
1978
|
+
if (parser.symbolizeNames) {
|
|
1979
|
+
lastName = context.getRuntime().is1_9()
|
|
1980
|
+
? name.intern19()
|
|
1981
|
+
: name.intern();
|
|
1982
|
+
} else {
|
|
1983
|
+
lastName = name;
|
|
1984
|
+
}
|
|
1985
|
+
{p = (( res.p))-1;}
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
break;
|
|
1989
|
+
case 2:
|
|
1990
|
+
// line 722 "Parser.rl"
|
|
1991
|
+
{
|
|
1992
|
+
p--;
|
|
1993
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
1994
|
+
}
|
|
1995
|
+
break;
|
|
1996
|
+
// line 1997 "Parser.java"
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
case 2:
|
|
2002
|
+
if ( cs == 0 ) {
|
|
2003
|
+
_goto_targ = 5;
|
|
2004
|
+
continue _goto;
|
|
2005
|
+
}
|
|
2006
|
+
if ( ++p != pe ) {
|
|
2007
|
+
_goto_targ = 1;
|
|
2008
|
+
continue _goto;
|
|
2009
|
+
}
|
|
2010
|
+
case 4:
|
|
2011
|
+
case 5:
|
|
2012
|
+
}
|
|
2013
|
+
break; }
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
// line 753 "Parser.rl"
|
|
2017
|
+
|
|
2018
|
+
if (cs < JSON_object_first_final) {
|
|
2019
|
+
return null;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
IRubyObject returnedResult = result;
|
|
2023
|
+
|
|
2024
|
+
// attempt to de-serialize object
|
|
2025
|
+
if (parser.createAdditions) {
|
|
2026
|
+
IRubyObject vKlassName = result.op_aref(context, parser.createId);
|
|
2027
|
+
if (!vKlassName.isNil()) {
|
|
2028
|
+
// might throw ArgumentError, we let it propagate
|
|
2029
|
+
IRubyObject klass = parser.info.jsonModule.get().
|
|
2030
|
+
callMethod(context, "deep_const_get", vKlassName);
|
|
2031
|
+
if (klass.respondsTo("json_creatable?") &&
|
|
2032
|
+
klass.callMethod(context, "json_creatable?").isTrue()) {
|
|
2033
|
+
|
|
2034
|
+
returnedResult = klass.callMethod(context, "json_create", result);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
return new ParserResult(returnedResult, p + 1);
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
// line 2043 "Parser.java"
|
|
2043
|
+
private static byte[] init__JSON_actions_0()
|
|
2044
|
+
{
|
|
2045
|
+
return new byte [] {
|
|
2046
|
+
0, 1, 0, 1, 1
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
private static final byte _JSON_actions[] = init__JSON_actions_0();
|
|
2051
|
+
|
|
2052
|
+
|
|
2053
|
+
private static byte[] init__JSON_key_offsets_0()
|
|
2054
|
+
{
|
|
2055
|
+
return new byte [] {
|
|
2056
|
+
0, 0, 7, 9, 10, 12, 13, 15, 16, 18, 19
|
|
2057
|
+
};
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
private static final byte _JSON_key_offsets[] = init__JSON_key_offsets_0();
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
private static char[] init__JSON_trans_keys_0()
|
|
2064
|
+
{
|
|
2065
|
+
return new char [] {
|
|
2066
|
+
13, 32, 47, 91, 123, 9, 10, 42, 47, 42, 42, 47,
|
|
2067
|
+
10, 42, 47, 42, 42, 47, 10, 13, 32, 47, 9, 10,
|
|
2068
|
+
0
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
private static final char _JSON_trans_keys[] = init__JSON_trans_keys_0();
|
|
2073
|
+
|
|
2074
|
+
|
|
2075
|
+
private static byte[] init__JSON_single_lengths_0()
|
|
2076
|
+
{
|
|
2077
|
+
return new byte [] {
|
|
2078
|
+
0, 5, 2, 1, 2, 1, 2, 1, 2, 1, 3
|
|
2079
|
+
};
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
private static final byte _JSON_single_lengths[] = init__JSON_single_lengths_0();
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
private static byte[] init__JSON_range_lengths_0()
|
|
2086
|
+
{
|
|
2087
|
+
return new byte [] {
|
|
2088
|
+
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
private static final byte _JSON_range_lengths[] = init__JSON_range_lengths_0();
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
private static byte[] init__JSON_index_offsets_0()
|
|
2096
|
+
{
|
|
2097
|
+
return new byte [] {
|
|
2098
|
+
0, 0, 7, 10, 12, 15, 17, 20, 22, 25, 27
|
|
2099
|
+
};
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
private static final byte _JSON_index_offsets[] = init__JSON_index_offsets_0();
|
|
2103
|
+
|
|
2104
|
+
|
|
2105
|
+
private static byte[] init__JSON_indicies_0()
|
|
2106
|
+
{
|
|
2107
|
+
return new byte [] {
|
|
2108
|
+
0, 0, 2, 3, 4, 0, 1, 5, 6, 1, 7, 5,
|
|
2109
|
+
7, 0, 5, 0, 6, 8, 9, 1, 10, 8, 10, 11,
|
|
2110
|
+
8, 11, 9, 11, 11, 12, 11, 1, 0
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
private static final byte _JSON_indicies[] = init__JSON_indicies_0();
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
private static byte[] init__JSON_trans_targs_0()
|
|
2118
|
+
{
|
|
2119
|
+
return new byte [] {
|
|
2120
|
+
1, 0, 2, 10, 10, 3, 5, 4, 7, 9, 8, 10,
|
|
2121
|
+
6
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
private static final byte _JSON_trans_targs[] = init__JSON_trans_targs_0();
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
private static byte[] init__JSON_trans_actions_0()
|
|
2129
|
+
{
|
|
2130
|
+
return new byte [] {
|
|
2131
|
+
0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0,
|
|
2132
|
+
0
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
private static final byte _JSON_trans_actions[] = init__JSON_trans_actions_0();
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
static final int JSON_start = 1;
|
|
2140
|
+
static final int JSON_first_final = 10;
|
|
2141
|
+
static final int JSON_error = 0;
|
|
2142
|
+
|
|
2143
|
+
static final int JSON_en_main = 1;
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
// line 811 "Parser.rl"
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
public IRubyObject parseStrict() {
|
|
2150
|
+
int cs = EVIL;
|
|
2151
|
+
int p, pe;
|
|
2152
|
+
IRubyObject result = null;
|
|
2153
|
+
|
|
2154
|
+
|
|
2155
|
+
// line 2156 "Parser.java"
|
|
2156
|
+
{
|
|
2157
|
+
cs = JSON_start;
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
// line 819 "Parser.rl"
|
|
2161
|
+
p = byteList.begin();
|
|
2162
|
+
pe = p + byteList.length();
|
|
2163
|
+
|
|
2164
|
+
// line 2165 "Parser.java"
|
|
2165
|
+
{
|
|
2166
|
+
int _klen;
|
|
2167
|
+
int _trans = 0;
|
|
2168
|
+
int _acts;
|
|
2169
|
+
int _nacts;
|
|
2170
|
+
int _keys;
|
|
2171
|
+
int _goto_targ = 0;
|
|
2172
|
+
|
|
2173
|
+
_goto: while (true) {
|
|
2174
|
+
switch ( _goto_targ ) {
|
|
2175
|
+
case 0:
|
|
2176
|
+
if ( p == pe ) {
|
|
2177
|
+
_goto_targ = 4;
|
|
2178
|
+
continue _goto;
|
|
2179
|
+
}
|
|
2180
|
+
if ( cs == 0 ) {
|
|
2181
|
+
_goto_targ = 5;
|
|
2182
|
+
continue _goto;
|
|
2183
|
+
}
|
|
2184
|
+
case 1:
|
|
2185
|
+
_match: do {
|
|
2186
|
+
_keys = _JSON_key_offsets[cs];
|
|
2187
|
+
_trans = _JSON_index_offsets[cs];
|
|
2188
|
+
_klen = _JSON_single_lengths[cs];
|
|
2189
|
+
if ( _klen > 0 ) {
|
|
2190
|
+
int _lower = _keys;
|
|
2191
|
+
int _mid;
|
|
2192
|
+
int _upper = _keys + _klen - 1;
|
|
2193
|
+
while (true) {
|
|
2194
|
+
if ( _upper < _lower )
|
|
2195
|
+
break;
|
|
2196
|
+
|
|
2197
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
2198
|
+
if ( data[p] < _JSON_trans_keys[_mid] )
|
|
2199
|
+
_upper = _mid - 1;
|
|
2200
|
+
else if ( data[p] > _JSON_trans_keys[_mid] )
|
|
2201
|
+
_lower = _mid + 1;
|
|
2202
|
+
else {
|
|
2203
|
+
_trans += (_mid - _keys);
|
|
2204
|
+
break _match;
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
_keys += _klen;
|
|
2208
|
+
_trans += _klen;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
_klen = _JSON_range_lengths[cs];
|
|
2212
|
+
if ( _klen > 0 ) {
|
|
2213
|
+
int _lower = _keys;
|
|
2214
|
+
int _mid;
|
|
2215
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
2216
|
+
while (true) {
|
|
2217
|
+
if ( _upper < _lower )
|
|
2218
|
+
break;
|
|
2219
|
+
|
|
2220
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
2221
|
+
if ( data[p] < _JSON_trans_keys[_mid] )
|
|
2222
|
+
_upper = _mid - 2;
|
|
2223
|
+
else if ( data[p] > _JSON_trans_keys[_mid+1] )
|
|
2224
|
+
_lower = _mid + 2;
|
|
2225
|
+
else {
|
|
2226
|
+
_trans += ((_mid - _keys)>>1);
|
|
2227
|
+
break _match;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
_trans += _klen;
|
|
2231
|
+
}
|
|
2232
|
+
} while (false);
|
|
2233
|
+
|
|
2234
|
+
_trans = _JSON_indicies[_trans];
|
|
2235
|
+
cs = _JSON_trans_targs[_trans];
|
|
2236
|
+
|
|
2237
|
+
if ( _JSON_trans_actions[_trans] != 0 ) {
|
|
2238
|
+
_acts = _JSON_trans_actions[_trans];
|
|
2239
|
+
_nacts = (int) _JSON_actions[_acts++];
|
|
2240
|
+
while ( _nacts-- > 0 )
|
|
2241
|
+
{
|
|
2242
|
+
switch ( _JSON_actions[_acts++] )
|
|
2243
|
+
{
|
|
2244
|
+
case 0:
|
|
2245
|
+
// line 783 "Parser.rl"
|
|
2246
|
+
{
|
|
2247
|
+
currentNesting = 1;
|
|
2248
|
+
ParserResult res = parseObject(p, pe);
|
|
2249
|
+
if (res == null) {
|
|
2250
|
+
p--;
|
|
2251
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
2252
|
+
} else {
|
|
2253
|
+
result = res.result;
|
|
2254
|
+
{p = (( res.p))-1;}
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
break;
|
|
2258
|
+
case 1:
|
|
2259
|
+
// line 795 "Parser.rl"
|
|
2260
|
+
{
|
|
2261
|
+
currentNesting = 1;
|
|
2262
|
+
ParserResult res = parseArray(p, pe);
|
|
2263
|
+
if (res == null) {
|
|
2264
|
+
p--;
|
|
2265
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
2266
|
+
} else {
|
|
2267
|
+
result = res.result;
|
|
2268
|
+
{p = (( res.p))-1;}
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
break;
|
|
2272
|
+
// line 2273 "Parser.java"
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
case 2:
|
|
2278
|
+
if ( cs == 0 ) {
|
|
2279
|
+
_goto_targ = 5;
|
|
2280
|
+
continue _goto;
|
|
2281
|
+
}
|
|
2282
|
+
if ( ++p != pe ) {
|
|
2283
|
+
_goto_targ = 1;
|
|
2284
|
+
continue _goto;
|
|
2285
|
+
}
|
|
2286
|
+
case 4:
|
|
2287
|
+
case 5:
|
|
2288
|
+
}
|
|
2289
|
+
break; }
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
// line 822 "Parser.rl"
|
|
2293
|
+
|
|
2294
|
+
if (cs >= JSON_first_final && p == pe) {
|
|
2295
|
+
return result;
|
|
2296
|
+
} else {
|
|
2297
|
+
throw unexpectedToken(p, pe);
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
// line 2303 "Parser.java"
|
|
2303
|
+
private static byte[] init__JSON_quirks_mode_actions_0()
|
|
2304
|
+
{
|
|
2305
|
+
return new byte [] {
|
|
2306
|
+
0, 1, 0
|
|
2307
|
+
};
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
private static final byte _JSON_quirks_mode_actions[] = init__JSON_quirks_mode_actions_0();
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
private static byte[] init__JSON_quirks_mode_key_offsets_0()
|
|
2314
|
+
{
|
|
2315
|
+
return new byte [] {
|
|
2316
|
+
0, 0, 16, 18, 19, 21, 22, 24, 25, 27, 28
|
|
2317
|
+
};
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
private static final byte _JSON_quirks_mode_key_offsets[] = init__JSON_quirks_mode_key_offsets_0();
|
|
2321
|
+
|
|
2322
|
+
|
|
2323
|
+
private static char[] init__JSON_quirks_mode_trans_keys_0()
|
|
2324
|
+
{
|
|
2325
|
+
return new char [] {
|
|
2326
|
+
13, 32, 34, 45, 47, 73, 78, 91, 102, 110, 116, 123,
|
|
2327
|
+
9, 10, 48, 57, 42, 47, 42, 42, 47, 10, 42, 47,
|
|
2328
|
+
42, 42, 47, 10, 13, 32, 47, 9, 10, 0
|
|
2329
|
+
};
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
private static final char _JSON_quirks_mode_trans_keys[] = init__JSON_quirks_mode_trans_keys_0();
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
private static byte[] init__JSON_quirks_mode_single_lengths_0()
|
|
2336
|
+
{
|
|
2337
|
+
return new byte [] {
|
|
2338
|
+
0, 12, 2, 1, 2, 1, 2, 1, 2, 1, 3
|
|
2339
|
+
};
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
private static final byte _JSON_quirks_mode_single_lengths[] = init__JSON_quirks_mode_single_lengths_0();
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
private static byte[] init__JSON_quirks_mode_range_lengths_0()
|
|
2346
|
+
{
|
|
2347
|
+
return new byte [] {
|
|
2348
|
+
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1
|
|
2349
|
+
};
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
private static final byte _JSON_quirks_mode_range_lengths[] = init__JSON_quirks_mode_range_lengths_0();
|
|
2353
|
+
|
|
2354
|
+
|
|
2355
|
+
private static byte[] init__JSON_quirks_mode_index_offsets_0()
|
|
2356
|
+
{
|
|
2357
|
+
return new byte [] {
|
|
2358
|
+
0, 0, 15, 18, 20, 23, 25, 28, 30, 33, 35
|
|
2359
|
+
};
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
private static final byte _JSON_quirks_mode_index_offsets[] = init__JSON_quirks_mode_index_offsets_0();
|
|
2363
|
+
|
|
2364
|
+
|
|
2365
|
+
private static byte[] init__JSON_quirks_mode_indicies_0()
|
|
2366
|
+
{
|
|
2367
|
+
return new byte [] {
|
|
2368
|
+
0, 0, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2,
|
|
2369
|
+
0, 2, 1, 4, 5, 1, 6, 4, 6, 7, 4, 7,
|
|
2370
|
+
5, 8, 9, 1, 10, 8, 10, 0, 8, 0, 9, 7,
|
|
2371
|
+
7, 11, 7, 1, 0
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
private static final byte _JSON_quirks_mode_indicies[] = init__JSON_quirks_mode_indicies_0();
|
|
2376
|
+
|
|
2377
|
+
|
|
2378
|
+
private static byte[] init__JSON_quirks_mode_trans_targs_0()
|
|
2379
|
+
{
|
|
2380
|
+
return new byte [] {
|
|
2381
|
+
1, 0, 10, 6, 3, 5, 4, 10, 7, 9, 8, 2
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
private static final byte _JSON_quirks_mode_trans_targs[] = init__JSON_quirks_mode_trans_targs_0();
|
|
2386
|
+
|
|
2387
|
+
|
|
2388
|
+
private static byte[] init__JSON_quirks_mode_trans_actions_0()
|
|
2389
|
+
{
|
|
2390
|
+
return new byte [] {
|
|
2391
|
+
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
private static final byte _JSON_quirks_mode_trans_actions[] = init__JSON_quirks_mode_trans_actions_0();
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
static final int JSON_quirks_mode_start = 1;
|
|
2399
|
+
static final int JSON_quirks_mode_first_final = 10;
|
|
2400
|
+
static final int JSON_quirks_mode_error = 0;
|
|
2401
|
+
|
|
2402
|
+
static final int JSON_quirks_mode_en_main = 1;
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
// line 850 "Parser.rl"
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
public IRubyObject parseQuirksMode() {
|
|
2409
|
+
int cs = EVIL;
|
|
2410
|
+
int p, pe;
|
|
2411
|
+
IRubyObject result = null;
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
// line 2415 "Parser.java"
|
|
2415
|
+
{
|
|
2416
|
+
cs = JSON_quirks_mode_start;
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
// line 858 "Parser.rl"
|
|
2420
|
+
p = byteList.begin();
|
|
2421
|
+
pe = p + byteList.length();
|
|
2422
|
+
|
|
2423
|
+
// line 2424 "Parser.java"
|
|
2424
|
+
{
|
|
2425
|
+
int _klen;
|
|
2426
|
+
int _trans = 0;
|
|
2427
|
+
int _acts;
|
|
2428
|
+
int _nacts;
|
|
2429
|
+
int _keys;
|
|
2430
|
+
int _goto_targ = 0;
|
|
2431
|
+
|
|
2432
|
+
_goto: while (true) {
|
|
2433
|
+
switch ( _goto_targ ) {
|
|
2434
|
+
case 0:
|
|
2435
|
+
if ( p == pe ) {
|
|
2436
|
+
_goto_targ = 4;
|
|
2437
|
+
continue _goto;
|
|
2438
|
+
}
|
|
2439
|
+
if ( cs == 0 ) {
|
|
2440
|
+
_goto_targ = 5;
|
|
2441
|
+
continue _goto;
|
|
2442
|
+
}
|
|
2443
|
+
case 1:
|
|
2444
|
+
_match: do {
|
|
2445
|
+
_keys = _JSON_quirks_mode_key_offsets[cs];
|
|
2446
|
+
_trans = _JSON_quirks_mode_index_offsets[cs];
|
|
2447
|
+
_klen = _JSON_quirks_mode_single_lengths[cs];
|
|
2448
|
+
if ( _klen > 0 ) {
|
|
2449
|
+
int _lower = _keys;
|
|
2450
|
+
int _mid;
|
|
2451
|
+
int _upper = _keys + _klen - 1;
|
|
2452
|
+
while (true) {
|
|
2453
|
+
if ( _upper < _lower )
|
|
2454
|
+
break;
|
|
2455
|
+
|
|
2456
|
+
_mid = _lower + ((_upper-_lower) >> 1);
|
|
2457
|
+
if ( data[p] < _JSON_quirks_mode_trans_keys[_mid] )
|
|
2458
|
+
_upper = _mid - 1;
|
|
2459
|
+
else if ( data[p] > _JSON_quirks_mode_trans_keys[_mid] )
|
|
2460
|
+
_lower = _mid + 1;
|
|
2461
|
+
else {
|
|
2462
|
+
_trans += (_mid - _keys);
|
|
2463
|
+
break _match;
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
_keys += _klen;
|
|
2467
|
+
_trans += _klen;
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
_klen = _JSON_quirks_mode_range_lengths[cs];
|
|
2471
|
+
if ( _klen > 0 ) {
|
|
2472
|
+
int _lower = _keys;
|
|
2473
|
+
int _mid;
|
|
2474
|
+
int _upper = _keys + (_klen<<1) - 2;
|
|
2475
|
+
while (true) {
|
|
2476
|
+
if ( _upper < _lower )
|
|
2477
|
+
break;
|
|
2478
|
+
|
|
2479
|
+
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
|
2480
|
+
if ( data[p] < _JSON_quirks_mode_trans_keys[_mid] )
|
|
2481
|
+
_upper = _mid - 2;
|
|
2482
|
+
else if ( data[p] > _JSON_quirks_mode_trans_keys[_mid+1] )
|
|
2483
|
+
_lower = _mid + 2;
|
|
2484
|
+
else {
|
|
2485
|
+
_trans += ((_mid - _keys)>>1);
|
|
2486
|
+
break _match;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
_trans += _klen;
|
|
2490
|
+
}
|
|
2491
|
+
} while (false);
|
|
2492
|
+
|
|
2493
|
+
_trans = _JSON_quirks_mode_indicies[_trans];
|
|
2494
|
+
cs = _JSON_quirks_mode_trans_targs[_trans];
|
|
2495
|
+
|
|
2496
|
+
if ( _JSON_quirks_mode_trans_actions[_trans] != 0 ) {
|
|
2497
|
+
_acts = _JSON_quirks_mode_trans_actions[_trans];
|
|
2498
|
+
_nacts = (int) _JSON_quirks_mode_actions[_acts++];
|
|
2499
|
+
while ( _nacts-- > 0 )
|
|
2500
|
+
{
|
|
2501
|
+
switch ( _JSON_quirks_mode_actions[_acts++] )
|
|
2502
|
+
{
|
|
2503
|
+
case 0:
|
|
2504
|
+
// line 836 "Parser.rl"
|
|
2505
|
+
{
|
|
2506
|
+
ParserResult res = parseValue(p, pe);
|
|
2507
|
+
if (res == null) {
|
|
2508
|
+
p--;
|
|
2509
|
+
{ p += 1; _goto_targ = 5; if (true) continue _goto;}
|
|
2510
|
+
} else {
|
|
2511
|
+
result = res.result;
|
|
2512
|
+
{p = (( res.p))-1;}
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
break;
|
|
2516
|
+
// line 2517 "Parser.java"
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
case 2:
|
|
2522
|
+
if ( cs == 0 ) {
|
|
2523
|
+
_goto_targ = 5;
|
|
2524
|
+
continue _goto;
|
|
2525
|
+
}
|
|
2526
|
+
if ( ++p != pe ) {
|
|
2527
|
+
_goto_targ = 1;
|
|
2528
|
+
continue _goto;
|
|
2529
|
+
}
|
|
2530
|
+
case 4:
|
|
2531
|
+
case 5:
|
|
2532
|
+
}
|
|
2533
|
+
break; }
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
// line 861 "Parser.rl"
|
|
2537
|
+
|
|
2538
|
+
if (cs >= JSON_quirks_mode_first_final && p == pe) {
|
|
2539
|
+
return result;
|
|
2540
|
+
} else {
|
|
2541
|
+
throw unexpectedToken(p, pe);
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
public IRubyObject parse() {
|
|
2546
|
+
if (parser.quirksMode) {
|
|
2547
|
+
return parseQuirksMode();
|
|
2548
|
+
} else {
|
|
2549
|
+
return parseStrict();
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* Returns a subsequence of the source ByteList, based on source
|
|
2556
|
+
* array byte offsets (i.e., the ByteList's own begin offset is not
|
|
2557
|
+
* automatically added).
|
|
2558
|
+
* @param start
|
|
2559
|
+
* @param end
|
|
2560
|
+
*/
|
|
2561
|
+
private ByteList absSubSequence(int absStart, int absEnd) {
|
|
2562
|
+
int offset = byteList.begin();
|
|
2563
|
+
return (ByteList)byteList.subSequence(absStart - offset,
|
|
2564
|
+
absEnd - offset);
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
/**
|
|
2568
|
+
* Retrieves a constant directly descended from the <code>JSON</code> module.
|
|
2569
|
+
* @param name The constant name
|
|
2570
|
+
*/
|
|
2571
|
+
private IRubyObject getConstant(String name) {
|
|
2572
|
+
return parser.info.jsonModule.get().getConstant(name);
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
private RaiseException newException(String className, String message) {
|
|
2576
|
+
return Utils.newException(context, className, message);
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
private RaiseException newException(String className, RubyString message) {
|
|
2580
|
+
return Utils.newException(context, className, message);
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
private RaiseException newException(String className,
|
|
2584
|
+
String messageBegin, ByteList messageEnd) {
|
|
2585
|
+
return newException(className,
|
|
2586
|
+
getRuntime().newString(messageBegin).cat(messageEnd));
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
}
|