brakeman 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +18 -0
- data/bin/brakeman +1 -1
- data/bundle/load.rb +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/CHANGES.txt +828 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/MIT-LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/README.txt +102 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/Makefile +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/bench.rb +313 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/bench_context.yaml +141 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/_footer.html +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/_header.html +52 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/bench_erb.rhtml +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/bench_erubis.rhtml +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/benchmark/templates/bench_eruby.rhtml +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/bin/erubis +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/contrib/erubis +3468 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/contrib/erubis-run.rb +132 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/contrib/inline-require +179 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/ActionView.html +105 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html +209 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/ERB.html +101 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis.html +362 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayBufferEnhancer.html +175 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayBufferEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayEnhancer.html +174 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ArrayEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Basic.html +112 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Basic/Converter.html +327 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Basic/Engine.html +130 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/BiPatternEnhancer.html +215 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/BiPatternEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/CGenerator.html +386 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/CommandOptionError.html +113 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Context.html +344 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Converter.html +283 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/CppGenerator.html +382 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/DeleteIndentEnhancer.html +150 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/DeleteIndentEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ec.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ecpp.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ejava.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ejavascript.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Engine.html +305 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Eperl.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Ephp.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ErboutEnhancer.html +175 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ErboutEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/ErubisError.html +117 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Eruby.html +132 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapeEnhancer.html +165 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEc.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEcpp.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEjava.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEjavascript.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEperl.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEphp.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEruby.html +127 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/EscapedEscheme.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Escheme.html +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Evaluator.html +212 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/FastEruby.html +131 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Generator.html +416 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/HeaderFooterEnhancer.html +267 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/HeaderFooterEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers.html +116 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +787 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers/RailsHelper.html +349 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Helpers/RailsHelper/TemplateConverter.html +213 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/InterpolationEnhancer.html +305 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/InterpolationEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/JavaGenerator.html +359 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/JavascriptGenerator.html +386 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/Main.html +341 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoCodeEnhancer.html +249 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoCodeEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoTextEnhancer.html +159 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NoTextEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/NotSupportedError.html +119 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/OptimizedEruby.html +163 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/OptimizedGenerator.html +439 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/OptimizedXmlEruby.html +163 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI.html +125 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Converter.html +266 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ec.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ecpp.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ejava.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ejavascript.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Engine.html +122 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Eperl.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Ephp.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Eruby.html +155 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/Escheme.html +166 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PI/TinyEruby.html +293 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PercentLineEnhancer.html +163 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PercentLineEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PerlGenerator.html +344 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PhpGenerator.html +350 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrefixedLineEnhancer.html +210 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrefixedLineEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PreprocessingEruby.html +183 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PreprocessingHelper.html +212 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintEnabledEnhancer.html +212 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintEnabledEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintOutEnhancer.html +244 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintOutEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/PrintOutSimplifiedEruby.html +121 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/RubyEvaluator.html +227 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/RubyGenerator.html +328 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/SchemeGenerator.html +382 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/SimplifiedEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/SimplifyEnhancer.html +191 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StdoutEnhancer.html +173 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StdoutEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StdoutSimplifiedEruby.html +121 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StringBufferEnhancer.html +174 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StringBufferEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/StringIOEruby.html +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/TinyEruby.html +298 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/XmlEruby.html +130 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Erubis/XmlHelper.html +255 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/classes/Kernel.html +155 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/created.rid +1 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/README_txt.html +247 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/context_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/converter_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ec_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ecpp_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ejava_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ejavascript_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/enhanced_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/eperl_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/ephp_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/eruby_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/escheme_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine/optimized_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/engine_rb.html +117 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/enhancer_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/error_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/evaluator_rb.html +115 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/generator_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/helper_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/helpers/rails_form_helper_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/helpers/rails_helper_rb.html +116 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/local-setting_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/main_rb.html +129 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/preprocessing_rb.html +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/tiny_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis/util_rb.html +107 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/files/erubis_rb.html +118 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/fr_class_index.html +129 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/fr_file_index.html +53 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/fr_method_index.html +265 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/index.html +24 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc-api/rdoc-style.css +208 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc/docstyle.css +209 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/doc/users-guide.html +3551 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/Makefile +58 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ec +42 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ecpp +33 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ejava +45 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ejs +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.eperl +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.ephp +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.eruby +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/basic/example.escheme +26 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/Makefile +54 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ec +42 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ejava +45 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ejs +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.eperl +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.ephp +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.eruby +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/examples/pi/example.escheme +26 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis.rb +73 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/context.rb +83 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/converter.rb +357 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine.rb +120 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +117 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +113 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +110 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +119 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +126 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +95 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +99 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +125 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +114 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +127 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/enhancer.rb +723 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/error.rb +23 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/evaluator.rb +88 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/generator.rb +85 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/helper.rb +47 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +197 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +353 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/local-setting.rb +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/main.rb +516 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +58 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/tiny.rb +144 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/lib/erubis/util.rb +22 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/setup.rb +1331 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/assert-text-equal.rb +44 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/Example.ejava +55 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/array_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/arraybuffer_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bipattern-example.rhtml +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bipattern_example.result +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bufvar-example.rb +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/bufvar-example.result +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/context.rb +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/context.yaml +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/def_method.rb +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/def_method.result +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/escape_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ec +27 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ecpp +30 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ejs +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.eperl +18 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.ephp +18 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example.escheme +28 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1.rb +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10.rb +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10.result +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10.xhtml +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example10_x.result +17 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11.php +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11.result +23 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11.rhtml +21 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_C.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_N.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_U.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example11_php.result +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example1_x.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2.eruby +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2.rb +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2.result +27 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2_trim.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example2_x.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example3.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example3.rb +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example31.result +22 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example32.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example3_e.result +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4.eruby +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4.rb +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4.result +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example4_x.result +5 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example5.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example5.rb +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example5.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example6.rb +12 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example6.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example7.eruby +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example71.result +13 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example72.result +13 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example8.eruby +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example8_ruby.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example8_yaml.result +7 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example9.eruby +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example9.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example9.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example91.result +5 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example92.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_c.result +32 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_java.result +56 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_js.result +22 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_perl.result +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_php.result +19 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_scheme.result +30 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/example_scheme_display.result +29 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby-example.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby-example.result +18 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby.rb +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby.result +38 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/fasteruby.rhtml +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter-example.eruby +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter-example2.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter-example2.rhtml +10 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter_example.result +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/headerfooter_example2.result +13 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/interpolation_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program1.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program1.result +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program2.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/main_program2.result +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/nocode-example.eruby +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/nocode-php.result +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/nocode_example.result +15 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/normal-eruby-test.eruby +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/normal_eruby_test.result +11 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext-example.eruby +14 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext-example.php +19 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext-php.result +20 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/notext_example.result +16 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/percentline-example.rhtml +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/percentline_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/prefixedline-example.rb +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/prefixedline-example.rhtml +6 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/prefixedline_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printenable_example.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printenabled-example.eruby +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printenabled-example.rb +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/printstatement_example.result +8 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/simplify_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/stderr.log +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/stdout_exmple.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/stringbuffer_example.result +9 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/tail_260.result +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/tailnewline.rhtml +3 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/template1.rhtml +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/data/users-guide/template2.rhtml +4 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-engines.rb +425 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-enhancers.rb +646 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-erubis.rb +887 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-index-cgi.rb +191 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-main.rb +752 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test-users-guide.rb +73 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/test.rb +45 -0
- data/bundle/ruby/2.3.0/gems/erubis-2.7.0/test/testutil.rb +111 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/CHANGELOG.md +1363 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/FAQ.md +157 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/MIT-LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/README.md +173 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/REFERENCE.md +1294 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/Rakefile +134 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/bin/haml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml.rb +23 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/buffer.rb +345 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/compiler.rb +540 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/engine.rb +245 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/error.rb +61 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/exec.rb +329 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/filters.rb +404 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers.rb +664 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_extensions.rb +58 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_mods.rb +147 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/action_view_xss_mods.rb +58 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/safe_erubis_template.rb +29 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/helpers/xss_mods.rb +104 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/options.rb +279 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/parser.rb +764 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/railtie.rb +22 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/sass_rails_filter.rb +33 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/template.rb +32 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/template/options.rb +16 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/template/plugin.rb +41 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/util.rb +377 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/lib/haml/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/engine_test.rb +2013 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/_av_partial_1.erb +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/_av_partial_2.erb +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/action_view.erb +62 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/erb/standard.erb +55 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/filters_test.rb +254 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-3.0.x +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-3.1.x +6 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-3.2.x +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/gemfiles/Gemfile.rails-4.0.x +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/LICENSE +14 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/README.md +106 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/lua_haml_spec.lua +38 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/perl_haml_test.pl +81 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/ruby_haml_test.rb +23 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/haml-spec/tests.json +660 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/helper_test.rb +583 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/markaby/standard.mab +52 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/mocks/article.rb +6 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/parser_test.rb +105 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/content_for_layout.xhtml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/eval_suppressed.xhtml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/helpers.xhtml +70 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/helpful.xhtml +10 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/just_stuff.xhtml +70 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/list.xhtml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/nuke_inner_whitespace.xhtml +40 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/nuke_outer_whitespace.xhtml +148 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/original_engine.xhtml +20 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/partial_layout.xhtml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/partial_layout_erb.xhtml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/partials.xhtml +21 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/render_layout.xhtml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/silent_script.xhtml +74 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/standard.xhtml +162 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/tag_parsing.xhtml +23 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/very_basic.xhtml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/results/whitespace_handling.xhtml +90 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/template_test.rb +354 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_1.haml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_1_ugly.haml +9 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_2.haml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_av_partial_2_ugly.haml +5 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_layout.erb +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_layout_for_partial.haml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_partial.haml +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_text_area.haml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/_text_area_helper.html.haml +4 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/action_view.haml +47 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/action_view_ugly.haml +47 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/breakage.haml +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/content_for_layout.haml +8 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/eval_suppressed.haml +11 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/helpers.haml +55 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/helpful.haml +11 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/just_stuff.haml +85 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/list.haml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/nuke_inner_whitespace.haml +32 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/nuke_outer_whitespace.haml +144 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/original_engine.haml +17 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partial_layout.haml +3 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partial_layout_erb.erb +4 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partialize.haml +1 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/partials.haml +12 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/render_layout.haml +2 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/silent_script.haml +45 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/standard.haml +43 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/standard_ugly.haml +43 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/tag_parsing.haml +21 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/very_basic.haml +4 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/templates/whitespace_handling.haml +87 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/test_helper.rb +81 -0
- data/bundle/ruby/2.3.0/gems/haml-4.0.7/test/util_test.rb +63 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/AUTHORS +3 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/COPYING +339 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/Changelog.md +415 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/Gemfile +9 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/INSTALL +59 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/LICENSE +7 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/README.rdoc +74 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/Rakefile +30 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/TODO +6 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/ansi_colors.rb +38 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/asking_for_arrays.rb +18 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/basic_usage.rb +75 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb +32 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb +12 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/limit.rb +12 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/menus.rb +65 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/overwrite.rb +19 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/page_and_wrap.rb +322 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/password.rb +7 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/repeat_entry.rb +21 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/trapping_eof.rb +22 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/examples/using_readline.rb +17 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/highline.gemspec +37 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline.rb +1048 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/color_scheme.rb +134 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/compatibility.rb +16 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/import.rb +41 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/menu.rb +381 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/question.rb +480 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/simulate.rb +48 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/string_extensions.rb +111 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/style.rb +192 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/system_extensions.rb +254 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/lib/highline/version.rb +4 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/setup.rb +1360 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/site/highline.css +65 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/site/images/logo.png +0 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/site/index.html +58 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/string_methods.rb +32 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_color_scheme.rb +96 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_highline.rb +1402 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_import.rb +52 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_menu.rb +439 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_simulator.rb +23 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_extension.rb +33 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_string_highline.rb +38 -0
- data/bundle/ruby/2.3.0/gems/highline-1.7.8/test/tc_style.rb +578 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/History.txt +371 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/Manifest.txt +8 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/README.txt +87 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/Rakefile +92 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/bin/r2r_show +33 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/lib/ruby2ruby.rb +1159 -0
- data/bundle/ruby/2.3.0/gems/ruby2ruby-2.3.0/test/test_ruby2ruby.rb +709 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/History.txt +882 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/Manifest.txt +29 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/README.txt +93 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/Rakefile +187 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/bin/ruby_parse +96 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/bin/ruby_parse_extract_error +156 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby18_parser.rb +5773 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby18_parser.y +1899 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby19_parser.rb +6171 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby19_parser.y +2109 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby20_parser.rb +6723 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby20_parser.y +2372 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby21_parser.rb +6764 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby21_parser.y +2382 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby22_parser.rb +6804 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby22_parser.y +2393 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby23_parser.rb +6905 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby23_parser.y +2425 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_lexer.rb +1237 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_lexer.rex +177 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_lexer.rex.rb +317 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_parser.rb +7 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_parser.yy +2506 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/lib/ruby_parser_extras.rb +1460 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/test/test_ruby_lexer.rb +2723 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/test/test_ruby_parser.rb +3502 -0
- data/bundle/ruby/2.3.0/gems/ruby_parser-3.8.1/test/test_ruby_parser_extras.rb +228 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/CHANGES.md +149 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/Gemfile +11 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/LICENSE.txt +22 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/README.md +191 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/Rakefile +26 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/bin/safe_yaml +75 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/bundle_install_all_ruby_versions.sh +11 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml.rb +94 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/deep.rb +34 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/libyaml_checker.rb +36 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/load.rb +181 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/date.rb +35 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/hexadecimal.rb +12 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/parse/sexagesimal.rb +26 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/psych_handler.rb +99 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/psych_resolver.rb +52 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/resolver.rb +94 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/safe_to_ruby_visitor.rb +29 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/syck_hack.rb +36 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/syck_node_monkeypatch.rb +43 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/syck_resolver.rb +38 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform.rb +41 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_boolean.rb +21 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_date.rb +13 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_float.rb +33 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_integer.rb +26 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_nil.rb +18 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/to_symbol.rb +17 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/transform/transformation_map.rb +47 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/lib/safe_yaml/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/run_specs_all_ruby_versions.sh +38 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/safe_yaml.gemspec +19 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/exploit.1.9.2.yaml +2 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/exploit.1.9.3.yaml +2 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/issue48.txt +20 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/issue49.yml +0 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/libyaml_checker_spec.rb +69 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/psych_resolver_spec.rb +10 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/resolver_specs.rb +278 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/safe_yaml_spec.rb +731 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/spec_helper.rb +42 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb +29 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/syck_resolver_spec.rb +10 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/base64_spec.rb +11 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_date_spec.rb +60 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_float_spec.rb +42 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_integer_spec.rb +64 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/transform/to_symbol_spec.rb +51 -0
- data/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/yaml_spec.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/CODE_OF_CONDUCT.md +10 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/CONTRIBUTING.md +125 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/MIT-LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/README.md +227 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/REVISION +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/Rakefile +432 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/VERSION +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/VERSION_DATE +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/VERSION_NAME +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/bin/sass +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/bin/sass-convert +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/bin/scss +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/extra/update_watch.rb +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/init.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass.rb +109 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/base.rb +88 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/chain.rb +34 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/filesystem.rb +60 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/memory.rb +46 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/cache_stores/null.rb +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/callbacks.rb +67 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/css.rb +408 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/engine.rb +1218 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/environment.rb +215 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/error.rb +198 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec.rb +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec/base.rb +199 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec/sass_convert.rb +283 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/exec/sass_scss.rb +440 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/features.rb +47 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers.rb +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers/base.rb +182 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers/deprecated_path.rb +51 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/importers/filesystem.rb +219 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/logger.rb +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/logger/base.rb +30 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/logger/log_level.rb +45 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/media.rb +210 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin.rb +134 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/compiler.rb +582 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/configuration.rb +134 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/generic.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/merb.rb +48 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/rack.rb +60 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/rails.rb +47 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/plugin/staleness_checker.rb +199 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/railtie.rb +10 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/repl.rb +57 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/root.rb +7 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script.rb +66 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/css_lexer.rb +33 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/css_parser.rb +33 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/css_variable_warning.rb +52 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/functions.rb +2690 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/lexer.rb +464 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/parser.rb +825 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree.rb +16 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/funcall.rb +313 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/interpolation.rb +223 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/list_literal.rb +104 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/literal.rb +49 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/map_literal.rb +64 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/node.rb +127 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/operation.rb +129 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/selector.rb +26 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/string_interpolation.rb +125 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/unary_operation.rb +69 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/tree/variable.rb +57 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value.rb +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/arg_list.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/base.rb +241 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/bool.rb +35 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/color.rb +698 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/helpers.rb +272 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/list.rb +113 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/map.rb +70 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/null.rb +44 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/number.rb +561 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/script/value/string.rb +145 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss.rb +14 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/css_parser.rb +56 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/parser.rb +1236 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/rx.rb +140 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/static_parser.rb +366 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector.rb +323 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/abstract_sequence.rb +111 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/comma_sequence.rb +179 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/pseudo.rb +266 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/sequence.rb +636 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/simple.rb +116 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/selector/simple_sequence.rb +344 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/shared.rb +76 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/source/map.rb +211 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/source/position.rb +39 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/source/range.rb +41 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/stack.rb +120 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/supports.rb +225 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/at_root_node.rb +83 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/charset_node.rb +22 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/comment_node.rb +82 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/content_node.rb +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/css_import_node.rb +68 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/debug_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/directive_node.rb +59 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/each_node.rb +24 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/error_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/extend_node.rb +43 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/for_node.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/function_node.rb +44 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/if_node.rb +52 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/import_node.rb +75 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/keyframe_rule_node.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/media_node.rb +48 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/mixin_def_node.rb +38 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/mixin_node.rb +52 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/node.rb +240 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/prop_node.rb +170 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/return_node.rb +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/root_node.rb +44 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/rule_node.rb +146 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/supports_node.rb +38 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/trace_node.rb +33 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/variable_node.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/base.rb +72 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/check_nesting.rb +173 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/convert.rb +349 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/cssize.rb +373 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/deep_copy.rb +107 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/extend.rb +70 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/perform.rb +563 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/set_options.rb +139 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/visitors/to_css.rb +409 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/warn_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/tree/while_node.rb +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util.rb +1350 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/cross_platform_random.rb +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/multibyte_string_scanner.rb +155 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/normalized_map.rb +129 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/ordered_hash.rb +192 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/subset_map.rb +109 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/util/test.rb +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/version.rb +124 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/rails/init.rb +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass-spec.yml +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/cache_test.rb +131 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/callbacks_test.rb +61 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/compiler_test.rb +236 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/conversion_test.rb +2171 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/css2sass_test.rb +526 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/css_variable_test.rb +132 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/data/hsl-rgb.txt +319 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/encoding_test.rb +219 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/engine_test.rb +3441 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/exec_test.rb +96 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/extend_test.rb +1707 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/functions_test.rb +1974 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/importer_test.rb +421 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/logger_test.rb +58 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/mock_importer.rb +49 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_results/more1.css +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_results/more1_with_line_comments.css +26 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_results/more_import.css +29 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_templates/_more_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_templates/more1.sass +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/more_templates/more_import.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/plugin_test.rb +556 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/alt.css +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/basic.css +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/cached_import_option.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/compact.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/complex.css +86 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/compressed.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/expanded.css +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/filename_fn.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/if.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import.css +31 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_charset.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_charset_1_8.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_charset_ibm866.css +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/import_content.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/line_numbers.css +49 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/mixins.css +95 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/multiline.css +24 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/nested.css +22 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/options.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/parent_ref.css +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/script.css +16 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/scss_import.css +31 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/scss_importee.css +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/subdir/subdir.css +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/units.css +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/warn.css +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/results/warn_imported.css +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/script_conversion_test.rb +357 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/script_test.rb +1422 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/css_test.rb +1281 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/rx_test.rb +160 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/scss_test.rb +4157 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/scss/test_helper.rb +37 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/source_map_test.rb +1055 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/superselector_test.rb +210 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_cached_import_option_partial.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_double_import_loop2.sass +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_filename_fn_import.scss +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_imported_charset_ibm866.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_imported_charset_utf8.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_imported_content.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/_same_name_different_partiality.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/alt.sass +16 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/basic.sass +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork1.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork2.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork3.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork4.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/bork5.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/cached_import_option.scss +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/compact.sass +17 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/complex.sass +305 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/compressed.sass +15 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/double_import_loop1.sass +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/expanded.sass +17 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/filename_fn.scss +18 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/if.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import.sass +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_charset.sass +9 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_charset_1_8.sass +6 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_charset_ibm866.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/import_content.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/importee.less +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/importee.sass +19 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/line_numbers.sass +13 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/mixin_bork.sass +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/mixins.sass +76 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/multiline.sass +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested.sass +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork1.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork2.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork3.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_bork4.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_import.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/nested_mixin_bork.sass +6 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/options.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/parent_ref.sass +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/same_name_different_ext.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/same_name_different_ext.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/same_name_different_partiality.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/script.sass +101 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/scss_import.scss +12 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/scss_importee.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/single_import_loop.sass +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/import_up1.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/import_up2.scss +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/subdir/subdir.sass +6 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/units.sass +11 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/warn.sass +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/templates/warn_imported.sass +4 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/test_helper.rb +8 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util/multibyte_string_scanner_test.rb +147 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util/normalized_map_test.rb +51 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util/subset_map_test.rb +91 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/util_test.rb +438 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/sass/value_helpers_test.rb +179 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/test/test_helper.rb +110 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/CHANGELOG.md +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/CONTRIBUTING.md +38 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Gemfile +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Guardfile +8 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/README.md +349 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Rakefile +5 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/Vagrantfile +96 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen.rb +54 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapter.rb +327 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/bsd.rb +75 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/darwin.rb +48 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/linux.rb +81 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/polling.rb +58 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/adapters/windows.rb +91 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/directory_record.rb +406 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/listener.rb +323 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/turnstile.rb +32 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/lib/listen/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/listen.gemspec +28 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapter_spec.rb +149 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/bsd_spec.rb +36 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/darwin_spec.rb +37 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/linux_spec.rb +47 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/adapters/windows_spec.rb +30 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/directory_record_spec.rb +1250 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/listener_spec.rb +258 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/listen_spec.rb +67 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/spec_helper.rb +25 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/adapter_helper.rb +666 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/directory_record_helper.rb +57 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/fixtures_helper.rb +29 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/listeners_helper.rb +179 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.22/vendor/listen/spec/support/platform_helper.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/History.txt +278 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/Manifest.txt +13 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/README.txt +64 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/Rakefile +12 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/composite_sexp_processor.rb +49 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/pt_testcase.rb +3125 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/sexp.rb +338 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/sexp_processor.rb +695 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/lib/unique.rb +15 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_composite_sexp_processor.rb +69 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_environment.rb +94 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_sexp.rb +356 -0
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.7.0/test/test_sexp_processor.rb +373 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/CHANGES +426 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/Gemfile +69 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/LICENSE +21 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/README.jp.md +1205 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/README.md +1205 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/Rakefile +100 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/context.rb +11 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/profile-parser.rb +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/profile-render.rb +12 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/run-benchmarks.rb +119 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/run-diffbench.rb +21 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/view.erb +23 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/view.haml +18 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/benchmarks/view.slim +17 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/bin/slimrb +6 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/include.md +20 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/include.md +20 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/logic_less.md +137 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/smart.md +102 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/jp/translator.md +28 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/logic_less.md +137 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/smart.md +103 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/doc/translator.md +28 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim.rb +14 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/code_attributes.rb +67 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/command.rb +128 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/controls.rb +60 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/do_inserter.rb +33 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/embedded.rb +273 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/end_inserter.rb +62 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/engine.rb +41 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/erb_converter.rb +14 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/filter.rb +30 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/grammar.rb +20 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/include.rb +57 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/interpolation.rb +35 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/logic_less.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/logic_less/context.rb +127 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/logic_less/filter.rb +80 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/parser.rb +527 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart.rb +8 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart/escaper.rb +42 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart/filter.rb +96 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/smart/parser.rb +36 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/splat/builder.rb +101 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/splat/filter.rb +91 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/template.rb +19 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/translator.rb +118 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/lib/slim/version.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/slim.gemspec +24 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/helper.rb +211 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_blocks.rb +183 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_escaping.rb +150 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_evaluation.rb +180 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_output.rb +168 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_code_structure.rb +168 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_commands.rb +223 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_embedded_engines.rb +242 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_encoding.rb +28 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_erb_converter.rb +67 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_html_attributes.rb +268 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_html_escaping.rb +65 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_html_structure.rb +537 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_parser_errors.rb +148 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_pretty.rb +166 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_ruby_errors.rb +207 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_slim_template.rb +77 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_tabs.rb +169 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_text_interpolation.rb +79 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_thread_options.rb +18 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/core/test_unicode.rb +16 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/recursive.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/slimfile.slim +3 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/subdir/test.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/files/textfile +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/include/test_include.rb +24 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/literate/TESTS.md +1290 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/literate/helper.rb +15 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/literate/run.rb +92 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/logic_less/test_logic_less.rb +295 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/Rakefile +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/controllers/application_controller.rb +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/controllers/entries_controller.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/controllers/slim_controller.rb +40 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/helpers/application_helper.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/models/entry.rb +16 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/entries/edit.html.slim +3 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/layouts/application.html.slim +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/_partial.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/content_for.html.slim +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/erb.html.erb +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/form_for.html.slim +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/helper.html.slim +4 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/integers.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/no_layout.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/normal.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/partial.html.slim +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/splat.html.slim +2 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/thread_options.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/variables.html.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/app/views/slim/xml.slim +1 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config.ru +4 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/application.rb +44 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/boot.rb +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/environment.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/environments/test.rb +34 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/backtrace_silencers.rb +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/inflections.rb +10 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/mime_types.rb +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/secret_token.rb +7 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/initializers/session_store.rb +8 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/locales/en.yml +5 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/config/routes.rb +60 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/script/rails +6 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/test/helper.rb +31 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/rails/test/test_slim.rb +90 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/smart/test_smart_text.rb +296 -0
- data/bundle/ruby/2.3.0/gems/slim-3.0.6/test/translator/test_translator.rb +76 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/CHANGES +235 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/EXPRESSIONS.md +261 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/Gemfile +3 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/LICENSE +20 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/README.md +267 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/Rakefile +25 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple.rb +64 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/engine.rb +67 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/engine.rb +15 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/parser.rb +40 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/template.rb +11 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/erb/trimming.rb +23 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/exceptions.rb +13 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filter.rb +9 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/code_merger.rb +30 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/control_flow.rb +42 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/dynamic_inliner.rb +71 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/encoding.rb +24 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/eraser.rb +22 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/escapable.rb +40 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/multi_flattener.rb +25 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/remove_bom.rb +13 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/static_merger.rb +37 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/filters/validator.rb +15 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generator.rb +88 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/array.rb +21 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/array_buffer.rb +28 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/erb.rb +32 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/rails_output_buffer.rb +35 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/generators/string_buffer.rb +25 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/grammar.rb +57 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/attribute_merger.rb +47 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/attribute_remover.rb +35 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/attribute_sorter.rb +21 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/dispatcher.rb +31 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/fast.rb +130 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/filter.rb +21 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/pretty.rb +103 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/html/safe.rb +23 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/map.rb +105 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/dispatcher.rb +158 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/engine_dsl.rb +145 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/grammar_dsl.rb +170 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/options.rb +87 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/mixins/template.rb +28 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/parser.rb +8 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/templates.rb +11 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/templates/rails.rb +26 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/templates/tilt.rb +46 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/utils.rb +90 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/temple.gemspec +29 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_code_merger.rb +38 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_control_flow.rb +90 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_dynamic_inliner.rb +95 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_eraser.rb +55 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_escapable.rb +49 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_multi_flattener.rb +33 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/filters/test_static_merger.rb +41 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/helper.rb +30 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_attribute_merger.rb +76 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_attribute_remover.rb +43 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_attribute_sorter.rb +48 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_fast.rb +97 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/html/test_pretty.rb +55 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/mixins/test_dispatcher.rb +70 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/mixins/test_grammar_dsl.rb +86 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_engine.rb +189 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_erb.rb +61 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_filter.rb +29 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_generator.rb +158 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_grammar.rb +47 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_map.rb +39 -0
- data/bundle/ruby/2.3.0/gems/temple-0.7.6/test/test_utils.rb +39 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Gemfile +4 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/History.rdoc +48 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Manifest +27 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/README.rdoc +240 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Rakefile +9 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/Todo.rdoc +14 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/examples/examples.rb +83 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table.rb +26 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/cell.rb +92 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/import.rb +3 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/row.rb +48 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/separator.rb +14 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/style.rb +62 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/table.rb +226 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/table_helper.rb +9 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/lib/terminal-table/version.rb +5 -0
- data/bundle/ruby/2.3.0/gems/terminal-table-1.5.2/terminal-table.gemspec +24 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/CHANGELOG.md +84 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/COPYING +18 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/Gemfile +64 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/HACKING +16 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/README.md +226 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/Rakefile +105 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/bin/tilt +122 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/docs/TEMPLATES.md +524 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/docs/common.css +14 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt.rb +159 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/asciidoc.rb +27 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/babel.rb +15 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/bluecloth.rb +24 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/builder.rb +33 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/coffee.rb +58 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/creole.rb +25 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/csv.rb +65 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/erb.rb +57 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/erubis.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/etanni.rb +27 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/haml.rb +58 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/kramdown.rb +25 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/less.rb +30 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/liquid.rb +38 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/mapping.rb +265 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/markaby.rb +45 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/maruku.rb +22 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/nokogiri.rb +36 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/plain.rb +16 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/prawn.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/radius.rb +48 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/rdiscount.rb +39 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/rdoc.rb +40 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/redcarpet.rb +83 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/redcloth.rb +23 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/sass.rb +41 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/string.rb +21 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/template.rb +295 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/wikicloth.rb +22 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/lib/tilt/yajl.rb +87 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/man/index.txt +2 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/man/tilt.1.ronn +59 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/locals.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/markaby.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/markaby_other_static.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/render_twice.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/scope.mab +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/markaby/yielding.mab +2 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/test_helper.rb +64 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_asciidoctor_test.rb +50 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_babeltemplate.rb +33 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_blueclothtemplate_test.rb +33 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_buildertemplate_test.rb +59 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_cache_test.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_coffeescripttemplate_test.rb +141 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_compilesite_test.rb +51 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_creoletemplate_test.rb +24 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_csv_test.rb +77 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_erbtemplate_test.rb +239 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_erubistemplate_test.rb +151 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_etannitemplate_test.rb +174 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_hamltemplate_test.rb +166 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_kramdown_test.rb +20 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_lesstemplate_test.less +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_lesstemplate_test.rb +42 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_liquidtemplate_test.rb +78 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_mapping_test.rb +229 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_markaby_test.rb +88 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_markdown_test.rb +177 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_marukutemplate_test.rb +36 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_metadata_test.rb +42 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_nokogiritemplate_test.rb +87 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_prawntemplate.prawn +1 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_prawntemplate_test.rb +75 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_radiustemplate_test.rb +75 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_rdiscounttemplate_test.rb +43 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_rdoctemplate_test.rb +29 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_redcarpettemplate_test.rb +54 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_redclothtemplate_test.rb +36 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_sasstemplate_test.rb +41 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_stringtemplate_test.rb +171 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_template_test.rb +308 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_test.rb +60 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_wikiclothtemplate_test.rb +32 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/test/tilt_yajltemplate_test.rb +101 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.2/tilt.gemspec +114 -0
- data/lib/brakeman.rb +9 -1
- data/lib/brakeman/call_index.rb +1 -1
- data/lib/brakeman/checks/check_content_tag.rb +1 -1
- data/lib/brakeman/checks/check_cross_site_scripting.rb +1 -1
- data/lib/brakeman/checks/check_execute.rb +4 -0
- data/lib/brakeman/checks/check_forgery_setting.rb +3 -2
- data/lib/brakeman/checks/check_link_to.rb +1 -1
- data/lib/brakeman/checks/check_link_to_href.rb +2 -2
- data/lib/brakeman/checks/check_mass_assignment.rb +1 -1
- data/lib/brakeman/checks/check_redirect.rb +6 -0
- data/lib/brakeman/checks/check_secrets.rb +40 -0
- data/lib/brakeman/checks/check_sql.rb +1 -1
- data/lib/brakeman/processor.rb +6 -6
- data/lib/brakeman/processors/alias_processor.rb +29 -3
- data/lib/brakeman/processors/base_processor.rb +35 -4
- data/lib/brakeman/processors/controller_alias_processor.rb +4 -4
- data/lib/brakeman/processors/haml_template_processor.rb +1 -1
- data/lib/brakeman/processors/lib/basic_processor.rb +18 -0
- data/lib/brakeman/processors/lib/rails2_config_processor.rb +3 -2
- data/lib/brakeman/processors/lib/rails2_route_processor.rb +2 -1
- data/lib/brakeman/processors/lib/rails3_config_processor.rb +3 -2
- data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -1
- data/lib/brakeman/processors/template_alias_processor.rb +4 -4
- data/lib/brakeman/processors/template_processor.rb +1 -0
- data/lib/brakeman/report/report_codeclimate.rb +2 -1
- data/lib/brakeman/scanner.rb +1 -1
- data/lib/brakeman/tracker.rb +11 -1
- data/lib/brakeman/tracker/constants.rb +101 -0
- data/lib/brakeman/util.rb +4 -0
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning_codes.rb +1 -0
- data/lib/ruby_parser/bm_sexp.rb +6 -0
- metadata +1171 -162
@@ -0,0 +1,13 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
README.txt
|
4
|
+
Rakefile
|
5
|
+
lib/composite_sexp_processor.rb
|
6
|
+
lib/pt_testcase.rb
|
7
|
+
lib/sexp.rb
|
8
|
+
lib/sexp_processor.rb
|
9
|
+
lib/unique.rb
|
10
|
+
test/test_composite_sexp_processor.rb
|
11
|
+
test/test_environment.rb
|
12
|
+
test/test_sexp.rb
|
13
|
+
test/test_sexp_processor.rb
|
@@ -0,0 +1,64 @@
|
|
1
|
+
= SexpProcessor
|
2
|
+
|
3
|
+
home :: https://github.com/seattlerb/sexp_processor
|
4
|
+
rdoc :: http://docs.seattlerb.org/sexp_processor
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
sexp_processor branches from ParseTree bringing all the generic sexp
|
9
|
+
processing tools with it. Sexp, SexpProcessor, Environment, etc... all
|
10
|
+
for your language processing pleasure.
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
* Includes SexpProcessor and CompositeSexpProcessor.
|
15
|
+
|
16
|
+
* Allows you to write very clean filters.
|
17
|
+
|
18
|
+
* Sexp provides a simple and clean interface to creating and manipulating ASTs.
|
19
|
+
|
20
|
+
== SYNOPSIS:
|
21
|
+
|
22
|
+
class MyProcessor < SexpProcessor
|
23
|
+
def initialize
|
24
|
+
super
|
25
|
+
self.strict = false
|
26
|
+
end
|
27
|
+
def process_lit(exp)
|
28
|
+
val = exp.shift
|
29
|
+
return val
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
== REQUIREMENTS:
|
34
|
+
|
35
|
+
* rubygems
|
36
|
+
|
37
|
+
== INSTALL:
|
38
|
+
|
39
|
+
* sudo gem install sexp_processor
|
40
|
+
|
41
|
+
== LICENSE:
|
42
|
+
|
43
|
+
(The MIT License)
|
44
|
+
|
45
|
+
Copyright (c) Ryan Davis, seattle.rb
|
46
|
+
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
48
|
+
a copy of this software and associated documentation files (the
|
49
|
+
'Software'), to deal in the Software without restriction, including
|
50
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
51
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
52
|
+
permit persons to whom the Software is furnished to do so, subject to
|
53
|
+
the following conditions:
|
54
|
+
|
55
|
+
The above copyright notice and this permission notice shall be
|
56
|
+
included in all copies or substantial portions of the Software.
|
57
|
+
|
58
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
59
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
60
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
61
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
62
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
63
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
64
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'sexp_processor'
|
2
|
+
|
3
|
+
##
|
4
|
+
# Implements the Composite pattern on SexpProcessor. Need we say more?
|
5
|
+
#
|
6
|
+
# Yeah... probably. Implements a SexpProcessor of SexpProcessors so
|
7
|
+
# you can easily chain multiple to each other. At some stage we plan
|
8
|
+
# on having all of them run +process+ and but only ever output
|
9
|
+
# something when +generate+ is called, allowing for deferred final
|
10
|
+
# processing.
|
11
|
+
|
12
|
+
class CompositeSexpProcessor < SexpProcessor
|
13
|
+
|
14
|
+
##
|
15
|
+
# The list o' processors to run.
|
16
|
+
|
17
|
+
attr_reader :processors
|
18
|
+
|
19
|
+
def initialize # :nodoc:
|
20
|
+
super
|
21
|
+
@processors = []
|
22
|
+
end
|
23
|
+
|
24
|
+
##
|
25
|
+
# Add a +processor+ to the list of processors to run.
|
26
|
+
|
27
|
+
def <<(processor)
|
28
|
+
raise ArgumentError, "Can only add sexp processors" unless
|
29
|
+
SexpProcessor === processor || processor.respond_to?(:process)
|
30
|
+
@processors << processor
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Run +exp+ through all of the processors, returning the final
|
35
|
+
# result.
|
36
|
+
|
37
|
+
def process(exp)
|
38
|
+
@processors.each do |processor|
|
39
|
+
exp = processor.process(exp)
|
40
|
+
end
|
41
|
+
exp
|
42
|
+
end
|
43
|
+
|
44
|
+
def on_error_in(node_type, &block)
|
45
|
+
@processors.each do |processor|
|
46
|
+
processor.on_error_in(node_type, &block)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,3125 @@
|
|
1
|
+
# encoding: US-ASCII
|
2
|
+
|
3
|
+
$TESTING = true
|
4
|
+
|
5
|
+
require 'minitest/unit'
|
6
|
+
require 'sexp_processor' # for deep_clone
|
7
|
+
|
8
|
+
# key:
|
9
|
+
# wwtt = what were they thinking?
|
10
|
+
|
11
|
+
class Examples
|
12
|
+
attr_reader :reader
|
13
|
+
attr_writer :writer
|
14
|
+
|
15
|
+
def a_method(x); x+1; end
|
16
|
+
alias an_alias a_method
|
17
|
+
|
18
|
+
define_method(:bmethod_noargs) do
|
19
|
+
x + 1
|
20
|
+
end
|
21
|
+
|
22
|
+
define_method(:unsplatted) do |x|
|
23
|
+
x + 1
|
24
|
+
end
|
25
|
+
|
26
|
+
define_method :splatted do |*args|
|
27
|
+
y = args.first
|
28
|
+
y + 42
|
29
|
+
end
|
30
|
+
|
31
|
+
define_method :dmethod_added, instance_method(:a_method) if
|
32
|
+
RUBY_VERSION < "1.9"
|
33
|
+
end
|
34
|
+
|
35
|
+
class ParseTreeTestCase < Minitest::Test
|
36
|
+
attr_accessor :processor # to be defined by subclass
|
37
|
+
|
38
|
+
def setup
|
39
|
+
super
|
40
|
+
@processor = nil
|
41
|
+
end
|
42
|
+
|
43
|
+
def after_process_hook klass, node, data, input_name, output_name
|
44
|
+
end
|
45
|
+
|
46
|
+
def before_process_hook klass, node, data, input_name, output_name
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.add_test name, data, klass = self.name[4..-1]
|
50
|
+
name = name.to_s
|
51
|
+
klass = klass.to_s
|
52
|
+
|
53
|
+
if testcases.has_key? name then
|
54
|
+
if testcases[name].has_key? klass then
|
55
|
+
warn "testcase #{klass}##{name} already has data"
|
56
|
+
else
|
57
|
+
testcases[name][klass] = data
|
58
|
+
end
|
59
|
+
else
|
60
|
+
warn "testcase #{name} does not exist"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.add_tests name, hash
|
65
|
+
name = name.to_s
|
66
|
+
|
67
|
+
hash.each do |klass, data|
|
68
|
+
warn "testcase #{klass}##{name} already has data" if
|
69
|
+
testcases[name].has_key? klass
|
70
|
+
testcases[name][klass] = data
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.add_18tests name, hash
|
75
|
+
add_tests "#{name}__18", hash
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.add_19tests name, hash
|
79
|
+
add_tests "#{name}__19_20_21_22_23", hash # HACK?
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.add_19edgecases ruby, sexp, cases
|
83
|
+
cases.each do |name, code|
|
84
|
+
add_19tests name, "Ruby" => code, "ParseTree" => sexp, "Ruby2Ruby" => ruby
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.clone_same
|
89
|
+
@@testcases.each do |node, data|
|
90
|
+
data.each do |key, val|
|
91
|
+
if val == :same then
|
92
|
+
prev_key = self.previous(key)
|
93
|
+
data[key] = data[prev_key].deep_clone
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.copy_test_case nonverbose, klass
|
100
|
+
verbose = nonverbose + "_mri_verbose_flag"
|
101
|
+
testcases[verbose][klass] = testcases[nonverbose][klass]
|
102
|
+
end
|
103
|
+
|
104
|
+
VER_RE = "(1[89]|2[0123])"
|
105
|
+
|
106
|
+
def self.generate_test klass, node, data, input_name, output_name
|
107
|
+
klass.send :define_method, "test_#{node}" do
|
108
|
+
flunk "Processor is nil" if processor.nil?
|
109
|
+
|
110
|
+
tversions = node[/(?:_#{VER_RE})+$/]
|
111
|
+
if tversions then
|
112
|
+
cversion = self.class.name[/#{VER_RE}/]
|
113
|
+
|
114
|
+
# can't push this up because it may be generating into an
|
115
|
+
# abstract test class and the actual subclass is versioned.
|
116
|
+
return "version specific test" unless tversions.include? cversion if cversion
|
117
|
+
end
|
118
|
+
|
119
|
+
assert data.has_key?(input_name), "Unknown input data"
|
120
|
+
assert data.has_key?(output_name), "Missing test data"
|
121
|
+
|
122
|
+
$missing[node] << output_name unless data.has_key? output_name
|
123
|
+
|
124
|
+
input = data[input_name].deep_clone
|
125
|
+
expected = data[output_name].deep_clone
|
126
|
+
|
127
|
+
case expected
|
128
|
+
when :unsupported then
|
129
|
+
assert_raises(UnsupportedNodeError) do
|
130
|
+
processor.process(input)
|
131
|
+
end
|
132
|
+
else
|
133
|
+
extra_expected = []
|
134
|
+
extra_input = []
|
135
|
+
|
136
|
+
_, expected, extra_expected = *expected if
|
137
|
+
Array === expected and expected.first == :defx
|
138
|
+
_, input, extra_input = *input if
|
139
|
+
Array === input and input.first == :defx
|
140
|
+
|
141
|
+
# OMG... I can't believe I have to do this this way. these
|
142
|
+
# hooks are here instead of refactoring this define_method
|
143
|
+
# body into an assertion. It'll allow subclasses to hook in
|
144
|
+
# and add behavior before or after the processor does it's
|
145
|
+
# thing. If you go the body refactor route, some of the
|
146
|
+
# RawParseTree test cases fail for completely bogus reasons.
|
147
|
+
|
148
|
+
before_process_hook klass, node, data, input_name, output_name
|
149
|
+
refute_nil data[input_name], "testcase does not exist?"
|
150
|
+
@result = processor.process input
|
151
|
+
assert_equal(expected, @result,
|
152
|
+
"failed on input: #{data[input_name].inspect}")
|
153
|
+
after_process_hook klass, node, data, input_name, output_name
|
154
|
+
|
155
|
+
extra_input.each do |extra|
|
156
|
+
processor.process(extra)
|
157
|
+
end
|
158
|
+
extra = processor.extra_methods rescue []
|
159
|
+
assert_equal extra_expected, extra
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
def self.generate_tests klass
|
165
|
+
install_missing_reporter
|
166
|
+
clone_same
|
167
|
+
|
168
|
+
output_name = klass.name.to_s.sub(/^Test/, '')
|
169
|
+
|
170
|
+
input_name = self.previous(output_name)
|
171
|
+
|
172
|
+
@@testcases.each do |node, data|
|
173
|
+
next if [:skip, :unsupported].include? data[input_name]
|
174
|
+
next if data[output_name] == :skip
|
175
|
+
|
176
|
+
generate_test klass, node, data, input_name, output_name
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def self.inherited klass
|
181
|
+
super
|
182
|
+
|
183
|
+
generate_tests klass unless klass.name =~ /TestCase/
|
184
|
+
end
|
185
|
+
|
186
|
+
def self.install_missing_reporter
|
187
|
+
unless defined? $missing then
|
188
|
+
$missing = Hash.new { |h,k| h[k] = [] }
|
189
|
+
at_exit {
|
190
|
+
at_exit {
|
191
|
+
warn ""
|
192
|
+
$missing.sort.each do |name, klasses|
|
193
|
+
warn "add_tests(#{name.inspect},"
|
194
|
+
klasses.map! { |klass| " #{klass.inspect} => :same" }
|
195
|
+
warn klasses.join("\n") + ")"
|
196
|
+
end
|
197
|
+
warn ""
|
198
|
+
}
|
199
|
+
}
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
def self.previous(key, extra=0) # FIX: remove R2C code
|
204
|
+
idx = @@testcase_order.index(key)
|
205
|
+
|
206
|
+
raise "Unknown class #{key} in @@testcase_order" if idx.nil?
|
207
|
+
|
208
|
+
case key
|
209
|
+
when "RubyToRubyC" then
|
210
|
+
idx -= 1
|
211
|
+
end
|
212
|
+
@@testcase_order[idx - 1 - extra]
|
213
|
+
end
|
214
|
+
|
215
|
+
def self.testcase_order; @@testcase_order; end
|
216
|
+
def self.testcases; @@testcases; end
|
217
|
+
|
218
|
+
def self.unsupported_tests *tests
|
219
|
+
tests.flatten.each do |name|
|
220
|
+
add_test name, :unsupported
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
############################################################
|
225
|
+
# Shared TestCases:
|
226
|
+
|
227
|
+
@@testcase_order = %w(Ruby ParseTree)
|
228
|
+
|
229
|
+
@@testcases = Hash.new { |h,k| h[k] = {} }
|
230
|
+
|
231
|
+
###
|
232
|
+
# 1.8 specific tests
|
233
|
+
|
234
|
+
add_18tests("call_arglist_norm_hash_splat",
|
235
|
+
"Ruby" => "o.m(42, :a => 1, :b => 2, *c)",
|
236
|
+
"ParseTree" => s(:call,
|
237
|
+
s(:call, nil, :o), :m,
|
238
|
+
s(:lit, 42),
|
239
|
+
s(:hash,
|
240
|
+
s(:lit, :a), s(:lit, 1),
|
241
|
+
s(:lit, :b), s(:lit, 2)),
|
242
|
+
s(:splat, s(:call, nil, :c))))
|
243
|
+
|
244
|
+
add_18tests("call_arglist_space",
|
245
|
+
"Ruby" => "a (1,2,3)",
|
246
|
+
"ParseTree" => s(:call, nil, :a,
|
247
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3)),
|
248
|
+
"Ruby2Ruby" => "a(1, 2, 3)")
|
249
|
+
|
250
|
+
add_18tests("fcall_arglist_norm_hash_splat",
|
251
|
+
"Ruby" => "m(42, :a => 1, :b => 2, *c)",
|
252
|
+
"ParseTree" => s(:call, nil, :m,
|
253
|
+
s(:lit, 42),
|
254
|
+
s(:hash,
|
255
|
+
s(:lit, :a), s(:lit, 1),
|
256
|
+
s(:lit, :b), s(:lit, 2)),
|
257
|
+
s(:splat, s(:call, nil, :c))))
|
258
|
+
|
259
|
+
add_18tests("if_args_no_space_symbol",
|
260
|
+
"Ruby" => "x if y:z",
|
261
|
+
"ParseTree" => s(:if,
|
262
|
+
s(:call, nil, :y, s(:lit, :z)),
|
263
|
+
s(:call, nil, :x),
|
264
|
+
nil),
|
265
|
+
"Ruby2Ruby" => "x if y(:z)")
|
266
|
+
|
267
|
+
add_18tests("if_post_not",
|
268
|
+
"Ruby" => "a if not b",
|
269
|
+
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
270
|
+
s(:call, nil, :a)),
|
271
|
+
"Ruby2Ruby" => "a unless b")
|
272
|
+
|
273
|
+
add_18tests("if_pre_not",
|
274
|
+
"Ruby" => "if not b then a end",
|
275
|
+
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
276
|
+
s(:call, nil, :a)),
|
277
|
+
"Ruby2Ruby" => "a unless b")
|
278
|
+
|
279
|
+
add_18tests("iter_args_ivar",
|
280
|
+
"Ruby" => "a { |@a| 42 }",
|
281
|
+
"ParseTree" => s(:iter,
|
282
|
+
s(:call, nil, :a),
|
283
|
+
s(:args, :@a),
|
284
|
+
s(:lit, 42)))
|
285
|
+
|
286
|
+
add_18tests("iter_masgn_args_ivar",
|
287
|
+
"Ruby" => "a { |a, @b| 42 }",
|
288
|
+
"ParseTree" => s(:iter,
|
289
|
+
s(:call, nil, :a),
|
290
|
+
s(:args, :a, :@b),
|
291
|
+
s(:lit, 42)))
|
292
|
+
|
293
|
+
add_18tests("not",
|
294
|
+
"Ruby" => "(not true)",
|
295
|
+
"ParseTree" => s(:not, s(:true)))
|
296
|
+
|
297
|
+
add_18tests("str_question_control",
|
298
|
+
"Ruby" => '?\M-\C-a',
|
299
|
+
"ParseTree" => s(:lit, 129),
|
300
|
+
"Ruby2Ruby" => "129")
|
301
|
+
|
302
|
+
add_18tests("str_question_escape",
|
303
|
+
"Ruby" => '?\n',
|
304
|
+
"ParseTree" => s(:lit, 10),
|
305
|
+
"Ruby2Ruby" => "10")
|
306
|
+
|
307
|
+
add_18tests("str_question_literal",
|
308
|
+
"Ruby" => '?a',
|
309
|
+
"ParseTree" => s(:lit, 97),
|
310
|
+
"Ruby2Ruby" => "97")
|
311
|
+
|
312
|
+
add_18tests("unless_post_not",
|
313
|
+
"Ruby" => "a unless not b",
|
314
|
+
"ParseTree" => s(:if, s(:call, nil, :b),
|
315
|
+
s(:call, nil, :a), nil),
|
316
|
+
"Ruby2Ruby" => "a if b")
|
317
|
+
|
318
|
+
add_18tests("unless_pre_not",
|
319
|
+
"Ruby" => "unless not b then a end",
|
320
|
+
"ParseTree" => s(:if, s(:call, nil, :b),
|
321
|
+
s(:call, nil, :a), nil),
|
322
|
+
"Ruby2Ruby" => "a if b")
|
323
|
+
|
324
|
+
add_18tests("until_post_not",
|
325
|
+
"Ruby" => "begin\n (1 + 1)\nend until not true",
|
326
|
+
"ParseTree" => s(:while, s(:true),
|
327
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
328
|
+
"Ruby2Ruby" => "begin\n (1 + 1)\nend while true")
|
329
|
+
|
330
|
+
add_18tests("until_pre_not",
|
331
|
+
"Ruby" => "until not true do\n (1 + 1)\nend",
|
332
|
+
"ParseTree" => s(:while, s(:true),
|
333
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
334
|
+
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
335
|
+
|
336
|
+
add_18tests("until_pre_not_mod",
|
337
|
+
"Ruby" => "(1 + 1) until not true",
|
338
|
+
"ParseTree" => s(:while, s(:true),
|
339
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
340
|
+
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
341
|
+
|
342
|
+
add_18tests("while_post_not",
|
343
|
+
"Ruby" => "begin\n (1 + 1)\nend while not true",
|
344
|
+
"ParseTree" => s(:until, s(:true),
|
345
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
346
|
+
"Ruby2Ruby" => "begin\n (1 + 1)\nend until true")
|
347
|
+
|
348
|
+
add_18tests("while_pre_not",
|
349
|
+
"Ruby" => "while not true do\n (1 + 1)\nend",
|
350
|
+
"ParseTree" => s(:until, s(:true),
|
351
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
352
|
+
"Ruby2Ruby" => "until true do\n (1 + 1)\nend")
|
353
|
+
|
354
|
+
add_18tests("while_pre_not_mod",
|
355
|
+
"Ruby" => "(1 + 1) while not true",
|
356
|
+
"ParseTree" => s(:until, s(:true),
|
357
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
358
|
+
"Ruby2Ruby" => "until true do\n (1 + 1)\nend") # FIX
|
359
|
+
|
360
|
+
###
|
361
|
+
# 1.9 specific tests
|
362
|
+
|
363
|
+
add_19edgecases("lambda { || (x + 1) }",
|
364
|
+
s(:iter,
|
365
|
+
s(:call, nil, :lambda),
|
366
|
+
s(:args),
|
367
|
+
s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
|
368
|
+
"stabby_args" => "->() { (x + 1) }",
|
369
|
+
"stabby_args_doend" => "->() do (x + 1) end")
|
370
|
+
|
371
|
+
add_19edgecases("lambda { (x + 1) }",
|
372
|
+
s(:iter,
|
373
|
+
s(:call, nil, :lambda),
|
374
|
+
0,
|
375
|
+
s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
|
376
|
+
"stabby_args_0_no_parens" => "-> { (x + 1) }",
|
377
|
+
"stabby_args_0_no_parens_doend" => "-> do (x + 1) end",
|
378
|
+
"stabby_args_0_spacebar_broken" => "->{x+1}") # I hate you
|
379
|
+
|
380
|
+
add_19edgecases("lambda { |x, y| (x + y) }",
|
381
|
+
s(:iter,
|
382
|
+
s(:call, nil, :lambda),
|
383
|
+
s(:args, :x, :y),
|
384
|
+
s(:call, s(:lvar, :x), :+, s(:lvar, :y))),
|
385
|
+
"stabby_args_2" => "->(x, y) { (x + y) }",
|
386
|
+
"stabby_args_2_doend" => "->(x, y) do (x + y) end",
|
387
|
+
"stabby_args_2_no_parens" => "-> x, y { (x + y) }",
|
388
|
+
"stabby_args_2_no_parens_doend" => "-> x, y do (x + y) end")
|
389
|
+
|
390
|
+
add_19edgecases("lambda { |x| (x + 1) }",
|
391
|
+
s(:iter,
|
392
|
+
s(:call, nil, :lambda),
|
393
|
+
s(:args, :x),
|
394
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
395
|
+
"stabby_args_1" => "->(x) { (x + 1) }",
|
396
|
+
"stabby_args_1_doend" => "->(x) do (x + 1) end",
|
397
|
+
"stabby_args_1_no_parens" => "-> x { (x + 1) }",
|
398
|
+
"stabby_args_1_no_parens_doend" => "-> x do (x + 1) end")
|
399
|
+
|
400
|
+
add_19tests("array_bare_hash",
|
401
|
+
"Ruby" => "[:a, :b => :c]",
|
402
|
+
"ParseTree" => s(:array,
|
403
|
+
s(:lit, :a),
|
404
|
+
s(:hash,
|
405
|
+
s(:lit, :b),
|
406
|
+
s(:lit, :c))),
|
407
|
+
"Ruby2Ruby" => "[:a, { :b => :c }]")
|
408
|
+
|
409
|
+
add_19tests("array_bare_hash_labels",
|
410
|
+
"Ruby" => "[:a, b: :c]",
|
411
|
+
"ParseTree" => s(:array,
|
412
|
+
s(:lit, :a),
|
413
|
+
s(:hash,
|
414
|
+
s(:lit, :b),
|
415
|
+
s(:lit, :c))),
|
416
|
+
"Ruby2Ruby" => "[:a, { :b => :c }]")
|
417
|
+
|
418
|
+
add_19tests("call_arglist_norm_hash_colons",
|
419
|
+
"Ruby" => "o.m(42, a: 1, b: 2)",
|
420
|
+
"ParseTree" => s(:call,
|
421
|
+
s(:call, nil, :o),
|
422
|
+
:m,
|
423
|
+
s(:lit, 42),
|
424
|
+
s(:hash,
|
425
|
+
s(:lit, :a), s(:lit, 1),
|
426
|
+
s(:lit, :b), s(:lit, 2))),
|
427
|
+
"Ruby2Ruby" => "o.m(42, :a => 1, :b => 2)")
|
428
|
+
|
429
|
+
add_19tests("call_arglist_trailing_comma",
|
430
|
+
"Ruby" => "a(1,2,3,)",
|
431
|
+
"ParseTree" => s(:call,
|
432
|
+
nil,
|
433
|
+
:a,
|
434
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3)),
|
435
|
+
"Ruby2Ruby" => "a(1, 2, 3)")
|
436
|
+
|
437
|
+
add_19tests("call_bang",
|
438
|
+
"Ruby" => "!a",
|
439
|
+
"ParseTree" => s(:call,
|
440
|
+
s(:call, nil, :a),
|
441
|
+
:"!"))
|
442
|
+
|
443
|
+
add_19tests("call_bang_empty",
|
444
|
+
"Ruby" => "! ()",
|
445
|
+
"ParseTree" => s(:call, s(:nil), :"!"))
|
446
|
+
|
447
|
+
add_19tests("call_fonz",
|
448
|
+
"Ruby" => "a.()",
|
449
|
+
"ParseTree" => s(:call, s(:call, nil, :a), :call),
|
450
|
+
"Ruby2Ruby" => "a.call")
|
451
|
+
|
452
|
+
add_19tests("call_fonz_cm",
|
453
|
+
"Ruby" => "a::()",
|
454
|
+
"ParseTree" => s(:call, s(:call, nil, :a), :call),
|
455
|
+
"Ruby2Ruby" => "a.call")
|
456
|
+
|
457
|
+
add_19tests("call_not",
|
458
|
+
"Ruby" => "not (42)",
|
459
|
+
"ParseTree" => s(:call, s(:lit, 42), :"!"))
|
460
|
+
|
461
|
+
# add_19tests("call_not_empty",
|
462
|
+
# "Ruby" => "not ()",
|
463
|
+
# "ParseTree" => s(:call, s(:lit, 42), :"!"))
|
464
|
+
|
465
|
+
add_19tests("call_not_equal",
|
466
|
+
"Ruby" => "a != b",
|
467
|
+
"ParseTree" => s(:call,
|
468
|
+
s(:call, nil, :a),
|
469
|
+
:"!=",
|
470
|
+
s(:call, nil, :b)))
|
471
|
+
|
472
|
+
add_19tests("call_splat_mid",
|
473
|
+
"Ruby" => "def f(a = nil, *b, c)\n # do nothing\nend",
|
474
|
+
"ParseTree" => s(:defn, :f,
|
475
|
+
s(:args, s(:lasgn, :a, s(:nil)), :"*b", :c),
|
476
|
+
s(:nil)))
|
477
|
+
|
478
|
+
add_19tests("defn_args_mand_opt_mand",
|
479
|
+
"Ruby" => "def f(mand1, opt = 42, mand2)\n # do nothing\nend",
|
480
|
+
"ParseTree" => s(:defn, :f,
|
481
|
+
s(:args, :mand1, s(:lasgn, :opt, s(:lit, 42)), :mand2),
|
482
|
+
s(:nil)))
|
483
|
+
|
484
|
+
add_19tests("defn_args_mand_opt_splat_mand",
|
485
|
+
"Ruby" => "def f(mand1, opt = 42, *rest, mand2)\n # do nothing\nend",
|
486
|
+
"ParseTree" => s(:defn, :f,
|
487
|
+
s(:args, :mand1, s(:lasgn, :opt, s(:lit, 42)), :"*rest", :mand2),
|
488
|
+
s(:nil)))
|
489
|
+
|
490
|
+
add_19tests("defn_args_opt_mand",
|
491
|
+
"Ruby" => "def f(opt = 42, mand)\n # do nothing\nend",
|
492
|
+
"ParseTree" => s(:defn, :f,
|
493
|
+
s(:args, s(:lasgn, :opt, s(:lit, 42)), :mand),
|
494
|
+
s(:nil)))
|
495
|
+
|
496
|
+
add_19tests("defn_args_opt_splat_mand",
|
497
|
+
"Ruby" => "def f(opt = 42, *rest, mand)\n # do nothing\nend",
|
498
|
+
"ParseTree" => s(:defn, :f,
|
499
|
+
s(:args, s(:lasgn, :opt, s(:lit, 42)), :"*rest", :mand),
|
500
|
+
s(:nil)))
|
501
|
+
|
502
|
+
add_19tests("defn_args_splat_mand",
|
503
|
+
"Ruby" => "def f(*rest, mand)\n # do nothing\nend",
|
504
|
+
"ParseTree" => s(:defn, :f,
|
505
|
+
s(:args, :"*rest", :mand),
|
506
|
+
s(:nil)))
|
507
|
+
|
508
|
+
add_19tests("defn_args_splat_middle",
|
509
|
+
"Ruby" => "def f(first, *middle, last)\n # do nothing\nend",
|
510
|
+
"ParseTree" => s(:defn, :f,
|
511
|
+
s(:args, :first, :"*middle", :last),
|
512
|
+
s(:nil)))
|
513
|
+
|
514
|
+
add_19tests("fcall_arglist_hash_colons",
|
515
|
+
"Ruby" => "m(a: 1, b: 2)",
|
516
|
+
"ParseTree" => s(:call, nil, :m,
|
517
|
+
s(:hash,
|
518
|
+
s(:lit, :a), s(:lit, 1),
|
519
|
+
s(:lit, :b), s(:lit, 2))),
|
520
|
+
"Ruby2Ruby" => "m(:a => 1, :b => 2)")
|
521
|
+
|
522
|
+
add_19tests("hash_new",
|
523
|
+
"Ruby" => "{ a: 1, b: 2 }",
|
524
|
+
"ParseTree" => s(:hash,
|
525
|
+
s(:lit, :a), s(:lit, 1),
|
526
|
+
s(:lit, :b), s(:lit, 2)),
|
527
|
+
"Ruby2Ruby" => "{ :a => 1, :b => 2 }")
|
528
|
+
|
529
|
+
add_19tests("hash_new_no_space",
|
530
|
+
"Ruby" => "{a:1,b:2}",
|
531
|
+
"ParseTree" => s(:hash,
|
532
|
+
s(:lit, :a), s(:lit, 1),
|
533
|
+
s(:lit, :b), s(:lit, 2)),
|
534
|
+
"Ruby2Ruby" => "{ :a => 1, :b => 2 }")
|
535
|
+
|
536
|
+
add_19tests("hash_new_with_keyword",
|
537
|
+
"Ruby" => "{ true: 1, b: 2 }",
|
538
|
+
"ParseTree" => s(:hash,
|
539
|
+
s(:lit, :true), s(:lit, 1),
|
540
|
+
s(:lit, :b), s(:lit, 2)),
|
541
|
+
"Ruby2Ruby" => "{ :true => 1, :b => 2 }")
|
542
|
+
|
543
|
+
add_19tests("if_post_not",
|
544
|
+
"Ruby" => "a if not b",
|
545
|
+
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
546
|
+
s(:call, nil, :a),
|
547
|
+
nil),
|
548
|
+
"Ruby2Ruby" => "a unless b")
|
549
|
+
|
550
|
+
add_19tests("if_pre_not",
|
551
|
+
"Ruby" => "if not b then a end",
|
552
|
+
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
553
|
+
s(:call, nil, :a),
|
554
|
+
nil),
|
555
|
+
"Ruby2Ruby" => "a unless b")
|
556
|
+
|
557
|
+
add_19tests("label_in_bare_hash_in_array_in_ternary",
|
558
|
+
"Ruby" => "1 ? [:a, b: 2] : 1",
|
559
|
+
"ParseTree" => s(:if, s(:lit, 1),
|
560
|
+
s(:array,
|
561
|
+
s(:lit, :a),
|
562
|
+
s(:hash, s(:lit, :b), s(:lit, 2))),
|
563
|
+
s(:lit, 1)),
|
564
|
+
"Ruby2Ruby" => "1 ? ([:a, { :b => 2 }]) : (1)")
|
565
|
+
|
566
|
+
add_19tests("label_in_callargs_in_ternary",
|
567
|
+
"Ruby" => "1 ? m(a: 2) : 1",
|
568
|
+
"ParseTree" => s(:if, s(:lit, 1),
|
569
|
+
s(:call, nil, :m,
|
570
|
+
s(:hash, s(:lit, :a), s(:lit, 2))),
|
571
|
+
s(:lit, 1)),
|
572
|
+
"Ruby2Ruby" => "1 ? (m(:a => 2)) : (1)")
|
573
|
+
|
574
|
+
add_19tests("not",
|
575
|
+
"Ruby" => "(not true)",
|
576
|
+
"ParseTree" => s(:call, s(:true), :"!"))
|
577
|
+
|
578
|
+
add_19tests("splat_fcall_middle",
|
579
|
+
"Ruby" => "meth(1, *[2], 3)",
|
580
|
+
"ParseTree" => s(:call,
|
581
|
+
nil,
|
582
|
+
:meth,
|
583
|
+
s(:lit, 1),
|
584
|
+
s(:splat, s(:array, s(:lit, 2))),
|
585
|
+
s(:lit, 3)))
|
586
|
+
|
587
|
+
add_19tests("str_question_control",
|
588
|
+
"Ruby" => '?\M-\C-a',
|
589
|
+
"ParseTree" => s(:str, "\x81"))
|
590
|
+
|
591
|
+
add_19tests("str_question_escape",
|
592
|
+
"Ruby" => '?\n',
|
593
|
+
"ParseTree" => s(:str, "\n"))
|
594
|
+
|
595
|
+
add_19tests("str_question_literal",
|
596
|
+
"Ruby" => '?a',
|
597
|
+
"ParseTree" => s(:str, "a"))
|
598
|
+
|
599
|
+
add_19tests("unless_post_not",
|
600
|
+
"Ruby" => "a unless not b",
|
601
|
+
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
602
|
+
nil,
|
603
|
+
s(:call, nil, :a)),
|
604
|
+
"Ruby2Ruby" => "a if b")
|
605
|
+
|
606
|
+
add_19tests("unless_pre_not",
|
607
|
+
"Ruby" => "unless not b then a end",
|
608
|
+
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
609
|
+
nil,
|
610
|
+
s(:call, nil, :a)),
|
611
|
+
"Ruby2Ruby" => "a if b")
|
612
|
+
|
613
|
+
add_19tests("until_post_not",
|
614
|
+
"Ruby" => "begin\n (1 + 1)\nend until not true",
|
615
|
+
"ParseTree" => s(:until, s(:call, s(:true), :"!"),
|
616
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
617
|
+
"Ruby2Ruby" => "begin\n (1 + 1)\nend while true")
|
618
|
+
|
619
|
+
add_19tests("until_pre_not",
|
620
|
+
"Ruby" => "until not true do\n (1 + 1)\nend",
|
621
|
+
"ParseTree" => s(:until, s(:call, s(:true), :"!"),
|
622
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
623
|
+
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
624
|
+
|
625
|
+
add_19tests("until_pre_not_mod",
|
626
|
+
"Ruby" => "(1 + 1) until not true",
|
627
|
+
"ParseTree" => s(:until, s(:call, s(:true), :"!"),
|
628
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
629
|
+
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
630
|
+
|
631
|
+
add_19tests("while_post_not",
|
632
|
+
"Ruby" => "begin\n (1 + 1)\nend while not true",
|
633
|
+
"ParseTree" => s(:while, s(:call, s(:true), :"!"),
|
634
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
635
|
+
"Ruby2Ruby" => "begin\n (1 + 1)\nend until true")
|
636
|
+
|
637
|
+
add_19tests("while_pre_not",
|
638
|
+
"Ruby" => "while not true do\n (1 + 1)\nend",
|
639
|
+
"ParseTree" => s(:while, s(:call, s(:true), :"!"),
|
640
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
641
|
+
"Ruby2Ruby" => "until true do\n (1 + 1)\nend")
|
642
|
+
|
643
|
+
add_19tests("while_pre_not_mod",
|
644
|
+
"Ruby" => "(1 + 1) while not true",
|
645
|
+
"ParseTree" => s(:while, s(:call, s(:true), :"!"),
|
646
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
647
|
+
"Ruby2Ruby" => "until true do\n (1 + 1)\nend") # FIX
|
648
|
+
|
649
|
+
###
|
650
|
+
# Shared tests:
|
651
|
+
|
652
|
+
add_tests("alias",
|
653
|
+
"Ruby" => "class X\n alias :y :x\nend",
|
654
|
+
"ParseTree" => s(:class, :X, nil,
|
655
|
+
s(:alias, s(:lit, :y), s(:lit, :x))))
|
656
|
+
|
657
|
+
add_tests("alias_ugh",
|
658
|
+
"Ruby" => "class X\n alias y x\nend",
|
659
|
+
"ParseTree" => s(:class, :X, nil,
|
660
|
+
s(:alias, s(:lit, :y), s(:lit, :x))),
|
661
|
+
"Ruby2Ruby" => "class X\n alias :y :x\nend")
|
662
|
+
|
663
|
+
add_tests("and",
|
664
|
+
"Ruby" => "a and b",
|
665
|
+
"ParseTree" => s(:and,
|
666
|
+
s(:call, nil, :a),
|
667
|
+
s(:call, nil, :b)))
|
668
|
+
|
669
|
+
add_tests("argscat_inside",
|
670
|
+
"Ruby" => "a = [b, *c]",
|
671
|
+
"ParseTree" => s(:lasgn, :a,
|
672
|
+
s(:array,
|
673
|
+
s(:call, nil, :b),
|
674
|
+
s(:splat, s(:call, nil, :c)))))
|
675
|
+
|
676
|
+
add_tests("argscat_svalue",
|
677
|
+
"Ruby" => "a = b, c, *d",
|
678
|
+
"ParseTree" => s(:lasgn, :a,
|
679
|
+
s(:svalue,
|
680
|
+
s(:array,
|
681
|
+
s(:call, nil, :b),
|
682
|
+
s(:call, nil, :c),
|
683
|
+
s(:splat,
|
684
|
+
s(:call, nil, :d))))))
|
685
|
+
|
686
|
+
add_tests("argspush",
|
687
|
+
"Ruby" => "a[*b] = c",
|
688
|
+
"ParseTree" => s(:attrasgn,
|
689
|
+
s(:call, nil, :a),
|
690
|
+
:[]=,
|
691
|
+
s(:splat,
|
692
|
+
s(:call, nil, :b)),
|
693
|
+
s(:call, nil, :c)))
|
694
|
+
|
695
|
+
add_tests("array",
|
696
|
+
"Ruby" => "[1, :b, \"c\"]",
|
697
|
+
"ParseTree" => s(:array, s(:lit, 1), s(:lit, :b), s(:str, "c")))
|
698
|
+
|
699
|
+
add_tests("array_pct_W",
|
700
|
+
"Ruby" => "%W[a b c]",
|
701
|
+
"ParseTree" => s(:array,
|
702
|
+
s(:str, "a"), s(:str, "b"), s(:str, "c")),
|
703
|
+
"Ruby2Ruby" => "[\"a\", \"b\", \"c\"]")
|
704
|
+
|
705
|
+
add_tests("array_pct_W_dstr",
|
706
|
+
"Ruby" => "%W[a #\{@b} c]",
|
707
|
+
"ParseTree" => s(:array,
|
708
|
+
s(:str, "a"),
|
709
|
+
s(:dstr, "", s(:evstr, s(:ivar, :@b))),
|
710
|
+
s(:str, "c")),
|
711
|
+
"Ruby2Ruby" => "[\"a\", \"#\{@b}\", \"c\"]")
|
712
|
+
|
713
|
+
add_tests("array_pct_w",
|
714
|
+
"Ruby" => "%w[a b c]",
|
715
|
+
"ParseTree" => s(:array,
|
716
|
+
s(:str, "a"), s(:str, "b"), s(:str, "c")),
|
717
|
+
"Ruby2Ruby" => "[\"a\", \"b\", \"c\"]")
|
718
|
+
|
719
|
+
add_tests("array_pct_w_dstr",
|
720
|
+
"Ruby" => "%w[a #\{@b} c]",
|
721
|
+
"ParseTree" => s(:array,
|
722
|
+
s(:str, "a"),
|
723
|
+
s(:str, "#\{@b}"),
|
724
|
+
s(:str, "c")),
|
725
|
+
"Ruby2Ruby" => "[\"a\", \"\\\#{@b}\", \"c\"]") # TODO: huh?
|
726
|
+
|
727
|
+
add_tests("attrasgn",
|
728
|
+
"Ruby" => "y = 0\n42.method = y\n",
|
729
|
+
"ParseTree" => s(:block,
|
730
|
+
s(:lasgn, :y, s(:lit, 0)),
|
731
|
+
s(:attrasgn,
|
732
|
+
s(:lit, 42), :method=, s(:lvar, :y))))
|
733
|
+
|
734
|
+
add_tests("attrasgn_index_equals",
|
735
|
+
"Ruby" => "a[42] = 24",
|
736
|
+
"ParseTree" => s(:attrasgn,
|
737
|
+
s(:call, nil, :a),
|
738
|
+
:[]=,
|
739
|
+
s(:lit, 42), s(:lit, 24)))
|
740
|
+
|
741
|
+
add_tests("attrasgn_index_equals_space",
|
742
|
+
"Ruby" => "a = []; a [42] = 24",
|
743
|
+
"ParseTree" => s(:block,
|
744
|
+
s(:lasgn, :a, s(:array)),
|
745
|
+
s(:attrasgn, s(:lvar, :a), :[]=,
|
746
|
+
s(:lit, 42), s(:lit, 24))),
|
747
|
+
"Ruby2Ruby" => "a = []\na[42] = 24\n")
|
748
|
+
|
749
|
+
add_tests("attrset",
|
750
|
+
"Ruby" => [Examples, :writer=],
|
751
|
+
"ParseTree" => s(:defn, :writer=,
|
752
|
+
s(:args, :arg),
|
753
|
+
s(:attrset, :@writer)),
|
754
|
+
"Ruby2Ruby" => "attr_writer :writer")
|
755
|
+
|
756
|
+
add_tests("back_ref",
|
757
|
+
"Ruby" => "[$&, $`, $', $+]",
|
758
|
+
"ParseTree" => s(:array,
|
759
|
+
s(:back_ref, :&),
|
760
|
+
s(:back_ref, :"`"),
|
761
|
+
s(:back_ref, :"'"),
|
762
|
+
s(:back_ref, :+)))
|
763
|
+
|
764
|
+
add_tests("begin",
|
765
|
+
"Ruby" => "begin\n (1 + 1)\nend",
|
766
|
+
"ParseTree" => s(:call, s(:lit, 1), :+, s(:lit, 1)),
|
767
|
+
"Ruby2Ruby" => "(1 + 1)")
|
768
|
+
|
769
|
+
add_tests("begin_def",
|
770
|
+
"Ruby" => "def m\n begin\n\n end\nend",
|
771
|
+
"ParseTree" => s(:defn, :m, s(:args), s(:nil)),
|
772
|
+
"Ruby2Ruby" => "def m\n # do nothing\nend")
|
773
|
+
|
774
|
+
add_tests("begin_rescue_ensure",
|
775
|
+
"Ruby" => "begin\n a\nrescue\n # do nothing\nensure\n # do nothing\nend",
|
776
|
+
"ParseTree" => s(:ensure,
|
777
|
+
s(:rescue,
|
778
|
+
s(:call, nil, :a),
|
779
|
+
s(:resbody, s(:array), nil)),
|
780
|
+
s(:nil)))
|
781
|
+
|
782
|
+
add_tests("begin_rescue_ensure_all_empty",
|
783
|
+
"Ruby" => "begin\n # do nothing\nrescue\n # do nothing\nensure\n # do nothing\nend",
|
784
|
+
"ParseTree" => s(:ensure,
|
785
|
+
s(:rescue,
|
786
|
+
s(:resbody, s(:array), nil)),
|
787
|
+
s(:nil)))
|
788
|
+
|
789
|
+
add_tests("begin_rescue_twice",
|
790
|
+
"Ruby" => "begin\n a\nrescue => mes\n # do nothing\nend\nbegin\n b\nrescue => mes\n # do nothing\nend\n",
|
791
|
+
"ParseTree" => s(:block,
|
792
|
+
s(:rescue,
|
793
|
+
s(:call, nil, :a),
|
794
|
+
s(:resbody,
|
795
|
+
s(:array, s(:lasgn, :mes, s(:gvar, :$!))),
|
796
|
+
nil)),
|
797
|
+
s(:rescue,
|
798
|
+
s(:call, nil, :b),
|
799
|
+
s(:resbody,
|
800
|
+
s(:array,
|
801
|
+
s(:lasgn, :mes, s(:gvar, :$!))),
|
802
|
+
nil))))
|
803
|
+
copy_test_case "begin_rescue_twice", "Ruby"
|
804
|
+
copy_test_case "begin_rescue_twice", "ParseTree"
|
805
|
+
|
806
|
+
add_tests("block_attrasgn",
|
807
|
+
"Ruby" => "def self.setup(ctx)\n bind = allocate\n bind.context = ctx\n return bind\nend",
|
808
|
+
"ParseTree" => s(:defs, s(:self), :setup,
|
809
|
+
s(:args, :ctx),
|
810
|
+
s(:lasgn, :bind, s(:call, nil, :allocate)),
|
811
|
+
s(:attrasgn,
|
812
|
+
s(:lvar, :bind), :context=, s(:lvar, :ctx)),
|
813
|
+
s(:return, s(:lvar, :bind))))
|
814
|
+
|
815
|
+
add_tests("block_lasgn",
|
816
|
+
"Ruby" => "x = (y = 1\n(y + 2))",
|
817
|
+
"ParseTree" => s(:lasgn, :x,
|
818
|
+
s(:block,
|
819
|
+
s(:lasgn, :y, s(:lit, 1)),
|
820
|
+
s(:call, s(:lvar, :y), :+, s(:lit, 2)))))
|
821
|
+
|
822
|
+
add_tests("block_mystery_block",
|
823
|
+
"Ruby" => "a(b) do\n if b then\n true\n else\n c = false\n d { |x| c = true }\n c\n end\nend",
|
824
|
+
"ParseTree" => s(:iter,
|
825
|
+
s(:call, nil, :a, s(:call, nil, :b)),
|
826
|
+
0,
|
827
|
+
s(:if,
|
828
|
+
s(:call, nil, :b),
|
829
|
+
s(:true),
|
830
|
+
s(:block,
|
831
|
+
s(:lasgn, :c, s(:false)),
|
832
|
+
s(:iter,
|
833
|
+
s(:call, nil, :d),
|
834
|
+
s(:args, :x),
|
835
|
+
s(:lasgn, :c, s(:true))),
|
836
|
+
s(:lvar, :c)))))
|
837
|
+
|
838
|
+
add_tests("block_pass_args_and_splat",
|
839
|
+
"Ruby" => "def blah(*args, &block)\n other(42, *args, &block)\nend",
|
840
|
+
"ParseTree" => s(:defn, :blah, s(:args, :"*args", :"&block"),
|
841
|
+
s(:call, nil, :other,
|
842
|
+
s(:lit, 42),
|
843
|
+
s(:splat, s(:lvar, :args)),
|
844
|
+
s(:block_pass, s(:lvar, :block)))))
|
845
|
+
|
846
|
+
add_tests("block_pass_call_0",
|
847
|
+
"Ruby" => "a.b(&c)",
|
848
|
+
"ParseTree" => s(:call,
|
849
|
+
s(:call, nil, :a),
|
850
|
+
:b,
|
851
|
+
s(:block_pass, s(:call, nil, :c))))
|
852
|
+
|
853
|
+
add_tests("block_pass_call_1",
|
854
|
+
"Ruby" => "a.b(4, &c)",
|
855
|
+
"ParseTree" => s(:call,
|
856
|
+
s(:call, nil, :a),
|
857
|
+
:b,
|
858
|
+
s(:lit, 4),
|
859
|
+
s(:block_pass, s(:call, nil, :c))))
|
860
|
+
|
861
|
+
add_tests("block_pass_call_n",
|
862
|
+
"Ruby" => "a.b(1, 2, 3, &c)",
|
863
|
+
"ParseTree" => s(:call,
|
864
|
+
s(:call, nil, :a),
|
865
|
+
:b,
|
866
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3),
|
867
|
+
s(:block_pass, s(:call, nil, :c))))
|
868
|
+
|
869
|
+
add_tests("block_pass_fcall_0",
|
870
|
+
"Ruby" => "a(&b)",
|
871
|
+
"ParseTree" => s(:call, nil, :a,
|
872
|
+
s(:block_pass, s(:call, nil, :b))))
|
873
|
+
|
874
|
+
add_tests("block_pass_fcall_1",
|
875
|
+
"Ruby" => "a(4, &b)",
|
876
|
+
"ParseTree" => s(:call, nil, :a,
|
877
|
+
s(:lit, 4),
|
878
|
+
s(:block_pass, s(:call, nil, :b))))
|
879
|
+
|
880
|
+
add_tests("block_pass_fcall_n",
|
881
|
+
"Ruby" => "a(1, 2, 3, &b)",
|
882
|
+
"ParseTree" => s(:call, nil, :a,
|
883
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3),
|
884
|
+
s(:block_pass, s(:call, nil, :b))))
|
885
|
+
|
886
|
+
add_tests("block_pass_omgwtf",
|
887
|
+
"Ruby" => "define_attr_method(:x, :sequence_name, &Proc.new { |*args| nil })",
|
888
|
+
"ParseTree" => s(:call, nil, :define_attr_method,
|
889
|
+
s(:lit, :x),
|
890
|
+
s(:lit, :sequence_name),
|
891
|
+
s(:block_pass,
|
892
|
+
s(:iter,
|
893
|
+
s(:call, s(:const, :Proc), :new),
|
894
|
+
s(:args, :"*args"),
|
895
|
+
s(:nil)))))
|
896
|
+
|
897
|
+
add_tests("block_pass_splat",
|
898
|
+
"Ruby" => "def blah(*args, &block)\n other(*args, &block)\nend",
|
899
|
+
"ParseTree" => s(:defn, :blah,
|
900
|
+
s(:args, :"*args", :"&block"),
|
901
|
+
s(:call, nil, :other,
|
902
|
+
s(:splat, s(:lvar, :args)),
|
903
|
+
s(:block_pass, s(:lvar, :block)))))
|
904
|
+
|
905
|
+
add_tests("block_pass_thingy",
|
906
|
+
"Ruby" => "r.read_body(dest, &block)",
|
907
|
+
"ParseTree" => s(:call,
|
908
|
+
s(:call, nil, :r),
|
909
|
+
:read_body,
|
910
|
+
s(:call, nil, :dest),
|
911
|
+
s(:block_pass, s(:call, nil, :block))))
|
912
|
+
|
913
|
+
add_tests("block_stmt_after",
|
914
|
+
"Ruby" => "def f\n begin\n b\n rescue\n c\n end\n\n d\nend",
|
915
|
+
"ParseTree" => s(:defn, :f, s(:args),
|
916
|
+
s(:rescue,
|
917
|
+
s(:call, nil, :b),
|
918
|
+
s(:resbody,
|
919
|
+
s(:array),
|
920
|
+
s(:call, nil, :c))),
|
921
|
+
s(:call, nil, :d)),
|
922
|
+
"Ruby2Ruby" => "def f\n b rescue c\n d\nend")
|
923
|
+
copy_test_case "block_stmt_after", "Ruby"
|
924
|
+
copy_test_case "block_stmt_after", "ParseTree"
|
925
|
+
copy_test_case "block_stmt_after", "Ruby2Ruby"
|
926
|
+
|
927
|
+
add_tests("block_stmt_before",
|
928
|
+
"Ruby" => "def f\n a\n begin\n b\n rescue\n c\n end\nend",
|
929
|
+
"ParseTree" => s(:defn, :f, s(:args),
|
930
|
+
s(:call, nil, :a),
|
931
|
+
s(:rescue, s(:call, nil, :b),
|
932
|
+
s(:resbody,
|
933
|
+
s(:array),
|
934
|
+
s(:call, nil, :c)))),
|
935
|
+
"Ruby2Ruby" => "def f\n a\n b rescue c\nend")
|
936
|
+
# oddly... this one doesn't HAVE any differences when verbose... new?
|
937
|
+
copy_test_case "block_stmt_before", "Ruby"
|
938
|
+
copy_test_case "block_stmt_before", "ParseTree"
|
939
|
+
copy_test_case "block_stmt_before", "Ruby2Ruby"
|
940
|
+
|
941
|
+
add_tests("block_stmt_both",
|
942
|
+
"Ruby" => "def f\n a\n begin\n b\n rescue\n c\n end\n d\nend",
|
943
|
+
"ParseTree" => s(:defn, :f, s(:args),
|
944
|
+
s(:call, nil, :a),
|
945
|
+
s(:rescue,
|
946
|
+
s(:call, nil, :b),
|
947
|
+
s(:resbody,
|
948
|
+
s(:array),
|
949
|
+
s(:call, nil, :c))),
|
950
|
+
s(:call, nil, :d)),
|
951
|
+
"Ruby2Ruby" => "def f\n a\n b rescue c\n d\nend")
|
952
|
+
copy_test_case "block_stmt_both", "Ruby"
|
953
|
+
copy_test_case "block_stmt_both", "ParseTree"
|
954
|
+
copy_test_case "block_stmt_both", "Ruby2Ruby"
|
955
|
+
|
956
|
+
add_tests("bmethod",
|
957
|
+
"Ruby" => [Examples, :unsplatted],
|
958
|
+
"ParseTree" => s(:defn, :unsplatted, s(:args, :x),
|
959
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
960
|
+
"Ruby2Ruby" => "def unsplatted(x)\n (x + 1)\nend")
|
961
|
+
|
962
|
+
add_tests("bmethod_noargs",
|
963
|
+
"Ruby" => [Examples, :bmethod_noargs],
|
964
|
+
"ParseTree" => s(:defn, :bmethod_noargs, s(:args),
|
965
|
+
s(:call,
|
966
|
+
s(:call, nil, :x),
|
967
|
+
:"+",
|
968
|
+
s(:lit, 1))),
|
969
|
+
"Ruby2Ruby" => "def bmethod_noargs\n (x + 1)\nend")
|
970
|
+
|
971
|
+
add_tests("bmethod_splat",
|
972
|
+
"Ruby" => [Examples, :splatted],
|
973
|
+
"ParseTree" => s(:defn, :splatted, s(:args, :"*args"),
|
974
|
+
s(:lasgn, :y,
|
975
|
+
s(:call, s(:lvar, :args), :first)),
|
976
|
+
s(:call, s(:lvar, :y), :+, s(:lit, 42))),
|
977
|
+
"Ruby2Ruby" => "def splatted(*args)\n y = args.first\n (y + 42)\nend")
|
978
|
+
|
979
|
+
add_tests("break",
|
980
|
+
"Ruby" => "loop { break if true }",
|
981
|
+
"ParseTree" => s(:iter,
|
982
|
+
s(:call, nil, :loop),
|
983
|
+
0,
|
984
|
+
s(:if, s(:true), s(:break), nil)))
|
985
|
+
|
986
|
+
add_tests("break_arg",
|
987
|
+
"Ruby" => "loop { break 42 if true }",
|
988
|
+
"ParseTree" => s(:iter,
|
989
|
+
s(:call, nil, :loop),
|
990
|
+
0,
|
991
|
+
s(:if, s(:true), s(:break, s(:lit, 42)), nil)))
|
992
|
+
|
993
|
+
add_tests("call",
|
994
|
+
"Ruby" => "self.method",
|
995
|
+
"ParseTree" => s(:call, s(:self), :method))
|
996
|
+
|
997
|
+
add_tests("call_arglist",
|
998
|
+
"Ruby" => "o.puts(42)",
|
999
|
+
"ParseTree" => s(:call, s(:call, nil, :o), :puts, s(:lit, 42)))
|
1000
|
+
|
1001
|
+
add_tests("call_arglist_hash",
|
1002
|
+
"Ruby" => "o.m(:a => 1, :b => 2)",
|
1003
|
+
"ParseTree" => s(:call,
|
1004
|
+
s(:call, nil, :o), :m,
|
1005
|
+
s(:hash,
|
1006
|
+
s(:lit, :a), s(:lit, 1),
|
1007
|
+
s(:lit, :b), s(:lit, 2))))
|
1008
|
+
|
1009
|
+
add_tests("call_arglist_norm_hash",
|
1010
|
+
"Ruby" => "o.m(42, :a => 1, :b => 2)",
|
1011
|
+
"ParseTree" => s(:call,
|
1012
|
+
s(:call, nil, :o), :m,
|
1013
|
+
s(:lit, 42),
|
1014
|
+
s(:hash,
|
1015
|
+
s(:lit, :a), s(:lit, 1),
|
1016
|
+
s(:lit, :b), s(:lit, 2))))
|
1017
|
+
|
1018
|
+
add_tests("call_command",
|
1019
|
+
"Ruby" => "1.b(c)",
|
1020
|
+
"ParseTree" => s(:call,
|
1021
|
+
s(:lit, 1),
|
1022
|
+
:b,
|
1023
|
+
s(:call, nil, :c)))
|
1024
|
+
|
1025
|
+
add_tests("call_expr",
|
1026
|
+
"Ruby" => "(v = (1 + 1)).zero?",
|
1027
|
+
"ParseTree" => s(:call,
|
1028
|
+
s(:lasgn, :v,
|
1029
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
1030
|
+
:zero?))
|
1031
|
+
|
1032
|
+
add_tests("call_index",
|
1033
|
+
"Ruby" => "a = []\na[42]\n",
|
1034
|
+
"ParseTree" => s(:block,
|
1035
|
+
s(:lasgn, :a, s(:array)),
|
1036
|
+
s(:call, s(:lvar, :a), :[], s(:lit, 42))))
|
1037
|
+
|
1038
|
+
add_tests("call_index_no_args",
|
1039
|
+
"Ruby" => "a[]",
|
1040
|
+
"ParseTree" => s(:call, s(:call, nil, :a),
|
1041
|
+
:[]))
|
1042
|
+
|
1043
|
+
add_tests("call_index_space",
|
1044
|
+
"Ruby" => "a = []\na [42]\n",
|
1045
|
+
"ParseTree" => s(:block,
|
1046
|
+
s(:lasgn, :a, s(:array)),
|
1047
|
+
s(:call, s(:lvar, :a), :[], s(:lit, 42))),
|
1048
|
+
"Ruby2Ruby" => "a = []\na[42]\n")
|
1049
|
+
|
1050
|
+
add_tests("call_no_space_symbol",
|
1051
|
+
"Ruby" => "foo:bar",
|
1052
|
+
"ParseTree" => s(:call, nil, :foo, s(:lit, :bar)),
|
1053
|
+
"Ruby2Ruby" => "foo(:bar)")
|
1054
|
+
|
1055
|
+
add_tests("call_unary_neg",
|
1056
|
+
"Ruby" => "-2**31",
|
1057
|
+
"ParseTree" => s(:call,
|
1058
|
+
s(:call, s(:lit, 2), :**, s(:lit, 31)),
|
1059
|
+
:-@),
|
1060
|
+
"Ruby2Ruby" => "-(2 ** 31)")
|
1061
|
+
|
1062
|
+
add_tests("case",
|
1063
|
+
"Ruby" => "var = 2\nresult = \"\"\ncase var\nwhen 1 then\n puts(\"something\")\n result = \"red\"\nwhen 2, 3 then\n result = \"yellow\"\nwhen 4 then\n # do nothing\nelse\n result = \"green\"\nend\ncase result\nwhen \"red\" then\n var = 1\nwhen \"yellow\" then\n var = 2\nwhen \"green\" then\n var = 3\nelse\n # do nothing\nend\n",
|
1064
|
+
"ParseTree" => s(:block,
|
1065
|
+
s(:lasgn, :var, s(:lit, 2)),
|
1066
|
+
s(:lasgn, :result, s(:str, "")),
|
1067
|
+
s(:case,
|
1068
|
+
s(:lvar, :var),
|
1069
|
+
s(:when,
|
1070
|
+
s(:array, s(:lit, 1)),
|
1071
|
+
s(:call, nil, :puts, s(:str, "something")),
|
1072
|
+
s(:lasgn, :result, s(:str, "red"))),
|
1073
|
+
s(:when,
|
1074
|
+
s(:array, s(:lit, 2), s(:lit, 3)),
|
1075
|
+
s(:lasgn, :result, s(:str, "yellow"))),
|
1076
|
+
s(:when, s(:array, s(:lit, 4)), nil),
|
1077
|
+
s(:lasgn, :result, s(:str, "green"))),
|
1078
|
+
s(:case,
|
1079
|
+
s(:lvar, :result),
|
1080
|
+
s(:when, s(:array, s(:str, "red")),
|
1081
|
+
s(:lasgn, :var, s(:lit, 1))),
|
1082
|
+
s(:when, s(:array, s(:str, "yellow")),
|
1083
|
+
s(:lasgn, :var, s(:lit, 2))),
|
1084
|
+
s(:when, s(:array, s(:str, "green")),
|
1085
|
+
s(:lasgn, :var, s(:lit, 3))),
|
1086
|
+
nil)))
|
1087
|
+
|
1088
|
+
add_tests("case_nested",
|
1089
|
+
"Ruby" => "var1 = 1\nvar2 = 2\nresult = nil\ncase var1\nwhen 1 then\n case var2\n when 1 then\n result = 1\n when 2 then\n result = 2\n else\n result = 3\n end\nwhen 2 then\n case var2\n when 1 then\n result = 4\n when 2 then\n result = 5\n else\n result = 6\n end\nelse\n result = 7\nend\n",
|
1090
|
+
"ParseTree" => s(:block,
|
1091
|
+
s(:lasgn, :var1, s(:lit, 1)),
|
1092
|
+
s(:lasgn, :var2, s(:lit, 2)),
|
1093
|
+
s(:lasgn, :result, s(:nil)),
|
1094
|
+
s(:case,
|
1095
|
+
s(:lvar, :var1),
|
1096
|
+
s(:when, s(:array, s(:lit, 1)),
|
1097
|
+
s(:case,
|
1098
|
+
s(:lvar, :var2),
|
1099
|
+
s(:when, s(:array, s(:lit, 1)),
|
1100
|
+
s(:lasgn, :result, s(:lit, 1))),
|
1101
|
+
s(:when, s(:array, s(:lit, 2)),
|
1102
|
+
s(:lasgn, :result, s(:lit, 2))),
|
1103
|
+
s(:lasgn, :result, s(:lit, 3)))),
|
1104
|
+
s(:when, s(:array, s(:lit, 2)),
|
1105
|
+
s(:case,
|
1106
|
+
s(:lvar, :var2),
|
1107
|
+
s(:when, s(:array, s(:lit, 1)),
|
1108
|
+
s(:lasgn, :result, s(:lit, 4))),
|
1109
|
+
s(:when, s(:array, s(:lit, 2)),
|
1110
|
+
s(:lasgn, :result, s(:lit, 5))),
|
1111
|
+
s(:lasgn, :result, s(:lit, 6)))),
|
1112
|
+
s(:lasgn, :result, s(:lit, 7)))))
|
1113
|
+
|
1114
|
+
add_tests("case_nested_inner_no_expr",
|
1115
|
+
"Ruby" => "case a\nwhen b then\n case\n when (d and e) then\n f\n else\n # do nothing\n end\nelse\n # do nothing\nend",
|
1116
|
+
"ParseTree" => s(:case, s(:call, nil, :a),
|
1117
|
+
s(:when,
|
1118
|
+
s(:array, s(:call, nil, :b)),
|
1119
|
+
s(:case, nil,
|
1120
|
+
s(:when,
|
1121
|
+
s(:array,
|
1122
|
+
s(:and,
|
1123
|
+
s(:call, nil, :d),
|
1124
|
+
s(:call, nil, :e))),
|
1125
|
+
s(:call, nil, :f)),
|
1126
|
+
nil)),
|
1127
|
+
nil))
|
1128
|
+
|
1129
|
+
add_tests("case_no_expr",
|
1130
|
+
"Ruby" => "case\nwhen (a == 1) then\n :a\nwhen (a == 2) then\n :b\nelse\n :c\nend",
|
1131
|
+
"ParseTree" => s(:case, nil,
|
1132
|
+
s(:when,
|
1133
|
+
s(:array,
|
1134
|
+
s(:call,
|
1135
|
+
s(:call, nil, :a),
|
1136
|
+
:==,
|
1137
|
+
s(:lit, 1))),
|
1138
|
+
s(:lit, :a)),
|
1139
|
+
s(:when,
|
1140
|
+
s(:array,
|
1141
|
+
s(:call,
|
1142
|
+
s(:call, nil, :a),
|
1143
|
+
:==,
|
1144
|
+
s(:lit, 2))),
|
1145
|
+
s(:lit, :b)),
|
1146
|
+
s(:lit, :c)))
|
1147
|
+
|
1148
|
+
add_tests("case_splat",
|
1149
|
+
"Ruby" => "case a\nwhen :b, *c then\n d\nelse\n e\nend",
|
1150
|
+
"ParseTree" => s(:case, s(:call, nil, :a),
|
1151
|
+
s(:when,
|
1152
|
+
s(:array,
|
1153
|
+
s(:lit, :b),
|
1154
|
+
s(:splat, s(:call, nil, :c))),
|
1155
|
+
s(:call, nil, :d)),
|
1156
|
+
s(:call, nil, :e)))
|
1157
|
+
|
1158
|
+
add_tests("cdecl",
|
1159
|
+
"Ruby" => "X = 42",
|
1160
|
+
"ParseTree" => s(:cdecl, :X, s(:lit, 42)))
|
1161
|
+
|
1162
|
+
add_tests("class_plain",
|
1163
|
+
"Ruby" => "class X\n puts((1 + 1))\n \n def blah\n puts(\"hello\")\n end\nend",
|
1164
|
+
"ParseTree" => s(:class, :X, nil,
|
1165
|
+
s(:call, nil, :puts,
|
1166
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
1167
|
+
s(:defn, :blah, s(:args),
|
1168
|
+
s(:call, nil, :puts, s(:str, "hello")))))
|
1169
|
+
|
1170
|
+
add_tests("class_scoped",
|
1171
|
+
"Ruby" => "class X::Y\n c\nend",
|
1172
|
+
"ParseTree" => s(:class, s(:colon2, s(:const, :X), :Y), nil,
|
1173
|
+
s(:call, nil, :c)))
|
1174
|
+
|
1175
|
+
add_tests("class_scoped3",
|
1176
|
+
"Ruby" => "class ::Y\n c\nend",
|
1177
|
+
"ParseTree" => s(:class, s(:colon3, :Y), nil,
|
1178
|
+
s(:call, nil, :c)))
|
1179
|
+
|
1180
|
+
add_tests("class_super_array",
|
1181
|
+
"Ruby" => "class X < Array\nend",
|
1182
|
+
"ParseTree" => s(:class, :X, s(:const, :Array)))
|
1183
|
+
|
1184
|
+
add_tests("class_super_expr",
|
1185
|
+
"Ruby" => "class X < expr\nend",
|
1186
|
+
"ParseTree" => s(:class, :X, s(:call, nil, :expr)))
|
1187
|
+
|
1188
|
+
add_tests("class_super_object",
|
1189
|
+
"Ruby" => "class X < Object\nend",
|
1190
|
+
"ParseTree" => s(:class, :X, s(:const, :Object)))
|
1191
|
+
|
1192
|
+
add_tests("colon2",
|
1193
|
+
"Ruby" => "X::Y",
|
1194
|
+
"ParseTree" => s(:colon2, s(:const, :X), :Y))
|
1195
|
+
|
1196
|
+
add_tests("colon3",
|
1197
|
+
"Ruby" => "::X",
|
1198
|
+
"ParseTree" => s(:colon3, :X))
|
1199
|
+
|
1200
|
+
add_tests("const",
|
1201
|
+
"Ruby" => "X",
|
1202
|
+
"ParseTree" => s(:const, :X))
|
1203
|
+
|
1204
|
+
add_tests("constX",
|
1205
|
+
"Ruby" => "X = 1",
|
1206
|
+
"ParseTree" => s(:cdecl, :X, s(:lit, 1)))
|
1207
|
+
|
1208
|
+
add_tests("constY",
|
1209
|
+
"Ruby" => "::X = 1",
|
1210
|
+
"ParseTree" => s(:cdecl, s(:colon3, :X), s(:lit, 1)))
|
1211
|
+
|
1212
|
+
add_tests("constZ",
|
1213
|
+
"Ruby" => "X::Y = 1",
|
1214
|
+
"ParseTree" => s(:cdecl,
|
1215
|
+
s(:colon2, s(:const, :X), :Y),
|
1216
|
+
s(:lit, 1)))
|
1217
|
+
|
1218
|
+
add_tests("cvar",
|
1219
|
+
"Ruby" => "@@x",
|
1220
|
+
"ParseTree" => s(:cvar, :@@x))
|
1221
|
+
|
1222
|
+
add_tests("cvasgn",
|
1223
|
+
"Ruby" => "def x\n @@blah = 1\nend",
|
1224
|
+
"ParseTree" => s(:defn, :x, s(:args),
|
1225
|
+
s(:cvasgn, :@@blah, s(:lit, 1))))
|
1226
|
+
|
1227
|
+
add_tests("cvasgn_cls_method",
|
1228
|
+
"Ruby" => "def self.quiet_mode=(boolean)\n @@quiet_mode = boolean\nend",
|
1229
|
+
"ParseTree" => s(:defs, s(:self), :quiet_mode=,
|
1230
|
+
s(:args, :boolean),
|
1231
|
+
s(:cvasgn, :@@quiet_mode,
|
1232
|
+
s(:lvar, :boolean))))
|
1233
|
+
|
1234
|
+
add_tests("cvdecl",
|
1235
|
+
"Ruby" => "class X\n @@blah = 1\nend",
|
1236
|
+
"ParseTree" => s(:class, :X, nil,
|
1237
|
+
s(:cvdecl, :@@blah, s(:lit, 1))))
|
1238
|
+
|
1239
|
+
add_tests("dasgn_0",
|
1240
|
+
"Ruby" => "a.each { |x| b.each { |y| x = (x + 1) } if true }",
|
1241
|
+
"ParseTree" => s(:iter,
|
1242
|
+
s(:call, s(:call, nil, :a), :each),
|
1243
|
+
s(:args, :x),
|
1244
|
+
s(:if, s(:true),
|
1245
|
+
s(:iter,
|
1246
|
+
s(:call, s(:call, nil, :b), :each),
|
1247
|
+
s(:args, :y),
|
1248
|
+
s(:lasgn, :x,
|
1249
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1)))),
|
1250
|
+
nil)))
|
1251
|
+
|
1252
|
+
add_tests("dasgn_1",
|
1253
|
+
"Ruby" => "a.each { |x| b.each { |y| c = (c + 1) } if true }",
|
1254
|
+
"ParseTree" => s(:iter,
|
1255
|
+
s(:call, s(:call, nil, :a), :each),
|
1256
|
+
s(:args, :x),
|
1257
|
+
s(:if, s(:true),
|
1258
|
+
s(:iter,
|
1259
|
+
s(:call, s(:call, nil, :b), :each),
|
1260
|
+
s(:args, :y),
|
1261
|
+
s(:lasgn, :c,
|
1262
|
+
s(:call, s(:lvar, :c), :+, s(:lit, 1)))),
|
1263
|
+
nil)))
|
1264
|
+
|
1265
|
+
add_tests("dasgn_2",
|
1266
|
+
"Ruby" => "a.each do |x|\n if true then\n c = 0\n b.each { |y| c = (c + 1) }\n end\nend",
|
1267
|
+
"ParseTree" => s(:iter,
|
1268
|
+
s(:call, s(:call, nil, :a), :each),
|
1269
|
+
s(:args, :x),
|
1270
|
+
s(:if, s(:true),
|
1271
|
+
s(:block,
|
1272
|
+
s(:lasgn, :c, s(:lit, 0)),
|
1273
|
+
s(:iter,
|
1274
|
+
s(:call, s(:call, nil, :b), :each),
|
1275
|
+
s(:args, :y),
|
1276
|
+
s(:lasgn, :c,
|
1277
|
+
s(:call, s(:lvar, :c), :+,
|
1278
|
+
s(:lit, 1))))),
|
1279
|
+
nil)))
|
1280
|
+
|
1281
|
+
add_tests("dasgn_curr",
|
1282
|
+
"Ruby" => "data.each do |x, y|\n a = 1\n b = a\n b = a = x\nend",
|
1283
|
+
"ParseTree" => s(:iter,
|
1284
|
+
s(:call, s(:call, nil, :data), :each),
|
1285
|
+
s(:args, :x, :y),
|
1286
|
+
s(:block,
|
1287
|
+
s(:lasgn, :a, s(:lit, 1)),
|
1288
|
+
s(:lasgn, :b, s(:lvar, :a)),
|
1289
|
+
s(:lasgn, :b, s(:lasgn, :a, s(:lvar, :x))))))
|
1290
|
+
|
1291
|
+
add_tests("dasgn_icky",
|
1292
|
+
"Ruby" => "a do\n v = nil\n assert_block(full_message) do\n begin\n yield\n rescue Exception => v\n break\n end\n end\nend",
|
1293
|
+
"ParseTree" => s(:iter,
|
1294
|
+
s(:call, nil, :a),
|
1295
|
+
0,
|
1296
|
+
s(:block,
|
1297
|
+
s(:lasgn, :v, s(:nil)),
|
1298
|
+
s(:iter,
|
1299
|
+
s(:call, nil, :assert_block,
|
1300
|
+
s(:call, nil, :full_message)),
|
1301
|
+
0,
|
1302
|
+
s(:rescue,
|
1303
|
+
s(:yield),
|
1304
|
+
s(:resbody,
|
1305
|
+
s(:array,
|
1306
|
+
s(:const, :Exception),
|
1307
|
+
s(:lasgn, :v, s(:gvar, :$!))),
|
1308
|
+
s(:break)))))))
|
1309
|
+
|
1310
|
+
add_tests("dasgn_mixed",
|
1311
|
+
"Ruby" => "t = 0\nns.each { |n| t += n }\n",
|
1312
|
+
"ParseTree" => s(:block,
|
1313
|
+
s(:lasgn, :t, s(:lit, 0)),
|
1314
|
+
s(:iter,
|
1315
|
+
s(:call, s(:call, nil, :ns), :each),
|
1316
|
+
s(:args, :n),
|
1317
|
+
s(:lasgn, :t,
|
1318
|
+
s(:call, s(:lvar, :t), :+, s(:lvar, :n))))),
|
1319
|
+
"Ruby2Ruby" => "t = 0\nns.each { |n| t = (t + n) }\n")
|
1320
|
+
|
1321
|
+
add_tests("defined",
|
1322
|
+
"Ruby" => "defined? $x",
|
1323
|
+
"ParseTree" => s(:defined, s(:gvar, :$x)))
|
1324
|
+
|
1325
|
+
add_tests("defn_args_block", # TODO: make all the defn_args* p their arglist
|
1326
|
+
"Ruby" => "def f(&block)\n # do nothing\nend",
|
1327
|
+
"ParseTree" => s(:defn, :f, s(:args, :"&block"),
|
1328
|
+
s(:nil)))
|
1329
|
+
|
1330
|
+
add_tests("defn_args_mand",
|
1331
|
+
"Ruby" => "def f(mand)\n # do nothing\nend",
|
1332
|
+
"ParseTree" => s(:defn, :f, s(:args, :mand),
|
1333
|
+
s(:nil)))
|
1334
|
+
|
1335
|
+
add_tests("defn_args_mand_block",
|
1336
|
+
"Ruby" => "def f(mand, &block)\n # do nothing\nend",
|
1337
|
+
"ParseTree" => s(:defn, :f, s(:args, :mand, :"&block"),
|
1338
|
+
s(:nil)))
|
1339
|
+
|
1340
|
+
add_tests("defn_args_mand_opt",
|
1341
|
+
"Ruby" => "def f(mand, opt = 42)\n # do nothing\nend",
|
1342
|
+
"ParseTree" => s(:defn, :f,
|
1343
|
+
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42))),
|
1344
|
+
s(:nil)))
|
1345
|
+
|
1346
|
+
add_tests("defn_args_mand_opt_block",
|
1347
|
+
"Ruby" => "def f(mand, opt = 42, &block)\n # do nothing\nend",
|
1348
|
+
"ParseTree" => s(:defn, :f,
|
1349
|
+
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42)), :"&block"),
|
1350
|
+
s(:nil)))
|
1351
|
+
|
1352
|
+
add_tests("defn_args_mand_opt_splat",
|
1353
|
+
"Ruby" => "def f(mand, opt = 42, *rest)\n # do nothing\nend",
|
1354
|
+
"ParseTree" => s(:defn, :f,
|
1355
|
+
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42)), :"*rest"),
|
1356
|
+
s(:nil)))
|
1357
|
+
|
1358
|
+
add_tests("defn_args_mand_opt_splat_block",
|
1359
|
+
"Ruby" => "def f(mand, opt = 42, *rest, &block)\n # do nothing\nend",
|
1360
|
+
"ParseTree" => s(:defn, :f,
|
1361
|
+
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42)), :"*rest", :"&block"),
|
1362
|
+
s(:nil)))
|
1363
|
+
|
1364
|
+
add_tests("defn_args_mand_opt_splat_no_name",
|
1365
|
+
"Ruby" => "def x(a, b = 42, *)\n # do nothing\nend",
|
1366
|
+
"ParseTree" => s(:defn, :x,
|
1367
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :"*"),
|
1368
|
+
s(:nil)))
|
1369
|
+
|
1370
|
+
add_tests("defn_args_mand_splat",
|
1371
|
+
"Ruby" => "def f(mand, *rest)\n # do nothing\nend",
|
1372
|
+
"ParseTree" => s(:defn, :f,
|
1373
|
+
s(:args, :mand, :"*rest"),
|
1374
|
+
s(:nil)))
|
1375
|
+
|
1376
|
+
add_tests("defn_args_mand_splat_block",
|
1377
|
+
"Ruby" => "def f(mand, *rest, &block)\n # do nothing\nend",
|
1378
|
+
"ParseTree" => s(:defn, :f,
|
1379
|
+
s(:args, :mand, :"*rest", :"&block"),
|
1380
|
+
s(:nil)))
|
1381
|
+
|
1382
|
+
add_tests("defn_args_mand_splat_no_name",
|
1383
|
+
"Ruby" => "def x(a, *args)\n p(a, args)\nend",
|
1384
|
+
"ParseTree" => s(:defn, :x, s(:args, :a, :"*args"),
|
1385
|
+
s(:call, nil, :p,
|
1386
|
+
s(:lvar, :a), s(:lvar, :args))))
|
1387
|
+
|
1388
|
+
add_tests("defn_args_none",
|
1389
|
+
"Ruby" => "def empty\n # do nothing\nend",
|
1390
|
+
"ParseTree" => s(:defn, :empty, s(:args),
|
1391
|
+
s(:nil)))
|
1392
|
+
|
1393
|
+
add_tests("defn_args_opt",
|
1394
|
+
"Ruby" => "def f(opt = 42)\n # do nothing\nend",
|
1395
|
+
"ParseTree" => s(:defn, :f,
|
1396
|
+
s(:args, s(:lasgn, :opt, s(:lit, 42))),
|
1397
|
+
s(:nil)))
|
1398
|
+
|
1399
|
+
add_tests("defn_args_opt_block",
|
1400
|
+
"Ruby" => "def f(opt = 42, &block)\n # do nothing\nend",
|
1401
|
+
"ParseTree" => s(:defn, :f,
|
1402
|
+
s(:args, s(:lasgn, :opt, s(:lit, 42)), :"&block"),
|
1403
|
+
s(:nil)))
|
1404
|
+
|
1405
|
+
add_tests("defn_args_opt_splat",
|
1406
|
+
"Ruby" => "def f(opt = 42, *rest)\n # do nothing\nend",
|
1407
|
+
"ParseTree" => s(:defn, :f,
|
1408
|
+
s(:args, s(:lasgn, :opt, s(:lit, 42)), :"*rest"),
|
1409
|
+
s(:nil)))
|
1410
|
+
|
1411
|
+
add_tests("defn_args_opt_splat_block",
|
1412
|
+
"Ruby" => "def f(opt = 42, *rest, &block)\n # do nothing\nend",
|
1413
|
+
"ParseTree" => s(:defn, :f,
|
1414
|
+
s(:args,
|
1415
|
+
s(:lasgn, :opt, s(:lit, 42)),
|
1416
|
+
:"*rest", :"&block"),
|
1417
|
+
s(:nil)))
|
1418
|
+
|
1419
|
+
add_tests("defn_args_opt_splat_no_name",
|
1420
|
+
"Ruby" => "def x(b = 42, *)\n # do nothing\nend",
|
1421
|
+
"ParseTree" => s(:defn, :x,
|
1422
|
+
s(:args, s(:lasgn, :b, s(:lit, 42)), :"*"),
|
1423
|
+
s(:nil)))
|
1424
|
+
|
1425
|
+
add_tests("defn_args_splat",
|
1426
|
+
"Ruby" => "def f(*rest)\n # do nothing\nend",
|
1427
|
+
"ParseTree" => s(:defn, :f, s(:args, :"*rest"),
|
1428
|
+
s(:nil)))
|
1429
|
+
|
1430
|
+
add_tests("defn_args_splat_no_name",
|
1431
|
+
"Ruby" => "def x(*)\n # do nothing\nend",
|
1432
|
+
"ParseTree" => s(:defn, :x, s(:args, :"*"),
|
1433
|
+
s(:nil)))
|
1434
|
+
|
1435
|
+
add_tests("defn_or",
|
1436
|
+
"Ruby" => "def |(o)\n # do nothing\nend",
|
1437
|
+
"ParseTree" => s(:defn, :|, s(:args, :o),
|
1438
|
+
s(:nil)))
|
1439
|
+
|
1440
|
+
add_tests("defn_rescue",
|
1441
|
+
"Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid)\nrescue\n false\nend",
|
1442
|
+
"ParseTree" => s(:defn, :eql?,
|
1443
|
+
s(:args, :resource),
|
1444
|
+
s(:rescue,
|
1445
|
+
s(:call,
|
1446
|
+
s(:call, s(:self), :uuid),
|
1447
|
+
:==,
|
1448
|
+
s(:call, s(:lvar, :resource), :uuid)),
|
1449
|
+
s(:resbody, s(:array), s(:false)))),
|
1450
|
+
"Ruby2Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid) rescue false\nend")
|
1451
|
+
|
1452
|
+
add_tests("defn_rescue_mri_verbose_flag",
|
1453
|
+
"Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid)\nrescue\n false\nend",
|
1454
|
+
"ParseTree" => s(:defn, :eql?,
|
1455
|
+
s(:args, :resource),
|
1456
|
+
s(:rescue,
|
1457
|
+
s(:call,
|
1458
|
+
s(:call, s(:self), :uuid),
|
1459
|
+
:==,
|
1460
|
+
s(:call, s(:lvar, :resource), :uuid)),
|
1461
|
+
s(:resbody, s(:array), s(:false)))),
|
1462
|
+
"Ruby2Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid) rescue false\nend")
|
1463
|
+
|
1464
|
+
add_tests("defn_something_eh",
|
1465
|
+
"Ruby" => "def something?\n # do nothing\nend",
|
1466
|
+
"ParseTree" => s(:defn, :something?,
|
1467
|
+
s(:args),
|
1468
|
+
s(:nil)))
|
1469
|
+
|
1470
|
+
add_tests("defn_splat_no_name",
|
1471
|
+
"Ruby" => "def x(a, *)\n p(a)\nend",
|
1472
|
+
"ParseTree" => s(:defn, :x,
|
1473
|
+
s(:args, :a, :"*"),
|
1474
|
+
s(:call, nil, :p, s(:lvar, :a))))
|
1475
|
+
|
1476
|
+
add_tests("defn_zarray",
|
1477
|
+
"Ruby" => "def zarray\n a = []\n return a\nend",
|
1478
|
+
"ParseTree" => s(:defn, :zarray,
|
1479
|
+
s(:args),
|
1480
|
+
s(:lasgn, :a, s(:array)),
|
1481
|
+
s(:return, s(:lvar, :a))))
|
1482
|
+
|
1483
|
+
add_tests("defs",
|
1484
|
+
"Ruby" => "def self.x(y)\n (y + 1)\nend",
|
1485
|
+
"ParseTree" => s(:defs, s(:self), :x,
|
1486
|
+
s(:args, :y),
|
1487
|
+
s(:call, s(:lvar, :y), :+, s(:lit, 1))))
|
1488
|
+
|
1489
|
+
add_tests("defs_empty",
|
1490
|
+
"Ruby" => "def self.empty\n # do nothing\nend",
|
1491
|
+
"ParseTree" => s(:defs, s(:self), :empty, s(:args), s(:nil)))
|
1492
|
+
|
1493
|
+
add_tests("defs_empty_args",
|
1494
|
+
"Ruby" => "def self.empty(*)\n # do nothing\nend",
|
1495
|
+
"ParseTree" => s(:defs, s(:self), :empty,
|
1496
|
+
s(:args, :*),
|
1497
|
+
s(:nil)))
|
1498
|
+
|
1499
|
+
add_tests("defs_expr_wtf",
|
1500
|
+
"Ruby" => "def (a.b).empty(*)\n # do nothing\nend",
|
1501
|
+
"ParseTree" => s(:defs,
|
1502
|
+
s(:call, s(:call, nil, :a), :b),
|
1503
|
+
:empty,
|
1504
|
+
s(:args, :*),
|
1505
|
+
s(:nil)))
|
1506
|
+
|
1507
|
+
add_tests("dmethod",
|
1508
|
+
"Ruby" => [Examples, :dmethod_added],
|
1509
|
+
"ParseTree" => s(:defn, :dmethod_added,
|
1510
|
+
s(:args, :x),
|
1511
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
1512
|
+
"Ruby2Ruby" => "def dmethod_added(x)\n (x + 1)\nend")
|
1513
|
+
|
1514
|
+
add_tests("dot2",
|
1515
|
+
"Ruby" => "(a..b)",
|
1516
|
+
"ParseTree" => s(:dot2,
|
1517
|
+
s(:call, nil, :a),
|
1518
|
+
s(:call, nil, :b)))
|
1519
|
+
|
1520
|
+
add_tests("dot3",
|
1521
|
+
"Ruby" => "(a...b)",
|
1522
|
+
"ParseTree" => s(:dot3,
|
1523
|
+
s(:call, nil, :a),
|
1524
|
+
s(:call, nil, :b)))
|
1525
|
+
|
1526
|
+
add_tests("dregx",
|
1527
|
+
"Ruby" => "/x#\{(1 + 1)}y/",
|
1528
|
+
"ParseTree" => s(:dregx, "x",
|
1529
|
+
s(:evstr,
|
1530
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
1531
|
+
s(:str, "y")))
|
1532
|
+
|
1533
|
+
add_tests("dregx_interp",
|
1534
|
+
"Ruby" => "/#\{@rakefile}/",
|
1535
|
+
"ParseTree" => s(:dregx, '', s(:evstr, s(:ivar, :@rakefile))))
|
1536
|
+
|
1537
|
+
add_tests("dregx_interp_empty",
|
1538
|
+
"Ruby" => "/a#\{}b/",
|
1539
|
+
"ParseTree" => s(:dregx, 'a', s(:evstr), s(:str, "b")))
|
1540
|
+
|
1541
|
+
add_tests("dregx_n",
|
1542
|
+
"Ruby" => '/#{1}/n',
|
1543
|
+
"ParseTree" => s(:dregx, '',
|
1544
|
+
s(:evstr, s(:lit, 1)), /x/n.options))
|
1545
|
+
|
1546
|
+
add_tests("dregx_once",
|
1547
|
+
"Ruby" => "/x#\{(1 + 1)}y/o",
|
1548
|
+
"ParseTree" => s(:dregx_once, "x",
|
1549
|
+
s(:evstr,
|
1550
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
1551
|
+
s(:str, "y")))
|
1552
|
+
|
1553
|
+
add_tests("dregx_once_n_interp",
|
1554
|
+
"Ruby" => "/#\{IAC}#\{SB}/no",
|
1555
|
+
"ParseTree" => s(:dregx_once, '',
|
1556
|
+
s(:evstr, s(:const, :IAC)),
|
1557
|
+
s(:evstr, s(:const, :SB)), /x/n.options))
|
1558
|
+
|
1559
|
+
add_tests("dstr",
|
1560
|
+
"Ruby" => "argl = 1\n\"x#\{argl}y\"\n",
|
1561
|
+
"ParseTree" => s(:block,
|
1562
|
+
s(:lasgn, :argl, s(:lit, 1)),
|
1563
|
+
s(:dstr, "x", s(:evstr, s(:lvar, :argl)),
|
1564
|
+
s(:str, "y"))))
|
1565
|
+
|
1566
|
+
add_tests("dstr_2",
|
1567
|
+
"Ruby" => "argl = 1\n\"x#\{(\"%.2f\" % 3.14159)}y\"\n",
|
1568
|
+
"ParseTree" => s(:block,
|
1569
|
+
s(:lasgn, :argl, s(:lit, 1)),
|
1570
|
+
s(:dstr,
|
1571
|
+
"x",
|
1572
|
+
s(:evstr,
|
1573
|
+
s(:call, s(:str, "%.2f"), :%,
|
1574
|
+
s(:lit, 3.14159))),
|
1575
|
+
s(:str, "y"))))
|
1576
|
+
|
1577
|
+
add_tests("dstr_3",
|
1578
|
+
"Ruby" => "max = 2\nargl = 1\n\"x#\{(\"%.#\{max}f\" % 3.14159)}y\"\n",
|
1579
|
+
"ParseTree" => s(:block,
|
1580
|
+
s(:lasgn, :max, s(:lit, 2)),
|
1581
|
+
s(:lasgn, :argl, s(:lit, 1)),
|
1582
|
+
s(:dstr, "x",
|
1583
|
+
s(:evstr,
|
1584
|
+
s(:call,
|
1585
|
+
s(:dstr, "%.",
|
1586
|
+
s(:evstr, s(:lvar, :max)),
|
1587
|
+
s(:str, "f")),
|
1588
|
+
:%,
|
1589
|
+
s(:lit, 3.14159))),
|
1590
|
+
s(:str, "y"))))
|
1591
|
+
|
1592
|
+
add_tests("dstr_concat",
|
1593
|
+
"Ruby" => '"#{22}aa" "cd#{44}" "55" "#{66}"',
|
1594
|
+
"ParseTree" => s(:dstr,
|
1595
|
+
"",
|
1596
|
+
s(:evstr, s(:lit, 22)),
|
1597
|
+
s(:str, "aa"),
|
1598
|
+
s(:str, "cd"),
|
1599
|
+
s(:evstr, s(:lit, 44)),
|
1600
|
+
s(:str, "55"),
|
1601
|
+
s(:evstr, s(:lit, 66))),
|
1602
|
+
"Ruby2Ruby" => '"#{22}aacd#{44}55#{66}"')
|
1603
|
+
|
1604
|
+
add_tests("dstr_gross",
|
1605
|
+
"Ruby" => '"a #$global b #@ivar c #@@cvar d"',
|
1606
|
+
"ParseTree" => s(:dstr, "a ",
|
1607
|
+
s(:evstr, s(:gvar, :$global)),
|
1608
|
+
s(:str, " b "),
|
1609
|
+
s(:evstr, s(:ivar, :@ivar)),
|
1610
|
+
s(:str, " c "),
|
1611
|
+
s(:evstr, s(:cvar, :@@cvar)),
|
1612
|
+
s(:str, " d")),
|
1613
|
+
"Ruby2Ruby" => '"a #{$global} b #{@ivar} c #{@@cvar} d"')
|
1614
|
+
|
1615
|
+
add_tests("dstr_heredoc_expand",
|
1616
|
+
"Ruby" => "<<EOM\n blah\n#\{1 + 1}blah\nEOM\n",
|
1617
|
+
"ParseTree" => s(:dstr, " blah\n",
|
1618
|
+
s(:evstr, s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
1619
|
+
s(:str, "blah\n")),
|
1620
|
+
"Ruby2Ruby" => "\" blah\\n#\{(1 + 1)}blah\\n\"")
|
1621
|
+
|
1622
|
+
add_tests("dstr_heredoc_windoze_sucks",
|
1623
|
+
"Ruby" => "<<-EOF\r\ndef test_#\{action}_valid_feed\r\n EOF\r\n",
|
1624
|
+
"ParseTree" => s(:dstr,
|
1625
|
+
'def test_',
|
1626
|
+
s(:evstr, s(:call, nil, :action)),
|
1627
|
+
s(:str, "_valid_feed\n")),
|
1628
|
+
"Ruby2Ruby" => "\"def test_#\{action}_valid_feed\\n\"")
|
1629
|
+
|
1630
|
+
add_tests("dstr_heredoc_yet_again",
|
1631
|
+
"Ruby" => "<<-EOF\ns1 '#\{RUBY_PLATFORM}' s2\n#\{__FILE__}\n EOF\n",
|
1632
|
+
"ParseTree" => s(:dstr, "s1 '",
|
1633
|
+
s(:evstr, s(:const, :RUBY_PLATFORM)),
|
1634
|
+
s(:str, "' s2\n"),
|
1635
|
+
s(:str, "(string)"),
|
1636
|
+
s(:str, "\n")),
|
1637
|
+
"Ruby2Ruby" => "\"s1 '#\{RUBY_PLATFORM}' s2\\n(string)\\n\"")
|
1638
|
+
|
1639
|
+
add_tests("dstr_nest",
|
1640
|
+
"Ruby" => "%Q[before [#\{nest}] after]",
|
1641
|
+
"ParseTree" => s(:dstr, "before [",
|
1642
|
+
s(:evstr, s(:call, nil, :nest)),
|
1643
|
+
s(:str, "] after")),
|
1644
|
+
"Ruby2Ruby" => "\"before [#\{nest}] after\"")
|
1645
|
+
|
1646
|
+
add_tests("dstr_str_lit_start",
|
1647
|
+
"Ruby" => '"#{"blah"}#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})"',
|
1648
|
+
"ParseTree" => s(:dstr,
|
1649
|
+
"blah(string):",
|
1650
|
+
s(:evstr, s(:lit, 1)),
|
1651
|
+
s(:str, ": warning: "),
|
1652
|
+
s(:evstr, s(:call, s(:gvar, :$!), :message)),
|
1653
|
+
s(:str, " ("),
|
1654
|
+
s(:evstr, s(:call, s(:gvar, :$!), :class)),
|
1655
|
+
s(:str, ")")),
|
1656
|
+
"Ruby2Ruby" => '"blah(string):#{1}: warning: #{$!.message} (#{$!.class})"')
|
1657
|
+
|
1658
|
+
add_tests("dstr_the_revenge",
|
1659
|
+
"Ruby" => '"before #{from} middle #{to} (#{__FILE__}:#{__LINE__})"',
|
1660
|
+
"ParseTree" => s(:dstr,
|
1661
|
+
"before ",
|
1662
|
+
s(:evstr, s(:call, nil, :from)),
|
1663
|
+
s(:str, " middle "),
|
1664
|
+
s(:evstr, s(:call, nil, :to)),
|
1665
|
+
s(:str, " ("),
|
1666
|
+
s(:str, "(string)"),
|
1667
|
+
s(:str, ":"),
|
1668
|
+
s(:evstr, s(:lit, 1)),
|
1669
|
+
s(:str, ")")),
|
1670
|
+
"Ruby2Ruby" => '"before #{from} middle #{to} ((string):#{1})"')
|
1671
|
+
|
1672
|
+
add_tests("dsym",
|
1673
|
+
"Ruby" => ":\"x#\{(1 + 1)}y\"",
|
1674
|
+
"ParseTree" => s(:dsym, "x",
|
1675
|
+
s(:evstr, s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
1676
|
+
s(:str, "y")))
|
1677
|
+
|
1678
|
+
add_tests("dxstr",
|
1679
|
+
"Ruby" => "t = 5\n`touch #\{t}`\n",
|
1680
|
+
"ParseTree" => s(:block,
|
1681
|
+
s(:lasgn, :t, s(:lit, 5)),
|
1682
|
+
s(:dxstr, 'touch ', s(:evstr, s(:lvar, :t)))))
|
1683
|
+
|
1684
|
+
add_tests("ensure",
|
1685
|
+
"Ruby" => "begin\n (1 + 1)\nrescue SyntaxError => e1\n 2\nrescue Exception => e2\n 3\nelse\n 4\nensure\n 5\nend",
|
1686
|
+
"ParseTree" => s(:ensure,
|
1687
|
+
s(:rescue,
|
1688
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)),
|
1689
|
+
s(:resbody,
|
1690
|
+
s(:array,
|
1691
|
+
s(:const, :SyntaxError),
|
1692
|
+
s(:lasgn, :e1, s(:gvar, :$!))),
|
1693
|
+
s(:lit, 2)),
|
1694
|
+
s(:resbody,
|
1695
|
+
s(:array,
|
1696
|
+
s(:const, :Exception),
|
1697
|
+
s(:lasgn, :e2, s(:gvar, :$!))),
|
1698
|
+
s(:lit, 3)),
|
1699
|
+
s(:lit, 4)),
|
1700
|
+
s(:lit, 5)))
|
1701
|
+
|
1702
|
+
add_tests("false",
|
1703
|
+
"Ruby" => "false",
|
1704
|
+
"ParseTree" => s(:false))
|
1705
|
+
|
1706
|
+
add_tests("fbody",
|
1707
|
+
"Ruby" => [Examples, :an_alias],
|
1708
|
+
"ParseTree" => s(:defn, :an_alias, s(:args, :x),
|
1709
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
1710
|
+
"Ruby2Ruby" => "def an_alias(x)\n (x + 1)\nend")
|
1711
|
+
|
1712
|
+
add_tests("fcall_arglist",
|
1713
|
+
"Ruby" => "m(42)",
|
1714
|
+
"ParseTree" => s(:call, nil, :m, s(:lit, 42)))
|
1715
|
+
|
1716
|
+
add_tests("fcall_arglist_hash",
|
1717
|
+
"Ruby" => "m(:a => 1, :b => 2)",
|
1718
|
+
"ParseTree" => s(:call, nil, :m,
|
1719
|
+
s(:hash,
|
1720
|
+
s(:lit, :a), s(:lit, 1),
|
1721
|
+
s(:lit, :b), s(:lit, 2))))
|
1722
|
+
|
1723
|
+
add_tests("fcall_arglist_norm_hash",
|
1724
|
+
"Ruby" => "m(42, :a => 1, :b => 2)",
|
1725
|
+
"ParseTree" => s(:call, nil, :m,
|
1726
|
+
s(:lit, 42),
|
1727
|
+
s(:hash,
|
1728
|
+
s(:lit, :a), s(:lit, 1),
|
1729
|
+
s(:lit, :b), s(:lit, 2))))
|
1730
|
+
|
1731
|
+
add_tests("fcall_block",
|
1732
|
+
"Ruby" => "a(:b) { :c }",
|
1733
|
+
"ParseTree" => s(:iter,
|
1734
|
+
s(:call, nil, :a, s(:lit, :b)),
|
1735
|
+
0,
|
1736
|
+
s(:lit, :c)))
|
1737
|
+
|
1738
|
+
add_tests("fcall_index_space",
|
1739
|
+
"Ruby" => "a [42]",
|
1740
|
+
"ParseTree" => s(:call, nil, :a, s(:array, s(:lit, 42))),
|
1741
|
+
"Ruby2Ruby" => "a([42])")
|
1742
|
+
|
1743
|
+
add_tests("fcall_inside_parens",
|
1744
|
+
"Ruby" => "( a (b), c)",
|
1745
|
+
"ParseTree" => s(:call, nil, :a,
|
1746
|
+
s(:call, nil, :b), s(:call, nil, :c)),
|
1747
|
+
"Ruby2Ruby" => "a(b, c)")
|
1748
|
+
|
1749
|
+
add_tests("fcall_keyword",
|
1750
|
+
"Ruby" => "42 if block_given?",
|
1751
|
+
"ParseTree" => s(:if,
|
1752
|
+
s(:call, nil, :block_given?),
|
1753
|
+
s(:lit, 42), nil))
|
1754
|
+
|
1755
|
+
add_tests("flip2",
|
1756
|
+
"Ruby" => "x = if ((i % 4) == 0)..((i % 3) == 0) then\n i\nelse\n nil\nend",
|
1757
|
+
"ParseTree" => s(:lasgn,
|
1758
|
+
:x,
|
1759
|
+
s(:if,
|
1760
|
+
s(:flip2,
|
1761
|
+
s(:call,
|
1762
|
+
s(:call, s(:call, nil, :i),
|
1763
|
+
:%,
|
1764
|
+
s(:lit, 4)),
|
1765
|
+
:==,
|
1766
|
+
s(:lit, 0)),
|
1767
|
+
s(:call,
|
1768
|
+
s(:call, s(:call, nil, :i),
|
1769
|
+
:%,
|
1770
|
+
s(:lit, 3)),
|
1771
|
+
:==,
|
1772
|
+
s(:lit, 0))),
|
1773
|
+
s(:call, nil, :i),
|
1774
|
+
s(:nil))))
|
1775
|
+
|
1776
|
+
add_tests("flip2_method",
|
1777
|
+
"Ruby" => "if 1..2.a?(b) then\n nil\nend",
|
1778
|
+
"ParseTree" => s(:if,
|
1779
|
+
s(:flip2,
|
1780
|
+
s(:lit, 1),
|
1781
|
+
s(:call, s(:lit, 2), :a?, s(:call, nil, :b))),
|
1782
|
+
s(:nil),
|
1783
|
+
nil))
|
1784
|
+
|
1785
|
+
add_tests("flip3",
|
1786
|
+
"Ruby" => "x = if ((i % 4) == 0)...((i % 3) == 0) then\n i\nelse\n nil\nend",
|
1787
|
+
"ParseTree" => s(:lasgn,
|
1788
|
+
:x,
|
1789
|
+
s(:if,
|
1790
|
+
s(:flip3,
|
1791
|
+
s(:call,
|
1792
|
+
s(:call, s(:call, nil, :i),
|
1793
|
+
:%,
|
1794
|
+
s(:lit, 4)),
|
1795
|
+
:==,
|
1796
|
+
s(:lit, 0)),
|
1797
|
+
s(:call,
|
1798
|
+
s(:call, s(:call, nil, :i),
|
1799
|
+
:%,
|
1800
|
+
s(:lit, 3)),
|
1801
|
+
:==,
|
1802
|
+
s(:lit, 0))),
|
1803
|
+
s(:call, nil, :i),
|
1804
|
+
s(:nil))))
|
1805
|
+
|
1806
|
+
add_tests("for",
|
1807
|
+
"Ruby" => "for o in ary do\n puts(o)\nend",
|
1808
|
+
"ParseTree" => s(:for,
|
1809
|
+
s(:call, nil, :ary),
|
1810
|
+
s(:lasgn, :o),
|
1811
|
+
s(:call, nil, :puts, s(:lvar, :o))))
|
1812
|
+
|
1813
|
+
add_tests("for_no_body",
|
1814
|
+
"Ruby" => "for i in (0..max) do\n # do nothing\nend",
|
1815
|
+
"ParseTree" => s(:for,
|
1816
|
+
s(:dot2,
|
1817
|
+
s(:lit, 0),
|
1818
|
+
s(:call, nil, :max)),
|
1819
|
+
s(:lasgn, :i)))
|
1820
|
+
|
1821
|
+
add_tests("gasgn",
|
1822
|
+
"Ruby" => "$x = 42",
|
1823
|
+
"ParseTree" => s(:gasgn, :$x, s(:lit, 42)))
|
1824
|
+
|
1825
|
+
add_tests("global",
|
1826
|
+
"Ruby" => "$stderr",
|
1827
|
+
"ParseTree" => s(:gvar, :$stderr))
|
1828
|
+
|
1829
|
+
add_tests("gvar",
|
1830
|
+
"Ruby" => "$x",
|
1831
|
+
"ParseTree" => s(:gvar, :$x))
|
1832
|
+
|
1833
|
+
add_tests("gvar_underscore",
|
1834
|
+
"Ruby" => "$_",
|
1835
|
+
"ParseTree" => s(:gvar, :$_))
|
1836
|
+
|
1837
|
+
add_tests("gvar_underscore_blah",
|
1838
|
+
"Ruby" => "$__blah",
|
1839
|
+
"ParseTree" => s(:gvar, :$__blah))
|
1840
|
+
|
1841
|
+
add_tests("hash",
|
1842
|
+
"Ruby" => "{ 1 => 2, 3 => 4 }",
|
1843
|
+
"ParseTree" => s(:hash,
|
1844
|
+
s(:lit, 1), s(:lit, 2),
|
1845
|
+
s(:lit, 3), s(:lit, 4)))
|
1846
|
+
|
1847
|
+
add_tests("hash_rescue",
|
1848
|
+
"Ruby" => "{ 1 => (2 rescue 3) }",
|
1849
|
+
"ParseTree" => s(:hash,
|
1850
|
+
s(:lit, 1),
|
1851
|
+
s(:rescue,
|
1852
|
+
s(:lit, 2),
|
1853
|
+
s(:resbody, s(:array), s(:lit, 3)))))
|
1854
|
+
|
1855
|
+
add_tests("iasgn",
|
1856
|
+
"Ruby" => "@a = 4",
|
1857
|
+
"ParseTree" => s(:iasgn, :@a, s(:lit, 4)))
|
1858
|
+
|
1859
|
+
add_tests("if_block_condition",
|
1860
|
+
"Ruby" => "if (x = 5\n(x + 1)) then\n nil\nend",
|
1861
|
+
"ParseTree" => s(:if,
|
1862
|
+
s(:block,
|
1863
|
+
s(:lasgn, :x, s(:lit, 5)),
|
1864
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
1865
|
+
s(:nil),
|
1866
|
+
nil))
|
1867
|
+
|
1868
|
+
add_tests("if_lasgn_short",
|
1869
|
+
"Ruby" => "if x = obj.x then\n x.do_it\nend",
|
1870
|
+
"ParseTree" => s(:if,
|
1871
|
+
s(:lasgn, :x,
|
1872
|
+
s(:call,
|
1873
|
+
s(:call, nil, :obj),
|
1874
|
+
:x)),
|
1875
|
+
s(:call, s(:lvar, :x), :do_it),
|
1876
|
+
nil))
|
1877
|
+
|
1878
|
+
add_tests("if_nested",
|
1879
|
+
"Ruby" => "return if false unless true",
|
1880
|
+
"ParseTree" => s(:if, s(:true), nil,
|
1881
|
+
s(:if, s(:false), s(:return), nil)))
|
1882
|
+
|
1883
|
+
add_tests("if_post",
|
1884
|
+
"Ruby" => "a if b",
|
1885
|
+
"ParseTree" => s(:if, s(:call, nil, :b),
|
1886
|
+
s(:call, nil, :a), nil))
|
1887
|
+
|
1888
|
+
add_tests("if_pre",
|
1889
|
+
"Ruby" => "if b then a end",
|
1890
|
+
"ParseTree" => s(:if, s(:call, nil, :b),
|
1891
|
+
s(:call, nil, :a), nil),
|
1892
|
+
"Ruby2Ruby" => "a if b")
|
1893
|
+
|
1894
|
+
add_tests("iter_call_arglist_space",
|
1895
|
+
"Ruby" => "a (1) {|c|d}",
|
1896
|
+
"ParseTree" => s(:iter,
|
1897
|
+
s(:call, nil, :a, s(:lit, 1)),
|
1898
|
+
s(:args, :c),
|
1899
|
+
s(:call, nil, :d)),
|
1900
|
+
"Ruby2Ruby" => "a(1) { |c| d }")
|
1901
|
+
|
1902
|
+
add_tests("iter_dasgn_curr_dasgn_madness",
|
1903
|
+
"Ruby" => "as.each { |a|\n b += a.b(false) }",
|
1904
|
+
"ParseTree" => s(:iter,
|
1905
|
+
s(:call, s(:call, nil, :as), :each),
|
1906
|
+
s(:args, :a),
|
1907
|
+
s(:lasgn, :b,
|
1908
|
+
s(:call,
|
1909
|
+
s(:lvar, :b),
|
1910
|
+
:+,
|
1911
|
+
s(:call, s(:lvar, :a), :b, s(:false))))),
|
1912
|
+
"Ruby2Ruby" => "as.each { |a| b = (b + a.b(false)) }")
|
1913
|
+
|
1914
|
+
add_tests("iter_downto",
|
1915
|
+
"Ruby" => "3.downto(1) { |n| puts(n.to_s) }",
|
1916
|
+
"ParseTree" => s(:iter,
|
1917
|
+
s(:call, s(:lit, 3), :downto, s(:lit, 1)),
|
1918
|
+
s(:args, :n),
|
1919
|
+
s(:call, nil, :puts,
|
1920
|
+
s(:call, s(:lvar, :n), :to_s))))
|
1921
|
+
|
1922
|
+
add_tests("iter_each_lvar",
|
1923
|
+
"Ruby" => "array = [1, 2, 3]\narray.each { |x| puts(x.to_s) }\n",
|
1924
|
+
"ParseTree" => s(:block,
|
1925
|
+
s(:lasgn, :array,
|
1926
|
+
s(:array,
|
1927
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3))),
|
1928
|
+
s(:iter,
|
1929
|
+
s(:call, s(:lvar, :array), :each),
|
1930
|
+
s(:args, :x),
|
1931
|
+
s(:call, nil, :puts,
|
1932
|
+
s(:call, s(:lvar, :x), :to_s)))))
|
1933
|
+
|
1934
|
+
add_tests("iter_each_nested",
|
1935
|
+
"Ruby" => "array1 = [1, 2, 3]\narray2 = [4, 5, 6, 7]\narray1.each do |x|\n array2.each do |y|\n puts(x.to_s)\n puts(y.to_s)\n end\nend\n",
|
1936
|
+
"ParseTree" => s(:block,
|
1937
|
+
s(:lasgn, :array1,
|
1938
|
+
s(:array,
|
1939
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3))),
|
1940
|
+
s(:lasgn, :array2,
|
1941
|
+
s(:array,
|
1942
|
+
s(:lit, 4), s(:lit, 5),
|
1943
|
+
s(:lit, 6), s(:lit, 7))),
|
1944
|
+
s(:iter,
|
1945
|
+
s(:call, s(:lvar, :array1), :each),
|
1946
|
+
s(:args, :x),
|
1947
|
+
s(:iter,
|
1948
|
+
s(:call, s(:lvar, :array2), :each),
|
1949
|
+
s(:args, :y),
|
1950
|
+
s(:block,
|
1951
|
+
s(:call, nil, :puts,
|
1952
|
+
s(:call, s(:lvar, :x), :to_s)),
|
1953
|
+
s(:call, nil, :puts,
|
1954
|
+
s(:call, s(:lvar, :y), :to_s)))))))
|
1955
|
+
|
1956
|
+
add_tests("iter_loop_empty",
|
1957
|
+
"Ruby" => "loop { }",
|
1958
|
+
"ParseTree" => s(:iter, s(:call, nil, :loop), 0))
|
1959
|
+
|
1960
|
+
add_tests("iter_masgn_2",
|
1961
|
+
"Ruby" => "a { |b, c| p(c) }",
|
1962
|
+
"ParseTree" => s(:iter,
|
1963
|
+
s(:call, nil, :a),
|
1964
|
+
s(:args, :b, :c),
|
1965
|
+
s(:call, nil, :p, s(:lvar, :c))))
|
1966
|
+
|
1967
|
+
add_tests("iter_masgn_args_splat",
|
1968
|
+
"Ruby" => "a { |b, c, *d| p(c) }",
|
1969
|
+
"ParseTree" => s(:iter,
|
1970
|
+
s(:call, nil, :a),
|
1971
|
+
s(:args, :b, :c, :"*d"),
|
1972
|
+
s(:call, nil, :p, s(:lvar, :c))))
|
1973
|
+
|
1974
|
+
add_tests("iter_masgn_args_splat_no_name",
|
1975
|
+
"Ruby" => "a { |b, c, *| p(c) }",
|
1976
|
+
"ParseTree" => s(:iter,
|
1977
|
+
s(:call, nil, :a),
|
1978
|
+
s(:args, :b, :c, :*),
|
1979
|
+
s(:call, nil, :p, s(:lvar, :c))))
|
1980
|
+
|
1981
|
+
add_tests("iter_masgn_splat",
|
1982
|
+
"Ruby" => "a { |*c| p(c) }",
|
1983
|
+
"ParseTree" => s(:iter,
|
1984
|
+
s(:call, nil, :a),
|
1985
|
+
s(:args, :"*c"),
|
1986
|
+
s(:call, nil, :p, s(:lvar, :c))))
|
1987
|
+
|
1988
|
+
add_tests("iter_masgn_splat_no_name",
|
1989
|
+
"Ruby" => "a { |*| p(c) }",
|
1990
|
+
"ParseTree" => s(:iter,
|
1991
|
+
s(:call, nil, :a),
|
1992
|
+
s(:args, :*),
|
1993
|
+
s(:call, nil, :p, s(:call, nil, :c))))
|
1994
|
+
|
1995
|
+
add_tests("iter_shadowed_var",
|
1996
|
+
"Ruby" => "a do |x|\n b do |x|\n puts x\n end\nend",
|
1997
|
+
"ParseTree" => s(:iter,
|
1998
|
+
s(:call, nil, :a),
|
1999
|
+
s(:args, :x),
|
2000
|
+
s(:iter,
|
2001
|
+
s(:call, nil, :b),
|
2002
|
+
s(:args, :x),
|
2003
|
+
s(:call, nil, :puts, s(:lvar, :x)))),
|
2004
|
+
"Ruby2Ruby" => "a { |x| b { |x| puts(x) } }")
|
2005
|
+
|
2006
|
+
add_tests("iter_upto",
|
2007
|
+
"Ruby" => "1.upto(3) { |n| puts(n.to_s) }",
|
2008
|
+
"ParseTree" => s(:iter,
|
2009
|
+
s(:call, s(:lit, 1), :upto, s(:lit, 3)),
|
2010
|
+
s(:args, :n),
|
2011
|
+
s(:call, nil, :puts,
|
2012
|
+
s(:call, s(:lvar, :n), :to_s))))
|
2013
|
+
|
2014
|
+
add_tests("iter_while",
|
2015
|
+
"Ruby" => "argl = 10\nwhile (argl >= 1) do\n puts(\"hello\")\n argl = (argl - 1)\nend\n",
|
2016
|
+
"ParseTree" => s(:block,
|
2017
|
+
s(:lasgn, :argl, s(:lit, 10)),
|
2018
|
+
s(:while,
|
2019
|
+
s(:call, s(:lvar, :argl), :">=", s(:lit, 1)),
|
2020
|
+
s(:block,
|
2021
|
+
s(:call, nil, :puts, s(:str, "hello")),
|
2022
|
+
s(:lasgn,
|
2023
|
+
:argl,
|
2024
|
+
s(:call, s(:lvar, :argl), :"-",
|
2025
|
+
s(:lit, 1)))),
|
2026
|
+
true)))
|
2027
|
+
|
2028
|
+
add_tests("ivar",
|
2029
|
+
"Ruby" => [Examples, :reader],
|
2030
|
+
"ParseTree" => s(:defn, :reader, s(:args),
|
2031
|
+
s(:ivar, :@reader)),
|
2032
|
+
"Ruby2Ruby" => "attr_reader :reader")
|
2033
|
+
|
2034
|
+
add_tests("lambda_args_anon_star",
|
2035
|
+
"Ruby" => "lambda { |*| nil }",
|
2036
|
+
"ParseTree" => s(:iter,
|
2037
|
+
s(:call, nil, :lambda),
|
2038
|
+
s(:args, :*),
|
2039
|
+
s(:nil)))
|
2040
|
+
|
2041
|
+
add_tests("lambda_args_anon_star_block",
|
2042
|
+
"Ruby" => "lambda { |*, &block| block }",
|
2043
|
+
"ParseTree" => s(:iter,
|
2044
|
+
s(:call, nil, :lambda),
|
2045
|
+
s(:args, :*, :"&block"),
|
2046
|
+
s(:lvar, :block)))
|
2047
|
+
|
2048
|
+
add_tests("lambda_args_block",
|
2049
|
+
"Ruby" => "lambda { |&block| block }",
|
2050
|
+
"ParseTree" => s(:iter,
|
2051
|
+
s(:call, nil, :lambda),
|
2052
|
+
s(:args, :"&block"),
|
2053
|
+
s(:lvar, :block)))
|
2054
|
+
|
2055
|
+
add_tests("lambda_args_norm_anon_star",
|
2056
|
+
"Ruby" => "lambda { |a, *| a }",
|
2057
|
+
"ParseTree" => s(:iter,
|
2058
|
+
s(:call, nil, :lambda),
|
2059
|
+
s(:args, :a, :*),
|
2060
|
+
s(:lvar, :a)))
|
2061
|
+
|
2062
|
+
add_tests("lambda_args_norm_anon_star_block",
|
2063
|
+
"Ruby" => "lambda { |a, *, &block| block }",
|
2064
|
+
"ParseTree" => s(:iter,
|
2065
|
+
s(:call, nil, :lambda),
|
2066
|
+
s(:args, :a, :*, :"&block"),
|
2067
|
+
s(:lvar, :block)))
|
2068
|
+
|
2069
|
+
add_tests("lambda_args_norm_block",
|
2070
|
+
"Ruby" => "lambda { |a, &block| block }",
|
2071
|
+
"ParseTree" => s(:iter,
|
2072
|
+
s(:call, nil, :lambda),
|
2073
|
+
s(:args, :a, :"&block"),
|
2074
|
+
s(:lvar, :block)))
|
2075
|
+
|
2076
|
+
add_tests("lambda_args_norm_comma",
|
2077
|
+
"Ruby" => "lambda { |a,| a }",
|
2078
|
+
"ParseTree" => s(:iter,
|
2079
|
+
s(:call, nil, :lambda),
|
2080
|
+
s(:args, :a),
|
2081
|
+
s(:lvar, :a)),
|
2082
|
+
"Ruby2Ruby" => "lambda { |a| a }")
|
2083
|
+
|
2084
|
+
add_tests("lambda_args_norm_comma2",
|
2085
|
+
"Ruby" => "lambda { |a,b,| a }",
|
2086
|
+
"ParseTree" => s(:iter,
|
2087
|
+
s(:call, nil, :lambda),
|
2088
|
+
s(:args, :a, :b),
|
2089
|
+
s(:lvar, :a)),
|
2090
|
+
"Ruby2Ruby" => "lambda { |a, b| a }")
|
2091
|
+
|
2092
|
+
add_tests("lambda_args_norm_star",
|
2093
|
+
"Ruby" => "lambda { |a, *star| star }",
|
2094
|
+
"ParseTree" => s(:iter,
|
2095
|
+
s(:call, nil, :lambda),
|
2096
|
+
s(:args, :a, :"*star"),
|
2097
|
+
s(:lvar, :star)))
|
2098
|
+
|
2099
|
+
add_tests("lambda_args_norm_star_block",
|
2100
|
+
"Ruby" => "lambda { |a, *star, &block| block }",
|
2101
|
+
"ParseTree" => s(:iter,
|
2102
|
+
s(:call, nil, :lambda),
|
2103
|
+
s(:args, :a, :"*star", :"&block"),
|
2104
|
+
s(:lvar, :block)))
|
2105
|
+
|
2106
|
+
add_tests("lambda_args_star",
|
2107
|
+
"Ruby" => "lambda { |*star| star }",
|
2108
|
+
"ParseTree" => s(:iter,
|
2109
|
+
s(:call, nil, :lambda),
|
2110
|
+
s(:args, :"*star"),
|
2111
|
+
s(:lvar, :star)))
|
2112
|
+
|
2113
|
+
add_tests("lambda_args_star_block",
|
2114
|
+
"Ruby" => "lambda { |*star, &block| block }",
|
2115
|
+
"ParseTree" => s(:iter,
|
2116
|
+
s(:call, nil, :lambda),
|
2117
|
+
s(:args, :"*star", :"&block"),
|
2118
|
+
s(:lvar, :block)))
|
2119
|
+
|
2120
|
+
add_tests("lasgn_array",
|
2121
|
+
"Ruby" => "var = [\"foo\", \"bar\"]",
|
2122
|
+
"ParseTree" => s(:lasgn, :var,
|
2123
|
+
s(:array,
|
2124
|
+
s(:str, "foo"),
|
2125
|
+
s(:str, "bar"))))
|
2126
|
+
|
2127
|
+
add_tests("lasgn_call",
|
2128
|
+
"Ruby" => "c = (2 + 3)",
|
2129
|
+
"ParseTree" => s(:lasgn, :c,
|
2130
|
+
s(:call, s(:lit, 2), :+, s(:lit, 3))))
|
2131
|
+
|
2132
|
+
add_tests("lit_bool_false",
|
2133
|
+
"Ruby" => "false",
|
2134
|
+
"ParseTree" => s(:false))
|
2135
|
+
|
2136
|
+
add_tests("lit_bool_true",
|
2137
|
+
"Ruby" => "true",
|
2138
|
+
"ParseTree" => s(:true))
|
2139
|
+
|
2140
|
+
add_tests("lit_float",
|
2141
|
+
"Ruby" => "1.1",
|
2142
|
+
"ParseTree" => s(:lit, 1.1))
|
2143
|
+
|
2144
|
+
add_tests("lit_long",
|
2145
|
+
"Ruby" => "1",
|
2146
|
+
"ParseTree" => s(:lit, 1))
|
2147
|
+
|
2148
|
+
add_tests("lit_long_negative",
|
2149
|
+
"Ruby" => "-1",
|
2150
|
+
"ParseTree" => s(:lit, -1))
|
2151
|
+
|
2152
|
+
add_tests("lit_range2",
|
2153
|
+
"Ruby" => "(1..10)",
|
2154
|
+
"ParseTree" => s(:lit, 1..10))
|
2155
|
+
|
2156
|
+
add_tests("lit_range3",
|
2157
|
+
"Ruby" => "(1...10)",
|
2158
|
+
"ParseTree" => s(:lit, 1...10))
|
2159
|
+
|
2160
|
+
add_tests("lit_regexp",
|
2161
|
+
"Ruby" => "/x/",
|
2162
|
+
"ParseTree" => s(:lit, /x/))
|
2163
|
+
|
2164
|
+
add_tests("lit_regexp_i_wwtt",
|
2165
|
+
"Ruby" => 'str.split(//i)',
|
2166
|
+
"ParseTree" => s(:call,
|
2167
|
+
s(:call, nil, :str),
|
2168
|
+
:split,
|
2169
|
+
s(:lit, //i)))
|
2170
|
+
|
2171
|
+
add_tests("lit_regexp_n",
|
2172
|
+
"Ruby" => "/x/n", # HACK differs on 1.9 - this is easiest
|
2173
|
+
"ParseTree" => s(:lit, /x/n),
|
2174
|
+
"Ruby2Ruby" => /x/n.inspect)
|
2175
|
+
|
2176
|
+
add_tests("lit_regexp_once",
|
2177
|
+
"Ruby" => "/x/o",
|
2178
|
+
"ParseTree" => s(:lit, /x/),
|
2179
|
+
"Ruby2Ruby" => "/x/")
|
2180
|
+
|
2181
|
+
add_tests("lit_sym",
|
2182
|
+
"Ruby" => ":x",
|
2183
|
+
"ParseTree" => s(:lit, :x))
|
2184
|
+
|
2185
|
+
add_tests("lit_sym_splat",
|
2186
|
+
"Ruby" => ":\"*args\"",
|
2187
|
+
"ParseTree" => s(:lit, :"*args"))
|
2188
|
+
|
2189
|
+
add_tests("lvar_def_boundary",
|
2190
|
+
"Ruby" => "b = 42\ndef a\n c do\n begin\n do_stuff\n rescue RuntimeError => b\n puts(b)\n end\n end\nend\n",
|
2191
|
+
"ParseTree" => s(:block,
|
2192
|
+
s(:lasgn, :b, s(:lit, 42)),
|
2193
|
+
s(:defn, :a, s(:args),
|
2194
|
+
s(:iter,
|
2195
|
+
s(:call, nil, :c),
|
2196
|
+
0,
|
2197
|
+
s(:rescue,
|
2198
|
+
s(:call, nil, :do_stuff),
|
2199
|
+
s(:resbody,
|
2200
|
+
s(:array,
|
2201
|
+
s(:const, :RuntimeError),
|
2202
|
+
s(:lasgn, :b, s(:gvar, :$!))),
|
2203
|
+
s(:call, nil, :puts,
|
2204
|
+
s(:lvar, :b))))))))
|
2205
|
+
|
2206
|
+
add_tests("masgn",
|
2207
|
+
"Ruby" => "a, b = c, d",
|
2208
|
+
"ParseTree" => s(:masgn,
|
2209
|
+
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
2210
|
+
s(:array, s(:call, nil, :c),
|
2211
|
+
s(:call, nil, :d))))
|
2212
|
+
|
2213
|
+
add_tests("masgn_argscat",
|
2214
|
+
"Ruby" => "a, b, *c = 1, 2, *[3, 4]",
|
2215
|
+
"ParseTree" => s(:masgn,
|
2216
|
+
s(:array,
|
2217
|
+
s(:lasgn, :a),
|
2218
|
+
s(:lasgn, :b),
|
2219
|
+
s(:splat, s(:lasgn, :c))),
|
2220
|
+
s(:array,
|
2221
|
+
s(:lit, 1), s(:lit, 2),
|
2222
|
+
s(:splat,
|
2223
|
+
s(:array, s(:lit, 3), s(:lit, 4))))))
|
2224
|
+
|
2225
|
+
add_tests("masgn_attrasgn",
|
2226
|
+
"Ruby" => "a, b.c = d, e",
|
2227
|
+
"ParseTree" => s(:masgn,
|
2228
|
+
s(:array,
|
2229
|
+
s(:lasgn, :a),
|
2230
|
+
s(:attrasgn,
|
2231
|
+
s(:call, nil, :b),
|
2232
|
+
:c=)),
|
2233
|
+
s(:array,
|
2234
|
+
s(:call, nil, :d),
|
2235
|
+
s(:call, nil, :e))))
|
2236
|
+
|
2237
|
+
add_tests("masgn_attrasgn_array_rhs",
|
2238
|
+
"Ruby" => "a.b, a.c, _ = q",
|
2239
|
+
"ParseTree" => s(:masgn,
|
2240
|
+
s(:array,
|
2241
|
+
s(:attrasgn,
|
2242
|
+
s(:call, nil, :a),
|
2243
|
+
:b=),
|
2244
|
+
s(:attrasgn,
|
2245
|
+
s(:call, nil, :a),
|
2246
|
+
:c=),
|
2247
|
+
s(:lasgn, :_)),
|
2248
|
+
s(:to_ary,
|
2249
|
+
s(:call, nil, :q))))
|
2250
|
+
|
2251
|
+
add_tests("masgn_attrasgn_idx",
|
2252
|
+
"Ruby" => "a, i, j = [], 1, 2\na[i], a[j] = a[j], a[i]\n",
|
2253
|
+
"ParseTree" => s(:block,
|
2254
|
+
s(:masgn,
|
2255
|
+
s(:array,
|
2256
|
+
s(:lasgn, :a),
|
2257
|
+
s(:lasgn, :i), s(:lasgn, :j)),
|
2258
|
+
s(:array, s(:array), s(:lit, 1), s(:lit, 2))),
|
2259
|
+
s(:masgn,
|
2260
|
+
s(:array,
|
2261
|
+
s(:attrasgn,
|
2262
|
+
s(:lvar, :a), :[]=, s(:lvar, :i)),
|
2263
|
+
s(:attrasgn,
|
2264
|
+
s(:lvar, :a), :[]=, s(:lvar, :j))),
|
2265
|
+
s(:array,
|
2266
|
+
s(:call,
|
2267
|
+
s(:lvar, :a), :[], s(:lvar, :j)),
|
2268
|
+
s(:call,
|
2269
|
+
s(:lvar, :a), :[], s(:lvar, :i))))))
|
2270
|
+
|
2271
|
+
add_tests("masgn_cdecl",
|
2272
|
+
"Ruby" => "A, B, C = 1, 2, 3",
|
2273
|
+
"ParseTree" => s(:masgn,
|
2274
|
+
s(:array, s(:cdecl, :A), s(:cdecl, :B),
|
2275
|
+
s(:cdecl, :C)),
|
2276
|
+
s(:array, s(:lit, 1), s(:lit, 2), s(:lit, 3))))
|
2277
|
+
|
2278
|
+
add_tests("masgn_iasgn",
|
2279
|
+
"Ruby" => "a, @b = c, d",
|
2280
|
+
"ParseTree" => s(:masgn,
|
2281
|
+
s(:array, s(:lasgn, :a), s(:iasgn, :"@b")),
|
2282
|
+
s(:array,
|
2283
|
+
s(:call, nil, :c),
|
2284
|
+
s(:call, nil, :d))))
|
2285
|
+
|
2286
|
+
add_tests("masgn_masgn",
|
2287
|
+
"Ruby" => "a, (b, c) = [1, [2, 3]]",
|
2288
|
+
"ParseTree" => s(:masgn,
|
2289
|
+
s(:array,
|
2290
|
+
s(:lasgn, :a),
|
2291
|
+
s(:masgn,
|
2292
|
+
s(:array,
|
2293
|
+
s(:lasgn, :b),
|
2294
|
+
s(:lasgn, :c)))),
|
2295
|
+
s(:to_ary,
|
2296
|
+
s(:array,
|
2297
|
+
s(:lit, 1),
|
2298
|
+
s(:array,
|
2299
|
+
s(:lit, 2),
|
2300
|
+
s(:lit, 3))))))
|
2301
|
+
|
2302
|
+
add_tests("masgn_splat_lhs",
|
2303
|
+
"Ruby" => "a, b, *c = d, e, f, g",
|
2304
|
+
"ParseTree" => s(:masgn,
|
2305
|
+
s(:array,
|
2306
|
+
s(:lasgn, :a),
|
2307
|
+
s(:lasgn, :b),
|
2308
|
+
s(:splat, s(:lasgn, :c))),
|
2309
|
+
s(:array,
|
2310
|
+
s(:call, nil, :d),
|
2311
|
+
s(:call, nil, :e),
|
2312
|
+
s(:call, nil, :f),
|
2313
|
+
s(:call, nil, :g))))
|
2314
|
+
|
2315
|
+
add_tests("masgn_splat_no_name_to_ary",
|
2316
|
+
"Ruby" => "a, b, * = c",
|
2317
|
+
"ParseTree" => s(:masgn,
|
2318
|
+
s(:array,
|
2319
|
+
s(:lasgn, :a),
|
2320
|
+
s(:lasgn, :b),
|
2321
|
+
s(:splat)),
|
2322
|
+
s(:to_ary, s(:call, nil, :c))))
|
2323
|
+
|
2324
|
+
add_tests("masgn_splat_no_name_trailing",
|
2325
|
+
"Ruby" => "a, b, = c",
|
2326
|
+
"ParseTree" => s(:masgn,
|
2327
|
+
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
2328
|
+
s(:to_ary, s(:call, nil, :c))),
|
2329
|
+
"Ruby2Ruby" => "a, b = c") # TODO: check this is right
|
2330
|
+
|
2331
|
+
add_tests("masgn_splat_rhs_1",
|
2332
|
+
"Ruby" => "a, b = *c",
|
2333
|
+
"ParseTree" => s(:masgn,
|
2334
|
+
s(:array,
|
2335
|
+
s(:lasgn, :a),
|
2336
|
+
s(:lasgn, :b)),
|
2337
|
+
s(:splat, s(:call, nil, :c))))
|
2338
|
+
|
2339
|
+
add_tests("masgn_splat_rhs_n",
|
2340
|
+
"Ruby" => "a, b = c, d, *e",
|
2341
|
+
"ParseTree" => s(:masgn,
|
2342
|
+
s(:array,
|
2343
|
+
s(:lasgn, :a),
|
2344
|
+
s(:lasgn, :b)),
|
2345
|
+
s(:array,
|
2346
|
+
s(:call, nil, :c),
|
2347
|
+
s(:call, nil, :d),
|
2348
|
+
s(:splat, s(:call, nil, :e)))))
|
2349
|
+
|
2350
|
+
add_tests("masgn_splat_to_ary",
|
2351
|
+
"Ruby" => "a, b, *c = d",
|
2352
|
+
"ParseTree" => s(:masgn,
|
2353
|
+
s(:array,
|
2354
|
+
s(:lasgn, :a),
|
2355
|
+
s(:lasgn, :b),
|
2356
|
+
s(:splat, s(:lasgn, :c))),
|
2357
|
+
s(:to_ary, s(:call, nil, :d))))
|
2358
|
+
|
2359
|
+
add_tests("masgn_splat_to_ary2",
|
2360
|
+
"Ruby" => "a, b, *c = d.e(\"f\")",
|
2361
|
+
"ParseTree" => s(:masgn,
|
2362
|
+
s(:array,
|
2363
|
+
s(:lasgn, :a),
|
2364
|
+
s(:lasgn, :b),
|
2365
|
+
s(:splat, s(:lasgn, :c))),
|
2366
|
+
s(:to_ary,
|
2367
|
+
s(:call,
|
2368
|
+
s(:call, nil, :d),
|
2369
|
+
:e,
|
2370
|
+
s(:str, 'f')))))
|
2371
|
+
|
2372
|
+
add_tests("match",
|
2373
|
+
"Ruby" => "1 if /x/",
|
2374
|
+
"ParseTree" => s(:if, s(:match, s(:lit, /x/)), s(:lit, 1), nil))
|
2375
|
+
|
2376
|
+
add_tests("match2",
|
2377
|
+
"Ruby" => "/x/ =~ \"blah\"",
|
2378
|
+
"ParseTree" => s(:match2, s(:lit, /x/), s(:str, "blah")))
|
2379
|
+
|
2380
|
+
add_tests("match3",
|
2381
|
+
"Ruby" => "\"blah\" =~ /x/",
|
2382
|
+
"ParseTree" => s(:match3, s(:lit, /x/), s(:str, "blah")))
|
2383
|
+
|
2384
|
+
add_tests("module",
|
2385
|
+
"Ruby" => "module X\n def y\n # do nothing\n end\nend",
|
2386
|
+
"ParseTree" => s(:module, :X,
|
2387
|
+
s(:defn, :y, s(:args), s(:nil))))
|
2388
|
+
|
2389
|
+
add_tests("module2",
|
2390
|
+
"Ruby" => "module X\n def y\n # do nothing\n end\n \n def z\n # do nothing\n end\nend",
|
2391
|
+
"ParseTree" => s(:module, :X,
|
2392
|
+
s(:defn, :y, s(:args), s(:nil)),
|
2393
|
+
s(:defn, :z, s(:args), s(:nil))))
|
2394
|
+
|
2395
|
+
add_tests("module_scoped",
|
2396
|
+
"Ruby" => "module X::Y\n c\nend",
|
2397
|
+
"ParseTree" => s(:module, s(:colon2, s(:const, :X), :Y),
|
2398
|
+
s(:call, nil, :c)))
|
2399
|
+
|
2400
|
+
add_tests("module_scoped3",
|
2401
|
+
"Ruby" => "module ::Y\n c\nend",
|
2402
|
+
"ParseTree" => s(:module, s(:colon3, :Y),
|
2403
|
+
s(:call, nil, :c)))
|
2404
|
+
|
2405
|
+
add_tests("next",
|
2406
|
+
"Ruby" => "loop { next if false }",
|
2407
|
+
"ParseTree" => s(:iter,
|
2408
|
+
s(:call, nil, :loop),
|
2409
|
+
0,
|
2410
|
+
s(:if, s(:false), s(:next), nil)))
|
2411
|
+
|
2412
|
+
add_tests("next_arg",
|
2413
|
+
"Ruby" => "loop { next 42 if false }",
|
2414
|
+
"ParseTree" => s(:iter,
|
2415
|
+
s(:call, nil, :loop),
|
2416
|
+
0,
|
2417
|
+
s(:if, s(:false), s(:next, s(:lit, 42)), nil)))
|
2418
|
+
|
2419
|
+
add_tests("nth_ref",
|
2420
|
+
"Ruby" => "$1",
|
2421
|
+
"ParseTree" => s(:nth_ref, 1))
|
2422
|
+
|
2423
|
+
add_tests("op_asgn1",
|
2424
|
+
"Ruby" => "b = []\nb[1] ||= 10\nb[2] &&= 11\nb[3] += 12\n",
|
2425
|
+
"ParseTree" => s(:block,
|
2426
|
+
s(:lasgn, :b, s(:array)),
|
2427
|
+
s(:op_asgn1, s(:lvar, :b),
|
2428
|
+
s(:arglist, s(:lit, 1)), :"||", s(:lit, 10)),
|
2429
|
+
s(:op_asgn1, s(:lvar, :b),
|
2430
|
+
s(:arglist, s(:lit, 2)), :"&&", s(:lit, 11)),
|
2431
|
+
s(:op_asgn1, s(:lvar, :b),
|
2432
|
+
s(:arglist, s(:lit, 3)), :+, s(:lit, 12))))
|
2433
|
+
|
2434
|
+
add_tests("op_asgn1_ivar",
|
2435
|
+
"Ruby" => "@b = []\n@b[1] ||= 10\n@b[2] &&= 11\n@b[3] += 12\n",
|
2436
|
+
"ParseTree" => s(:block,
|
2437
|
+
s(:iasgn, :@b, s(:array)),
|
2438
|
+
s(:op_asgn1, s(:ivar, :@b),
|
2439
|
+
s(:arglist, s(:lit, 1)), :"||", s(:lit, 10)),
|
2440
|
+
s(:op_asgn1, s(:ivar, :@b),
|
2441
|
+
s(:arglist, s(:lit, 2)), :"&&", s(:lit, 11)),
|
2442
|
+
s(:op_asgn1, s(:ivar, :@b),
|
2443
|
+
s(:arglist, s(:lit, 3)), :+, s(:lit, 12))))
|
2444
|
+
|
2445
|
+
add_tests("op_asgn2",
|
2446
|
+
"Ruby" => "s = Struct.new(:var)\nc = s.new(nil)\nc.var ||= 20\nc.var &&= 21\nc.var += 22\nc.d.e.f ||= 42\n",
|
2447
|
+
"ParseTree" => s(:block,
|
2448
|
+
s(:lasgn, :s,
|
2449
|
+
s(:call,
|
2450
|
+
s(:const, :Struct),
|
2451
|
+
:new,
|
2452
|
+
s(:lit, :var))),
|
2453
|
+
s(:lasgn, :c,
|
2454
|
+
s(:call, s(:lvar, :s), :new, s(:nil))),
|
2455
|
+
s(:op_asgn2, s(:lvar, :c),
|
2456
|
+
:var=, :"||", s(:lit, 20)),
|
2457
|
+
s(:op_asgn2, s(:lvar, :c),
|
2458
|
+
:var=, :"&&", s(:lit, 21)),
|
2459
|
+
s(:op_asgn2, s(:lvar, :c),
|
2460
|
+
:var=, :+, s(:lit, 22)),
|
2461
|
+
s(:op_asgn2,
|
2462
|
+
s(:call,
|
2463
|
+
s(:call, s(:lvar, :c), :d),
|
2464
|
+
:e),
|
2465
|
+
:f=, :"||", s(:lit, 42))))
|
2466
|
+
|
2467
|
+
add_tests("op_asgn2_self",
|
2468
|
+
"Ruby" => "self.Bag ||= Bag.new",
|
2469
|
+
"ParseTree" => s(:op_asgn2, s(:self), :"Bag=", :"||",
|
2470
|
+
s(:call, s(:const, :Bag), :new)))
|
2471
|
+
|
2472
|
+
add_tests("op_asgn_and",
|
2473
|
+
"Ruby" => "a = 0\na &&= 2\n",
|
2474
|
+
"ParseTree" => s(:block,
|
2475
|
+
s(:lasgn, :a, s(:lit, 0)),
|
2476
|
+
s(:op_asgn_and,
|
2477
|
+
s(:lvar, :a), s(:lasgn, :a, s(:lit, 2)))))
|
2478
|
+
|
2479
|
+
add_tests("op_asgn_and_ivar2",
|
2480
|
+
"Ruby" => "@fetcher &&= new(Gem.configuration[:http_proxy])",
|
2481
|
+
"ParseTree" => s(:op_asgn_and,
|
2482
|
+
s(:ivar, :@fetcher),
|
2483
|
+
s(:iasgn,
|
2484
|
+
:@fetcher,
|
2485
|
+
s(:call, nil,
|
2486
|
+
:new,
|
2487
|
+
s(:call,
|
2488
|
+
s(:call, s(:const, :Gem), :configuration),
|
2489
|
+
:[],
|
2490
|
+
s(:lit, :http_proxy))))))
|
2491
|
+
|
2492
|
+
add_tests("op_asgn_or",
|
2493
|
+
"Ruby" => "a = 0\na ||= 1\n",
|
2494
|
+
"ParseTree" => s(:block,
|
2495
|
+
s(:lasgn, :a, s(:lit, 0)),
|
2496
|
+
s(:op_asgn_or,
|
2497
|
+
s(:lvar, :a), s(:lasgn, :a, s(:lit, 1)))))
|
2498
|
+
|
2499
|
+
add_tests("op_asgn_or_block",
|
2500
|
+
"Ruby" => "a ||= begin\n b\n rescue\n c\n end",
|
2501
|
+
"ParseTree" => s(:op_asgn_or,
|
2502
|
+
s(:lvar, :a),
|
2503
|
+
s(:lasgn, :a,
|
2504
|
+
s(:rescue,
|
2505
|
+
s(:call, nil, :b),
|
2506
|
+
s(:resbody, s(:array),
|
2507
|
+
s(:call, nil, :c))))),
|
2508
|
+
"Ruby2Ruby" => "a ||= b rescue c")
|
2509
|
+
|
2510
|
+
add_tests("op_asgn_or_ivar",
|
2511
|
+
"Ruby" => "@v ||= {}",
|
2512
|
+
"ParseTree" => s(:op_asgn_or,
|
2513
|
+
s(:ivar, :@v),
|
2514
|
+
s(:iasgn, :@v, s(:hash))))
|
2515
|
+
|
2516
|
+
add_tests("op_asgn_or_ivar2",
|
2517
|
+
"Ruby" => "@fetcher ||= new(Gem.configuration[:http_proxy])",
|
2518
|
+
"ParseTree" => s(:op_asgn_or,
|
2519
|
+
s(:ivar, :@fetcher),
|
2520
|
+
s(:iasgn,
|
2521
|
+
:@fetcher,
|
2522
|
+
s(:call, nil, :new,
|
2523
|
+
s(:call,
|
2524
|
+
s(:call, s(:const, :Gem), :configuration),
|
2525
|
+
:[],
|
2526
|
+
s(:lit, :http_proxy))))))
|
2527
|
+
|
2528
|
+
add_tests("or",
|
2529
|
+
"Ruby" => "(a or b)",
|
2530
|
+
"ParseTree" => s(:or,
|
2531
|
+
s(:call, nil, :a),
|
2532
|
+
s(:call, nil, :b)))
|
2533
|
+
|
2534
|
+
add_tests("or_big",
|
2535
|
+
"Ruby" => "((a or b) or (c and d))",
|
2536
|
+
"ParseTree" => s(:or,
|
2537
|
+
s(:or,
|
2538
|
+
s(:call, nil, :a),
|
2539
|
+
s(:call, nil, :b)),
|
2540
|
+
s(:and,
|
2541
|
+
s(:call, nil, :c),
|
2542
|
+
s(:call, nil, :d))))
|
2543
|
+
|
2544
|
+
add_tests("or_big2",
|
2545
|
+
"Ruby" => "((a || b) || (c && d))",
|
2546
|
+
"ParseTree" => s(:or,
|
2547
|
+
s(:or,
|
2548
|
+
s(:call, nil, :a),
|
2549
|
+
s(:call, nil, :b)),
|
2550
|
+
s(:and,
|
2551
|
+
s(:call, nil, :c),
|
2552
|
+
s(:call, nil, :d))),
|
2553
|
+
"Ruby2Ruby" => "((a or b) or (c and d))")
|
2554
|
+
|
2555
|
+
add_tests("parse_floats_as_args",
|
2556
|
+
"Ruby" => "def x(a=0.0,b=0.0)\n a+b\nend",
|
2557
|
+
"ParseTree" => s(:defn, :x,
|
2558
|
+
s(:args,
|
2559
|
+
s(:lasgn, :a, s(:lit, 0.0)),
|
2560
|
+
s(:lasgn, :b, s(:lit, 0.0))),
|
2561
|
+
s(:call, s(:lvar, :a), :+, s(:lvar, :b))),
|
2562
|
+
"Ruby2Ruby" => "def x(a = 0.0, b = 0.0)\n (a + b)\nend")
|
2563
|
+
|
2564
|
+
add_tests("postexe",
|
2565
|
+
"Ruby" => "END { 1 }",
|
2566
|
+
"ParseTree" => s(:iter, s(:postexe), 0, s(:lit, 1)))
|
2567
|
+
|
2568
|
+
add_tests("proc_args_0",
|
2569
|
+
"Ruby" => "proc { || (x + 1) }",
|
2570
|
+
"ParseTree" => s(:iter,
|
2571
|
+
s(:call, nil, :proc),
|
2572
|
+
s(:args),
|
2573
|
+
s(:call, s(:call, nil, :x), :+, s(:lit, 1))))
|
2574
|
+
|
2575
|
+
add_tests("proc_args_1",
|
2576
|
+
"Ruby" => "proc { |x| (x + 1) }",
|
2577
|
+
"ParseTree" => s(:iter,
|
2578
|
+
s(:call, nil, :proc),
|
2579
|
+
s(:args, :x),
|
2580
|
+
s(:call, s(:lvar, :x), :+, s(:lit, 1))))
|
2581
|
+
|
2582
|
+
add_tests("proc_args_2",
|
2583
|
+
"Ruby" => "proc { |x, y| (x + y) }",
|
2584
|
+
"ParseTree" => s(:iter,
|
2585
|
+
s(:call, nil, :proc),
|
2586
|
+
s(:args, :x, :y),
|
2587
|
+
s(:call, s(:lvar, :x), :+, s(:lvar, :y))))
|
2588
|
+
|
2589
|
+
add_tests("proc_args_no",
|
2590
|
+
"Ruby" => "proc { (x + 1) }",
|
2591
|
+
"ParseTree" => s(:iter,
|
2592
|
+
s(:call, nil, :proc),
|
2593
|
+
0,
|
2594
|
+
s(:call, s(:call, nil, :x), :+, s(:lit, 1))))
|
2595
|
+
|
2596
|
+
add_tests("redo",
|
2597
|
+
"Ruby" => "loop { redo if false }",
|
2598
|
+
"ParseTree" => s(:iter,
|
2599
|
+
s(:call, nil, :loop),
|
2600
|
+
0,
|
2601
|
+
s(:if, s(:false), s(:redo), nil)))
|
2602
|
+
|
2603
|
+
add_tests("rescue", # TODO: need a resbody w/ multiple classes and a splat
|
2604
|
+
"Ruby" => "blah rescue nil",
|
2605
|
+
"ParseTree" => s(:rescue,
|
2606
|
+
s(:call, nil, :blah),
|
2607
|
+
s(:resbody, s(:array), s(:nil))))
|
2608
|
+
|
2609
|
+
add_tests("rescue_block_body",
|
2610
|
+
"Ruby" => "begin\n a\nrescue => e\n c\n d\nend",
|
2611
|
+
"ParseTree" => s(:rescue,
|
2612
|
+
s(:call, nil, :a),
|
2613
|
+
s(:resbody,
|
2614
|
+
s(:array, s(:lasgn, :e, s(:gvar, :$!))),
|
2615
|
+
s(:call, nil, :c),
|
2616
|
+
s(:call, nil, :d))))
|
2617
|
+
|
2618
|
+
add_tests("rescue_block_body_3",
|
2619
|
+
"Ruby" => "begin\n a\nrescue A\n b\nrescue B\n c\nrescue C\n d\nend",
|
2620
|
+
"ParseTree" => s(:rescue,
|
2621
|
+
s(:call, nil, :a),
|
2622
|
+
s(:resbody, s(:array, s(:const, :A)),
|
2623
|
+
s(:call, nil, :b)),
|
2624
|
+
s(:resbody, s(:array, s(:const, :B)),
|
2625
|
+
s(:call, nil, :c)),
|
2626
|
+
s(:resbody, s(:array, s(:const, :C)),
|
2627
|
+
s(:call, nil, :d))))
|
2628
|
+
|
2629
|
+
add_tests("rescue_block_body_ivar",
|
2630
|
+
"Ruby" => "begin\n a\nrescue => @e\n c\n d\nend",
|
2631
|
+
"ParseTree" => s(:rescue,
|
2632
|
+
s(:call, nil, :a),
|
2633
|
+
s(:resbody,
|
2634
|
+
s(:array, s(:iasgn, :@e, s(:gvar, :$!))),
|
2635
|
+
s(:call, nil, :c),
|
2636
|
+
s(:call, nil, :d))))
|
2637
|
+
|
2638
|
+
add_tests("rescue_block_nada",
|
2639
|
+
"Ruby" => "begin\n blah\nrescue\n # do nothing\nend",
|
2640
|
+
"ParseTree" => s(:rescue,
|
2641
|
+
s(:call, nil, :blah),
|
2642
|
+
s(:resbody, s(:array), nil)))
|
2643
|
+
|
2644
|
+
add_tests("rescue_exceptions",
|
2645
|
+
"Ruby" => "begin\n blah\nrescue RuntimeError => r\n # do nothing\nend",
|
2646
|
+
"ParseTree" => s(:rescue,
|
2647
|
+
s(:call, nil, :blah),
|
2648
|
+
s(:resbody,
|
2649
|
+
s(:array,
|
2650
|
+
s(:const, :RuntimeError),
|
2651
|
+
s(:lasgn, :r, s(:gvar, :$!))),
|
2652
|
+
nil)))
|
2653
|
+
|
2654
|
+
add_tests("rescue_iasgn_var_empty",
|
2655
|
+
"Ruby" => "begin\n 1\nrescue => @e\n # do nothing\nend",
|
2656
|
+
"ParseTree" => s(:rescue,
|
2657
|
+
s(:lit, 1),
|
2658
|
+
s(:resbody,
|
2659
|
+
s(:array, s(:iasgn, :@e, s(:gvar, :$!))),
|
2660
|
+
nil)))
|
2661
|
+
|
2662
|
+
add_tests("rescue_lasgn",
|
2663
|
+
"Ruby" => "begin\n 1\nrescue\n var = 2\nend",
|
2664
|
+
"ParseTree" => s(:rescue,
|
2665
|
+
s(:lit, 1),
|
2666
|
+
s(:resbody,
|
2667
|
+
s(:array),
|
2668
|
+
s(:lasgn, :var, s(:lit, 2)))),
|
2669
|
+
"Ruby2Ruby" => "1 rescue var = 2")
|
2670
|
+
|
2671
|
+
add_tests("rescue_lasgn_var",
|
2672
|
+
"Ruby" => "begin\n 1\nrescue => e\n var = 2\nend",
|
2673
|
+
"ParseTree" => s(:rescue,
|
2674
|
+
s(:lit, 1),
|
2675
|
+
s(:resbody,
|
2676
|
+
s(:array, s(:lasgn, :e, s(:gvar, :$!))),
|
2677
|
+
s(:lasgn, :var, s(:lit, 2)))))
|
2678
|
+
|
2679
|
+
add_tests("rescue_lasgn_var_empty",
|
2680
|
+
"Ruby" => "begin\n 1\nrescue => e\n # do nothing\nend",
|
2681
|
+
"ParseTree" => s(:rescue,
|
2682
|
+
s(:lit, 1),
|
2683
|
+
s(:resbody,
|
2684
|
+
s(:array, s(:lasgn, :e, s(:gvar, :$!))),
|
2685
|
+
nil)))
|
2686
|
+
|
2687
|
+
add_tests("retry",
|
2688
|
+
"Ruby" => "retry",
|
2689
|
+
"ParseTree" => s(:retry))
|
2690
|
+
|
2691
|
+
add_tests("return_0",
|
2692
|
+
"Ruby" => "return",
|
2693
|
+
"ParseTree" => s(:return))
|
2694
|
+
|
2695
|
+
add_tests("return_1",
|
2696
|
+
"Ruby" => "return 1",
|
2697
|
+
"ParseTree" => s(:return, s(:lit, 1)))
|
2698
|
+
|
2699
|
+
add_tests("return_1_splatted",
|
2700
|
+
"Ruby" => "return *1",
|
2701
|
+
"ParseTree" => s(:return, s(:svalue, s(:splat, s(:lit, 1)))))
|
2702
|
+
|
2703
|
+
add_tests("return_n",
|
2704
|
+
"Ruby" => "return 1, 2, 3",
|
2705
|
+
"ParseTree" => s(:return, s(:array,
|
2706
|
+
s(:lit, 1), s(:lit, 2), s(:lit, 3))),
|
2707
|
+
"Ruby2Ruby" => "return [1, 2, 3]")
|
2708
|
+
|
2709
|
+
add_tests("sclass",
|
2710
|
+
"Ruby" => "class << self\n 42\nend",
|
2711
|
+
"ParseTree" => s(:sclass, s(:self), s(:lit, 42)))
|
2712
|
+
|
2713
|
+
add_tests("sclass_multiple",
|
2714
|
+
"Ruby" => "class << self\n x\n y\nend",
|
2715
|
+
"ParseTree" => s(:sclass, s(:self),
|
2716
|
+
s(:call, nil, :x), s(:call, nil, :y)))
|
2717
|
+
|
2718
|
+
add_tests("sclass_trailing_class",
|
2719
|
+
"Ruby" => "class A\n class << self\n a\n end\n \n class B\n end\nend",
|
2720
|
+
"ParseTree" => s(:class, :A, nil,
|
2721
|
+
s(:sclass, s(:self),
|
2722
|
+
s(:call, nil, :a)),
|
2723
|
+
s(:class, :B, nil)))
|
2724
|
+
|
2725
|
+
add_tests("splat",
|
2726
|
+
"Ruby" => "def x(*b)\n a(*b)\nend",
|
2727
|
+
"ParseTree" => s(:defn, :x,
|
2728
|
+
s(:args, :"*b"),
|
2729
|
+
s(:call, nil, :a, s(:splat, s(:lvar, :b)))))
|
2730
|
+
|
2731
|
+
add_tests("splat_array",
|
2732
|
+
"Ruby" => "[*[1]]",
|
2733
|
+
"ParseTree" => s(:array, s(:splat, s(:array, s(:lit, 1)))))
|
2734
|
+
|
2735
|
+
add_tests("splat_break",
|
2736
|
+
"Ruby" => "break *[1]",
|
2737
|
+
"ParseTree" => s(:break, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
2738
|
+
|
2739
|
+
add_tests("splat_break_array",
|
2740
|
+
"Ruby" => "break [*[1]]",
|
2741
|
+
"ParseTree" => s(:break, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2742
|
+
|
2743
|
+
add_tests("splat_fcall",
|
2744
|
+
"Ruby" => "meth(*[1])",
|
2745
|
+
"ParseTree" => s(:call,
|
2746
|
+
nil,
|
2747
|
+
:meth,
|
2748
|
+
s(:splat, s(:array, s(:lit, 1)))))
|
2749
|
+
|
2750
|
+
add_tests("splat_fcall_array",
|
2751
|
+
"Ruby" => "meth([*[1]])",
|
2752
|
+
"ParseTree" => s(:call, nil, :meth,
|
2753
|
+
s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2754
|
+
|
2755
|
+
add_tests("splat_lasgn",
|
2756
|
+
"Ruby" => "x = *[1]",
|
2757
|
+
"ParseTree" => s(:lasgn, :x, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
2758
|
+
|
2759
|
+
add_tests("splat_lasgn_array",
|
2760
|
+
"Ruby" => "x = [*[1]]",
|
2761
|
+
"ParseTree" => s(:lasgn, :x, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2762
|
+
|
2763
|
+
add_tests("splat_lit_1",
|
2764
|
+
"Ruby" => "[*1]",
|
2765
|
+
# UGH - damn MRI
|
2766
|
+
"ParseTree" => s(:array, s(:splat, s(:lit, 1))))
|
2767
|
+
|
2768
|
+
add_tests("splat_lit_n",
|
2769
|
+
"Ruby" => "[1, *2]",
|
2770
|
+
"ParseTree" => s(:array, s(:lit, 1), s(:splat, s(:lit, 2))))
|
2771
|
+
|
2772
|
+
add_tests("splat_next",
|
2773
|
+
"Ruby" => "next *[1]",
|
2774
|
+
"ParseTree" => s(:next, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
2775
|
+
|
2776
|
+
add_tests("splat_next_array",
|
2777
|
+
"Ruby" => "next [*[1]]",
|
2778
|
+
"ParseTree" => s(:next, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2779
|
+
|
2780
|
+
add_tests("splat_return",
|
2781
|
+
"Ruby" => "return *[1]",
|
2782
|
+
"ParseTree" => s(:return, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
2783
|
+
|
2784
|
+
add_tests("splat_return_array",
|
2785
|
+
"Ruby" => "return [*[1]]",
|
2786
|
+
"ParseTree" => s(:return, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2787
|
+
|
2788
|
+
add_tests("splat_super",
|
2789
|
+
"Ruby" => "super(*[1])",
|
2790
|
+
"ParseTree" => s(:super, s(:splat, s(:array, s(:lit, 1)))))
|
2791
|
+
|
2792
|
+
add_tests("splat_super_array",
|
2793
|
+
"Ruby" => "super([*[1]])",
|
2794
|
+
"ParseTree" => s(:super, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2795
|
+
|
2796
|
+
add_tests("splat_yield",
|
2797
|
+
"Ruby" => "yield(*[1])",
|
2798
|
+
"ParseTree" => s(:yield, s(:splat, s(:array, s(:lit, 1)))))
|
2799
|
+
|
2800
|
+
add_tests("splat_yield_array",
|
2801
|
+
"Ruby" => "yield([*[1]])",
|
2802
|
+
"ParseTree" => s(:yield, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
2803
|
+
|
2804
|
+
add_tests("str",
|
2805
|
+
"Ruby" => '"x"',
|
2806
|
+
"ParseTree" => s(:str, "x"))
|
2807
|
+
|
2808
|
+
add_tests("str_concat_newline", # FIX? make prettier? possible?
|
2809
|
+
"Ruby" => '"before" \\
|
2810
|
+
" after"',
|
2811
|
+
"ParseTree" => s(:str, "before after"),
|
2812
|
+
"Ruby2Ruby" => '"before after"')
|
2813
|
+
|
2814
|
+
add_tests("str_concat_space",
|
2815
|
+
"Ruby" => '"before" " after"',
|
2816
|
+
"ParseTree" => s(:str, "before after"),
|
2817
|
+
"Ruby2Ruby" => '"before after"')
|
2818
|
+
|
2819
|
+
add_tests("str_heredoc",
|
2820
|
+
"Ruby" => "<<'EOM'\n blah\nblah\nEOM",
|
2821
|
+
"ParseTree" => s(:str, " blah\nblah\n"),
|
2822
|
+
"Ruby2Ruby" => "\" blah\\nblah\\n\"")
|
2823
|
+
|
2824
|
+
add_tests("str_heredoc_call",
|
2825
|
+
"Ruby" => "<<'EOM'.strip\n blah\nblah\nEOM",
|
2826
|
+
"ParseTree" => s(:call, s(:str, " blah\nblah\n"),
|
2827
|
+
:strip),
|
2828
|
+
"Ruby2Ruby" => "\" blah\\nblah\\n\".strip")
|
2829
|
+
|
2830
|
+
add_tests("str_heredoc_double",
|
2831
|
+
"Ruby" => "a += <<-H1 + b + <<-H2\n first\nH1\n second\nH2",
|
2832
|
+
"ParseTree" => s(:lasgn, :a,
|
2833
|
+
s(:call,
|
2834
|
+
s(:lvar, :a),
|
2835
|
+
:+,
|
2836
|
+
s(:call,
|
2837
|
+
s(:call,
|
2838
|
+
s(:str, " first\n"),
|
2839
|
+
:+,
|
2840
|
+
s(:call, nil, :b)),
|
2841
|
+
:+,
|
2842
|
+
s(:str, " second\n")))),
|
2843
|
+
"Ruby2Ruby" => "a = (a + ((\" first\\n\" + b) + \" second\\n\"))")
|
2844
|
+
|
2845
|
+
add_tests("str_heredoc_empty", # yes... tarded
|
2846
|
+
"Ruby" => "<<'EOM'\nEOM",
|
2847
|
+
"ParseTree" => s(:str, ""),
|
2848
|
+
"Ruby2Ruby" => '""')
|
2849
|
+
|
2850
|
+
add_tests("str_heredoc_indent",
|
2851
|
+
"Ruby" => "<<-EOM\n blah\nblah\n\n EOM",
|
2852
|
+
"ParseTree" => s(:str, " blah\nblah\n\n"),
|
2853
|
+
"Ruby2Ruby" => "\" blah\\nblah\\n\\n\"")
|
2854
|
+
|
2855
|
+
add_tests("str_interp_file",
|
2856
|
+
"Ruby" => '"file = #{__FILE__}\n"',
|
2857
|
+
"ParseTree" => s(:str, "file = (string)\n"),
|
2858
|
+
"Ruby2Ruby" => '"file = (string)\\n"')
|
2859
|
+
|
2860
|
+
add_tests("structure_extra_block_for_dvar_scoping",
|
2861
|
+
"Ruby" => "a.b do |c, d|\n unless e.f(c) then\n g = false\n d.h { |x, i| g = true }\n end\nend",
|
2862
|
+
"ParseTree" => s(:iter,
|
2863
|
+
s(:call, s(:call, nil, :a), :b),
|
2864
|
+
s(:args, :c, :d),
|
2865
|
+
s(:if,
|
2866
|
+
s(:call, s(:call, nil, :e), :f, s(:lvar, :c)),
|
2867
|
+
nil,
|
2868
|
+
s(:block,
|
2869
|
+
s(:lasgn, :g, s(:false)),
|
2870
|
+
s(:iter,
|
2871
|
+
s(:call, s(:lvar, :d), :h),
|
2872
|
+
s(:args, :x, :i),
|
2873
|
+
s(:lasgn, :g, s(:true)))))))
|
2874
|
+
|
2875
|
+
add_tests("structure_remove_begin_1",
|
2876
|
+
"Ruby" => "a << begin\n b\n rescue\n c\n end",
|
2877
|
+
"ParseTree" => s(:call, s(:call, nil, :a), :<<,
|
2878
|
+
s(:rescue,
|
2879
|
+
s(:call, nil, :b),
|
2880
|
+
s(:resbody, s(:array),
|
2881
|
+
s(:call, nil, :c)))),
|
2882
|
+
"Ruby2Ruby" => "(a << (b rescue c))")
|
2883
|
+
|
2884
|
+
add_tests("structure_remove_begin_2",
|
2885
|
+
"Ruby" => "a = if c\n begin\n b\n rescue\n nil\n end\n end\na",
|
2886
|
+
"ParseTree" => s(:block,
|
2887
|
+
s(:lasgn,
|
2888
|
+
:a,
|
2889
|
+
s(:if, s(:call, nil, :c),
|
2890
|
+
s(:rescue, s(:call, nil, :b),
|
2891
|
+
s(:resbody,
|
2892
|
+
s(:array), s(:nil))),
|
2893
|
+
nil)),
|
2894
|
+
s(:lvar, :a)),
|
2895
|
+
"Ruby2Ruby" => "a = b rescue nil if c\na\n") # OMG that's awesome
|
2896
|
+
|
2897
|
+
add_tests("super_0",
|
2898
|
+
"Ruby" => "def x\n super()\nend",
|
2899
|
+
"ParseTree" => s(:defn, :x, s(:args), s(:super)))
|
2900
|
+
|
2901
|
+
add_tests("super_1",
|
2902
|
+
"Ruby" => "def x\n super(4)\nend",
|
2903
|
+
"ParseTree" => s(:defn, :x, s(:args),
|
2904
|
+
s(:super, s(:lit, 4))))
|
2905
|
+
|
2906
|
+
add_tests("super_1_array",
|
2907
|
+
"Ruby" => "def x\n super([24, 42])\nend",
|
2908
|
+
"ParseTree" => s(:defn, :x, s(:args),
|
2909
|
+
s(:super, s(:array, s(:lit, 24), s(:lit, 42)))))
|
2910
|
+
|
2911
|
+
add_tests("super_block_pass",
|
2912
|
+
"Ruby" => "super(a, &b)",
|
2913
|
+
"ParseTree" => s(:super,
|
2914
|
+
s(:call, nil, :a),
|
2915
|
+
s(:block_pass,
|
2916
|
+
s(:call, nil, :b))))
|
2917
|
+
|
2918
|
+
add_tests("super_block_splat",
|
2919
|
+
"Ruby" => "super(a, *b)",
|
2920
|
+
"ParseTree" => s(:super,
|
2921
|
+
s(:call, nil, :a),
|
2922
|
+
s(:splat, s(:call, nil, :b))))
|
2923
|
+
|
2924
|
+
add_tests("super_n",
|
2925
|
+
"Ruby" => "def x\n super(24, 42)\nend",
|
2926
|
+
"ParseTree" => s(:defn, :x, s(:args),
|
2927
|
+
s(:super, s(:lit, 24), s(:lit, 42))))
|
2928
|
+
|
2929
|
+
add_tests("svalue",
|
2930
|
+
"Ruby" => "a = *b",
|
2931
|
+
"ParseTree" => s(:lasgn, :a,
|
2932
|
+
s(:svalue,
|
2933
|
+
s(:splat, s(:call, nil, :b)))))
|
2934
|
+
|
2935
|
+
add_tests("ternary_nil_no_space",
|
2936
|
+
"Ruby" => "1 ? nil: 1",
|
2937
|
+
"ParseTree" => s(:if, s(:lit, 1), s(:nil), s(:lit, 1)),
|
2938
|
+
"Ruby2Ruby" => "1 ? (nil) : (1)")
|
2939
|
+
|
2940
|
+
add_tests("ternary_symbol_no_spaces",
|
2941
|
+
"Ruby" => "1?:x:1",
|
2942
|
+
"ParseTree" => s(:if, s(:lit, 1), s(:lit, :x), s(:lit, 1)),
|
2943
|
+
"Ruby2Ruby" => "1 ? (:x) : (1)")
|
2944
|
+
|
2945
|
+
add_tests("to_ary",
|
2946
|
+
"Ruby" => "a, b = c",
|
2947
|
+
"ParseTree" => s(:masgn,
|
2948
|
+
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
2949
|
+
s(:to_ary, s(:call, nil, :c))))
|
2950
|
+
|
2951
|
+
add_tests("true",
|
2952
|
+
"Ruby" => "true",
|
2953
|
+
"ParseTree" => s(:true))
|
2954
|
+
|
2955
|
+
add_tests("undef",
|
2956
|
+
"Ruby" => "undef :x",
|
2957
|
+
"ParseTree" => s(:undef, s(:lit, :x)))
|
2958
|
+
|
2959
|
+
add_tests("undef_2",
|
2960
|
+
"Ruby" => "undef :x, :y",
|
2961
|
+
"ParseTree" => s(:block,
|
2962
|
+
s(:undef, s(:lit, :x)),
|
2963
|
+
s(:undef, s(:lit, :y))),
|
2964
|
+
"Ruby2Ruby" => "undef :x\nundef :y\n")
|
2965
|
+
|
2966
|
+
add_tests("undef_3",
|
2967
|
+
"Ruby" => "undef :x, :y, :z",
|
2968
|
+
"ParseTree" => s(:block,
|
2969
|
+
s(:undef, s(:lit, :x)),
|
2970
|
+
s(:undef, s(:lit, :y)),
|
2971
|
+
s(:undef, s(:lit, :z))),
|
2972
|
+
"Ruby2Ruby" => "undef :x\nundef :y\nundef :z\n")
|
2973
|
+
|
2974
|
+
add_tests("undef_block_1",
|
2975
|
+
"Ruby" => "f1\nundef :x\n", # TODO: don't like the extra return
|
2976
|
+
"ParseTree" => s(:block,
|
2977
|
+
s(:call, nil, :f1),
|
2978
|
+
s(:undef, s(:lit, :x))))
|
2979
|
+
|
2980
|
+
add_tests("undef_block_2",
|
2981
|
+
"Ruby" => "f1\nundef :x, :y",
|
2982
|
+
"ParseTree" => s(:block,
|
2983
|
+
s(:call, nil, :f1),
|
2984
|
+
s(:block,
|
2985
|
+
s(:undef, s(:lit, :x)),
|
2986
|
+
s(:undef, s(:lit, :y)))),
|
2987
|
+
"Ruby2Ruby" => "f1\n(undef :x\nundef :y)\n")
|
2988
|
+
|
2989
|
+
add_tests("undef_block_3",
|
2990
|
+
"Ruby" => "f1\nundef :x, :y, :z",
|
2991
|
+
"ParseTree" => s(:block,
|
2992
|
+
s(:call, nil, :f1),
|
2993
|
+
s(:block,
|
2994
|
+
s(:undef, s(:lit, :x)),
|
2995
|
+
s(:undef, s(:lit, :y)),
|
2996
|
+
s(:undef, s(:lit, :z)))),
|
2997
|
+
"Ruby2Ruby" => "f1\n(undef :x\nundef :y\nundef :z)\n")
|
2998
|
+
|
2999
|
+
add_tests("undef_block_3_post",
|
3000
|
+
"Ruby" => "undef :x, :y, :z\nf2",
|
3001
|
+
"ParseTree" => s(:block,
|
3002
|
+
s(:undef, s(:lit, :x)),
|
3003
|
+
s(:undef, s(:lit, :y)),
|
3004
|
+
s(:undef, s(:lit, :z)),
|
3005
|
+
s(:call, nil, :f2)),
|
3006
|
+
"Ruby2Ruby" => "undef :x\nundef :y\nundef :z\nf2\n")
|
3007
|
+
|
3008
|
+
add_tests("undef_block_wtf",
|
3009
|
+
"Ruby" => "f1\nundef :x, :y, :z\nf2",
|
3010
|
+
"ParseTree" => s(:block,
|
3011
|
+
s(:call, nil, :f1),
|
3012
|
+
s(:block,
|
3013
|
+
s(:undef, s(:lit, :x)),
|
3014
|
+
s(:undef, s(:lit, :y)),
|
3015
|
+
s(:undef, s(:lit, :z))),
|
3016
|
+
s(:call, nil, :f2)),
|
3017
|
+
"Ruby2Ruby" => "f1\n(undef :x\nundef :y\nundef :z)\nf2\n")
|
3018
|
+
|
3019
|
+
add_tests("unless_post",
|
3020
|
+
"Ruby" => "a unless b",
|
3021
|
+
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
3022
|
+
s(:call, nil, :a)))
|
3023
|
+
|
3024
|
+
add_tests("unless_pre",
|
3025
|
+
"Ruby" => "unless b then a end",
|
3026
|
+
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
3027
|
+
s(:call, nil, :a)),
|
3028
|
+
"Ruby2Ruby" => "a unless b")
|
3029
|
+
|
3030
|
+
add_tests("until_post",
|
3031
|
+
"Ruby" => "begin\n (1 + 1)\nend until false",
|
3032
|
+
"ParseTree" => s(:until, s(:false),
|
3033
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), false))
|
3034
|
+
|
3035
|
+
add_tests("until_pre",
|
3036
|
+
"Ruby" => "until false do\n (1 + 1)\nend",
|
3037
|
+
"ParseTree" => s(:until, s(:false),
|
3038
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true))
|
3039
|
+
|
3040
|
+
add_tests("until_pre_mod",
|
3041
|
+
"Ruby" => "(1 + 1) until false",
|
3042
|
+
"ParseTree" => s(:until, s(:false),
|
3043
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
3044
|
+
"Ruby2Ruby" => "until false do\n (1 + 1)\nend")
|
3045
|
+
|
3046
|
+
add_tests("valias",
|
3047
|
+
"Ruby" => "alias $y $x",
|
3048
|
+
"ParseTree" => s(:valias, :$y, :$x))
|
3049
|
+
|
3050
|
+
add_tests("vcall",
|
3051
|
+
"Ruby" => "method",
|
3052
|
+
"ParseTree" => s(:call, nil, :method))
|
3053
|
+
|
3054
|
+
add_tests("while_post",
|
3055
|
+
"Ruby" => "begin\n (1 + 1)\nend while false",
|
3056
|
+
"ParseTree" => s(:while, s(:false),
|
3057
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), false))
|
3058
|
+
|
3059
|
+
add_tests("while_post2",
|
3060
|
+
"Ruby" => "begin\n (1 + 2)\n (3 + 4)\nend while false",
|
3061
|
+
"ParseTree" => s(:while, s(:false),
|
3062
|
+
s(:block,
|
3063
|
+
s(:call, s(:lit, 1), :+, s(:lit, 2)),
|
3064
|
+
s(:call, s(:lit, 3), :+, s(:lit, 4))),
|
3065
|
+
false))
|
3066
|
+
|
3067
|
+
add_tests("while_pre",
|
3068
|
+
"Ruby" => "while false do\n (1 + 1)\nend",
|
3069
|
+
"ParseTree" => s(:while, s(:false),
|
3070
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true))
|
3071
|
+
|
3072
|
+
add_tests("while_pre_mod",
|
3073
|
+
"Ruby" => "(1 + 1) while false",
|
3074
|
+
"ParseTree" => s(:while, s(:false),
|
3075
|
+
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
3076
|
+
"Ruby2Ruby" => "while false do\n (1 + 1)\nend") # FIX can be one liner
|
3077
|
+
|
3078
|
+
add_tests("while_pre_nil",
|
3079
|
+
"Ruby" => "while false do\nend",
|
3080
|
+
"ParseTree" => s(:while, s(:false), nil, true))
|
3081
|
+
|
3082
|
+
add_tests("xstr",
|
3083
|
+
"Ruby" => "`touch 5`",
|
3084
|
+
"ParseTree" => s(:xstr, 'touch 5'))
|
3085
|
+
|
3086
|
+
add_tests("yield_0",
|
3087
|
+
"Ruby" => "yield",
|
3088
|
+
"ParseTree" => s(:yield))
|
3089
|
+
|
3090
|
+
add_tests("yield_1",
|
3091
|
+
"Ruby" => "yield(42)",
|
3092
|
+
"ParseTree" => s(:yield, s(:lit, 42)))
|
3093
|
+
|
3094
|
+
add_tests("yield_array_0",
|
3095
|
+
"Ruby" => "yield([])",
|
3096
|
+
"ParseTree" => s(:yield, s(:array)))
|
3097
|
+
|
3098
|
+
add_tests("yield_array_1",
|
3099
|
+
"Ruby" => "yield([42])",
|
3100
|
+
"ParseTree" => s(:yield, s(:array, s(:lit, 42))))
|
3101
|
+
|
3102
|
+
add_tests("yield_array_n",
|
3103
|
+
"Ruby" => "yield([42, 24])",
|
3104
|
+
"ParseTree" => s(:yield, s(:array, s(:lit, 42), s(:lit, 24))))
|
3105
|
+
|
3106
|
+
add_tests("yield_n",
|
3107
|
+
"Ruby" => "yield(42, 24)",
|
3108
|
+
"ParseTree" => s(:yield, s(:lit, 42), s(:lit, 24)))
|
3109
|
+
|
3110
|
+
add_tests("zarray",
|
3111
|
+
"Ruby" => "a = []",
|
3112
|
+
"ParseTree" => s(:lasgn, :a, s(:array)))
|
3113
|
+
|
3114
|
+
add_tests("zsuper",
|
3115
|
+
"Ruby" => "def x\n super\nend",
|
3116
|
+
"ParseTree" => s(:defn, :x, s(:args), s(:zsuper)))
|
3117
|
+
|
3118
|
+
# TODO: discuss and decide which lit we like
|
3119
|
+
# it "converts a regexp to an sexp" do
|
3120
|
+
# "/blah/".to_sexp.should == s(:regex, "blah", 0)
|
3121
|
+
# "/blah/i".to_sexp.should == s(:regex, "blah", 1)
|
3122
|
+
# "/blah/u".to_sexp.should == s(:regex, "blah", 64)
|
3123
|
+
# end
|
3124
|
+
|
3125
|
+
end
|