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,3502 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# ENV['VERBOSE'] = "1"
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'minitest/autorun'
|
7
|
+
require 'ruby_parser'
|
8
|
+
|
9
|
+
$: << File.expand_path('~/Work/p4/zss/src/sexp_processor/dev/lib')
|
10
|
+
|
11
|
+
require 'pt_testcase'
|
12
|
+
|
13
|
+
class Sexp
|
14
|
+
alias oldeq2 ==
|
15
|
+
def ==(obj) # :nodoc:
|
16
|
+
if obj.class == self.class then
|
17
|
+
super and
|
18
|
+
(self.line.nil? or obj.line.nil? or self.line == obj.line)
|
19
|
+
else
|
20
|
+
false
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class RubyParserTestCase < ParseTreeTestCase
|
26
|
+
attr_accessor :result, :processor
|
27
|
+
|
28
|
+
make_my_diffs_pretty!
|
29
|
+
|
30
|
+
def self.previous key
|
31
|
+
"Ruby"
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.generate_test klass, node, data, input_name, output_name
|
35
|
+
return if node.to_s =~ /bmethod|dmethod/
|
36
|
+
return if Array === data['Ruby']
|
37
|
+
|
38
|
+
output_name = "ParseTree"
|
39
|
+
|
40
|
+
super
|
41
|
+
end
|
42
|
+
|
43
|
+
def assert_parse rb, pt
|
44
|
+
self.result = processor.parse rb
|
45
|
+
assert_equal pt, result
|
46
|
+
end
|
47
|
+
|
48
|
+
def assert_syntax_error rb, emsg
|
49
|
+
e = nil
|
50
|
+
assert_silent do
|
51
|
+
e = assert_raises RubyParser::SyntaxError do
|
52
|
+
processor.parse rb
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
assert_equal emsg, e.message
|
57
|
+
end
|
58
|
+
|
59
|
+
def assert_parse_error rb, emsg
|
60
|
+
e = nil
|
61
|
+
assert_silent do
|
62
|
+
e = assert_raises Racc::ParseError do
|
63
|
+
processor.parse rb
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
assert_equal emsg, e.message
|
68
|
+
end
|
69
|
+
|
70
|
+
def assert_parse_line rb, pt, line
|
71
|
+
assert_parse rb, pt
|
72
|
+
assert_equal line, result.line, "call should have line number"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
module TestRubyParserShared
|
77
|
+
def setup
|
78
|
+
super
|
79
|
+
# p :test => [self.class, __name__]
|
80
|
+
end
|
81
|
+
|
82
|
+
BLOCK_DUP_MSG = "Both block arg and actual block given."
|
83
|
+
|
84
|
+
def test_double_block_error_01
|
85
|
+
assert_syntax_error "a(1, &b) { }", BLOCK_DUP_MSG
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_double_block_error_02
|
89
|
+
assert_syntax_error "a(1, &b) do end", BLOCK_DUP_MSG
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_double_block_error_03
|
93
|
+
assert_syntax_error "a 1, &b do end", BLOCK_DUP_MSG
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_double_block_error_04
|
97
|
+
assert_syntax_error "m.a(1, &b) { }", BLOCK_DUP_MSG
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_double_block_error_05
|
101
|
+
assert_syntax_error "m.a(1, &b) do end", BLOCK_DUP_MSG
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_double_block_error_06
|
105
|
+
assert_syntax_error "m.a 1, &b do end", BLOCK_DUP_MSG
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_double_block_error_07
|
109
|
+
assert_syntax_error "m::a(1, &b) { }", BLOCK_DUP_MSG
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_double_block_error_08
|
113
|
+
assert_syntax_error "m::a(1, &b) do end", BLOCK_DUP_MSG
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_double_block_error_09
|
117
|
+
assert_syntax_error "m::a 1, &b do end", BLOCK_DUP_MSG
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_wtf_7
|
121
|
+
rb = "a.b (1) {c}"
|
122
|
+
pt = s(:iter,
|
123
|
+
s(:call, s(:call, nil, :a), :b, s(:lit, 1)),
|
124
|
+
0,
|
125
|
+
s(:call, nil, :c))
|
126
|
+
|
127
|
+
assert_parse rb, pt
|
128
|
+
end
|
129
|
+
|
130
|
+
def test_wtf_8
|
131
|
+
rb = "a::b (1) {c}"
|
132
|
+
pt = s(:iter,
|
133
|
+
s(:call, s(:call, nil, :a), :b, s(:lit, 1)),
|
134
|
+
0,
|
135
|
+
s(:call, nil, :c))
|
136
|
+
|
137
|
+
assert_parse rb, pt
|
138
|
+
end
|
139
|
+
|
140
|
+
def test_attrasgn_array_lhs
|
141
|
+
rb = '[1, 2, 3, 4][from .. to] = ["a", "b", "c"]'
|
142
|
+
pt = s(:attrasgn,
|
143
|
+
s(:array, s(:lit, 1), s(:lit, 2), s(:lit, 3), s(:lit, 4)),
|
144
|
+
:[]=,
|
145
|
+
s(:dot2,
|
146
|
+
s(:call, nil, :from),
|
147
|
+
s(:call, nil, :to)),
|
148
|
+
s(:array, s(:str, "a"), s(:str, "b"), s(:str, "c")))
|
149
|
+
|
150
|
+
assert_parse rb, pt
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_attrasgn_array_arg
|
154
|
+
rb = "a[[1, 2]] = 3"
|
155
|
+
pt = s(:attrasgn,
|
156
|
+
s(:call, nil, :a),
|
157
|
+
:[]=,
|
158
|
+
s(:array,
|
159
|
+
s(:lit, 1),
|
160
|
+
s(:lit, 2)),
|
161
|
+
s(:lit, 3))
|
162
|
+
|
163
|
+
assert_parse rb, pt
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_block_append
|
167
|
+
head = s(:args)
|
168
|
+
tail = s(:zsuper)
|
169
|
+
expected = s(:block, s(:args), s(:zsuper))
|
170
|
+
assert_equal expected, processor.block_append(head, tail)
|
171
|
+
end
|
172
|
+
|
173
|
+
def test_block_append_begin_begin
|
174
|
+
head = s(:begin, s(:args))
|
175
|
+
tail = s(:begin, s(:args))
|
176
|
+
expected = s(:block, s(:args), s(:begin, s(:args)))
|
177
|
+
assert_equal expected, processor.block_append(head, tail)
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_block_append_block
|
181
|
+
head = s(:block, s(:args))
|
182
|
+
tail = s(:zsuper)
|
183
|
+
expected = s(:block, s(:args), s(:zsuper))
|
184
|
+
assert_equal expected, processor.block_append(head, tail)
|
185
|
+
end
|
186
|
+
|
187
|
+
def test_block_append_nil_head
|
188
|
+
head = nil
|
189
|
+
tail = s(:zsuper)
|
190
|
+
expected = s(:zsuper)
|
191
|
+
assert_equal expected, processor.block_append(head, tail)
|
192
|
+
end
|
193
|
+
|
194
|
+
def test_block_append_nil_tail
|
195
|
+
head = s(:args)
|
196
|
+
tail = nil
|
197
|
+
expected = s(:args)
|
198
|
+
assert_equal expected, processor.block_append(head, tail)
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_block_append_tail_block
|
202
|
+
head = s(:call, nil, :f1)
|
203
|
+
tail = s(:block, s(:undef, s(:lit, :x)), s(:undef, s(:lit, :y)))
|
204
|
+
expected = s(:block,
|
205
|
+
s(:call, nil, :f1),
|
206
|
+
s(:block, s(:undef, s(:lit, :x)), s(:undef, s(:lit, :y))))
|
207
|
+
assert_equal expected, processor.block_append(head, tail)
|
208
|
+
end
|
209
|
+
|
210
|
+
def test_call_array_arg
|
211
|
+
rb = "1 == [:b, :c]"
|
212
|
+
pt = s(:call, s(:lit, 1), :==, s(:array, s(:lit, :b), s(:lit, :c)))
|
213
|
+
|
214
|
+
assert_parse rb, pt
|
215
|
+
end
|
216
|
+
|
217
|
+
def test_call_env
|
218
|
+
processor.env[:a] = :lvar
|
219
|
+
rb = "a.happy"
|
220
|
+
pt = s(:call, s(:lvar, :a), :happy)
|
221
|
+
|
222
|
+
assert_parse rb, pt
|
223
|
+
end
|
224
|
+
|
225
|
+
def test_dasgn_icky2
|
226
|
+
rb = "a do\n v = nil\n begin\n yield\n rescue Exception => v\n break\n end\nend"
|
227
|
+
pt = s(:iter,
|
228
|
+
s(:call, nil, :a),
|
229
|
+
0,
|
230
|
+
s(:block,
|
231
|
+
s(:lasgn, :v, s(:nil)),
|
232
|
+
s(:rescue,
|
233
|
+
s(:yield),
|
234
|
+
s(:resbody,
|
235
|
+
s(:array, s(:const, :Exception), s(:lasgn, :v, s(:gvar, :$!))),
|
236
|
+
s(:break)))))
|
237
|
+
|
238
|
+
assert_parse rb, pt
|
239
|
+
end
|
240
|
+
|
241
|
+
def test_class_comments
|
242
|
+
rb = "# blah 1\n# blah 2\n\nclass X\n # blah 3\n def blah\n # blah 4\n end\nend"
|
243
|
+
pt = s(:class, :X, nil,
|
244
|
+
s(:defn, :blah, s(:args), s(:nil)))
|
245
|
+
|
246
|
+
assert_parse rb, pt
|
247
|
+
|
248
|
+
assert_equal "# blah 1\n# blah 2\n\n", result.comments
|
249
|
+
assert_equal "# blah 3\n", result.defn.comments
|
250
|
+
end
|
251
|
+
|
252
|
+
def test_module_comments
|
253
|
+
rb = "# blah 1\n \n # blah 2\n\nmodule X\n # blah 3\n def blah\n # blah 4\n end\nend"
|
254
|
+
pt = s(:module, :X,
|
255
|
+
s(:defn, :blah, s(:args), s(:nil)))
|
256
|
+
|
257
|
+
assert_parse rb, pt
|
258
|
+
assert_equal "# blah 1\n\n# blah 2\n\n", result.comments
|
259
|
+
assert_equal "# blah 3\n", result.defn.comments
|
260
|
+
end
|
261
|
+
|
262
|
+
def test_defn_comments
|
263
|
+
rb = "# blah 1\n# blah 2\n\ndef blah\nend"
|
264
|
+
pt = s(:defn, :blah, s(:args), s(:nil))
|
265
|
+
|
266
|
+
assert_parse rb, pt
|
267
|
+
assert_equal "# blah 1\n# blah 2\n\n", result.comments
|
268
|
+
end
|
269
|
+
|
270
|
+
def test_defs_comments
|
271
|
+
rb = "# blah 1\n# blah 2\n\ndef self.blah\nend"
|
272
|
+
pt = s(:defs, s(:self), :blah, s(:args), s(:nil))
|
273
|
+
|
274
|
+
assert_parse rb, pt
|
275
|
+
assert_equal "# blah 1\n# blah 2\n\n", result.comments
|
276
|
+
end
|
277
|
+
|
278
|
+
def test_do_bug # TODO: rename
|
279
|
+
rb = "a 1\na.b do |c|\n # do nothing\nend"
|
280
|
+
pt = s(:block,
|
281
|
+
s(:call, nil, :a, s(:lit, 1)),
|
282
|
+
s(:iter,
|
283
|
+
s(:call, s(:call, nil, :a), :b),
|
284
|
+
s(:args, :c)))
|
285
|
+
|
286
|
+
assert_parse rb, pt
|
287
|
+
end
|
288
|
+
|
289
|
+
def test_bug_begin_else
|
290
|
+
rb = "begin 1; else; 2 end"
|
291
|
+
pt = s(:block, s(:lit, 1), s(:lit, 2))
|
292
|
+
|
293
|
+
assert_parse rb, pt
|
294
|
+
end
|
295
|
+
|
296
|
+
def test_begin_else_return_value
|
297
|
+
rb = "begin; else 2; end"
|
298
|
+
pt = s(:lit, 2)
|
299
|
+
|
300
|
+
assert_parse rb, pt
|
301
|
+
end
|
302
|
+
|
303
|
+
def test_bug_comment_eq_begin
|
304
|
+
rb = "\n\n#\n=begin\nblah\n=end\n\n"
|
305
|
+
pt = nil
|
306
|
+
exp = rb.strip + "\n"
|
307
|
+
|
308
|
+
assert_parse rb, pt
|
309
|
+
assert_equal exp, processor.lexer.comments
|
310
|
+
end
|
311
|
+
|
312
|
+
def test_eq_begin_why_wont_people_use_their_spacebar?
|
313
|
+
rb = "h[k]=begin\n 42\n end"
|
314
|
+
pt = s(:attrasgn, s(:call, nil, :h), :[]=, s(:call, nil, :k), s(:lit, 42))
|
315
|
+
|
316
|
+
assert_parse rb, pt
|
317
|
+
end
|
318
|
+
|
319
|
+
def test_eq_begin_line_numbers
|
320
|
+
rb = "1\n=begin\ncomment\ncomment\n=end\n2"
|
321
|
+
pt = s(:block,
|
322
|
+
s(:lit, 1).line(1),
|
323
|
+
s(:lit, 2).line(6))
|
324
|
+
|
325
|
+
assert_parse rb, pt
|
326
|
+
end
|
327
|
+
|
328
|
+
def test_bug_call_arglist_parens
|
329
|
+
rb = 'g ( 1), 2'
|
330
|
+
pt = s(:call, nil, :g, s(:lit, 1), s(:lit, 2))
|
331
|
+
|
332
|
+
assert_parse rb, pt
|
333
|
+
|
334
|
+
rb = <<-CODE
|
335
|
+
def f
|
336
|
+
g ( 1), 2
|
337
|
+
end
|
338
|
+
CODE
|
339
|
+
|
340
|
+
pt = s(:defn, :f, s(:args),
|
341
|
+
s(:call, nil, :g, s(:lit, 1), s(:lit, 2)))
|
342
|
+
|
343
|
+
assert_parse rb, pt
|
344
|
+
|
345
|
+
rb = <<-CODE
|
346
|
+
def f()
|
347
|
+
g (1), 2
|
348
|
+
end
|
349
|
+
CODE
|
350
|
+
|
351
|
+
assert_parse rb, pt
|
352
|
+
end
|
353
|
+
|
354
|
+
def test_dstr_evstr
|
355
|
+
rb = "\"#\{'a'}#\{b}\""
|
356
|
+
pt = s(:dstr, "a", s(:evstr, s(:call, nil, :b)))
|
357
|
+
|
358
|
+
assert_parse rb, pt
|
359
|
+
end
|
360
|
+
|
361
|
+
def test_dstr_str
|
362
|
+
rb = "\"#\{'a'} b\""
|
363
|
+
pt = s(:str, "a b")
|
364
|
+
|
365
|
+
assert_parse rb, pt
|
366
|
+
end
|
367
|
+
|
368
|
+
def test_empty
|
369
|
+
rb = ""
|
370
|
+
pt = nil
|
371
|
+
|
372
|
+
assert_parse rb, pt
|
373
|
+
end
|
374
|
+
|
375
|
+
def test_evstr_evstr
|
376
|
+
rb = "\"#\{a}#\{b}\""
|
377
|
+
pt = s(:dstr, "", s(:evstr, s(:call, nil, :a)), s(:evstr, s(:call, nil, :b)))
|
378
|
+
|
379
|
+
assert_parse rb, pt
|
380
|
+
end
|
381
|
+
|
382
|
+
def test_evstr_str
|
383
|
+
rb = "\"#\{a} b\""
|
384
|
+
pt = s(:dstr, "", s(:evstr, s(:call, nil, :a)), s(:str, " b"))
|
385
|
+
|
386
|
+
assert_parse rb, pt
|
387
|
+
end
|
388
|
+
|
389
|
+
def test_lasgn_env
|
390
|
+
rb = 'a = 42'
|
391
|
+
pt = s(:lasgn, :a, s(:lit, 42))
|
392
|
+
expected_env = { :a => :lvar }
|
393
|
+
|
394
|
+
assert_parse rb, pt
|
395
|
+
assert_equal expected_env, processor.env.all
|
396
|
+
end
|
397
|
+
|
398
|
+
def test_lasgn_ivar_env
|
399
|
+
rb = '@a = 42'
|
400
|
+
pt = s(:iasgn, :@a, s(:lit, 42))
|
401
|
+
|
402
|
+
assert_parse rb, pt
|
403
|
+
assert_empty processor.env.all
|
404
|
+
end
|
405
|
+
|
406
|
+
def test_list_append
|
407
|
+
a = s(:lit, 1)
|
408
|
+
b = s(:lit, 2)
|
409
|
+
c = s(:lit, 3)
|
410
|
+
|
411
|
+
result = processor.list_append(s(:array, b.dup), c.dup)
|
412
|
+
|
413
|
+
assert_equal s(:array, b, c), result
|
414
|
+
|
415
|
+
result = processor.list_append(b.dup, c.dup)
|
416
|
+
|
417
|
+
assert_equal s(:array, b, c), result
|
418
|
+
|
419
|
+
result = processor.list_append(result, a.dup)
|
420
|
+
|
421
|
+
assert_equal s(:array, b, c, a), result
|
422
|
+
|
423
|
+
lhs, rhs = s(:array, s(:lit, :iter)), s(:when, s(:const, :BRANCHING), nil)
|
424
|
+
expected = s(:array, s(:lit, :iter), s(:when, s(:const, :BRANCHING), nil))
|
425
|
+
|
426
|
+
assert_equal expected, processor.list_append(lhs, rhs)
|
427
|
+
end
|
428
|
+
|
429
|
+
def test_list_prepend
|
430
|
+
a = s(:lit, 1)
|
431
|
+
b = s(:lit, 2)
|
432
|
+
c = s(:lit, 3)
|
433
|
+
|
434
|
+
result = processor.list_prepend(b.dup, s(:array, c.dup))
|
435
|
+
|
436
|
+
assert_equal s(:array, b, c), result
|
437
|
+
|
438
|
+
result = processor.list_prepend(b.dup, c.dup)
|
439
|
+
|
440
|
+
assert_equal s(:array, b, c), result
|
441
|
+
|
442
|
+
result = processor.list_prepend(a.dup, result)
|
443
|
+
|
444
|
+
assert_equal s(:array, a, b, c), result
|
445
|
+
end
|
446
|
+
|
447
|
+
def test_literal_concat_dstr_dstr
|
448
|
+
lhs = s(:dstr, "Failed to download spec ",
|
449
|
+
s(:evstr, s(:call, nil, :spec_name)),
|
450
|
+
s(:str, " from "),
|
451
|
+
s(:evstr, s(:call, nil, :source_uri)),
|
452
|
+
s(:str, ":\n"))
|
453
|
+
rhs = s(:dstr, "\t",
|
454
|
+
s(:evstr, s(:call, s(:ivar, :@fetch_error), :message)))
|
455
|
+
expected = s(:dstr, "Failed to download spec ",
|
456
|
+
s(:evstr, s(:call, nil, :spec_name)),
|
457
|
+
s(:str, " from "),
|
458
|
+
s(:evstr, s(:call, nil, :source_uri)),
|
459
|
+
s(:str, ":\n"),
|
460
|
+
s(:str, "\t"),
|
461
|
+
s(:evstr, s(:call, s(:ivar, :@fetch_error), :message)))
|
462
|
+
|
463
|
+
assert_equal expected, processor.literal_concat(lhs, rhs)
|
464
|
+
end
|
465
|
+
|
466
|
+
def test_literal_concat_dstr_evstr
|
467
|
+
lhs, rhs = s(:dstr, "a"), s(:evstr, s(:call, nil, :b))
|
468
|
+
expected = s(:dstr, "a", s(:evstr, s(:call, nil, :b)))
|
469
|
+
|
470
|
+
assert_equal expected, processor.literal_concat(lhs, rhs)
|
471
|
+
end
|
472
|
+
|
473
|
+
def test_literal_concat_evstr_evstr
|
474
|
+
lhs, rhs = s(:evstr, s(:lit, 1)), s(:evstr, s(:lit, 2))
|
475
|
+
expected = s(:dstr, "", s(:evstr, s(:lit, 1)), s(:evstr, s(:lit, 2)))
|
476
|
+
|
477
|
+
assert_equal expected, processor.literal_concat(lhs, rhs)
|
478
|
+
end
|
479
|
+
|
480
|
+
def test_literal_concat_str_evstr
|
481
|
+
lhs, rhs = s(:str, ""), s(:evstr, s(:str, "blah"))
|
482
|
+
|
483
|
+
assert_equal s(:str, "blah"), processor.literal_concat(lhs, rhs)
|
484
|
+
end
|
485
|
+
|
486
|
+
def test_logop_12
|
487
|
+
lhs = s(:lit, 1)
|
488
|
+
rhs = s(:lit, 2)
|
489
|
+
exp = s(:and, s(:lit, 1), s(:lit, 2))
|
490
|
+
|
491
|
+
assert_equal exp, processor.logop(:and, lhs, rhs)
|
492
|
+
end
|
493
|
+
|
494
|
+
def test_logop_1234_5
|
495
|
+
lhs = s(:and, s(:lit, 1), s(:and, s(:lit, 2), s(:and, s(:lit, 3), s(:lit, 4))))
|
496
|
+
rhs = s(:lit, 5)
|
497
|
+
exp = s(:and,
|
498
|
+
s(:lit, 1),
|
499
|
+
s(:and,
|
500
|
+
s(:lit, 2),
|
501
|
+
s(:and,
|
502
|
+
s(:lit, 3),
|
503
|
+
s(:and,
|
504
|
+
s(:lit, 4),
|
505
|
+
s(:lit, 5)))))
|
506
|
+
|
507
|
+
assert_equal exp, processor.logop(:and, lhs, rhs)
|
508
|
+
end
|
509
|
+
|
510
|
+
def test_logop_123_4
|
511
|
+
lhs = s(:and, s(:lit, 1), s(:and, s(:lit, 2), s(:lit, 3)))
|
512
|
+
rhs = s(:lit, 4)
|
513
|
+
exp = s(:and,
|
514
|
+
s(:lit, 1),
|
515
|
+
s(:and,
|
516
|
+
s(:lit, 2),
|
517
|
+
s(:and,
|
518
|
+
s(:lit, 3),
|
519
|
+
s(:lit, 4))))
|
520
|
+
|
521
|
+
assert_equal exp, processor.logop(:and, lhs, rhs)
|
522
|
+
end
|
523
|
+
|
524
|
+
def test_logop_12_3
|
525
|
+
lhs = s(:and, s(:lit, 1), s(:lit, 2))
|
526
|
+
rhs = s(:lit, 3)
|
527
|
+
exp = s(:and, s(:lit, 1), s(:and, s(:lit, 2), s(:lit, 3)))
|
528
|
+
|
529
|
+
assert_equal exp, processor.logop(:and, lhs, rhs)
|
530
|
+
end
|
531
|
+
|
532
|
+
def test_logop_nested_mix
|
533
|
+
lhs = s(:or, s(:call, nil, :a), s(:call, nil, :b))
|
534
|
+
rhs = s(:and, s(:call, nil, :c), s(:call, nil, :d))
|
535
|
+
exp = s(:or,
|
536
|
+
s(:or, s(:call, nil, :a), s(:call, nil, :b)),
|
537
|
+
s(:and, s(:call, nil, :c), s(:call, nil, :d)))
|
538
|
+
|
539
|
+
lhs.paren = true
|
540
|
+
rhs.paren = true
|
541
|
+
|
542
|
+
assert_equal exp, processor.logop(:or, lhs, rhs)
|
543
|
+
end
|
544
|
+
|
545
|
+
def test_str_evstr
|
546
|
+
rb = "\"a #\{b}\""
|
547
|
+
pt = s(:dstr, "a ", s(:evstr, s(:call, nil, :b)))
|
548
|
+
|
549
|
+
assert_parse rb, pt
|
550
|
+
end
|
551
|
+
|
552
|
+
def test_dsym_to_sym
|
553
|
+
pt = s(:alias, s(:lit, :<<), s(:lit, :>>))
|
554
|
+
|
555
|
+
rb = 'alias :<< :>>'
|
556
|
+
assert_parse rb, pt
|
557
|
+
|
558
|
+
rb = 'alias :"<<" :">>"'
|
559
|
+
assert_parse rb, pt
|
560
|
+
end
|
561
|
+
|
562
|
+
def test_regexp
|
563
|
+
regexps = {
|
564
|
+
"/wtf/" => /wtf/,
|
565
|
+
"/wtf/n" => /wtf/n,
|
566
|
+
"/wtf/m" => /wtf/m,
|
567
|
+
"/wtf/nm" => /wtf/nm,
|
568
|
+
"/wtf/nmnmnmnm" => /wtf/nm,
|
569
|
+
}
|
570
|
+
|
571
|
+
regexps.each do |rb, lit|
|
572
|
+
assert_parse rb, s(:lit, lit)
|
573
|
+
end
|
574
|
+
|
575
|
+
# TODO: add more including interpolation etc
|
576
|
+
end
|
577
|
+
|
578
|
+
def test_label_vs_string
|
579
|
+
rb = "_buf << ':\n'"
|
580
|
+
pt = s(:call, s(:call, nil, :_buf), :<<, s(:str, ":\n"))
|
581
|
+
|
582
|
+
assert_parse rb, pt
|
583
|
+
end
|
584
|
+
|
585
|
+
def test_str_backslashes
|
586
|
+
long_string = '\n' * 100
|
587
|
+
rb = "x '#{long_string}'"
|
588
|
+
pt = s(:call, nil, :x, s(:str, long_string))
|
589
|
+
|
590
|
+
assert_parse rb, pt
|
591
|
+
end
|
592
|
+
|
593
|
+
def test_str_pct_Q_nested
|
594
|
+
rb = "%Q[before [#\{nest}] after]"
|
595
|
+
pt = s(:dstr, "before [", s(:evstr, s(:call, nil, :nest)), s(:str, "] after"))
|
596
|
+
|
597
|
+
assert_parse rb, pt
|
598
|
+
end
|
599
|
+
|
600
|
+
def test_str_pct_q
|
601
|
+
rb = "%q{a b c}"
|
602
|
+
pt = s(:str, "a b c")
|
603
|
+
|
604
|
+
assert_parse rb, pt
|
605
|
+
end
|
606
|
+
|
607
|
+
# def test_str_pct_nested_nested
|
608
|
+
# rb = "%{ { #\{ \"#\{1}\" } } }"
|
609
|
+
# assert_equal " { 1 } ", eval(rb)
|
610
|
+
# pt = s(:dstr, " { ", s(:evstr, s(:lit, 1)), s(:str, " } "))
|
611
|
+
#
|
612
|
+
# assert_parse rb, pt
|
613
|
+
# end
|
614
|
+
|
615
|
+
def test_str_str
|
616
|
+
rb = "\"a #\{'b'}\""
|
617
|
+
pt = s(:str, "a b")
|
618
|
+
|
619
|
+
assert_parse rb, pt
|
620
|
+
end
|
621
|
+
|
622
|
+
def test_str_str_str
|
623
|
+
rb = "\"a #\{'b'} c\""
|
624
|
+
pt = s(:str, "a b c")
|
625
|
+
|
626
|
+
assert_parse rb, pt
|
627
|
+
end
|
628
|
+
|
629
|
+
def after_process_hook klass, node, data, input_name, output_name
|
630
|
+
assert_equal 1, @result.line, "should have proper line number"
|
631
|
+
end
|
632
|
+
|
633
|
+
def test_parse_line_block
|
634
|
+
rb = "a = 42\np a"
|
635
|
+
pt = s(:block,
|
636
|
+
s(:lasgn, :a, s(:lit, 42)),
|
637
|
+
s(:call, nil, :p, s(:lvar, :a)))
|
638
|
+
|
639
|
+
assert_parse_line rb, pt, 1
|
640
|
+
assert_equal 1, result.lasgn.line, "lasgn should have line number"
|
641
|
+
assert_equal 2, result.call.line, "call should have line number"
|
642
|
+
|
643
|
+
expected = "(string)"
|
644
|
+
assert_equal expected, result.file
|
645
|
+
assert_equal expected, result.lasgn.file
|
646
|
+
assert_equal expected, result.call.file
|
647
|
+
|
648
|
+
assert_same result.file, result.lasgn.file
|
649
|
+
assert_same result.file, result.call.file
|
650
|
+
end
|
651
|
+
|
652
|
+
def test_parse_line_block_inline_comment
|
653
|
+
rb = "a\nb # comment\nc"
|
654
|
+
pt = s(:block,
|
655
|
+
s(:call, nil, :a).line(1),
|
656
|
+
s(:call, nil, :b).line(2),
|
657
|
+
s(:call, nil, :c).line(3))
|
658
|
+
|
659
|
+
assert_parse rb, pt
|
660
|
+
end
|
661
|
+
|
662
|
+
def test_parse_line_block_inline_multiline_comment
|
663
|
+
rb = "a\nb # comment\n# another comment\nc"
|
664
|
+
pt = s(:block,
|
665
|
+
s(:call, nil, :a).line(1),
|
666
|
+
s(:call, nil, :b).line(2),
|
667
|
+
s(:call, nil, :c).line(4)).line(1)
|
668
|
+
|
669
|
+
assert_parse rb, pt
|
670
|
+
end
|
671
|
+
|
672
|
+
def test_parse_line_block_inline_comment_leading_newlines
|
673
|
+
rb = "\n\n\na\nb # comment\n# another comment\nc"
|
674
|
+
pt = s(:block,
|
675
|
+
s(:call, nil, :a).line(4),
|
676
|
+
s(:call, nil, :b).line(5),
|
677
|
+
s(:call, nil, :c).line(7)).line(4)
|
678
|
+
|
679
|
+
assert_parse rb, pt
|
680
|
+
end
|
681
|
+
|
682
|
+
def test_parse_line_call_no_args
|
683
|
+
rb = "f do |x, y|\n x + y\nend"
|
684
|
+
|
685
|
+
pt = s(:iter,
|
686
|
+
s(:call, nil, :f),
|
687
|
+
s(:args, :x, :y),
|
688
|
+
s(:call, s(:lvar, :x), :+, s(:lvar, :y)))
|
689
|
+
|
690
|
+
assert_parse_line rb, pt, 1
|
691
|
+
assert_equal 1, result[1].line, "call should have line number"
|
692
|
+
assert_equal 1, result[2].line, "masgn should have line number"
|
693
|
+
assert_equal 2, result[3].line, "call should have line number"
|
694
|
+
end
|
695
|
+
|
696
|
+
def test_parse_line_call_ivar_line_break_paren
|
697
|
+
rb = "a(@b\n)"
|
698
|
+
pt = s(:call, nil, :a, s(:ivar, :@b).line(1)).line(1)
|
699
|
+
|
700
|
+
assert_parse rb, pt
|
701
|
+
end
|
702
|
+
|
703
|
+
def test_parse_line_call_ivar_arg_no_parens_line_break
|
704
|
+
rb = "a @b\n"
|
705
|
+
pt = s(:call, nil, :a, s(:ivar, :@b).line(1)).line(1)
|
706
|
+
|
707
|
+
assert_parse rb, pt
|
708
|
+
end
|
709
|
+
|
710
|
+
def test_parse_line_defn_no_parens
|
711
|
+
pt = s(:defn, :f, s(:args), s(:nil))
|
712
|
+
|
713
|
+
rb = "def f\nend"
|
714
|
+
assert_parse_line rb, pt, 1
|
715
|
+
|
716
|
+
processor.reset
|
717
|
+
|
718
|
+
rb = "def f\n\nend"
|
719
|
+
assert_parse_line rb, pt, 1
|
720
|
+
end
|
721
|
+
|
722
|
+
def test_parse_line_defn_complex
|
723
|
+
rb = "def x(y)\n p(y)\n y *= 2\n return y;\nend" # TODO: remove () & ;
|
724
|
+
pt = s(:defn, :x, s(:args, :y),
|
725
|
+
s(:call, nil, :p, s(:lvar, :y)),
|
726
|
+
s(:lasgn, :y, s(:call, s(:lvar, :y), :*, s(:lit, 2))),
|
727
|
+
s(:return, s(:lvar, :y)))
|
728
|
+
|
729
|
+
assert_parse_line rb, pt, 1
|
730
|
+
|
731
|
+
body = result
|
732
|
+
assert_equal 2, body.call.line, "call should have line number"
|
733
|
+
assert_equal 3, body.lasgn.line, "lasgn should have line number"
|
734
|
+
assert_equal 4, body.return.line, "return should have line number"
|
735
|
+
end
|
736
|
+
|
737
|
+
def test_parse_line_evstr_after_break
|
738
|
+
rb = "\"a\"\\\n\"\#{b}\""
|
739
|
+
pt = s(:dstr, "a",
|
740
|
+
s(:evstr,
|
741
|
+
s(:call, nil, :b).line(2)).line(2)).line(1)
|
742
|
+
|
743
|
+
assert_parse rb, pt
|
744
|
+
end
|
745
|
+
|
746
|
+
def test_parse_line_dstr_newline
|
747
|
+
skip "dstr line numbers are just gonna be screwed for a while..."
|
748
|
+
|
749
|
+
rb = <<-'CODE'
|
750
|
+
"a\n#{
|
751
|
+
}"
|
752
|
+
true
|
753
|
+
CODE
|
754
|
+
|
755
|
+
pt = s(:block,
|
756
|
+
s(:dstr, "a\n",
|
757
|
+
s(:evstr)).line(1),
|
758
|
+
s(:true).line(3))
|
759
|
+
|
760
|
+
assert_parse rb, pt
|
761
|
+
end
|
762
|
+
|
763
|
+
def test_parse_line_heredoc_evstr
|
764
|
+
skip "heredoc line numbers are just gonna be screwed for a while..."
|
765
|
+
|
766
|
+
rb = "<<-A\na\n\#{b}\nA"
|
767
|
+
pt = s(:dstr, "a\n",
|
768
|
+
s(:evstr,
|
769
|
+
s(:call, nil, :b).line(3)),
|
770
|
+
s(:str, "\n")).line(1)
|
771
|
+
|
772
|
+
assert_parse rb, pt
|
773
|
+
end
|
774
|
+
|
775
|
+
def test_parse_line_multiline_str
|
776
|
+
rb = "\"a\nb\"\n1"
|
777
|
+
pt = s(:block,
|
778
|
+
s(:str, "a\nb").line(1),
|
779
|
+
s(:lit, 1).line(3)).line(1)
|
780
|
+
|
781
|
+
assert_parse rb, pt
|
782
|
+
end
|
783
|
+
|
784
|
+
def test_parse_line_multiline_str_literal_n
|
785
|
+
rb = "\"a\\nb\"\n1"
|
786
|
+
pt = s(:block,
|
787
|
+
s(:str, "a\nb").line(1),
|
788
|
+
s(:lit, 1).line(2)).line(1)
|
789
|
+
|
790
|
+
assert_parse rb, pt
|
791
|
+
end
|
792
|
+
|
793
|
+
def test_parse_line_iter_call_parens
|
794
|
+
rb = "f(a) do |x, y|\n x + y\nend"
|
795
|
+
|
796
|
+
pt = s(:iter,
|
797
|
+
s(:call, nil, :f, s(:call, nil, :a)),
|
798
|
+
s(:args, :x, :y),
|
799
|
+
s(:call, s(:lvar, :x), :+, s(:lvar, :y)))
|
800
|
+
|
801
|
+
assert_parse_line rb, pt, 1
|
802
|
+
|
803
|
+
assert_equal 1, result[1].line, "call should have line number"
|
804
|
+
assert_equal 1, result[2].line, "masgn should have line number"
|
805
|
+
assert_equal 2, result[3].line, "call should have line number"
|
806
|
+
end
|
807
|
+
|
808
|
+
def test_parse_line_iter_call_no_parens
|
809
|
+
rb = "f a do |x, y|\n x + y\nend"
|
810
|
+
|
811
|
+
pt = s(:iter,
|
812
|
+
s(:call, nil, :f, s(:call, nil, :a).line(1)).line(1),
|
813
|
+
s(:args, :x, :y).line(1),
|
814
|
+
s(:call, s(:lvar, :x).line(2), :+,
|
815
|
+
s(:lvar, :y).line(2)).line(2)).line(1)
|
816
|
+
|
817
|
+
assert_parse rb, pt
|
818
|
+
end
|
819
|
+
|
820
|
+
def test_parse_line_heredoc
|
821
|
+
rb = <<-CODE
|
822
|
+
string = <<-HEREDOC
|
823
|
+
very long string
|
824
|
+
HEREDOC
|
825
|
+
puts string
|
826
|
+
CODE
|
827
|
+
|
828
|
+
pt = s(:block,
|
829
|
+
s(:lasgn, :string,
|
830
|
+
s(:str, " very long string\n").line(1)).line(1),
|
831
|
+
s(:call, nil, :puts, s(:lvar, :string).line(4)).line(4)).line(1)
|
832
|
+
|
833
|
+
assert_parse rb, pt
|
834
|
+
end
|
835
|
+
|
836
|
+
def test_parse_line_heredoc_regexp_chars
|
837
|
+
rb = <<-CODE
|
838
|
+
string = <<-"^D"
|
839
|
+
very long string
|
840
|
+
^D
|
841
|
+
puts string
|
842
|
+
CODE
|
843
|
+
|
844
|
+
pt = s(:block,
|
845
|
+
s(:lasgn, :string,
|
846
|
+
s(:str, " very long string\n").line(1)).line(1),
|
847
|
+
s(:call, nil, :puts, s(:lvar, :string).line(4)).line(4)).line(1)
|
848
|
+
|
849
|
+
assert_parse rb, pt
|
850
|
+
end
|
851
|
+
|
852
|
+
def test_parse_line_newlines
|
853
|
+
rb = "true\n\n"
|
854
|
+
pt = s(:true)
|
855
|
+
|
856
|
+
assert_parse_line rb, pt, 1
|
857
|
+
end
|
858
|
+
|
859
|
+
def test_parse_line_return
|
860
|
+
rb = <<-RUBY
|
861
|
+
def blah
|
862
|
+
if true then
|
863
|
+
return 42
|
864
|
+
end
|
865
|
+
end
|
866
|
+
RUBY
|
867
|
+
|
868
|
+
pt = s(:defn, :blah, s(:args),
|
869
|
+
s(:if, s(:true),
|
870
|
+
s(:return, s(:lit, 42)),
|
871
|
+
nil))
|
872
|
+
|
873
|
+
assert_parse_line rb, pt, 1
|
874
|
+
|
875
|
+
assert_equal 3, result.if.return.line
|
876
|
+
assert_equal 3, result.if.return.lit.line
|
877
|
+
end
|
878
|
+
|
879
|
+
def test_parse_line_str_with_newline_escape
|
880
|
+
rb = 'a("\n", true)'
|
881
|
+
pt = s(:call, nil, :a,
|
882
|
+
s(:str, "\n").line(1),
|
883
|
+
s(:true).line(1))
|
884
|
+
|
885
|
+
assert_parse rb, pt
|
886
|
+
end
|
887
|
+
|
888
|
+
def test_parse_line_trailing_newlines
|
889
|
+
rb = "a \nb"
|
890
|
+
pt = s(:block,
|
891
|
+
s(:call, nil, :a).line(1),
|
892
|
+
s(:call, nil, :b).line(2)).line(1)
|
893
|
+
|
894
|
+
assert_parse rb, pt
|
895
|
+
end
|
896
|
+
|
897
|
+
def test_bug_and
|
898
|
+
rb = "true and []"
|
899
|
+
pt = s(:and, s(:true), s(:array))
|
900
|
+
|
901
|
+
assert_parse rb, pt
|
902
|
+
|
903
|
+
rb = "true and\ntrue"
|
904
|
+
pt = s(:and, s(:true), s(:true))
|
905
|
+
|
906
|
+
assert_parse rb, pt
|
907
|
+
end
|
908
|
+
|
909
|
+
def test_bug_cond_pct
|
910
|
+
rb = "case; when %r%blahblah%; end"
|
911
|
+
pt = s(:case, nil, s(:when, s(:array, s(:lit, /blahblah/)), nil), nil)
|
912
|
+
|
913
|
+
assert_parse rb, pt
|
914
|
+
end
|
915
|
+
|
916
|
+
# according to 2.3.1 parser -- added: ON 1.8 only:
|
917
|
+
# rp.process("f { |(a,b),c| }") == rp.process("f { |((a,b),c)| }")
|
918
|
+
|
919
|
+
# ruby18 -e "p lambda { |(a,b)| }.arity" # => 2
|
920
|
+
# ruby19 -e "p lambda { |(a,b)| }.arity" # => 1
|
921
|
+
# ruby18 -e "p lambda { |(a,b),c| }.arity" # => 2
|
922
|
+
# ruby19 -e "p lambda { |(a,b),c| }.arity" # => 2
|
923
|
+
# ruby18 -e "p lambda { |((a,b),c)| }.arity" # => 2
|
924
|
+
# ruby19 -e "p lambda { |((a,b),c)| }.arity" # => 1
|
925
|
+
|
926
|
+
def test_bug_args_masgn
|
927
|
+
rb = "f { |(a, b), c| }"
|
928
|
+
pt = s(:iter,
|
929
|
+
s(:call, nil, :f),
|
930
|
+
s(:args, s(:masgn, :a, :b), :c))
|
931
|
+
|
932
|
+
assert_parse rb, pt.dup
|
933
|
+
end
|
934
|
+
|
935
|
+
def test_bug_args_masgn2
|
936
|
+
rb = "f { |((a, b), c), d| }"
|
937
|
+
pt = s(:iter,
|
938
|
+
s(:call, nil, :f),
|
939
|
+
s(:args, s(:masgn, s(:masgn, :a, :b), :c), :d))
|
940
|
+
|
941
|
+
assert_parse rb, pt
|
942
|
+
end
|
943
|
+
|
944
|
+
def ruby18
|
945
|
+
Ruby18Parser === self.processor
|
946
|
+
end
|
947
|
+
|
948
|
+
def ruby19
|
949
|
+
Ruby19Parser === self.processor
|
950
|
+
end
|
951
|
+
|
952
|
+
def ruby20
|
953
|
+
Ruby20Parser === self.processor
|
954
|
+
end
|
955
|
+
|
956
|
+
def ruby21
|
957
|
+
Ruby21Parser === self.processor
|
958
|
+
end
|
959
|
+
|
960
|
+
def ruby22
|
961
|
+
Ruby22Parser === self.processor
|
962
|
+
end
|
963
|
+
|
964
|
+
def ruby23
|
965
|
+
Ruby23Parser === self.processor
|
966
|
+
end
|
967
|
+
|
968
|
+
def test_bug_comma
|
969
|
+
val = if ruby18 then
|
970
|
+
s(:lit, 100)
|
971
|
+
else
|
972
|
+
s(:str, "d")
|
973
|
+
end
|
974
|
+
|
975
|
+
rb = "if test ?d, dir then end"
|
976
|
+
pt = s(:if,
|
977
|
+
s(:call, nil, :test, val, s(:call, nil, :dir)),
|
978
|
+
nil,
|
979
|
+
nil)
|
980
|
+
|
981
|
+
assert_parse rb, pt
|
982
|
+
end
|
983
|
+
|
984
|
+
def test_bug_case_when_regexp
|
985
|
+
rb = "case :x; when /x/ then end"
|
986
|
+
pt = s(:case, s(:lit, :x),
|
987
|
+
s(:when, s(:array, s(:lit, /x/)), nil),
|
988
|
+
nil)
|
989
|
+
|
990
|
+
assert_parse rb, pt
|
991
|
+
end
|
992
|
+
|
993
|
+
def test_bug_masgn_right
|
994
|
+
rb = "f { |a, (b, c)| }"
|
995
|
+
pt = s(:iter,
|
996
|
+
s(:call, nil, :f),
|
997
|
+
s(:args, :a, s(:masgn, :b, :c)))
|
998
|
+
|
999
|
+
assert_parse rb, pt
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
def test_when_splat
|
1003
|
+
rb = "case a; when *b then; end"
|
1004
|
+
pt = s(:case, s(:call, nil, :a),
|
1005
|
+
s(:when, s(:array, s(:splat, s(:call, nil, :b))), nil),
|
1006
|
+
nil)
|
1007
|
+
|
1008
|
+
assert_parse rb, pt
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
def test_if_symbol
|
1012
|
+
rb = "if f :x; end"
|
1013
|
+
pt = s(:if, s(:call, nil, :f, s(:lit, :x)), nil, nil)
|
1014
|
+
|
1015
|
+
assert_parse rb, pt
|
1016
|
+
end
|
1017
|
+
|
1018
|
+
|
1019
|
+
def test_bug_not_parens
|
1020
|
+
rb = "not(a)"
|
1021
|
+
pt = if ruby18 then
|
1022
|
+
s(:not, s(:call, nil, :a))
|
1023
|
+
elsif ruby19 or ruby20 or ruby21 or ruby22 or ruby23 then
|
1024
|
+
s(:call, s(:call, nil, :a), :"!")
|
1025
|
+
else
|
1026
|
+
raise "wtf"
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
assert_parse rb, pt
|
1030
|
+
end
|
1031
|
+
|
1032
|
+
def test_pipe_space
|
1033
|
+
rb = "a.b do | | end"
|
1034
|
+
pt = s(:iter, s(:call, s(:call, nil, :a), :b), s(:args))
|
1035
|
+
|
1036
|
+
assert_parse rb, pt
|
1037
|
+
end
|
1038
|
+
|
1039
|
+
def test_cond_unary_minus
|
1040
|
+
rb = "if -1; end"
|
1041
|
+
pt = s(:if, s(:lit, -1), nil, nil)
|
1042
|
+
|
1043
|
+
assert_parse rb, pt
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
def test_bug_op_asgn_rescue
|
1047
|
+
rb = "a ||= b rescue nil"
|
1048
|
+
pt = s(:rescue,
|
1049
|
+
s(:op_asgn_or, s(:lvar, :a), s(:lasgn, :a, s(:call, nil, :b))),
|
1050
|
+
s(:resbody, s(:array), s(:nil)))
|
1051
|
+
|
1052
|
+
assert_parse rb, pt
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
def test_magic_encoding_comment
|
1056
|
+
rb = "# encoding: utf-8\nclass ExampleUTF8ClassNameVarietà; def self.è; così = :però; end\nend\n"
|
1057
|
+
|
1058
|
+
rb.force_encoding "ASCII-8BIT" if rb.respond_to? :force_encoding
|
1059
|
+
|
1060
|
+
# TODO: class vars
|
1061
|
+
# TODO: odd-ternary: a ?bb : c
|
1062
|
+
# TODO: globals
|
1063
|
+
|
1064
|
+
pt = s(:class, :"ExampleUTF8ClassNameVariet\303\240", nil,
|
1065
|
+
s(:defs, s(:self), :"\303\250", s(:args),
|
1066
|
+
s(:lasgn, :"cos\303\254", s(:lit, :"per\303\262"))))
|
1067
|
+
|
1068
|
+
err = RUBY_VERSION =~ /^1\.8/ ? "Skipping magic encoding comment\n" : ""
|
1069
|
+
|
1070
|
+
assert_output "", err do
|
1071
|
+
assert_parse rb, pt
|
1072
|
+
end
|
1073
|
+
end
|
1074
|
+
|
1075
|
+
def test_iter_args_1
|
1076
|
+
rb = "f { |a,b| }"
|
1077
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :a, :b))
|
1078
|
+
|
1079
|
+
assert_parse rb, pt
|
1080
|
+
end
|
1081
|
+
|
1082
|
+
def test_iter_args_3
|
1083
|
+
rb = "f { |a, (b, c), d| }"
|
1084
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :a, s(:masgn, :b, :c), :d))
|
1085
|
+
|
1086
|
+
assert_parse rb, pt
|
1087
|
+
end
|
1088
|
+
|
1089
|
+
def test_str_heredoc_interp
|
1090
|
+
rb = "<<\"\"\n\#{x}\nblah2\n\n"
|
1091
|
+
pt = s(:dstr, "", s(:evstr, s(:call, nil, :x)), s(:str, "\nblah2\n"))
|
1092
|
+
|
1093
|
+
assert_parse rb, pt
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
def test_i_fucking_hate_line_numbers
|
1097
|
+
rb = <<-END.gsub(/^ {6}/, '')
|
1098
|
+
if true
|
1099
|
+
p 1
|
1100
|
+
a.b 2
|
1101
|
+
c.d 3, 4
|
1102
|
+
e.f 5
|
1103
|
+
g.h 6, 7
|
1104
|
+
p(1)
|
1105
|
+
a.b(2)
|
1106
|
+
c.d(3, 4)
|
1107
|
+
e.f(5)
|
1108
|
+
g.h(6, 7)
|
1109
|
+
end
|
1110
|
+
END
|
1111
|
+
|
1112
|
+
pt = s(:if, s(:true).line(1),
|
1113
|
+
s(:block,
|
1114
|
+
s(:call, nil, :p, s(:lit, 1).line(2)).line(2),
|
1115
|
+
s(:call, s(:call, nil, :a).line(3), :b,
|
1116
|
+
s(:lit, 2).line(3)).line(3),
|
1117
|
+
s(:call, s(:call, nil, :c).line(4), :d,
|
1118
|
+
s(:lit, 3).line(4), s(:lit, 4).line(4)).line(4),
|
1119
|
+
s(:call, s(:call, nil, :e).line(5), :f,
|
1120
|
+
s(:lit, 5).line(5)).line(5),
|
1121
|
+
s(:call, s(:call, nil, :g).line(6), :h,
|
1122
|
+
s(:lit, 6).line(6), s(:lit, 7).line(6)).line(6),
|
1123
|
+
s(:call, nil, :p, s(:lit, 1).line(7)).line(7),
|
1124
|
+
s(:call, s(:call, nil, :a).line(8), :b,
|
1125
|
+
s(:lit, 2).line(8)).line(8),
|
1126
|
+
s(:call, s(:call, nil, :c).line(9), :d,
|
1127
|
+
s(:lit, 3).line(9), s(:lit, 4).line(9)).line(9),
|
1128
|
+
s(:call, s(:call, nil, :e).line(10), :f,
|
1129
|
+
s(:lit, 5).line(10)).line(10),
|
1130
|
+
s(:call, s(:call, nil, :g).line(11), :h,
|
1131
|
+
s(:lit, 6).line(11), s(:lit, 7).line(11)).line(11)).line(2),
|
1132
|
+
nil).line(1)
|
1133
|
+
|
1134
|
+
assert_parse rb, pt
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
def test_i_fucking_hate_line_numbers2
|
1138
|
+
rb = <<-EOM.gsub(/^ {6}/, '')
|
1139
|
+
if true then
|
1140
|
+
p('a')
|
1141
|
+
b = 1
|
1142
|
+
p b
|
1143
|
+
c =1
|
1144
|
+
end
|
1145
|
+
a
|
1146
|
+
EOM
|
1147
|
+
|
1148
|
+
pt = s(:block,
|
1149
|
+
s(:if, s(:true).line(1),
|
1150
|
+
s(:block,
|
1151
|
+
s(:call, nil, :p, s(:str, "a").line(2)).line(2),
|
1152
|
+
s(:lasgn, :b, s(:lit, 1).line(3)).line(3),
|
1153
|
+
s(:call, nil, :p, s(:lvar, :b).line(4)).line(4),
|
1154
|
+
s(:lasgn, :c, s(:lit, 1).line(5)).line(5)).line(2),
|
1155
|
+
nil).line(1),
|
1156
|
+
s(:call, nil, :a).line(7)).line(1)
|
1157
|
+
|
1158
|
+
assert_parse rb, pt
|
1159
|
+
end
|
1160
|
+
|
1161
|
+
def test_parse_comments
|
1162
|
+
p = RubyParser.new
|
1163
|
+
sexp = p.parse <<-CODE
|
1164
|
+
# class comment
|
1165
|
+
class Inline
|
1166
|
+
def show
|
1167
|
+
# woot
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
# Returns a list of things
|
1171
|
+
def list
|
1172
|
+
# woot
|
1173
|
+
end
|
1174
|
+
end
|
1175
|
+
CODE
|
1176
|
+
|
1177
|
+
assert_equal "# class comment\n", sexp.comments
|
1178
|
+
act = sexp.find_nodes(:defn).map(&:comments)
|
1179
|
+
exp = ["", "# Returns a list of things\n"]
|
1180
|
+
|
1181
|
+
assert_equal exp, act
|
1182
|
+
assert_equal [], processor.comments
|
1183
|
+
assert_equal "", processor.lexer.comments
|
1184
|
+
end
|
1185
|
+
|
1186
|
+
def test_call_pipe
|
1187
|
+
rb = "1 | 2"
|
1188
|
+
pt = s(:call, s(:lit, 1), :|, s(:lit, 2))
|
1189
|
+
|
1190
|
+
assert_parse rb, pt
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
def test_lasgn_command
|
1194
|
+
rb = "a = b.c 1"
|
1195
|
+
pt = s(:lasgn, :a, s(:call, s(:call, nil, :b), :c, s(:lit, 1)))
|
1196
|
+
|
1197
|
+
assert_parse rb, pt
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
def test_call_args_command
|
1201
|
+
rb = "a.b c.d 1"
|
1202
|
+
pt = s(:call, s(:call, nil, :a), :b,
|
1203
|
+
s(:call, s(:call, nil, :c), :d,
|
1204
|
+
s(:lit, 1)))
|
1205
|
+
|
1206
|
+
assert_parse rb, pt
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
def test_defined_eh_parens
|
1210
|
+
rb = "defined?(42)"
|
1211
|
+
pt = s(:defined, s(:lit, 42))
|
1212
|
+
|
1213
|
+
assert_parse rb, pt
|
1214
|
+
end
|
1215
|
+
|
1216
|
+
def test_if_elsif
|
1217
|
+
rb = "if 1; elsif 2; end"
|
1218
|
+
pt = s(:if, s(:lit, 1), nil, s(:if, s(:lit, 2), nil, nil))
|
1219
|
+
|
1220
|
+
assert_parse rb, pt
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
def test_call_gt
|
1224
|
+
rb = "1 > 2"
|
1225
|
+
pt = s(:call, s(:lit, 1), :>, s(:lit, 2))
|
1226
|
+
|
1227
|
+
assert_parse rb, pt
|
1228
|
+
end
|
1229
|
+
|
1230
|
+
def test_call_lt
|
1231
|
+
rb = "1 < 2"
|
1232
|
+
pt = s(:call, s(:lit, 1), :<, s(:lit, 2))
|
1233
|
+
|
1234
|
+
assert_parse rb, pt
|
1235
|
+
end
|
1236
|
+
|
1237
|
+
def test_call_lte
|
1238
|
+
rb = "1 <= 2"
|
1239
|
+
pt = s(:call, s(:lit, 1), :<=, s(:lit, 2))
|
1240
|
+
|
1241
|
+
assert_parse rb, pt
|
1242
|
+
end
|
1243
|
+
|
1244
|
+
def test_call_spaceship
|
1245
|
+
rb = "1 <=> 2"
|
1246
|
+
pt = s(:call, s(:lit, 1), :<=>, s(:lit, 2))
|
1247
|
+
|
1248
|
+
assert_parse rb, pt
|
1249
|
+
end
|
1250
|
+
|
1251
|
+
def test_call_and
|
1252
|
+
rb = "1 & 2"
|
1253
|
+
pt = s(:call, s(:lit, 1), :&, s(:lit, 2))
|
1254
|
+
|
1255
|
+
assert_parse rb, pt
|
1256
|
+
end
|
1257
|
+
|
1258
|
+
def test_call_star2
|
1259
|
+
rb = "1 ** 2"
|
1260
|
+
pt = s(:call, s(:lit, 1), :"**", s(:lit, 2))
|
1261
|
+
|
1262
|
+
assert_parse rb, pt
|
1263
|
+
end
|
1264
|
+
|
1265
|
+
def test_call_colon2
|
1266
|
+
rb = "A::b"
|
1267
|
+
pt = s(:call, s(:const, :A), :b)
|
1268
|
+
|
1269
|
+
assert_parse rb, pt
|
1270
|
+
end
|
1271
|
+
|
1272
|
+
def test_call_star
|
1273
|
+
rb = "1 * 2"
|
1274
|
+
pt = s(:call, s(:lit, 1), :"*", s(:lit, 2))
|
1275
|
+
|
1276
|
+
assert_parse rb, pt
|
1277
|
+
end
|
1278
|
+
|
1279
|
+
def test_yield_arg
|
1280
|
+
rb = "yield 42"
|
1281
|
+
pt = s(:yield, s(:lit, 42))
|
1282
|
+
|
1283
|
+
assert_parse rb, pt
|
1284
|
+
end
|
1285
|
+
|
1286
|
+
def test_call_div
|
1287
|
+
rb = "1 / 2"
|
1288
|
+
pt = s(:call, s(:lit, 1), :/, s(:lit, 2))
|
1289
|
+
|
1290
|
+
assert_parse rb, pt
|
1291
|
+
end
|
1292
|
+
|
1293
|
+
def test_call_eq3
|
1294
|
+
rb = "1 === 2"
|
1295
|
+
pt = s(:call, s(:lit, 1), :===, s(:lit, 2))
|
1296
|
+
|
1297
|
+
assert_parse rb, pt
|
1298
|
+
end
|
1299
|
+
|
1300
|
+
def test_call_carat
|
1301
|
+
rb = "1 ^ 2"
|
1302
|
+
pt = s(:call, s(:lit, 1), :^, s(:lit, 2))
|
1303
|
+
|
1304
|
+
assert_parse rb, pt
|
1305
|
+
end
|
1306
|
+
|
1307
|
+
def test_call_rshift
|
1308
|
+
rb = "1 >> 2"
|
1309
|
+
pt = s(:call, s(:lit, 1), :>>, s(:lit, 2))
|
1310
|
+
|
1311
|
+
assert_parse rb, pt
|
1312
|
+
end
|
1313
|
+
|
1314
|
+
def test_lasgn_arg_rescue_arg
|
1315
|
+
rb = "a = 1 rescue 2"
|
1316
|
+
pt = s(:lasgn, :a, s(:rescue, s(:lit, 1), s(:resbody, s(:array), s(:lit, 2))))
|
1317
|
+
|
1318
|
+
assert_parse rb, pt
|
1319
|
+
end
|
1320
|
+
|
1321
|
+
def test_call_bang_squiggle
|
1322
|
+
rb = "1 !~ 2"
|
1323
|
+
pt = s(:not, s(:call, s(:lit, 1), :=~, s(:lit, 2))) # TODO: check for 1.9+
|
1324
|
+
|
1325
|
+
assert_parse rb, pt
|
1326
|
+
end
|
1327
|
+
|
1328
|
+
def test_super_arg
|
1329
|
+
rb = "super 42"
|
1330
|
+
pt = s(:super, s(:lit, 42))
|
1331
|
+
|
1332
|
+
assert_parse rb, pt
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
def test_defns_reserved
|
1336
|
+
rb = "def self.return; end"
|
1337
|
+
pt = s(:defs, s(:self), :return, s(:args), s(:nil))
|
1338
|
+
|
1339
|
+
assert_parse rb, pt
|
1340
|
+
end
|
1341
|
+
|
1342
|
+
def test_unary_minus
|
1343
|
+
rb = "-a"
|
1344
|
+
pt = s(:call, s(:call, nil, :a), :"-@")
|
1345
|
+
|
1346
|
+
assert_parse rb, pt
|
1347
|
+
end
|
1348
|
+
|
1349
|
+
def test_masgn_command_call
|
1350
|
+
rb = "a, = b.c 1"
|
1351
|
+
pt = s(:masgn,
|
1352
|
+
s(:array, s(:lasgn, :a)),
|
1353
|
+
s(:to_ary, s(:call, s(:call, nil, :b), :c, s(:lit, 1))))
|
1354
|
+
|
1355
|
+
assert_parse rb, pt
|
1356
|
+
end
|
1357
|
+
|
1358
|
+
def test_uminus_float
|
1359
|
+
rb = "-0.0"
|
1360
|
+
pt = s(:lit, -0.0)
|
1361
|
+
|
1362
|
+
assert_parse rb, pt
|
1363
|
+
end
|
1364
|
+
|
1365
|
+
def test_op_asgn_command_call
|
1366
|
+
rb = "a ||= b.c 2"
|
1367
|
+
pt = s(:op_asgn_or,
|
1368
|
+
s(:lvar, :a),
|
1369
|
+
s(:lasgn, :a, s(:call, s(:call, nil, :b), :c, s(:lit, 2))))
|
1370
|
+
|
1371
|
+
assert_parse rb, pt
|
1372
|
+
end
|
1373
|
+
|
1374
|
+
def test_masgn_paren
|
1375
|
+
rb = "(a, b) = c.d"
|
1376
|
+
pt = s(:masgn,
|
1377
|
+
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
1378
|
+
s(:to_ary, s(:call, s(:call, nil, :c), :d)))
|
1379
|
+
|
1380
|
+
assert_parse rb, pt
|
1381
|
+
end
|
1382
|
+
|
1383
|
+
def test_unary_tilde
|
1384
|
+
rb = "~a"
|
1385
|
+
pt = s(:call, s(:call, nil, :a), :~)
|
1386
|
+
|
1387
|
+
assert_parse rb, pt
|
1388
|
+
end
|
1389
|
+
|
1390
|
+
def test_unary_plus
|
1391
|
+
rb = "+a"
|
1392
|
+
pt = s(:call, s(:call, nil, :a), :+@)
|
1393
|
+
|
1394
|
+
assert_parse rb, pt
|
1395
|
+
end
|
1396
|
+
|
1397
|
+
def test_qwords_empty
|
1398
|
+
rb = "%w()"
|
1399
|
+
pt = s(:array)
|
1400
|
+
|
1401
|
+
assert_parse rb, pt
|
1402
|
+
end
|
1403
|
+
|
1404
|
+
def test_qWords_space
|
1405
|
+
rb = "%W( )"
|
1406
|
+
pt = s(:array)
|
1407
|
+
|
1408
|
+
assert_parse rb, pt
|
1409
|
+
end
|
1410
|
+
|
1411
|
+
def test_attr_asgn_colon_id
|
1412
|
+
rb = "A::b = 1"
|
1413
|
+
pt = s(:attrasgn, s(:const, :A), :b=, s(:lit, 1))
|
1414
|
+
|
1415
|
+
assert_parse rb, pt
|
1416
|
+
end
|
1417
|
+
|
1418
|
+
def test_aref_args_assocs
|
1419
|
+
rb = "[1 => 2]"
|
1420
|
+
pt = s(:array, s(:hash, s(:lit, 1), s(:lit, 2)))
|
1421
|
+
|
1422
|
+
assert_parse rb, pt
|
1423
|
+
end
|
1424
|
+
|
1425
|
+
def test_BEGIN
|
1426
|
+
rb = "BEGIN { 42 }"
|
1427
|
+
pt = s(:iter, s(:preexe), s(:args), s(:lit, 42))
|
1428
|
+
|
1429
|
+
assert_parse rb, pt
|
1430
|
+
end
|
1431
|
+
|
1432
|
+
def test_attrasgn_primary_dot_constant
|
1433
|
+
rb = "a.B = 1"
|
1434
|
+
pt = s(:attrasgn, s(:call, nil, :a), :"B=", s(:lit, 1))
|
1435
|
+
|
1436
|
+
assert_parse rb, pt
|
1437
|
+
end
|
1438
|
+
|
1439
|
+
def test_op_asgn_primary_colon_identifier
|
1440
|
+
rb = "A::b += 1"
|
1441
|
+
pt = s(:op_asgn, s(:const, :A), s(:lit, 1), :b, :+) # TODO: check? looks wack
|
1442
|
+
|
1443
|
+
assert_parse rb, pt
|
1444
|
+
end
|
1445
|
+
|
1446
|
+
def test_words_interp
|
1447
|
+
rb = '%W(#{1}b)'
|
1448
|
+
pt = s(:array, s(:dstr, "", s(:evstr, s(:lit, 1)), s(:str, "b")))
|
1449
|
+
|
1450
|
+
assert_parse rb, pt
|
1451
|
+
end
|
1452
|
+
|
1453
|
+
def test_op_asgn_index_command_call
|
1454
|
+
rb = "a[:b] ||= c 1, 2"
|
1455
|
+
pt = s(:op_asgn1, s(:call, nil, :a), s(:array, s(:lit, :b)),
|
1456
|
+
:"||",
|
1457
|
+
s(:call, nil, :c, s(:lit, 1), s(:lit, 2)))
|
1458
|
+
|
1459
|
+
assert_parse rb, pt
|
1460
|
+
end
|
1461
|
+
|
1462
|
+
def test_op_asgn_val_dot_ident_command_call
|
1463
|
+
rb = "a.b ||= c 1"
|
1464
|
+
pt = s(:op_asgn, s(:call, nil, :a), s(:call, nil, :c, s(:lit, 1)), :b, :"||")
|
1465
|
+
|
1466
|
+
assert_parse rb, pt
|
1467
|
+
end
|
1468
|
+
|
1469
|
+
def test_yield_empty_parens
|
1470
|
+
rb = "yield()"
|
1471
|
+
pt = s(:yield)
|
1472
|
+
|
1473
|
+
assert_parse rb, pt
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
def test_masgn_lhs_splat
|
1477
|
+
rb = "*a = 1, 2, 3"
|
1478
|
+
pt = s(:masgn,
|
1479
|
+
s(:array, s(:splat, s(:lasgn, :a))),
|
1480
|
+
s(:array, s(:lit, 1), s(:lit, 2), s(:lit, 3)))
|
1481
|
+
|
1482
|
+
assert_parse rb, pt
|
1483
|
+
end
|
1484
|
+
|
1485
|
+
def test_masgn_arg_ident
|
1486
|
+
rb = "a, b.C = d"
|
1487
|
+
pt = s(:masgn,
|
1488
|
+
s(:array, s(:lasgn, :a), s(:attrasgn, s(:call, nil, :b), :"C=")),
|
1489
|
+
s(:to_ary, s(:call, nil, :d)))
|
1490
|
+
|
1491
|
+
assert_parse rb, pt
|
1492
|
+
end
|
1493
|
+
|
1494
|
+
def test_masgn_arg_colon_arg
|
1495
|
+
rb = "a, b::c = d"
|
1496
|
+
pt = s(:masgn,
|
1497
|
+
s(:array, s(:lasgn, :a), s(:attrasgn, s(:call, nil, :b), :c=)),
|
1498
|
+
s(:to_ary, s(:call, nil, :d)))
|
1499
|
+
|
1500
|
+
assert_parse rb, pt
|
1501
|
+
end
|
1502
|
+
|
1503
|
+
def test_masgn_star
|
1504
|
+
rb = "* = 1"
|
1505
|
+
pt = s(:masgn,
|
1506
|
+
s(:array, s(:splat)),
|
1507
|
+
s(:to_ary, s(:lit, 1)))
|
1508
|
+
|
1509
|
+
assert_parse rb, pt
|
1510
|
+
end
|
1511
|
+
|
1512
|
+
def test_op_asgn_dot_ident_command_call
|
1513
|
+
rb = "A.B ||= c 1"
|
1514
|
+
pt = s(:op_asgn, s(:const, :A), s(:call, nil, :c, s(:lit, 1)), :B, :"||")
|
1515
|
+
|
1516
|
+
assert_parse rb, pt
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
def test_block_decomp_splat
|
1520
|
+
skip "not that smart yet" if ruby18 # HACK
|
1521
|
+
|
1522
|
+
rb = "f { |(*a)| }"
|
1523
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, s(:masgn, :"*a")))
|
1524
|
+
|
1525
|
+
assert_parse rb, pt
|
1526
|
+
end
|
1527
|
+
|
1528
|
+
def test_masgn_colon3
|
1529
|
+
rb = "::A, ::B = 1, 2"
|
1530
|
+
pt = s(:masgn,
|
1531
|
+
s(:array, s(:const, nil, s(:colon3, :A)), s(:const, s(:colon3, :B))),
|
1532
|
+
s(:array, s(:lit, 1), s(:lit, 2)))
|
1533
|
+
|
1534
|
+
assert_parse rb, pt
|
1535
|
+
end
|
1536
|
+
|
1537
|
+
def test_masgn_colon2
|
1538
|
+
rb = "a, b::C = 1, 2"
|
1539
|
+
pt = s(:masgn,
|
1540
|
+
s(:array, s(:lasgn, :a), s(:const, s(:colon2, s(:call, nil, :b), :C))),
|
1541
|
+
s(:array, s(:lit, 1), s(:lit, 2)))
|
1542
|
+
|
1543
|
+
assert_parse rb, pt
|
1544
|
+
end
|
1545
|
+
|
1546
|
+
def test_alias_gvar_backref
|
1547
|
+
rb = "alias $MATCH $&"
|
1548
|
+
pt = s(:valias, :$MATCH, :$&)
|
1549
|
+
|
1550
|
+
assert_parse rb, pt
|
1551
|
+
end
|
1552
|
+
|
1553
|
+
def test_heredoc_broken_windows_theory_applies_to_microsoft_more_than_anything
|
1554
|
+
rb = "<<EOS\r\r\nEOS\r\r\n"
|
1555
|
+
pt = s(:str, "")
|
1556
|
+
|
1557
|
+
assert_parse rb, pt
|
1558
|
+
end
|
1559
|
+
|
1560
|
+
def test_heredoc_unicode
|
1561
|
+
rb = "<<OOTPÜT\n.\nOOTPÜT\n"
|
1562
|
+
pt = s(:str, ".\n")
|
1563
|
+
|
1564
|
+
assert_parse rb, pt
|
1565
|
+
end
|
1566
|
+
|
1567
|
+
def test_masgn_double_paren
|
1568
|
+
rb = "((a,b))=c" # TODO: blog
|
1569
|
+
pt = s(:masgn,
|
1570
|
+
s(:array, s(:masgn, s(:array, s(:lasgn, :a), s(:lasgn, :b)))),
|
1571
|
+
s(:to_ary, s(:call, nil, :c)))
|
1572
|
+
|
1573
|
+
assert_parse rb, pt
|
1574
|
+
end
|
1575
|
+
|
1576
|
+
def test_index_0_opasgn
|
1577
|
+
rb = "a[] += b"
|
1578
|
+
pt = s(:op_asgn1, s(:call, nil, :a), nil, :+, s(:call, nil, :b))
|
1579
|
+
|
1580
|
+
assert_parse rb, pt
|
1581
|
+
end
|
1582
|
+
|
1583
|
+
def test___ENCODING__
|
1584
|
+
rb = "__ENCODING__"
|
1585
|
+
pt = if Ruby18Parser === processor then
|
1586
|
+
s(:call, nil, :__ENCODING__)
|
1587
|
+
else
|
1588
|
+
if defined? Encoding then
|
1589
|
+
if Ruby18Parser === processor then
|
1590
|
+
s(:call, nil, :__ENCODING__)
|
1591
|
+
else
|
1592
|
+
s(:colon2, s(:const, :Encoding), :UTF_8)
|
1593
|
+
end
|
1594
|
+
else
|
1595
|
+
s(:str, "Unsupported!")
|
1596
|
+
end
|
1597
|
+
end
|
1598
|
+
|
1599
|
+
assert_parse rb, pt
|
1600
|
+
end
|
1601
|
+
|
1602
|
+
def test_dstr_evstr_empty_end
|
1603
|
+
rb = ':"#{field}"'
|
1604
|
+
pt = s(:dsym, "", s(:evstr, s(:call, nil, :field)))
|
1605
|
+
|
1606
|
+
assert_parse rb, pt
|
1607
|
+
end
|
1608
|
+
|
1609
|
+
def test_fubar_nesting
|
1610
|
+
err = "class definition in method body"
|
1611
|
+
|
1612
|
+
assert_syntax_error "def a; class B; end; end", err
|
1613
|
+
assert_syntax_error "def a; def b; end; class B; end; end", err
|
1614
|
+
end
|
1615
|
+
end
|
1616
|
+
|
1617
|
+
module TestRubyParserShared19to22
|
1618
|
+
def test_aref_args_lit_assocs
|
1619
|
+
rb = "[1, 2 => 3]"
|
1620
|
+
pt = s(:array, s(:lit, 1), s(:hash, s(:lit, 2), s(:lit, 3)))
|
1621
|
+
|
1622
|
+
assert_parse rb, pt
|
1623
|
+
end
|
1624
|
+
|
1625
|
+
def test_block_decomp_arg_splat
|
1626
|
+
rb = "a { |(b, *)| }"
|
1627
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:masgn, :b, :*)))
|
1628
|
+
|
1629
|
+
assert_parse rb, pt
|
1630
|
+
end
|
1631
|
+
|
1632
|
+
def test_block_call_operation_dot
|
1633
|
+
rb = "a.b c do end.d"
|
1634
|
+
pt = s(:call,
|
1635
|
+
s(:iter,
|
1636
|
+
s(:call, s(:call, nil, :a), :b, s(:call, nil, :c)), 0),
|
1637
|
+
:d)
|
1638
|
+
|
1639
|
+
assert_parse rb, pt
|
1640
|
+
end
|
1641
|
+
|
1642
|
+
def test_block_call_operation_colon
|
1643
|
+
rb = "a.b c do end::d"
|
1644
|
+
pt = s(:call,
|
1645
|
+
s(:iter,
|
1646
|
+
s(:call, s(:call, nil, :a), :b, s(:call, nil, :c)), 0),
|
1647
|
+
:d)
|
1648
|
+
|
1649
|
+
assert_parse rb, pt
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
def test_block_command_operation_dot
|
1653
|
+
rb = "a :b do end.c :d"
|
1654
|
+
pt = s(:call,
|
1655
|
+
s(:iter, s(:call, nil, :a, s(:lit, :b)), 0),
|
1656
|
+
:c,
|
1657
|
+
s(:lit, :d))
|
1658
|
+
|
1659
|
+
assert_parse rb, pt
|
1660
|
+
end
|
1661
|
+
|
1662
|
+
def test_block_command_operation_colon
|
1663
|
+
rb = "a :b do end::c :d"
|
1664
|
+
pt = s(:call,
|
1665
|
+
s(:iter, s(:call, nil, :a, s(:lit, :b)), 0),
|
1666
|
+
:c,
|
1667
|
+
s(:lit, :d))
|
1668
|
+
|
1669
|
+
assert_parse rb, pt
|
1670
|
+
end
|
1671
|
+
|
1672
|
+
def test_block_optarg
|
1673
|
+
rb = "a { |b = :c| }"
|
1674
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:lasgn, :b, s(:lit, :c))))
|
1675
|
+
|
1676
|
+
assert_parse rb, pt
|
1677
|
+
end
|
1678
|
+
|
1679
|
+
def test_block_reg_optarg
|
1680
|
+
rb = "a { |b, c = :d| }"
|
1681
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :b, s(:lasgn, :c, s(:lit, :d))))
|
1682
|
+
|
1683
|
+
assert_parse rb, pt
|
1684
|
+
end
|
1685
|
+
|
1686
|
+
def test_block_return
|
1687
|
+
rb = "return foo arg do |bar| end"
|
1688
|
+
pt = s(:return,
|
1689
|
+
s(:iter,
|
1690
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1691
|
+
s(:args, :bar)))
|
1692
|
+
|
1693
|
+
assert_parse rb, pt
|
1694
|
+
end
|
1695
|
+
|
1696
|
+
def test_block_next
|
1697
|
+
rb = "next foo arg do |bar| end"
|
1698
|
+
pt = s(:next,
|
1699
|
+
s(:iter,
|
1700
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1701
|
+
s(:args, :bar)))
|
1702
|
+
|
1703
|
+
assert_parse rb, pt
|
1704
|
+
end
|
1705
|
+
|
1706
|
+
def test_block_yield
|
1707
|
+
rb = "yield foo arg do |bar| end"
|
1708
|
+
pt = s(:yield,
|
1709
|
+
s(:iter,
|
1710
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1711
|
+
s(:args, :bar)))
|
1712
|
+
|
1713
|
+
assert_parse rb, pt
|
1714
|
+
end
|
1715
|
+
|
1716
|
+
def test_block_break
|
1717
|
+
rb = "break foo arg do |bar| end"
|
1718
|
+
pt = s(:break,
|
1719
|
+
s(:iter,
|
1720
|
+
s(:call, nil, :foo, s(:call, nil, :arg)),
|
1721
|
+
s(:args, :bar)))
|
1722
|
+
|
1723
|
+
assert_parse rb, pt
|
1724
|
+
end
|
1725
|
+
|
1726
|
+
def test_block_splat_reg
|
1727
|
+
rb = "a { |*b, c| }"
|
1728
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :"*b", :c))
|
1729
|
+
|
1730
|
+
assert_parse rb, pt
|
1731
|
+
end
|
1732
|
+
|
1733
|
+
def test_bug_187
|
1734
|
+
rb = "private def f\na.b do end\nend"
|
1735
|
+
pt = s(:call,
|
1736
|
+
nil,
|
1737
|
+
:private,
|
1738
|
+
s(:defn, :f, s(:args),
|
1739
|
+
s(:iter, s(:call, s(:call, nil, :a), :b), 0)))
|
1740
|
+
|
1741
|
+
assert_parse rb, pt
|
1742
|
+
end
|
1743
|
+
|
1744
|
+
def test_defn_opt_reg
|
1745
|
+
rb = "def f(a=nil, b) end"
|
1746
|
+
pt = s(:defn, :f, s(:args, s(:lasgn, :a, s(:nil)), :b), s(:nil))
|
1747
|
+
|
1748
|
+
assert_parse rb, pt
|
1749
|
+
end
|
1750
|
+
|
1751
|
+
def test_defn_reg_opt_reg
|
1752
|
+
rb = "def f(a, b = :c, d) end"
|
1753
|
+
pt = s(:defn, :f, s(:args, :a, s(:lasgn, :b, s(:lit, :c)), :d), s(:nil))
|
1754
|
+
|
1755
|
+
assert_parse rb, pt
|
1756
|
+
end
|
1757
|
+
|
1758
|
+
def test_defn_splat_arg
|
1759
|
+
rb = "def f(*, a) end"
|
1760
|
+
pt = s(:defn, :f, s(:args, :*, :a), s(:nil))
|
1761
|
+
|
1762
|
+
assert_parse rb, pt
|
1763
|
+
end
|
1764
|
+
|
1765
|
+
def test_defn_arg_asplat_arg
|
1766
|
+
rb = "def call(interp, *, args) end"
|
1767
|
+
pt = s(:defn, :call, s(:args, :interp, :*, :args), s(:nil))
|
1768
|
+
|
1769
|
+
assert_parse rb, pt
|
1770
|
+
end
|
1771
|
+
|
1772
|
+
def test_block_arg_scope
|
1773
|
+
rb = "a { |b; c| }"
|
1774
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :b, s(:shadow, :c)))
|
1775
|
+
|
1776
|
+
assert_parse rb, pt
|
1777
|
+
end
|
1778
|
+
|
1779
|
+
def test_block_arg_scope2
|
1780
|
+
rb = "a {|b; c, d| }"
|
1781
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :b, s(:shadow, :c, :d)))
|
1782
|
+
|
1783
|
+
assert_parse rb, pt
|
1784
|
+
end
|
1785
|
+
|
1786
|
+
def test_block_arg_splat_arg
|
1787
|
+
rb = "a { |b, *c, d| }"
|
1788
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :b, :"*c", :d))
|
1789
|
+
|
1790
|
+
assert_parse rb, pt
|
1791
|
+
end
|
1792
|
+
|
1793
|
+
def test_stabby_proc_scope
|
1794
|
+
rb = "->(a; b) {}"
|
1795
|
+
pt = s(:iter, s(:call, nil, :lambda), s(:args, :a, s(:shadow, :b)))
|
1796
|
+
|
1797
|
+
assert_parse rb, pt
|
1798
|
+
end
|
1799
|
+
|
1800
|
+
def test_stabby_arg_opt_splat_arg_block_omfg
|
1801
|
+
rb = "->(b, c=1, *d, e, &f){}"
|
1802
|
+
pt = s(:iter,
|
1803
|
+
s(:call, nil, :lambda),
|
1804
|
+
s(:args, :b, s(:lasgn, :c, s(:lit, 1)), :"*d", :e, :"&f"))
|
1805
|
+
|
1806
|
+
assert_parse rb, pt
|
1807
|
+
end
|
1808
|
+
|
1809
|
+
def test_block_arg_opt_splat_arg_block_omfg
|
1810
|
+
rb = "a { |b, c=1, *d, e, &f| }"
|
1811
|
+
pt = s(:iter,
|
1812
|
+
s(:call, nil, :a),
|
1813
|
+
s(:args, :b, s(:lasgn, :c, s(:lit, 1)), :"*d", :e, :"&f"))
|
1814
|
+
|
1815
|
+
assert_parse rb, pt
|
1816
|
+
end
|
1817
|
+
|
1818
|
+
def test_block_arg_opt_splat
|
1819
|
+
rb = "a { |b, c = 1, *d| }"
|
1820
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :b, s(:lasgn, :c, s(:lit, 1)), :"*d"))
|
1821
|
+
|
1822
|
+
assert_parse rb, pt
|
1823
|
+
end
|
1824
|
+
|
1825
|
+
def test_block_opt_splat
|
1826
|
+
rb = "a { |b = 1, *c| }"
|
1827
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:lasgn, :b, s(:lit, 1)), :"*c"))
|
1828
|
+
|
1829
|
+
assert_parse rb, pt
|
1830
|
+
end
|
1831
|
+
|
1832
|
+
def test_block_arg_opt_arg_block
|
1833
|
+
rb = "a { |b, c=1, d, &e| }"
|
1834
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :b, s(:lasgn, :c, s(:lit, 1)), :d, :"&e"))
|
1835
|
+
|
1836
|
+
assert_parse rb, pt
|
1837
|
+
end
|
1838
|
+
|
1839
|
+
def test_block_opt_arg
|
1840
|
+
rb = "a { |b=1, c| }"
|
1841
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:lasgn, :b, s(:lit, 1)), :c))
|
1842
|
+
|
1843
|
+
assert_parse rb, pt
|
1844
|
+
end
|
1845
|
+
|
1846
|
+
def test_defn_opt_splat_arg
|
1847
|
+
rb = "def f (a = 1, *b, c) end"
|
1848
|
+
pt = s(:defn, :f, s(:args, s(:lasgn, :a, s(:lit, 1)), :"*b", :c), s(:nil))
|
1849
|
+
|
1850
|
+
assert_parse rb, pt
|
1851
|
+
end
|
1852
|
+
|
1853
|
+
def test_block_opt_splat_arg_block_omfg
|
1854
|
+
rb = "a { |b=1, *c, d, &e| }"
|
1855
|
+
pt = s(:iter,
|
1856
|
+
s(:call, nil, :a),
|
1857
|
+
s(:args, s(:lasgn, :b, s(:lit, 1)), :"*c", :d, :"&e"))
|
1858
|
+
|
1859
|
+
assert_parse rb, pt
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
def test_block_scope
|
1863
|
+
rb = "a { |;b| }"
|
1864
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:shadow, :b)))
|
1865
|
+
|
1866
|
+
assert_parse rb, pt
|
1867
|
+
end
|
1868
|
+
|
1869
|
+
def test_call_unary_bang
|
1870
|
+
rb = "!1"
|
1871
|
+
pt = s(:call, s(:lit, 1), :"!")
|
1872
|
+
|
1873
|
+
assert_parse rb, pt
|
1874
|
+
end
|
1875
|
+
|
1876
|
+
def test_assoc_label
|
1877
|
+
rb = "a(b:1)"
|
1878
|
+
pt = s(:call, nil, :a, s(:hash, s(:lit, :b), s(:lit, 1)))
|
1879
|
+
|
1880
|
+
assert_parse rb, pt
|
1881
|
+
end
|
1882
|
+
|
1883
|
+
def test_bang_eq
|
1884
|
+
rb = "1 != 2"
|
1885
|
+
pt = s(:call, s(:lit, 1), :"!=", s(:lit, 2))
|
1886
|
+
|
1887
|
+
assert_parse rb, pt
|
1888
|
+
end
|
1889
|
+
|
1890
|
+
def test_call_not
|
1891
|
+
rb = "not 42"
|
1892
|
+
pt = s(:call, s(:lit, 42), :"!")
|
1893
|
+
|
1894
|
+
assert_parse rb, pt
|
1895
|
+
end
|
1896
|
+
|
1897
|
+
def test_call_bang_command_call
|
1898
|
+
rb = "! a.b 1"
|
1899
|
+
pt = s(:call, s(:call, s(:call, nil, :a), :b, s(:lit, 1)), :"!")
|
1900
|
+
|
1901
|
+
assert_parse rb, pt
|
1902
|
+
end
|
1903
|
+
|
1904
|
+
def test_stabby_arg_no_paren
|
1905
|
+
rb = "->a{}"
|
1906
|
+
pt = s(:iter, s(:call, nil, :lambda), s(:args, :a))
|
1907
|
+
|
1908
|
+
assert_parse rb, pt
|
1909
|
+
end
|
1910
|
+
|
1911
|
+
def test_call_trailing_comma
|
1912
|
+
rb = "f(1,)"
|
1913
|
+
pt = s(:call, nil, :f, s(:lit, 1))
|
1914
|
+
|
1915
|
+
assert_parse rb, pt
|
1916
|
+
end
|
1917
|
+
|
1918
|
+
def test_method_call_trailing_comma
|
1919
|
+
rb = "a.f(1,)"
|
1920
|
+
pt = s(:call, s(:call, nil, :a), :f, s(:lit, 1))
|
1921
|
+
|
1922
|
+
assert_parse rb, pt
|
1923
|
+
end
|
1924
|
+
|
1925
|
+
def test_call_assoc_trailing_comma
|
1926
|
+
rb = "f(1=>2,)"
|
1927
|
+
pt = s(:call, nil, :f, s(:hash, s(:lit, 1), s(:lit, 2)))
|
1928
|
+
|
1929
|
+
assert_parse rb, pt
|
1930
|
+
end
|
1931
|
+
|
1932
|
+
def test_method_call_assoc_trailing_comma
|
1933
|
+
rb = "a.f(1=>2,)"
|
1934
|
+
pt = s(:call, s(:call, nil, :a), :f, s(:hash, s(:lit, 1), s(:lit, 2)))
|
1935
|
+
|
1936
|
+
assert_parse rb, pt
|
1937
|
+
end
|
1938
|
+
|
1939
|
+
def test_call_args_assoc_trailing_comma
|
1940
|
+
rb = "f(1, 2=>3,)"
|
1941
|
+
pt = s(:call, nil, :f, s(:lit, 1), s(:hash, s(:lit, 2), s(:lit, 3)))
|
1942
|
+
|
1943
|
+
assert_parse rb, pt
|
1944
|
+
end
|
1945
|
+
|
1946
|
+
def test_call_arg_assoc
|
1947
|
+
rb = "f(1, 2=>3)"
|
1948
|
+
pt = s(:call, nil, :f, s(:lit, 1), s(:hash, s(:lit, 2), s(:lit, 3)))
|
1949
|
+
|
1950
|
+
assert_parse rb, pt
|
1951
|
+
end
|
1952
|
+
|
1953
|
+
def test_call_assoc
|
1954
|
+
rb = "f(2=>3)"
|
1955
|
+
pt = s(:call, nil, :f, s(:hash, s(:lit, 2), s(:lit, 3)))
|
1956
|
+
|
1957
|
+
assert_parse rb, pt
|
1958
|
+
end
|
1959
|
+
|
1960
|
+
def test_return_call_assocs
|
1961
|
+
rb = "return y(z:1)"
|
1962
|
+
pt = s(:return, s(:call, nil, :y, s(:hash, s(:lit, :z), s(:lit, 1))))
|
1963
|
+
|
1964
|
+
assert_parse rb, pt
|
1965
|
+
|
1966
|
+
rb = "return y z:1"
|
1967
|
+
pt = s(:return, s(:call, nil, :y, s(:hash, s(:lit, :z), s(:lit, 1))))
|
1968
|
+
|
1969
|
+
assert_parse rb, pt
|
1970
|
+
|
1971
|
+
rb = "return y(z=>1)"
|
1972
|
+
pt = s(:return, s(:call, nil, :y, s(:hash, s(:call, nil, :z), s(:lit, 1))))
|
1973
|
+
|
1974
|
+
assert_parse rb, pt
|
1975
|
+
|
1976
|
+
rb = "return y :z=>1"
|
1977
|
+
pt = s(:return, s(:call, nil, :y, s(:hash, s(:lit, :z), s(:lit, 1))))
|
1978
|
+
|
1979
|
+
assert_parse rb, pt
|
1980
|
+
|
1981
|
+
rb = "return 1, :z => 1"
|
1982
|
+
pt = s(:return,
|
1983
|
+
s(:array,
|
1984
|
+
s(:lit, 1),
|
1985
|
+
s(:hash, s(:lit, :z), s(:lit, 1))))
|
1986
|
+
|
1987
|
+
assert_parse rb, pt
|
1988
|
+
|
1989
|
+
rb = "return 1, :z => 1, :w => 2"
|
1990
|
+
pt = s(:return,
|
1991
|
+
s(:array,
|
1992
|
+
s(:lit, 1),
|
1993
|
+
s(:hash, s(:lit, :z), s(:lit, 1), s(:lit, :w), s(:lit, 2))))
|
1994
|
+
|
1995
|
+
assert_parse rb, pt
|
1996
|
+
end
|
1997
|
+
|
1998
|
+
def test_yield_call_assocs
|
1999
|
+
rb = "yield y(z:1)"
|
2000
|
+
pt = s(:yield, s(:call, nil, :y, s(:hash, s(:lit, :z), s(:lit, 1))))
|
2001
|
+
|
2002
|
+
assert_parse rb, pt
|
2003
|
+
|
2004
|
+
rb = "yield y z:1"
|
2005
|
+
pt = s(:yield, s(:call, nil, :y, s(:hash, s(:lit, :z), s(:lit, 1))))
|
2006
|
+
|
2007
|
+
assert_parse rb, pt
|
2008
|
+
|
2009
|
+
rb = "yield y(z=>1)"
|
2010
|
+
pt = s(:yield, s(:call, nil, :y, s(:hash, s(:call, nil, :z), s(:lit, 1))))
|
2011
|
+
|
2012
|
+
assert_parse rb, pt
|
2013
|
+
|
2014
|
+
rb = "yield y :z=>1"
|
2015
|
+
pt = s(:yield, s(:call, nil, :y, s(:hash, s(:lit, :z), s(:lit, 1))))
|
2016
|
+
|
2017
|
+
assert_parse rb, pt
|
2018
|
+
|
2019
|
+
rb = "yield 1, :z => 1"
|
2020
|
+
pt = s(:yield,
|
2021
|
+
s(:lit, 1),
|
2022
|
+
s(:hash, s(:lit, :z), s(:lit, 1)))
|
2023
|
+
|
2024
|
+
assert_parse rb, pt
|
2025
|
+
|
2026
|
+
rb = "yield 1, :z => 1, :w => 2"
|
2027
|
+
pt = s(:yield,
|
2028
|
+
s(:lit, 1),
|
2029
|
+
s(:hash, s(:lit, :z), s(:lit, 1), s(:lit, :w), s(:lit, 2)))
|
2030
|
+
|
2031
|
+
assert_parse rb, pt
|
2032
|
+
end
|
2033
|
+
|
2034
|
+
def test_call_assoc_new
|
2035
|
+
rb = "f(a:3)"
|
2036
|
+
pt = s(:call, nil, :f, s(:hash, s(:lit, :a), s(:lit, 3)))
|
2037
|
+
|
2038
|
+
assert_parse rb, pt
|
2039
|
+
end
|
2040
|
+
|
2041
|
+
def test_do_lambda
|
2042
|
+
rb = "->() do end"
|
2043
|
+
pt = s(:iter, s(:call, nil, :lambda), s(:args))
|
2044
|
+
|
2045
|
+
assert_parse rb, pt
|
2046
|
+
end
|
2047
|
+
|
2048
|
+
def test_call_dot_parens
|
2049
|
+
rb = "1.()"
|
2050
|
+
pt = s(:call, s(:lit, 1), :call)
|
2051
|
+
|
2052
|
+
assert_parse rb, pt
|
2053
|
+
end
|
2054
|
+
|
2055
|
+
def test_call_colon_parens
|
2056
|
+
rb = "1::()"
|
2057
|
+
pt = s(:call, s(:lit, 1), :call)
|
2058
|
+
|
2059
|
+
assert_parse rb, pt
|
2060
|
+
end
|
2061
|
+
|
2062
|
+
def test_block_args_opt2
|
2063
|
+
rb = "a { | b=1, c=2 | }"
|
2064
|
+
pt = s(:iter,
|
2065
|
+
s(:call, nil, :a),
|
2066
|
+
s(:args, s(:lasgn, :b, s(:lit, 1)), s(:lasgn, :c, s(:lit, 2))))
|
2067
|
+
|
2068
|
+
assert_parse rb, pt
|
2069
|
+
end
|
2070
|
+
|
2071
|
+
def test_block_paren_splat # TODO: rename # TODO: should work on 1.8
|
2072
|
+
rb = "a { |(b, *c)| }"
|
2073
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:masgn, :b, :"*c")))
|
2074
|
+
|
2075
|
+
assert_parse rb, pt
|
2076
|
+
end
|
2077
|
+
|
2078
|
+
def test_masgn_anon_splat_arg
|
2079
|
+
rb = "*, a = b"
|
2080
|
+
pt = s(:masgn,
|
2081
|
+
s(:array, s(:splat), s(:lasgn, :a)),
|
2082
|
+
s(:to_ary, s(:call, nil, :b)))
|
2083
|
+
|
2084
|
+
assert_parse rb, pt
|
2085
|
+
end
|
2086
|
+
|
2087
|
+
def test_masgn_splat_arg
|
2088
|
+
rb = "*a, b = c"
|
2089
|
+
pt = s(:masgn,
|
2090
|
+
s(:array, s(:splat, s(:lasgn, :a)), s(:lasgn, :b)),
|
2091
|
+
s(:to_ary, s(:call, nil, :c)))
|
2092
|
+
|
2093
|
+
assert_parse rb, pt
|
2094
|
+
end
|
2095
|
+
|
2096
|
+
def test_lasgn_lasgn_command_call
|
2097
|
+
rb = "a = b = c 1"
|
2098
|
+
pt = s(:lasgn, :a, s(:lasgn, :b, s(:call, nil, :c, s(:lit, 1))))
|
2099
|
+
|
2100
|
+
assert_parse rb, pt
|
2101
|
+
end
|
2102
|
+
|
2103
|
+
def test_masgn_arg_splat_arg
|
2104
|
+
rb = "a, *b, c = d"
|
2105
|
+
pt = s(:masgn,
|
2106
|
+
s(:array, s(:lasgn, :a), s(:splat, s(:lasgn, :b)), s(:lasgn, :c)),
|
2107
|
+
s(:to_ary, s(:call, nil, :d)))
|
2108
|
+
|
2109
|
+
assert_parse rb, pt
|
2110
|
+
end
|
2111
|
+
|
2112
|
+
def test_masgn_splat_arg_arg
|
2113
|
+
rb = "*a, b, c = d"
|
2114
|
+
pt = s(:masgn,
|
2115
|
+
s(:array, s(:splat, s(:lasgn, :a)), s(:lasgn, :b), s(:lasgn, :c)),
|
2116
|
+
s(:to_ary, s(:call, nil, :d)))
|
2117
|
+
|
2118
|
+
assert_parse rb, pt
|
2119
|
+
end
|
2120
|
+
|
2121
|
+
def test_block_decomp_anon_splat_arg
|
2122
|
+
rb = "f { |(*, a)| }"
|
2123
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, s(:masgn, :*, :a)))
|
2124
|
+
|
2125
|
+
assert_parse rb, pt
|
2126
|
+
end
|
2127
|
+
|
2128
|
+
def test_block_decomp_arg_splat_arg
|
2129
|
+
rb = "f { |(a, *b, c)| }"
|
2130
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, s(:masgn, :a, :"*b", :c)))
|
2131
|
+
|
2132
|
+
assert_parse rb, pt
|
2133
|
+
end
|
2134
|
+
|
2135
|
+
def test_symbol_empty
|
2136
|
+
skip "can't do this in ruby 1.8" if RUBY_VERSION < "1.9"
|
2137
|
+
|
2138
|
+
rb = ":''"
|
2139
|
+
pt = s(:lit, "".to_sym)
|
2140
|
+
|
2141
|
+
assert_parse rb, pt
|
2142
|
+
end
|
2143
|
+
|
2144
|
+
def test_masgn_var_star_var
|
2145
|
+
rb = "a, *, b = c" # TODO: blog
|
2146
|
+
pt = s(:masgn,
|
2147
|
+
s(:array, s(:lasgn, :a), s(:splat), s(:lasgn, :b)),
|
2148
|
+
s(:to_ary, s(:call, nil, :c)))
|
2149
|
+
|
2150
|
+
assert_parse rb, pt
|
2151
|
+
end
|
2152
|
+
|
2153
|
+
def test_mlhs_keyword
|
2154
|
+
rb = "a.!=(true, true)"
|
2155
|
+
pt = s(:call, s(:call, nil, :a), :"!=", s(:true), s(:true))
|
2156
|
+
|
2157
|
+
assert_parse rb, pt
|
2158
|
+
end
|
2159
|
+
|
2160
|
+
def test_call_array_lit_inline_hash
|
2161
|
+
rb = "a([:b, :c => 1])"
|
2162
|
+
pt = s(:call, nil, :a, s(:array, s(:lit, :b), s(:hash, s(:lit, :c), s(:lit, 1))))
|
2163
|
+
|
2164
|
+
assert_parse rb, pt
|
2165
|
+
end
|
2166
|
+
|
2167
|
+
def test_multiline_hash_declaration
|
2168
|
+
pt = s(:call, nil, :f, s(:hash, s(:lit, :state), s(:hash)))
|
2169
|
+
|
2170
|
+
assert_parse "f(state: {})", pt
|
2171
|
+
assert_parse "f(state: {\n})", pt
|
2172
|
+
assert_parse "f(state:\n {\n})", pt
|
2173
|
+
end
|
2174
|
+
end
|
2175
|
+
|
2176
|
+
module TestRubyParserShared20to22
|
2177
|
+
def test_defs_kwarg
|
2178
|
+
rb = "def self.a b: 1\nend"
|
2179
|
+
pt = s(:defs, s(:self), :a, s(:args, s(:kwarg, :b, s(:lit, 1))), s(:nil))
|
2180
|
+
|
2181
|
+
assert_parse rb, pt
|
2182
|
+
end
|
2183
|
+
|
2184
|
+
def test_defn_kwarg_kwsplat
|
2185
|
+
rb = "def a(b: 1, **c) end"
|
2186
|
+
pt = s(:defn, :a, s(:args, s(:kwarg, :b, s(:lit, 1)), :"**c"), s(:nil))
|
2187
|
+
|
2188
|
+
assert_parse rb, pt
|
2189
|
+
end
|
2190
|
+
|
2191
|
+
def test_defn_kwarg_env
|
2192
|
+
rb = "def test(**testing) test_splat(**testing) end"
|
2193
|
+
pt = s(:defn, :test, s(:args, :"**testing"),
|
2194
|
+
s(:call, nil, :test_splat, s(:hash, s(:kwsplat, s(:lvar, :testing)))))
|
2195
|
+
|
2196
|
+
assert_parse rb, pt
|
2197
|
+
end
|
2198
|
+
|
2199
|
+
def test_call_arg_kwsplat
|
2200
|
+
rb = "a(b, **1)"
|
2201
|
+
pt = s(:call, nil, :a, s(:call, nil, :b), s(:hash, s(:kwsplat, s(:lit, 1))))
|
2202
|
+
|
2203
|
+
assert_parse rb, pt
|
2204
|
+
end
|
2205
|
+
|
2206
|
+
def test_call_arg_assoc_kwsplat
|
2207
|
+
rb = "f(1, kw: 2, **3)"
|
2208
|
+
pt = s(:call, nil, :f,
|
2209
|
+
s(:lit, 1),
|
2210
|
+
s(:hash, s(:lit, :kw), s(:lit, 2), s(:kwsplat, s(:lit, 3))))
|
2211
|
+
|
2212
|
+
assert_parse rb, pt
|
2213
|
+
end
|
2214
|
+
|
2215
|
+
def test_call_kwsplat
|
2216
|
+
rb = "a(**1)"
|
2217
|
+
pt = s(:call, nil, :a, s(:hash, s(:kwsplat, s(:lit, 1))))
|
2218
|
+
|
2219
|
+
assert_parse rb, pt
|
2220
|
+
end
|
2221
|
+
|
2222
|
+
def test_iter_kwarg
|
2223
|
+
rb = "a { |b: 1| }"
|
2224
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:kwarg, :b, s(:lit, 1))))
|
2225
|
+
|
2226
|
+
assert_parse rb, pt
|
2227
|
+
end
|
2228
|
+
|
2229
|
+
def test_iter_kwarg_kwsplat
|
2230
|
+
rb = "a { |b: 1, **c| }"
|
2231
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, s(:kwarg, :b, s(:lit, 1)), :"**c"))
|
2232
|
+
|
2233
|
+
assert_parse rb, pt
|
2234
|
+
end
|
2235
|
+
|
2236
|
+
def test_block_kwarg_lvar
|
2237
|
+
rb = "bl { |kw: :val| kw }"
|
2238
|
+
pt = s(:iter, s(:call, nil, :bl), s(:args, s(:kwarg, :kw, s(:lit, :val))),
|
2239
|
+
s(:lvar, :kw))
|
2240
|
+
|
2241
|
+
assert_parse rb, pt
|
2242
|
+
end
|
2243
|
+
|
2244
|
+
def test_block_kwarg_lvar_multiple
|
2245
|
+
rb = "bl { |kw: :val, kw2: :val2 | kw }"
|
2246
|
+
pt = s(:iter, s(:call, nil, :bl),
|
2247
|
+
s(:args,
|
2248
|
+
s(:kwarg, :kw, s(:lit, :val)),
|
2249
|
+
s(:kwarg, :kw2, s(:lit, :val2))),
|
2250
|
+
s(:lvar, :kw))
|
2251
|
+
|
2252
|
+
assert_parse rb, pt
|
2253
|
+
end
|
2254
|
+
end
|
2255
|
+
|
2256
|
+
class TestRubyParser < Minitest::Test
|
2257
|
+
def test_parse
|
2258
|
+
processor = RubyParser.new
|
2259
|
+
|
2260
|
+
# 1.8 only syntax
|
2261
|
+
rb = "while false : 42 end"
|
2262
|
+
pt = s(:while, s(:false), s(:lit, 42), true)
|
2263
|
+
|
2264
|
+
assert_silent do
|
2265
|
+
assert_equal pt, processor.parse(rb)
|
2266
|
+
end
|
2267
|
+
|
2268
|
+
# 1.9 only syntax
|
2269
|
+
rb = "a.()"
|
2270
|
+
pt = s(:call, s(:call, nil, :a), :call)
|
2271
|
+
|
2272
|
+
assert_equal pt, processor.parse(rb)
|
2273
|
+
|
2274
|
+
# bad syntax
|
2275
|
+
e = assert_raises Racc::ParseError do
|
2276
|
+
capture_io do
|
2277
|
+
processor.parse "a.("
|
2278
|
+
end
|
2279
|
+
end
|
2280
|
+
|
2281
|
+
msg = "(string):1 :: parse error on value \"(\" (tLPAREN2)"
|
2282
|
+
assert_equal msg, e.message.strip
|
2283
|
+
end
|
2284
|
+
end
|
2285
|
+
|
2286
|
+
class TestRuby18Parser < RubyParserTestCase
|
2287
|
+
include TestRubyParserShared
|
2288
|
+
|
2289
|
+
def setup
|
2290
|
+
super
|
2291
|
+
|
2292
|
+
self.processor = Ruby18Parser.new
|
2293
|
+
end
|
2294
|
+
|
2295
|
+
def test_call_space_before_paren_args
|
2296
|
+
rb = "a (:b, :c, :d => :e)"
|
2297
|
+
pt = s(:call, nil, :a,
|
2298
|
+
s(:lit, :b),
|
2299
|
+
s(:lit, :c),
|
2300
|
+
s(:hash, s(:lit, :d), s(:lit, :e)))
|
2301
|
+
|
2302
|
+
assert_parse rb, pt
|
2303
|
+
end
|
2304
|
+
|
2305
|
+
def test_flip2_env_lvar
|
2306
|
+
rb = "if a..b then end"
|
2307
|
+
pt = s(:if, s(:flip2, s(:call, nil, :a), s(:call, nil, :b)), nil, nil)
|
2308
|
+
|
2309
|
+
assert_parse rb, pt
|
2310
|
+
|
2311
|
+
top_env = processor.env.env.first
|
2312
|
+
|
2313
|
+
assert_kind_of Hash, top_env
|
2314
|
+
|
2315
|
+
flip = top_env.find { |k,v| k =~ /^flip/ }
|
2316
|
+
|
2317
|
+
assert flip
|
2318
|
+
assert_equal :lvar, flip.last
|
2319
|
+
end
|
2320
|
+
|
2321
|
+
def test_assoc_list_18
|
2322
|
+
rb = "{1, 2, 3, 4}"
|
2323
|
+
pt = s(:hash, s(:lit, 1), s(:lit, 2), s(:lit, 3), s(:lit, 4))
|
2324
|
+
|
2325
|
+
assert_parse rb, pt
|
2326
|
+
end
|
2327
|
+
|
2328
|
+
def test_case_then_colon_18
|
2329
|
+
rb = "case x; when Fixnum: 42; end"
|
2330
|
+
pt = s(:case,
|
2331
|
+
s(:call, nil, :x),
|
2332
|
+
s(:when, s(:array, s(:const, :Fixnum)), s(:lit, 42)),
|
2333
|
+
nil)
|
2334
|
+
|
2335
|
+
assert_parse rb, pt
|
2336
|
+
end
|
2337
|
+
|
2338
|
+
def test_do_colon_18
|
2339
|
+
rb = "while false : 42 end"
|
2340
|
+
pt = s(:while, s(:false), s(:lit, 42), true)
|
2341
|
+
|
2342
|
+
assert_parse rb, pt
|
2343
|
+
end
|
2344
|
+
|
2345
|
+
def test_parse_until_not_canonical
|
2346
|
+
rb = "until not var.nil?\n 'foo'\nend"
|
2347
|
+
|
2348
|
+
pt = s(:while,
|
2349
|
+
s(:call, s(:call, nil, :var), :nil?),
|
2350
|
+
s(:str, "foo"), true)
|
2351
|
+
|
2352
|
+
assert_parse rb, pt
|
2353
|
+
end
|
2354
|
+
|
2355
|
+
def test_parse_until_not_noncanonical
|
2356
|
+
rb = "until not var.nil?\n 'foo'\nend"
|
2357
|
+
pt = s(:until,
|
2358
|
+
s(:not, s(:call, s(:call, nil, :var), :nil?)),
|
2359
|
+
s(:str, "foo"), true)
|
2360
|
+
|
2361
|
+
processor.canonicalize_conditions = false
|
2362
|
+
|
2363
|
+
assert_parse rb, pt
|
2364
|
+
end
|
2365
|
+
|
2366
|
+
def test_parse_if_not_canonical
|
2367
|
+
rb = "if not var.nil? then 'foo' else 'bar'\nend"
|
2368
|
+
pt = s(:if,
|
2369
|
+
s(:call, s(:call, nil, :var), :nil?),
|
2370
|
+
s(:str, "bar"),
|
2371
|
+
s(:str, "foo"))
|
2372
|
+
|
2373
|
+
assert_parse rb, pt
|
2374
|
+
end
|
2375
|
+
|
2376
|
+
def test_parse_if_not_noncanonical
|
2377
|
+
rb = "if not var.nil? then 'foo' else 'bar'\nend"
|
2378
|
+
pt = s(:if,
|
2379
|
+
s(:not, s(:call, s(:call, nil, :var), :nil?)),
|
2380
|
+
s(:str, "foo"),
|
2381
|
+
s(:str, "bar"))
|
2382
|
+
|
2383
|
+
processor.canonicalize_conditions = false
|
2384
|
+
|
2385
|
+
assert_parse rb, pt
|
2386
|
+
end
|
2387
|
+
|
2388
|
+
def test_parse_while_not_canonical
|
2389
|
+
rb = "while not var.nil?\n 'foo'\nend"
|
2390
|
+
pt = s(:until,
|
2391
|
+
s(:call, s(:call, nil, :var), :nil?),
|
2392
|
+
s(:str, "foo"), true)
|
2393
|
+
|
2394
|
+
assert_parse rb, pt
|
2395
|
+
end
|
2396
|
+
|
2397
|
+
def test_parse_while_not_noncanonical
|
2398
|
+
rb = "while not var.nil?\n 'foo'\nend"
|
2399
|
+
pt = s(:while,
|
2400
|
+
s(:not, s(:call, s(:call, nil, :var), :nil?)),
|
2401
|
+
s(:str, "foo"), true)
|
2402
|
+
|
2403
|
+
processor.canonicalize_conditions = false
|
2404
|
+
|
2405
|
+
assert_parse rb, pt
|
2406
|
+
end
|
2407
|
+
|
2408
|
+
def test_double_block_error_10
|
2409
|
+
assert_syntax_error "a.b (&b) {}", BLOCK_DUP_MSG
|
2410
|
+
end
|
2411
|
+
|
2412
|
+
def test_double_block_error_11
|
2413
|
+
assert_syntax_error "a (1, &b) { }", BLOCK_DUP_MSG
|
2414
|
+
end
|
2415
|
+
|
2416
|
+
def test_double_block_error_12
|
2417
|
+
assert_syntax_error "a (1, &b) do end", BLOCK_DUP_MSG
|
2418
|
+
end
|
2419
|
+
|
2420
|
+
def test_double_block_error_13
|
2421
|
+
assert_syntax_error "m.a (1, &b) { }", BLOCK_DUP_MSG
|
2422
|
+
end
|
2423
|
+
|
2424
|
+
def test_double_block_error_14
|
2425
|
+
assert_syntax_error "m.a (1, &b) do end", BLOCK_DUP_MSG
|
2426
|
+
end
|
2427
|
+
|
2428
|
+
def test_double_block_error_15
|
2429
|
+
assert_syntax_error "m::a (1, &b) { }", BLOCK_DUP_MSG
|
2430
|
+
end
|
2431
|
+
|
2432
|
+
def test_double_block_error_16
|
2433
|
+
assert_syntax_error "m::a (1, &b) do end", BLOCK_DUP_MSG
|
2434
|
+
end
|
2435
|
+
|
2436
|
+
# In 1.8, block args with an outer set of parens are superfluous.
|
2437
|
+
# In 1.9, outer set of parens are NOT... they are an explicit extra masgn.
|
2438
|
+
|
2439
|
+
def test_iter_args_2_18
|
2440
|
+
rb = "f { |(a, b)| }"
|
2441
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :a, :b))
|
2442
|
+
|
2443
|
+
assert_parse rb, pt
|
2444
|
+
end
|
2445
|
+
|
2446
|
+
def test_bug_args__18
|
2447
|
+
rb = "f { |(a, b)| }"
|
2448
|
+
pt = s(:iter, s(:call, nil, :f),
|
2449
|
+
s(:args, :a, :b))
|
2450
|
+
|
2451
|
+
assert_parse rb, pt
|
2452
|
+
end
|
2453
|
+
|
2454
|
+
def test_bug_args_masgn_outer_parens__18
|
2455
|
+
rb = "f { |((a, b), c)| }"
|
2456
|
+
pt = s(:iter, # NOTE: same sexp as test_bug_args_masgn
|
2457
|
+
s(:call, nil, :f),
|
2458
|
+
s(:args, s(:masgn, :a, :b), :c))
|
2459
|
+
|
2460
|
+
assert_parse rb, pt.dup
|
2461
|
+
end
|
2462
|
+
|
2463
|
+
def test_call_unary_bang
|
2464
|
+
rb = "!1"
|
2465
|
+
pt = s(:not, s(:lit, 1))
|
2466
|
+
|
2467
|
+
assert_parse rb, pt
|
2468
|
+
end
|
2469
|
+
|
2470
|
+
def test_bang_eq
|
2471
|
+
rb = "1 != 2"
|
2472
|
+
pt = s(:not, s(:call, s(:lit, 1), :"==", s(:lit, 2)))
|
2473
|
+
|
2474
|
+
assert_parse rb, pt
|
2475
|
+
end
|
2476
|
+
|
2477
|
+
def test_call_not
|
2478
|
+
rb = "not 42"
|
2479
|
+
pt = s(:not, s(:lit, 42))
|
2480
|
+
|
2481
|
+
assert_parse rb, pt
|
2482
|
+
end
|
2483
|
+
|
2484
|
+
def test_call_bang_command_call
|
2485
|
+
rb = "! a.b 1"
|
2486
|
+
pt = s(:not, s(:call, s(:call, nil, :a), :b, s(:lit, 1)))
|
2487
|
+
|
2488
|
+
assert_parse rb, pt
|
2489
|
+
end
|
2490
|
+
end
|
2491
|
+
|
2492
|
+
class TestRuby19Parser < RubyParserTestCase
|
2493
|
+
include TestRubyParserShared
|
2494
|
+
include TestRubyParserShared19to22
|
2495
|
+
|
2496
|
+
def setup
|
2497
|
+
super
|
2498
|
+
|
2499
|
+
self.processor = Ruby19Parser.new
|
2500
|
+
end
|
2501
|
+
|
2502
|
+
def test_mlhs_back_splat
|
2503
|
+
rb = "a, b, c, *s = f"
|
2504
|
+
pt = s(:masgn,
|
2505
|
+
s(:array,
|
2506
|
+
s(:lasgn, :a), s(:lasgn, :b), s(:lasgn, :c),
|
2507
|
+
s(:splat, s(:lasgn, :s))),
|
2508
|
+
s(:to_ary, s(:call, nil, :f)))
|
2509
|
+
|
2510
|
+
assert_parse rb, pt
|
2511
|
+
end
|
2512
|
+
|
2513
|
+
def test_mlhs_back_anonsplat
|
2514
|
+
rb = "a, b, c, * = f"
|
2515
|
+
pt = s(:masgn,
|
2516
|
+
s(:array,
|
2517
|
+
s(:lasgn, :a), s(:lasgn, :b), s(:lasgn, :c),
|
2518
|
+
s(:splat)),
|
2519
|
+
s(:to_ary, s(:call, nil, :f)))
|
2520
|
+
|
2521
|
+
assert_parse rb, pt
|
2522
|
+
end
|
2523
|
+
|
2524
|
+
def test_mlhs_mid_splat
|
2525
|
+
rb = "a, b, c, *s, x, y, z = f"
|
2526
|
+
pt = s(:masgn,
|
2527
|
+
s(:array,
|
2528
|
+
s(:lasgn, :a), s(:lasgn, :b), s(:lasgn, :c),
|
2529
|
+
s(:splat, s(:lasgn, :s)),
|
2530
|
+
s(:lasgn, :x), s(:lasgn, :y), s(:lasgn, :z)),
|
2531
|
+
s(:to_ary, s(:call, nil, :f)))
|
2532
|
+
|
2533
|
+
assert_parse rb, pt
|
2534
|
+
end
|
2535
|
+
|
2536
|
+
def test_mlhs_mid_anonsplat
|
2537
|
+
rb = "a, b, c, *, x, y, z = f"
|
2538
|
+
pt = s(:masgn,
|
2539
|
+
s(:array, s(:lasgn, :a), s(:splat), s(:lasgn, :z)),
|
2540
|
+
s(:to_ary, s(:call, nil, :f)))
|
2541
|
+
pt = s(:masgn,
|
2542
|
+
s(:array,
|
2543
|
+
s(:lasgn, :a), s(:lasgn, :b), s(:lasgn, :c),
|
2544
|
+
s(:splat),
|
2545
|
+
s(:lasgn, :x), s(:lasgn, :y), s(:lasgn, :z)),
|
2546
|
+
s(:to_ary, s(:call, nil, :f)))
|
2547
|
+
|
2548
|
+
assert_parse rb, pt
|
2549
|
+
end
|
2550
|
+
|
2551
|
+
def test_mlhs_front_splat
|
2552
|
+
rb = "*s, x, y, z = f"
|
2553
|
+
pt = s(:masgn,
|
2554
|
+
s(:array, s(:splat, s(:lasgn, :s)), s(:lasgn, :z)),
|
2555
|
+
s(:to_ary, s(:call, nil, :f)))
|
2556
|
+
pt = s(:masgn,
|
2557
|
+
s(:array,
|
2558
|
+
s(:splat, s(:lasgn, :s)),
|
2559
|
+
s(:lasgn, :x), s(:lasgn, :y), s(:lasgn, :z)),
|
2560
|
+
s(:to_ary, s(:call, nil, :f)))
|
2561
|
+
|
2562
|
+
assert_parse rb, pt
|
2563
|
+
end
|
2564
|
+
|
2565
|
+
def test_mlhs_front_anonsplat
|
2566
|
+
rb = "*, x, y, z = f"
|
2567
|
+
pt = s(:masgn,
|
2568
|
+
s(:array,
|
2569
|
+
s(:splat),
|
2570
|
+
s(:lasgn, :x), s(:lasgn, :y), s(:lasgn, :z)),
|
2571
|
+
s(:to_ary, s(:call, nil, :f)))
|
2572
|
+
|
2573
|
+
assert_parse rb, pt
|
2574
|
+
end
|
2575
|
+
|
2576
|
+
def test_expr_not_bang
|
2577
|
+
rb = "! a b"
|
2578
|
+
pt = s(:call, s(:call, nil, :a, s(:call, nil, :b)), :"!")
|
2579
|
+
|
2580
|
+
assert_parse rb, pt
|
2581
|
+
end
|
2582
|
+
|
2583
|
+
def test_do_colon_19
|
2584
|
+
rb = "while false : 42 end"
|
2585
|
+
|
2586
|
+
assert_parse_error rb, "(string):1 :: parse error on value \":\" (tCOLON)"
|
2587
|
+
end
|
2588
|
+
|
2589
|
+
def test_assoc_list_19
|
2590
|
+
rb = "{1, 2, 3, 4}"
|
2591
|
+
|
2592
|
+
assert_parse_error rb, "(string):1 :: parse error on value \",\" (tCOMMA)"
|
2593
|
+
end
|
2594
|
+
|
2595
|
+
def test_case_then_colon_19
|
2596
|
+
rb = <<-EOM
|
2597
|
+
case x
|
2598
|
+
when Fixnum : # need the space to not hit new hash arg syntax
|
2599
|
+
42
|
2600
|
+
end
|
2601
|
+
EOM
|
2602
|
+
|
2603
|
+
assert_parse_error rb, "(string):2 :: parse error on value \":\" (tCOLON)"
|
2604
|
+
end
|
2605
|
+
|
2606
|
+
def test_parse_def_xxx1
|
2607
|
+
rb = 'def f(a, *b, c = nil) end'
|
2608
|
+
|
2609
|
+
assert_parse_error rb, '(string):1 :: parse error on value "=" (tEQL)'
|
2610
|
+
end
|
2611
|
+
|
2612
|
+
def test_parse_def_xxx2
|
2613
|
+
rb = 'def f(a = nil, *b, c = nil) end'
|
2614
|
+
|
2615
|
+
assert_parse_error rb, '(string):1 :: parse error on value "=" (tEQL)'
|
2616
|
+
end
|
2617
|
+
|
2618
|
+
def test_parse_until_not_canonical
|
2619
|
+
rb = "until not var.nil?\n 'foo'\nend"
|
2620
|
+
pt = s(:until,
|
2621
|
+
s(:call, s(:call, s(:call, nil, :var), :nil?), :"!"),
|
2622
|
+
s(:str, "foo"), true)
|
2623
|
+
|
2624
|
+
assert_parse rb, pt
|
2625
|
+
end
|
2626
|
+
|
2627
|
+
def test_parse_until_not_noncanonical
|
2628
|
+
rb = "until not var.nil?\n 'foo'\nend"
|
2629
|
+
pt = s(:until,
|
2630
|
+
s(:call, s(:call, s(:call, nil, :var), :nil?), :"!"),
|
2631
|
+
s(:str, "foo"), true)
|
2632
|
+
|
2633
|
+
processor.canonicalize_conditions = false
|
2634
|
+
|
2635
|
+
assert_parse rb, pt
|
2636
|
+
end
|
2637
|
+
|
2638
|
+
def test_parse_if_not_canonical
|
2639
|
+
rb = "if not var.nil? then 'foo' else 'bar'\nend"
|
2640
|
+
pt = s(:if,
|
2641
|
+
s(:call, s(:call, s(:call, nil, :var), :nil?), :"!"),
|
2642
|
+
s(:str, "foo"),
|
2643
|
+
s(:str, "bar"))
|
2644
|
+
|
2645
|
+
assert_parse rb, pt
|
2646
|
+
end
|
2647
|
+
|
2648
|
+
def test_parse_if_not_noncanonical
|
2649
|
+
rb = "if not var.nil? then 'foo' else 'bar'\nend"
|
2650
|
+
pt = s(:if,
|
2651
|
+
s(:call, s(:call, s(:call, nil, :var), :nil?), :"!"),
|
2652
|
+
s(:str, "foo"),
|
2653
|
+
s(:str, "bar"))
|
2654
|
+
|
2655
|
+
processor.canonicalize_conditions = false
|
2656
|
+
|
2657
|
+
assert_parse rb, pt
|
2658
|
+
end
|
2659
|
+
|
2660
|
+
def test_parse_while_not_canonical
|
2661
|
+
rb = "while not var.nil?\n 'foo'\nend"
|
2662
|
+
pt = s(:while,
|
2663
|
+
s(:call, s(:call, s(:call, nil, :var), :nil?), :"!"),
|
2664
|
+
s(:str, "foo"), true)
|
2665
|
+
|
2666
|
+
assert_parse rb, pt
|
2667
|
+
end
|
2668
|
+
|
2669
|
+
def test_parse_while_not_noncanonical
|
2670
|
+
rb = "while not var.nil?\n 'foo'\nend"
|
2671
|
+
pt = s(:while,
|
2672
|
+
s(:call, s(:call, s(:call, nil, :var), :nil?), :"!"),
|
2673
|
+
s(:str, "foo"), true)
|
2674
|
+
|
2675
|
+
processor.canonicalize_conditions = false
|
2676
|
+
|
2677
|
+
assert_parse rb, pt
|
2678
|
+
end
|
2679
|
+
|
2680
|
+
def test_parse_opt_call_args_assocs_comma
|
2681
|
+
rb = "1[2=>3,]"
|
2682
|
+
pt = s(:call, s(:lit, 1), :[], s(:hash, s(:lit, 2), s(:lit, 3)))
|
2683
|
+
|
2684
|
+
assert_parse rb, pt
|
2685
|
+
end
|
2686
|
+
|
2687
|
+
def test_parse_opt_call_args_lit_comma
|
2688
|
+
rb = "1[2,]"
|
2689
|
+
pt = s(:call, s(:lit, 1), :[], s(:lit, 2))
|
2690
|
+
|
2691
|
+
assert_parse rb, pt
|
2692
|
+
end
|
2693
|
+
|
2694
|
+
def test_bug_hash_args
|
2695
|
+
rb = "foo(:bar, baz: nil)"
|
2696
|
+
pt = s(:call, nil, :foo,
|
2697
|
+
s(:lit, :bar),
|
2698
|
+
s(:hash, s(:lit, :baz), s(:nil)))
|
2699
|
+
|
2700
|
+
assert_parse rb, pt
|
2701
|
+
end
|
2702
|
+
|
2703
|
+
def test_bug_hash_args_trailing_comma
|
2704
|
+
rb = "foo(:bar, baz: nil,)"
|
2705
|
+
pt = s(:call, nil, :foo, # NOTE: same sexp as test_bug_hash_args
|
2706
|
+
s(:lit, :bar),
|
2707
|
+
s(:hash, s(:lit, :baz), s(:nil)))
|
2708
|
+
|
2709
|
+
assert_parse rb, pt
|
2710
|
+
end
|
2711
|
+
|
2712
|
+
def test_block_arg_optional
|
2713
|
+
rb = "a { |b = 1| }"
|
2714
|
+
pt = s(:iter,
|
2715
|
+
s(:call, nil, :a),
|
2716
|
+
s(:args, s(:lasgn, :b, s(:lit, 1))))
|
2717
|
+
|
2718
|
+
assert_parse rb, pt
|
2719
|
+
end
|
2720
|
+
|
2721
|
+
def test_zomg_sometimes_i_hate_this_project
|
2722
|
+
rb = <<-RUBY
|
2723
|
+
{
|
2724
|
+
a: lambda { b ? c() : d },
|
2725
|
+
e: nil,
|
2726
|
+
}
|
2727
|
+
RUBY
|
2728
|
+
|
2729
|
+
pt = s(:hash,
|
2730
|
+
s(:lit, :a),
|
2731
|
+
s(:iter,
|
2732
|
+
s(:call, nil, :lambda),
|
2733
|
+
0,
|
2734
|
+
s(:if, s(:call, nil, :b), s(:call, nil, :c), s(:call, nil, :d))),
|
2735
|
+
|
2736
|
+
s(:lit, :e),
|
2737
|
+
s(:nil))
|
2738
|
+
|
2739
|
+
assert_parse rb, pt
|
2740
|
+
end
|
2741
|
+
|
2742
|
+
def test_pipe_semicolon
|
2743
|
+
skip "not yet"
|
2744
|
+
|
2745
|
+
rb = "a.b do | ; c | end"
|
2746
|
+
pt = s(:iter, s(:call, s(:call, nil, :a), :b), 0)
|
2747
|
+
|
2748
|
+
assert_parse rb, pt
|
2749
|
+
end
|
2750
|
+
|
2751
|
+
def test_wtf
|
2752
|
+
# lambda -> f_larglist lambda_body
|
2753
|
+
# f_larglist -> f_args opt_bv_decl
|
2754
|
+
# opt_bv_decl
|
2755
|
+
# bv_decls
|
2756
|
+
# bvar
|
2757
|
+
|
2758
|
+
rb = "->(a, b=nil) { p [a, b] }"
|
2759
|
+
pt = s(:iter,
|
2760
|
+
s(:call, nil, :lambda),
|
2761
|
+
s(:args, :a, s(:lasgn, :b, s(:nil))),
|
2762
|
+
s(:call, nil, :p, s(:array, s(:lvar, :a), s(:lvar, :b))))
|
2763
|
+
|
2764
|
+
assert_parse rb, pt
|
2765
|
+
|
2766
|
+
# rb = "->(a; b) { p [a, b] }"
|
2767
|
+
#
|
2768
|
+
# assert_parse rb, pt
|
2769
|
+
end
|
2770
|
+
|
2771
|
+
def test_block_args_opt1
|
2772
|
+
rb = "f { |a, b = 42| [a, b] }"
|
2773
|
+
pt = s(:iter,
|
2774
|
+
s(:call, nil, :f),
|
2775
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42))),
|
2776
|
+
s(:array, s(:lvar, :a), s(:lvar, :b)))
|
2777
|
+
|
2778
|
+
assert_parse rb, pt
|
2779
|
+
end
|
2780
|
+
|
2781
|
+
def test_block_args_opt2
|
2782
|
+
rb = "f { |a, b = 42, c = 24| [a, b, c] }"
|
2783
|
+
pt = s(:iter,
|
2784
|
+
s(:call, nil, :f),
|
2785
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), s(:lasgn, :c, s(:lit, 24))),
|
2786
|
+
s(:array, s(:lvar, :a), s(:lvar, :b), s(:lvar, :c)))
|
2787
|
+
|
2788
|
+
assert_parse rb, pt
|
2789
|
+
end
|
2790
|
+
|
2791
|
+
def test_block_args_opt3
|
2792
|
+
rb = "f { |a, b = 42, c = 24, &d| [a, b, c, d] }"
|
2793
|
+
pt = s(:iter,
|
2794
|
+
s(:call, nil, :f),
|
2795
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), s(:lasgn, :c, s(:lit, 24)), :"&d"),
|
2796
|
+
s(:array, s(:lvar, :a), s(:lvar, :b), s(:lvar, :c), s(:lvar, :d)))
|
2797
|
+
|
2798
|
+
assert_parse rb, pt
|
2799
|
+
end
|
2800
|
+
|
2801
|
+
def test_i_have_no_freakin_clue
|
2802
|
+
rb = "1 ? b('') : 2\na d: 3"
|
2803
|
+
pt = s(:block,
|
2804
|
+
s(:if, s(:lit, 1), s(:call, nil, :b, s(:str, "")), s(:lit, 2)),
|
2805
|
+
s(:call, nil, :a, s(:hash, s(:lit, :d), s(:lit, 3))))
|
2806
|
+
|
2807
|
+
assert_parse rb, pt
|
2808
|
+
end
|
2809
|
+
|
2810
|
+
def test_motherfuckin_leading_dots
|
2811
|
+
rb = "a\n.b"
|
2812
|
+
pt = s(:call, s(:call, nil, :a), :b)
|
2813
|
+
|
2814
|
+
assert_parse rb, pt
|
2815
|
+
end
|
2816
|
+
|
2817
|
+
def test_motherfuckin_leading_dots2
|
2818
|
+
rb = "a\n..b"
|
2819
|
+
|
2820
|
+
assert_parse_error rb, '(string):2 :: parse error on value ".." (tDOT2)'
|
2821
|
+
end
|
2822
|
+
|
2823
|
+
def test_kill_me
|
2824
|
+
rb = "f { |a, (b, *c)| }"
|
2825
|
+
pt = s(:iter,
|
2826
|
+
s(:call, nil, :f),
|
2827
|
+
s(:args, :a, s(:masgn, :b, :"*c")))
|
2828
|
+
|
2829
|
+
assert_parse rb, pt
|
2830
|
+
end
|
2831
|
+
|
2832
|
+
def test_kill_me2
|
2833
|
+
rb = "f { |*a, b| }"
|
2834
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :"*a", :b))
|
2835
|
+
|
2836
|
+
assert_parse rb, pt
|
2837
|
+
end
|
2838
|
+
|
2839
|
+
def test_kill_me3
|
2840
|
+
rb = "f { |*a, b, &c| }"
|
2841
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :"*a", :b, :"&c"))
|
2842
|
+
|
2843
|
+
assert_parse rb, pt
|
2844
|
+
end
|
2845
|
+
|
2846
|
+
def test_kill_me4
|
2847
|
+
rb = "a=b ? true: false"
|
2848
|
+
pt = s(:lasgn, :a, s(:if, s(:call, nil, :b), s(:true), s(:false)))
|
2849
|
+
|
2850
|
+
assert_parse rb, pt
|
2851
|
+
end
|
2852
|
+
|
2853
|
+
def test_kill_me5
|
2854
|
+
skip "not yet"
|
2855
|
+
|
2856
|
+
rb = "f ->() { g do end }"
|
2857
|
+
pt = 42
|
2858
|
+
|
2859
|
+
assert_parse rb, pt
|
2860
|
+
end
|
2861
|
+
|
2862
|
+
def test_iter_args_4
|
2863
|
+
rb = "f { |a, *b, c| }"
|
2864
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :a, :"*b", :c))
|
2865
|
+
|
2866
|
+
assert_parse rb, pt
|
2867
|
+
end
|
2868
|
+
|
2869
|
+
def test_iter_args_5
|
2870
|
+
skip "not yet"
|
2871
|
+
|
2872
|
+
rb = "f { |a, &b| }"
|
2873
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :a, :"&b"))
|
2874
|
+
|
2875
|
+
assert_parse rb, pt
|
2876
|
+
end
|
2877
|
+
|
2878
|
+
def test_iter_args_6
|
2879
|
+
rb = "f { |a, b=42, c| }"
|
2880
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :c))
|
2881
|
+
|
2882
|
+
assert_parse rb, pt
|
2883
|
+
end
|
2884
|
+
|
2885
|
+
# In 1.8, block args with an outer set of parens are superfluous.
|
2886
|
+
# In 1.9, outer set of parens are NOT... they are an explicit extra masgn.
|
2887
|
+
|
2888
|
+
def test_iter_args_2__19
|
2889
|
+
rb = "f { |(a, b)| }"
|
2890
|
+
pt = s(:iter, s(:call, nil, :f), s(:args, s(:masgn, :a, :b)))
|
2891
|
+
|
2892
|
+
assert_parse rb, pt
|
2893
|
+
end
|
2894
|
+
|
2895
|
+
def test_bug_args__19
|
2896
|
+
rb = "f { |(a, b)| d }"
|
2897
|
+
pt = s(:iter, s(:call, nil, :f),
|
2898
|
+
s(:args, s(:masgn, :a, :b)),
|
2899
|
+
s(:call, nil, :d))
|
2900
|
+
|
2901
|
+
assert_parse rb, pt
|
2902
|
+
end
|
2903
|
+
|
2904
|
+
def test_bug_args_masgn_outer_parens__19
|
2905
|
+
rb = "f { |((k, v), i)| }"
|
2906
|
+
pt = s(:iter, # NOTE: same sexp as test_bug_args_masgn
|
2907
|
+
s(:call, nil, :f),
|
2908
|
+
s(:args, s(:masgn, s(:masgn, :k, :v), :i)))
|
2909
|
+
|
2910
|
+
assert_parse rb, pt.dup
|
2911
|
+
end
|
2912
|
+
|
2913
|
+
def test_iter_args_7_1
|
2914
|
+
rb = "f { |a = 42, *b| }"
|
2915
|
+
pt = s(:iter, s(:call, nil, :f),
|
2916
|
+
s(:args, s(:lasgn, :a, s(:lit, 42)), :"*b"))
|
2917
|
+
|
2918
|
+
assert_parse rb, pt
|
2919
|
+
end
|
2920
|
+
|
2921
|
+
def test_iter_args_7_2
|
2922
|
+
rb = "f { |a = 42, *b, &c| }"
|
2923
|
+
pt = s(:iter, s(:call, nil, :f),
|
2924
|
+
s(:args, s(:lasgn, :a, s(:lit, 42)), :"*b", :"&c"))
|
2925
|
+
|
2926
|
+
assert_parse rb, pt
|
2927
|
+
end
|
2928
|
+
|
2929
|
+
def test_iter_args_8_1
|
2930
|
+
rb = "f { |a = 42, *b, c| }"
|
2931
|
+
pt = s(:iter, s(:call, nil, :f),
|
2932
|
+
s(:args, s(:lasgn, :a, s(:lit, 42)), :"*b", :c))
|
2933
|
+
|
2934
|
+
assert_parse rb, pt
|
2935
|
+
end
|
2936
|
+
|
2937
|
+
def test_iter_args_8_2
|
2938
|
+
rb = "f { |a = 42, *b, c, &d| }"
|
2939
|
+
pt = s(:iter, s(:call, nil, :f),
|
2940
|
+
s(:args, s(:lasgn, :a, s(:lit, 42)), :"*b", :c, :"&d"))
|
2941
|
+
|
2942
|
+
assert_parse rb, pt
|
2943
|
+
end
|
2944
|
+
|
2945
|
+
def test_iter_args_9_1
|
2946
|
+
rb = "f { |a = 42, b| }"
|
2947
|
+
pt = s(:iter, s(:call, nil, :f),
|
2948
|
+
s(:args, s(:lasgn, :a, s(:lit, 42)), :b))
|
2949
|
+
|
2950
|
+
assert_parse rb, pt
|
2951
|
+
end
|
2952
|
+
|
2953
|
+
def test_iter_args_9_2
|
2954
|
+
rb = "f { |a = 42, b, &c| }"
|
2955
|
+
pt = s(:iter, s(:call, nil, :f),
|
2956
|
+
s(:args, s(:lasgn, :a, s(:lit, 42)), :b, :"&c"))
|
2957
|
+
|
2958
|
+
assert_parse rb, pt
|
2959
|
+
end
|
2960
|
+
|
2961
|
+
def test_iter_args_10_1
|
2962
|
+
rb = "f { |a, b = 42, *c| }"
|
2963
|
+
pt = s(:iter, s(:call, nil, :f),
|
2964
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :"*c"))
|
2965
|
+
|
2966
|
+
assert_parse rb, pt
|
2967
|
+
end
|
2968
|
+
|
2969
|
+
def test_iter_args_10_2
|
2970
|
+
rb = "f { |a, b = 42, *c, &d| }"
|
2971
|
+
pt = s(:iter, s(:call, nil, :f),
|
2972
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :"*c", :"&d"))
|
2973
|
+
|
2974
|
+
assert_parse rb, pt
|
2975
|
+
end
|
2976
|
+
|
2977
|
+
def test_iter_args_11_1
|
2978
|
+
rb = "f { |a, b = 42, *c, d| }"
|
2979
|
+
pt = s(:iter, s(:call, nil, :f),
|
2980
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :"*c", :d))
|
2981
|
+
|
2982
|
+
assert_parse rb, pt
|
2983
|
+
end
|
2984
|
+
|
2985
|
+
def test_iter_args_11_2
|
2986
|
+
rb = "f { |a, b = 42, *c, d, &e| }"
|
2987
|
+
pt = s(:iter, s(:call, nil, :f),
|
2988
|
+
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :"*c", :d, :"&e"))
|
2989
|
+
|
2990
|
+
assert_parse rb, pt
|
2991
|
+
end
|
2992
|
+
|
2993
|
+
def test_kill_me_6
|
2994
|
+
# | f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list
|
2995
|
+
rb = "f { |a, (b, *c, d)| }"
|
2996
|
+
pt = s(:iter,
|
2997
|
+
s(:call, nil, :f),
|
2998
|
+
s(:args, :a, s(:masgn, :b, :"*c", :d)))
|
2999
|
+
|
3000
|
+
assert_parse rb, pt
|
3001
|
+
end
|
3002
|
+
|
3003
|
+
def test_kill_me_7
|
3004
|
+
# | f_marg_list tCOMMA tSTAR
|
3005
|
+
rb = "f { |a, (b, *)| }"
|
3006
|
+
pt = s(:iter,
|
3007
|
+
s(:call, nil, :f),
|
3008
|
+
s(:args, :a, s(:masgn, :b, :*)))
|
3009
|
+
|
3010
|
+
assert_parse rb, pt
|
3011
|
+
end
|
3012
|
+
|
3013
|
+
def test_kill_me_8
|
3014
|
+
# | f_marg_list tCOMMA tSTAR tCOMMA f_marg_list
|
3015
|
+
rb = "f { |a, (b, *, c)| }"
|
3016
|
+
pt = s(:iter,
|
3017
|
+
s(:call, nil, :f),
|
3018
|
+
s(:args, :a, s(:masgn, :b, :*, :c)))
|
3019
|
+
|
3020
|
+
assert_parse rb, pt
|
3021
|
+
end
|
3022
|
+
|
3023
|
+
def test_kill_me_9
|
3024
|
+
# | tSTAR f_norm_arg
|
3025
|
+
rb = "f { |a, (*b)| }"
|
3026
|
+
pt = s(:iter,
|
3027
|
+
s(:call, nil, :f),
|
3028
|
+
s(:args, :a, s(:masgn, :"*b")))
|
3029
|
+
|
3030
|
+
assert_parse rb, pt
|
3031
|
+
end
|
3032
|
+
|
3033
|
+
def test_kill_me_10
|
3034
|
+
# | tSTAR f_norm_arg tCOMMA f_marg_list
|
3035
|
+
rb = "f { |a, (*b, c)| }"
|
3036
|
+
pt = s(:iter,
|
3037
|
+
s(:call, nil, :f),
|
3038
|
+
s(:args, :a, s(:masgn, :"*b", :c)))
|
3039
|
+
|
3040
|
+
assert_parse rb, pt
|
3041
|
+
end
|
3042
|
+
|
3043
|
+
def test_kill_me_11
|
3044
|
+
# | tSTAR
|
3045
|
+
rb = "f { |a, (*)| }"
|
3046
|
+
pt = s(:iter,
|
3047
|
+
s(:call, nil, :f),
|
3048
|
+
s(:args, :a, s(:masgn, :*)))
|
3049
|
+
|
3050
|
+
assert_parse rb, pt
|
3051
|
+
end
|
3052
|
+
|
3053
|
+
def test_kill_me_12
|
3054
|
+
# | tSTAR tCOMMA f_marg_list
|
3055
|
+
rb = "f { |a, (*, b)| }"
|
3056
|
+
pt = s(:iter,
|
3057
|
+
s(:call, nil, :f),
|
3058
|
+
s(:args, :a, s(:masgn, :*, :b)))
|
3059
|
+
|
3060
|
+
assert_parse rb, pt
|
3061
|
+
end
|
3062
|
+
|
3063
|
+
def test_index_0
|
3064
|
+
rb = "a[] = b"
|
3065
|
+
pt = s(:attrasgn, s(:call, nil, :a), :[]=, s(:call, nil, :b))
|
3066
|
+
|
3067
|
+
assert_parse rb, pt
|
3068
|
+
end
|
3069
|
+
|
3070
|
+
def test_lambda_do_vs_brace
|
3071
|
+
pt = s(:call, nil, :f, s(:iter, s(:call, nil, :lambda), s(:args)))
|
3072
|
+
|
3073
|
+
rb = "f ->() {}"
|
3074
|
+
assert_parse rb, pt
|
3075
|
+
|
3076
|
+
rb = "f ->() do end"
|
3077
|
+
assert_parse rb, pt
|
3078
|
+
|
3079
|
+
pt = s(:call, nil, :f, s(:iter, s(:call, nil, :lambda), 0))
|
3080
|
+
|
3081
|
+
rb = "f -> {}"
|
3082
|
+
assert_parse rb, pt
|
3083
|
+
|
3084
|
+
rb = "f -> do end"
|
3085
|
+
assert_parse rb, pt
|
3086
|
+
end
|
3087
|
+
|
3088
|
+
def test_thingy
|
3089
|
+
pt = s(:call, s(:call, nil, :f), :call, s(:lit, 42))
|
3090
|
+
|
3091
|
+
rb = "f.(42)"
|
3092
|
+
assert_parse rb, pt
|
3093
|
+
|
3094
|
+
rb = "f::(42)"
|
3095
|
+
assert_parse rb, pt
|
3096
|
+
end
|
3097
|
+
|
3098
|
+
def test_unary_plus_on_literal
|
3099
|
+
rb = "+:a"
|
3100
|
+
pt = s(:call, s(:lit, :a), :+@)
|
3101
|
+
|
3102
|
+
assert_parse rb, pt
|
3103
|
+
end
|
3104
|
+
end
|
3105
|
+
|
3106
|
+
class TestRuby20Parser < RubyParserTestCase
|
3107
|
+
include TestRubyParserShared
|
3108
|
+
include TestRubyParserShared20to22
|
3109
|
+
include TestRubyParserShared19to22
|
3110
|
+
|
3111
|
+
def setup
|
3112
|
+
super
|
3113
|
+
|
3114
|
+
self.processor = Ruby20Parser.new
|
3115
|
+
end
|
3116
|
+
|
3117
|
+
def test_block_call_dot_op2_brace_block
|
3118
|
+
rb = "a.b c() do d end.e do |f| g end"
|
3119
|
+
pt = s(:iter,
|
3120
|
+
s(:call,
|
3121
|
+
s(:iter,
|
3122
|
+
s(:call, s(:call, nil, :a), :b, s(:call, nil, :c)),
|
3123
|
+
0,
|
3124
|
+
s(:call, nil, :d)),
|
3125
|
+
:e),
|
3126
|
+
s(:args, :f),
|
3127
|
+
s(:call, nil, :g))
|
3128
|
+
|
3129
|
+
|
3130
|
+
assert_parse rb, pt
|
3131
|
+
end
|
3132
|
+
|
3133
|
+
def test_block_call_dot_op2_cmd_args_do_block
|
3134
|
+
rb = "a.b c() do d end.e f do |g| h end"
|
3135
|
+
pt = s(:iter,
|
3136
|
+
s(:call,
|
3137
|
+
s(:iter,
|
3138
|
+
s(:call, s(:call, nil, :a), :b, s(:call, nil, :c)),
|
3139
|
+
0,
|
3140
|
+
s(:call, nil, :d)),
|
3141
|
+
:e,
|
3142
|
+
s(:call, nil, :f)),
|
3143
|
+
s(:args, :g),
|
3144
|
+
s(:call, nil, :h))
|
3145
|
+
|
3146
|
+
assert_parse rb, pt
|
3147
|
+
end
|
3148
|
+
|
3149
|
+
def test_defn_kwarg_val
|
3150
|
+
rb = "def f(a, b:1) end"
|
3151
|
+
pt = s(:defn, :f, s(:args, :a, s(:kwarg, :b, s(:lit, 1))), s(:nil))
|
3152
|
+
|
3153
|
+
assert_parse rb, pt
|
3154
|
+
end
|
3155
|
+
|
3156
|
+
def test_args_kw_block
|
3157
|
+
rb = "def f(a: 1, &b); end"
|
3158
|
+
pt = s(:defn, :f, s(:args, s(:kwarg, :a, s(:lit, 1)), :"&b"), s(:nil))
|
3159
|
+
|
3160
|
+
assert_parse rb, pt
|
3161
|
+
end
|
3162
|
+
|
3163
|
+
def test_defn_kwarg_kwarg
|
3164
|
+
rb = "def f(a, b: 1, c: 2) end"
|
3165
|
+
pt = s(:defn, :f, s(:args, :a,
|
3166
|
+
s(:kwarg, :b, s(:lit, 1)),
|
3167
|
+
s(:kwarg, :c, s(:lit, 2))),
|
3168
|
+
s(:nil))
|
3169
|
+
|
3170
|
+
assert_parse rb, pt
|
3171
|
+
end
|
3172
|
+
|
3173
|
+
def test_defn_kwarg_lvar
|
3174
|
+
rb = "def fun(kw: :val); kw; end"
|
3175
|
+
pt = s(:defn, :fun, s(:args, s(:kwarg, :kw, s(:lit, :val))), s(:lvar, :kw))
|
3176
|
+
|
3177
|
+
assert_parse rb, pt
|
3178
|
+
end
|
3179
|
+
|
3180
|
+
def test_defn_kwarg_no_parens
|
3181
|
+
rb = "def f a: 1\nend"
|
3182
|
+
pt = s(:defn, :f, s(:args, s(:kwarg, :a, s(:lit, 1))), s(:nil))
|
3183
|
+
|
3184
|
+
assert_parse rb, pt
|
3185
|
+
end
|
3186
|
+
|
3187
|
+
def test_defn_powarg
|
3188
|
+
rb = "def f(**opts) end"
|
3189
|
+
pt = s(:defn, :f, s(:args, :"**opts"), s(:nil))
|
3190
|
+
|
3191
|
+
assert_parse rb, pt
|
3192
|
+
end
|
3193
|
+
|
3194
|
+
def test_block_arg_kwsplat
|
3195
|
+
rb = "a { |**b| }"
|
3196
|
+
pt = s(:iter, s(:call, nil, :a), s(:args, :"**b"))
|
3197
|
+
|
3198
|
+
assert_parse rb, pt
|
3199
|
+
end
|
3200
|
+
|
3201
|
+
def test_symbols
|
3202
|
+
rb = "%i(a b c)"
|
3203
|
+
pt = s(:array, s(:lit, :a), s(:lit, :b), s(:lit, :c))
|
3204
|
+
|
3205
|
+
assert_parse rb, pt
|
3206
|
+
end
|
3207
|
+
|
3208
|
+
def test_symbols_interp
|
3209
|
+
rb = '%i(a b#{1+1} c)'
|
3210
|
+
pt = s(:array, s(:lit, :a), s(:lit, :'b#{1+1}'), s(:lit, :c))
|
3211
|
+
|
3212
|
+
assert_parse rb, pt
|
3213
|
+
end
|
3214
|
+
|
3215
|
+
def test_symbols_empty_space
|
3216
|
+
rb = "%i( )"
|
3217
|
+
pt = s(:array)
|
3218
|
+
|
3219
|
+
assert_parse rb, pt
|
3220
|
+
end
|
3221
|
+
|
3222
|
+
def test_symbols_empty
|
3223
|
+
rb = "%i()"
|
3224
|
+
pt = s(:array)
|
3225
|
+
|
3226
|
+
assert_parse rb, pt
|
3227
|
+
end
|
3228
|
+
|
3229
|
+
def test_qsymbols
|
3230
|
+
rb = "%I(a b c)"
|
3231
|
+
pt = s(:array, s(:lit, :a), s(:lit, :b), s(:lit, :c))
|
3232
|
+
|
3233
|
+
assert_parse rb, pt
|
3234
|
+
end
|
3235
|
+
|
3236
|
+
def test_qsymbols_interp
|
3237
|
+
rb = '%I(a b#{1+1} c)'
|
3238
|
+
pt = s(:array,
|
3239
|
+
s(:lit, :a),
|
3240
|
+
s(:dsym, "b", s(:evstr, s(:call, s(:lit, 1), :+, s(:lit, 1)))),
|
3241
|
+
s(:lit, :c))
|
3242
|
+
|
3243
|
+
assert_parse rb, pt
|
3244
|
+
end
|
3245
|
+
|
3246
|
+
def test_qsymbols_empty
|
3247
|
+
rb = "%I()"
|
3248
|
+
pt = s(:array)
|
3249
|
+
|
3250
|
+
assert_parse rb, pt
|
3251
|
+
end
|
3252
|
+
|
3253
|
+
def test_qsymbols_empty_space
|
3254
|
+
rb = "%I( )"
|
3255
|
+
pt = s(:array)
|
3256
|
+
|
3257
|
+
assert_parse rb, pt
|
3258
|
+
end
|
3259
|
+
|
3260
|
+
def test_defn_unary_not
|
3261
|
+
rb = "def !@; true; end" # I seriously HATE this
|
3262
|
+
pt = s(:defn, :"!@", s(:args), s(:true))
|
3263
|
+
|
3264
|
+
assert_parse rb, pt
|
3265
|
+
end
|
3266
|
+
|
3267
|
+
def test_iter_array_curly
|
3268
|
+
rb = "f :a, [:b] { |c, d| }" # yes, this is bad code... that's their problem
|
3269
|
+
pt = s(:iter,
|
3270
|
+
s(:call, nil, :f, s(:lit, :a), s(:array, s(:lit, :b))),
|
3271
|
+
s(:args, :c, :d))
|
3272
|
+
|
3273
|
+
assert_parse rb, pt
|
3274
|
+
end
|
3275
|
+
end
|
3276
|
+
|
3277
|
+
class TestRuby21Parser < RubyParserTestCase
|
3278
|
+
include TestRubyParserShared
|
3279
|
+
include TestRubyParserShared19to22
|
3280
|
+
include TestRubyParserShared20to22
|
3281
|
+
|
3282
|
+
def setup
|
3283
|
+
super
|
3284
|
+
|
3285
|
+
self.processor = Ruby21Parser.new
|
3286
|
+
end
|
3287
|
+
|
3288
|
+
def test_f_kw
|
3289
|
+
rb = "def x k:42; end"
|
3290
|
+
pt = s(:defn, :x, s(:args, s(:kwarg, :k, s(:lit, 42))), s(:nil))
|
3291
|
+
|
3292
|
+
assert_parse rb, pt
|
3293
|
+
end
|
3294
|
+
|
3295
|
+
def test_f_kw__required
|
3296
|
+
rb = "def x k:; end"
|
3297
|
+
pt = s(:defn, :x, s(:args, s(:kwarg, :k)), s(:nil))
|
3298
|
+
|
3299
|
+
assert_parse rb, pt
|
3300
|
+
end
|
3301
|
+
|
3302
|
+
def test_block_kw
|
3303
|
+
rb = "blah { |k:42| }"
|
3304
|
+
pt = s(:iter, s(:call, nil, :blah), s(:args, s(:kwarg, :k, s(:lit, 42))))
|
3305
|
+
|
3306
|
+
assert_parse rb, pt
|
3307
|
+
|
3308
|
+
rb = "blah { |k:42| }"
|
3309
|
+
assert_parse rb, pt
|
3310
|
+
end
|
3311
|
+
|
3312
|
+
def test_block_kw__required
|
3313
|
+
rb = "blah do |k:| end"
|
3314
|
+
pt = s(:iter, s(:call, nil, :blah), s(:args, s(:kwarg, :k)))
|
3315
|
+
|
3316
|
+
assert_parse rb, pt
|
3317
|
+
|
3318
|
+
rb = "blah do |k:| end"
|
3319
|
+
assert_parse rb, pt
|
3320
|
+
end
|
3321
|
+
|
3322
|
+
def test_stabby_block_kw
|
3323
|
+
rb = "-> (k:42) { }"
|
3324
|
+
pt = s(:iter, s(:call, nil, :lambda), s(:args, s(:kwarg, :k, s(:lit, 42))))
|
3325
|
+
|
3326
|
+
assert_parse rb, pt
|
3327
|
+
end
|
3328
|
+
|
3329
|
+
def test_stabby_block_kw__required
|
3330
|
+
rb = "-> (k:) { }"
|
3331
|
+
pt = s(:iter, s(:call, nil, :lambda), s(:args, s(:kwarg, :k)))
|
3332
|
+
|
3333
|
+
assert_parse rb, pt
|
3334
|
+
end
|
3335
|
+
|
3336
|
+
def test_parse_line_heredoc_hardnewline
|
3337
|
+
skip "not yet"
|
3338
|
+
|
3339
|
+
rb = <<-'CODE'.gsub(/^ /, '')
|
3340
|
+
<<-EOFOO
|
3341
|
+
\n\n\n\n\n\n\n\n\n
|
3342
|
+
EOFOO
|
3343
|
+
|
3344
|
+
class Foo
|
3345
|
+
end
|
3346
|
+
CODE
|
3347
|
+
|
3348
|
+
pt = s(:block,
|
3349
|
+
s(:str, "\n\n\n\n\n\n\n\n\n\n").line(1),
|
3350
|
+
s(:class, :Foo, nil).line(5)).line(1)
|
3351
|
+
|
3352
|
+
assert_parse rb, pt
|
3353
|
+
end
|
3354
|
+
end
|
3355
|
+
|
3356
|
+
class TestRuby22Parser < RubyParserTestCase
|
3357
|
+
include TestRubyParserShared
|
3358
|
+
include TestRubyParserShared19to22
|
3359
|
+
include TestRubyParserShared20to22
|
3360
|
+
|
3361
|
+
def setup
|
3362
|
+
super
|
3363
|
+
|
3364
|
+
self.processor = Ruby22Parser.new
|
3365
|
+
end
|
3366
|
+
|
3367
|
+
def test_call_args_assoc_quoted
|
3368
|
+
pt = s(:call, nil, :x, s(:hash, s(:lit, :k), s(:lit, 42)))
|
3369
|
+
|
3370
|
+
rb = "x 'k':42"
|
3371
|
+
assert_parse rb, pt
|
3372
|
+
|
3373
|
+
rb = 'x "k":42'
|
3374
|
+
assert_parse rb, pt
|
3375
|
+
|
3376
|
+
rb = 'x "#{k}":42'
|
3377
|
+
pt = s(:call, nil, :x, s(:hash, s(:dsym, "", s(:evstr, s(:call, nil, :k))), s(:lit, 42)))
|
3378
|
+
|
3379
|
+
assert_parse rb, pt
|
3380
|
+
end
|
3381
|
+
|
3382
|
+
def test_bug191
|
3383
|
+
pt = s(:if, s(:call, nil, :a), s(:str, ""), s(:call, nil, :b))
|
3384
|
+
|
3385
|
+
rb = "a ? '': b"
|
3386
|
+
assert_parse rb, pt
|
3387
|
+
|
3388
|
+
rb = "a ? \"\": b"
|
3389
|
+
assert_parse rb, pt
|
3390
|
+
end
|
3391
|
+
|
3392
|
+
def test_quoted_symbol_keys
|
3393
|
+
rb = "{ 'a': :b }"
|
3394
|
+
pt = s(:hash, s(:lit, :a), s(:lit, :b))
|
3395
|
+
|
3396
|
+
assert_parse rb, pt
|
3397
|
+
end
|
3398
|
+
|
3399
|
+
def test_quoted_symbol_hash_arg
|
3400
|
+
rb = "puts 'a': {}"
|
3401
|
+
pt = s(:call, nil, :puts, s(:hash, s(:lit, :a), s(:hash)))
|
3402
|
+
|
3403
|
+
assert_parse rb, pt
|
3404
|
+
end
|
3405
|
+
end
|
3406
|
+
|
3407
|
+
class TestRuby23Parser < RubyParserTestCase
|
3408
|
+
include TestRubyParserShared
|
3409
|
+
include TestRubyParserShared19to22
|
3410
|
+
include TestRubyParserShared20to22
|
3411
|
+
|
3412
|
+
def setup
|
3413
|
+
super
|
3414
|
+
|
3415
|
+
self.processor = Ruby23Parser.new
|
3416
|
+
end
|
3417
|
+
|
3418
|
+
def test_safe_call
|
3419
|
+
rb = "a&.b"
|
3420
|
+
pt = s(:safe_call, s(:call, nil, :a), :b)
|
3421
|
+
|
3422
|
+
assert_parse rb, pt
|
3423
|
+
end
|
3424
|
+
|
3425
|
+
def test_safe_call_newline
|
3426
|
+
rb = "a&.b\n"
|
3427
|
+
pt = s(:safe_call, s(:call, nil, :a), :b)
|
3428
|
+
|
3429
|
+
assert_parse rb, pt
|
3430
|
+
end
|
3431
|
+
|
3432
|
+
def test_safe_calls
|
3433
|
+
rb = "a&.b&.c(1)"
|
3434
|
+
pt = s(:safe_call, s(:safe_call, s(:call, nil, :a), :b), :c, s(:lit, 1))
|
3435
|
+
|
3436
|
+
assert_parse rb, pt
|
3437
|
+
end
|
3438
|
+
|
3439
|
+
def test_safe_attrasgn
|
3440
|
+
rb = "a&.b = 1"
|
3441
|
+
pt = s(:safe_attrasgn, s(:call, nil, :a), :"b=", s(:lit, 1))
|
3442
|
+
|
3443
|
+
assert_parse rb, pt
|
3444
|
+
end
|
3445
|
+
|
3446
|
+
def test_safe_attrasgn_constant
|
3447
|
+
rb = "a&.B = 1"
|
3448
|
+
pt = s(:safe_attrasgn, s(:call, nil, :a), :"B=", s(:lit, 1))
|
3449
|
+
|
3450
|
+
assert_parse rb, pt
|
3451
|
+
end
|
3452
|
+
|
3453
|
+
def test_safe_call_dot_parens
|
3454
|
+
rb = "a&.()"
|
3455
|
+
pt = s(:safe_call, s(:call, nil, :a), :call)
|
3456
|
+
|
3457
|
+
assert_parse rb, pt
|
3458
|
+
end
|
3459
|
+
|
3460
|
+
def test_safe_call_operator
|
3461
|
+
rb = "a&.> 1"
|
3462
|
+
pt = s(:safe_call, s(:call, nil, :a), :>, s(:lit, 1))
|
3463
|
+
|
3464
|
+
assert_parse rb, pt
|
3465
|
+
end
|
3466
|
+
end
|
3467
|
+
|
3468
|
+
|
3469
|
+
[18, 19, 20, 21, 22, 23].each do |v|
|
3470
|
+
describe "block args arity #{v}" do
|
3471
|
+
attr_accessor :parser
|
3472
|
+
|
3473
|
+
before do
|
3474
|
+
self.parser = Object.const_get("Ruby#{v}Parser").new
|
3475
|
+
end
|
3476
|
+
|
3477
|
+
{
|
3478
|
+
"-> { }" => s(:iter, s(:call, nil, :lambda), 0),
|
3479
|
+
"lambda { }" => s(:iter, s(:call, nil, :lambda), 0),
|
3480
|
+
"proc { }" => s(:iter, s(:call, nil, :proc), 0),
|
3481
|
+
"Proc.new { }" => s(:iter, s(:call, s(:const, :Proc), :new), 0),
|
3482
|
+
|
3483
|
+
"-> () { }" => s(:iter, s(:call, nil, :lambda), s(:args)),
|
3484
|
+
"lambda { || }" => s(:iter, s(:call, nil, :lambda), s(:args)),
|
3485
|
+
"proc { || }" => s(:iter, s(:call, nil, :proc), s(:args)),
|
3486
|
+
"Proc.new { || }" => s(:iter, s(:call, s(:const, :Proc), :new), s(:args)),
|
3487
|
+
|
3488
|
+
}.each do |input, expected|
|
3489
|
+
next if v == 18 and input =~ /->/
|
3490
|
+
next if v == 19 and input =~ /-> \(\)/
|
3491
|
+
|
3492
|
+
it "parses '#{input}'" do
|
3493
|
+
assert_equal expected, parser.parse(input)
|
3494
|
+
end
|
3495
|
+
|
3496
|
+
input = input.sub(/\{/, "do").sub(/\}/, "end")
|
3497
|
+
it "parses '#{input}'" do
|
3498
|
+
assert_equal expected, parser.parse(input)
|
3499
|
+
end
|
3500
|
+
end
|
3501
|
+
end
|
3502
|
+
end
|