rubyjobbuilderdsl 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -0
- data/lib/rubyjobbuilderdsl/buildstep/xvfb.rb +46 -0
- data/lib/rubyjobbuilderdsl/freestyle.rb +8 -0
- data/lib/rubyjobbuilderdsl/xml_generator.rb +14 -0
- data/rubyjobbuilderdsl-0.0.0.gem +0 -0
- data/rubyjobbuilderdsl.gemspec +2 -2
- data/sample/local.ini +3 -3
- data/test/test_xvfb.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/bin/nokogiri +23 -0
- data/vendor/bundle/ruby/2.1.0/bin/nokogiri.bat +6 -0
- data/vendor/bundle/ruby/2.1.0/bin/rake +23 -0
- data/vendor/bundle/ruby/2.1.0/bin/rake.bat +6 -0
- data/vendor/bundle/ruby/2.1.0/bin/rubocop +23 -0
- data/vendor/bundle/ruby/2.1.0/bin/rubocop.bat +6 -0
- data/vendor/bundle/ruby/2.1.0/bin/ruby-parse +23 -0
- data/vendor/bundle/ruby/2.1.0/bin/ruby-parse.bat +6 -0
- data/vendor/bundle/ruby/2.1.0/bin/ruby-rewrite +23 -0
- data/vendor/bundle/ruby/2.1.0/bin/ruby-rewrite.bat +6 -0
- data/vendor/bundle/ruby/2.1.0/cache/ast-2.0.0.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/astrolabe-1.3.0.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/builder-3.2.2.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/mini_portile-0.6.0.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/nokogiri-1.6.3.1-x64-mingw32.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/parser-2.2.0.pre.4.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/powerpack-0.0.9.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/rainbow-2.0.0.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/rake-0.9.6.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/rubocop-0.26.0.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/ruby-progressbar-1.5.1.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/cache/slop-3.6.0.gem +0 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/CHANGELOG.md +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/Gemfile +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/LICENSE.MIT +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/README.YARD.md +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/README.md +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/Rakefile +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/ast.gemspec +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/lib/ast/node.rb +232 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/lib/ast/processor.rb +266 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/lib/ast/sexp.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/lib/ast.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/test/helper.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/ast-2.0.0/test/test_ast.rb +243 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/CHANGELOG.md +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/Gemfile +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/Guardfile +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/README.md +130 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/Rakefile +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/astrolabe.gemspec +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/benchmark/benchmark_helper.rb +122 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/benchmark/performance_spec.rb +346 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/lib/astrolabe/builder.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/lib/astrolabe/node.rb +270 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/lib/astrolabe/sexp.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/lib/astrolabe/version.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/lib/astrolabe.rb +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/spec/astrolabe/node_spec.rb +479 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/spec/astrolabe/sexp_spec.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/spec/spec_helper.rb +96 -0
- data/vendor/bundle/ruby/2.1.0/gems/astrolabe-1.3.0/spec/support/shared_contexts.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/CHANGES +107 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/README.md +258 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/Rakefile +195 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/doc/releases/builder-1.2.4.rdoc +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/doc/releases/builder-2.0.0.rdoc +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/doc/releases/builder-2.1.1.rdoc +58 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/blankslate.rb +137 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder/blankslate.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder/version.rb +8 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder/xchar.rb +197 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder/xmlbase.rb +199 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder/xmlevents.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder/xmlmarkup.rb +339 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/lib/builder.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/rakelib/publish.rake +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/rakelib/tags.rake +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/performance.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/preload.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/test_blankslate.rb +217 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/test_eventbuilder.rb +150 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/test_markupbuilder.rb +611 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/test_method_caching.rb +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/test_namecollision.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/builder-3.2.2/test/test_xchar.rb +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/mini_portile-0.6.0/History.txt +86 -0
- data/vendor/bundle/ruby/2.1.0/gems/mini_portile-0.6.0/LICENSE.txt +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/mini_portile-0.6.0/README.rdoc +169 -0
- data/vendor/bundle/ruby/2.1.0/gems/mini_portile-0.6.0/Rakefile +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/mini_portile-0.6.0/examples/Rakefile +113 -0
- data/vendor/bundle/ruby/2.1.0/gems/mini_portile-0.6.0/lib/mini_portile.rb +437 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/CHANGELOG.ja.rdoc +913 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/CHANGELOG.rdoc +922 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/C_CODING_STYLE.rdoc +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/Gemfile +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/Manifest.txt +377 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/README.ja.rdoc +111 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/README.rdoc +180 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ROADMAP.md +89 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/Rakefile +356 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/STANDARD_RESPONSES.md +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/Y_U_NO_GEMSPEC.md +155 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/bin/nokogiri +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/build_all +129 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/dependencies.yml +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/depend +358 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/extconf.rb +548 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_document.c +170 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_document.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_element_description.c +279 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_element_description.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_entity_lookup.c +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_entity_lookup.h +8 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_sax_parser_context.c +116 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_sax_parser_context.h +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_sax_push_parser.c +87 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/html_sax_push_parser.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/nokogiri.c +148 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/nokogiri.h +164 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_attr.c +94 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_attr.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_attribute_decl.c +70 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_attribute_decl.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_cdata.c +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_cdata.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_comment.c +54 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_comment.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_document.c +600 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_document.h +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_document_fragment.c +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_document_fragment.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_dtd.c +202 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_dtd.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_element_content.c +123 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_element_content.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_element_decl.c +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_element_decl.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_encoding_handler.c +79 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_encoding_handler.h +8 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_entity_decl.c +110 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_entity_decl.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_entity_reference.c +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_entity_reference.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_io.c +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_io.h +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_libxml2_hacks.c +112 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_libxml2_hacks.h +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_namespace.c +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_namespace.h +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_node.c +1603 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_node.h +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_node_set.c +467 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_node_set.h +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_processing_instruction.c +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_processing_instruction.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_reader.c +681 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_reader.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_relax_ng.c +161 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_relax_ng.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_sax_parser.c +312 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_sax_parser.h +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_sax_parser_context.c +262 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_sax_parser_context.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_sax_push_parser.c +115 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_sax_push_parser.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_schema.c +205 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_schema.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_syntax_error.c +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_syntax_error.h +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_text.c +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_text.h +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_xpath_context.c +307 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xml_xpath_context.h +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xslt_stylesheet.c +270 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/ext/nokogiri/xslt_stylesheet.h +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/2.0/nokogiri.so +0 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/2.1/nokogiri.so +0 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/node.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/parser.rb +715 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/parser.y +249 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/parser_extras.rb +91 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/syntax_error.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/tokenizer.rb +152 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/tokenizer.rex +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css/xpath_visitor.rb +219 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/css.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/decorators/slop.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/builder.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/document.rb +333 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/document_fragment.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/element_description.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/element_description_defaults.rb +671 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/entity_lookup.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/sax/parser.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/sax/parser_context.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html/sax/push_parser.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/html.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/syntax_error.rb +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/version.rb +106 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/attr.rb +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/attribute_decl.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/builder.rb +443 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/cdata.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/character_data.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/document.rb +279 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/document_fragment.rb +112 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/dtd.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/element_content.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/element_decl.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/entity_decl.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/namespace.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/node/save_options.rb +61 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/node.rb +992 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/node_set.rb +355 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/notation.rb +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/parse_options.rb +98 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/pp/character_data.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/pp/node.rb +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/pp.rb +2 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/processing_instruction.rb +8 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/reader.rb +112 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/relax_ng.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/sax/document.rb +171 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/sax/parser.rb +123 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/sax/parser_context.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/sax/push_parser.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/sax.rb +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/schema.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/syntax_error.rb +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/text.rb +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/xpath/syntax_error.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/xpath.rb +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml/xpath_context.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xml.rb +73 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xslt/stylesheet.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri/xslt.rb +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/nokogiri.rb +137 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/lib/xsd/xmlparser/nokogiri.rb +102 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/suppressions/README.txt +1 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/suppressions/nokogiri_ree-1.8.7.358.supp +61 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/suppressions/nokogiri_ruby-1.8.7.370.supp +0 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/suppressions/nokogiri_ruby-1.9.2.320.supp +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/suppressions/nokogiri_ruby-1.9.3.327.supp +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/tasks/nokogiri.org.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/tasks/test.rb +95 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/css/test_nthiness.rb +222 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/css/test_parser.rb +358 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/css/test_tokenizer.rb +198 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/css/test_xpath_visitor.rb +96 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/decorators/test_slop.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/2ch.html +108 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/address_book.rlx +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/address_book.xml +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/atom.xml +344 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/bar/bar.xsd +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/bogus.xml +0 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/dont_hurt_em_why.xml +422 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/encoding.html +82 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/encoding.xhtml +84 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/exslt.xml +8 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/exslt.xslt +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/foo/foo.xsd +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/metacharset.html +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/noencoding.html +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/po.xml +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/po.xsd +66 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/saml/saml20assertion_schema.xsd +283 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/saml/saml20protocol_schema.xsd +302 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/saml/xenc_schema.xsd +146 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/saml/xmldsig_schema.xsd +318 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/shift_jis.html +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/shift_jis.xml +5 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/shift_jis_no_charset.html +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/slow-xpath.xml +25509 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/snuggles.xml +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/staff.dtd +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/staff.xml +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/staff.xslt +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/test_document_url/bar.xml +2 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/test_document_url/document.dtd +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/test_document_url/document.xml +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/tlm.html +850 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/to_be_xincluded.xml +2 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/valid_bar.xml +2 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/files/xinclude.xml +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/helper.rb +164 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/sax/test_parser.rb +141 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/sax/test_parser_context.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_builder.rb +164 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_document.rb +619 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_document_encoding.rb +148 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_document_fragment.rb +267 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_element_description.rb +105 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_named_characters.rb +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_node.rb +196 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/html/test_node_encoding.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_additional_namespaces_in_builder_doc.rb +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_namespaces_aliased_default.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_namespaces_in_builder_doc.rb +75 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_namespaces_in_cloned_doc.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_namespaces_in_created_doc.rb +75 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_namespaces_in_parsed_doc.rb +66 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/namespaces/test_namespaces_preservation.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_convert_xpath.rb +135 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_css_cache.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_encoding_handler.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_memory_leak.rb +156 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_nokogiri.rb +138 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_reader.rb +558 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_soap4r_sax.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/test_xslt_transforms.rb +279 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/node/test_save_options.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/node/test_subclass.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/sax/test_parser.rb +382 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/sax/test_parser_context.rb +115 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/sax/test_push_parser.rb +157 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_attr.rb +64 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_attribute_decl.rb +86 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_builder.rb +315 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_c14n.rb +161 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_cdata.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_comment.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_document.rb +940 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_document_encoding.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_document_fragment.rb +228 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_dtd.rb +187 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_dtd_encoding.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_element_content.rb +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_element_decl.rb +73 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_entity_decl.rb +122 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_entity_reference.rb +245 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_namespace.rb +95 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_node.rb +1197 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_node_attributes.rb +113 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_node_encoding.rb +107 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_node_inheritance.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_node_reparenting.rb +374 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_node_set.rb +755 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_parse_options.rb +64 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_processing_instruction.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_reader_encoding.rb +142 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_relax_ng.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_schema.rb +129 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_syntax_error.rb +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_text.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_unparented_node.rb +427 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_xinclude.rb +83 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xml/test_xpath.rb +382 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xslt/test_custom_functions.rb +133 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test/xslt/test_exception_handling.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.3.1-x64-mingw32/test_all +81 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/CHANGELOG.md +496 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/CONTRIBUTING.md +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/Gemfile +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/LICENSE.txt +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/README.md +272 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/Rakefile +146 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/bin/ruby-parse +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/bin/ruby-rewrite +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/doc/AST_FORMAT.md +1546 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/doc/CUSTOMIZATION.md +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/doc/INTERNALS.md +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/doc/css/common.css +68 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/gauntlet_parser.rb +121 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/all.rb +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ast/node.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ast/processor.rb +190 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/base.rb +269 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/builders/default.rb +1383 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/clobbering_error.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/compatibility/ruby1_8.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/compatibility/ruby1_9.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/current.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/diagnostic/engine.rb +103 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/diagnostic.rb +104 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/lexer/explanation.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/lexer/literal.rb +235 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/lexer/stack_state.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/lexer.rb +20895 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/lexer.rl +2163 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/messages.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/meta.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/rewriter.rb +119 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby18.rb +6344 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby18.y +1917 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby19.rb +6827 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby19.y +2148 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby20.rb +7332 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby20.y +2324 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby21.rb +7385 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby21.y +2319 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby22.rb +7393 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/ruby22.y +2327 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/runner/ruby_parse.rb +129 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/runner/ruby_rewrite.rb +98 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/runner.rb +215 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/buffer.rb +245 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/comment/associator.rb +157 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/comment.rb +106 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/collection.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/condition.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/constant.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/definition.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/for.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/heredoc.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/keyword.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/operator.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/rescue_body.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/send.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/ternary.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map/variable.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/map.rb +146 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/range.rb +187 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/rewriter/action.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/source/rewriter.rb +221 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/static_environment.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/syntax_error.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser/version.rb +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/lib/parser.rb +79 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/parser.gemspec +49 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/helper.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/parse_helper.rb +241 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/racc_coverage_helper.rb +130 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_base.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_current.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_diagnostic.rb +49 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_diagnostic_engine.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_encoding.rb +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_lexer.rb +3064 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_lexer_stack_state.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_parse_helper.rb +80 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_parser.rb +4872 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_source_buffer.rb +103 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_source_comment.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_source_comment_associator.rb +107 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_source_range.rb +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_source_rewriter.rb +183 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_source_rewriter_action.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/parser-2.2.0.pre.4/test/test_static_environment.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/CHANGELOG.md +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/Gemfile +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/README.md +95 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/Rakefile +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/array/butfirst.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/array/butlast.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/array.rb +2 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/average.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/drop_last.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/drop_last_while.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/exactly.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/frequencies.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/several.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/sum.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/take_last.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable/take_last_while.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/enumerable.rb +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/hash/symbolize_keys.rb +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/hash.rb +1 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/numeric/neg.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/numeric/pos.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/numeric/scale.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/numeric.rb +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/ascii_only.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/blank.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/format.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/remove.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/squish.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/strip_indent.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string/strip_margin.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/string.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack/version.rb +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/lib/powerpack.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/powerpack.gemspec +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/array/butfirst_spec.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/array/butlast_spec.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/average_spec.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/drop_last_spec.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/drop_last_while_spec.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/exactly_spec.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/frequencies_spec.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/several_spec.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/sum_spec.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/take_last_spec.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/enumerable/take_last_while_spec.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/hash/symbolize_keys_spec.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/numeric/neg_spec.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/numeric/pos_spec.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/numeric/scale_spec.rb +139 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/ascii_only_spec.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/blank_spec.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/format_spec.rb +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/remove_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/squish_spec.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/strip_indent_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/powerpack/string/strip_margin_spec.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/powerpack-0.0.9/spec/spec_helper.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/Changelog.md +67 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/Gemfile +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/Guardfile +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/LICENSE +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/README.markdown +175 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/Rakefile +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/color.rb +115 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/ext/string.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/global.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/legacy.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/null_presenter.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/presenter.rb +113 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/string_utils.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/version.rb +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/wrapper.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/rainbow.gemspec +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/integration/instance_spec.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/integration/rainbow_spec.rb +139 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/integration/string_spec.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/spec_helper.rb +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/support/presenter_shared_examples.rb +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/unit/color_spec.rb +244 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/unit/namespace_spec.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/unit/null_presenter_spec.rb +93 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/unit/presenter_spec.rb +168 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/unit/string_utils_spec.rb +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/spec/unit/wrapper_spec.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/CHANGES +526 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/README.rdoc +187 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/Rakefile +374 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/TODO +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/bin/rake +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/command_line_usage.rdoc +169 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/glossary.rdoc +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/rake.1.gz +0 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/rakefile.rdoc +557 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.6.rdoc +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.4.rdoc +110 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.5.rdoc +114 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/doc/release_notes/rake-0.9.6.rdoc +127 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/install.rb +90 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/alt_system.rb +109 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/application.rb +702 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/backtrace.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/classic_namespace.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/clean.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/contrib/ftptools.rb +151 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/contrib/publisher.rb +73 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/contrib/rubyforgepublisher.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/contrib/sshpublisher.rb +50 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/contrib/sys.rb +192 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/default_loader.rb +10 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/dsl_definition.rb +182 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/early_time.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ext/core.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ext/module.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ext/string.rb +168 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ext/time.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/file_list.rb +410 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/file_task.rb +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/file_utils.rb +114 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/file_utils_ext.rb +146 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/gempackagetask.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/invocation_chain.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/loaders/makefile.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/multi_task.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/name_space.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/packagetask.rb +185 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/pathmap.rb +1 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/phony.rb +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/promise.rb +99 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/pseudo_status.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/rake_module.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/rdoctask.rb +234 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/ruby182_test_unit_fix.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/runtest.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/task.rb +350 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/task_arguments.rb +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/task_manager.rb +307 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/tasklib.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/testtask.rb +198 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/thread_pool.rb +155 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/trace_output.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/version.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake/win32.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/lib/rake.rb +71 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/file_creation.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/helper.rb +562 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_private_reader.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_application.rb +531 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_application_options.rb +460 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_backtrace.rb +89 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_clean.rb +14 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_definitions.rb +80 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_directory_task.rb +57 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_dsl.rb +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_extension.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_file_list.rb +628 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_file_list_path_map.rb +8 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_file_task.rb +122 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_file_utils.rb +305 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_ftp_file.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_functional.rb +496 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_invocation_chain.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_makefile_loader.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_multi_task.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_name_space.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_path_map.rb +157 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_rake_test_loader.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_rdoc_task.rb +83 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_reduce_compat.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_require.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_rules.rb +327 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task.rb +316 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task_argument_parsing.rb +103 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task_arguments.rb +88 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task_lib.rb +9 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task_manager.rb +157 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task_manager_argument_resolution.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_task_with_arguments.rb +181 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_test_task.rb +120 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_thread_pool.rb +123 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_top_level_functions.rb +111 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_sys.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_thread_history_display.rb +91 -0
- data/vendor/bundle/ruby/2.1.0/gems/rake-0.9.6/test/test_trace_output.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/CHANGELOG.md +1095 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/CONTRIBUTING.md +68 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/Gemfile +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/LICENSE.txt +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/README.md +807 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/Rakefile +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/assets/output.html.erb +190 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/bin/rubocop +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/config/default.yml +581 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/config/disabled.yml +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/config/enabled.yml +952 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cli.rb +116 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/comment_config.rb +101 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/config.rb +160 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/config_loader.rb +152 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/config_store.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/commissioner.rb +102 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/cop.rb +218 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/corrector.rb +84 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/force.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/ignored_node.rb +38 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/ambiguous_operator.rb +50 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/assignment_in_condition.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/block_alignment.rb +176 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/condition_position.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/debugger.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/def_end_alignment.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/deprecated_class_methods.rb +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/else_layout.rb +57 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/empty_ensure.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/empty_interpolation.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/end_alignment.rb +75 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/end_in_method.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/ensure_return.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/eval.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/handle_exceptions.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/invalid_character_literal.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/literal_in_condition.rb +138 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/literal_in_interpolation.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/loop.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/require_parentheses.rb +68 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/rescue_exception.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/space_before_first_arg.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/string_conversion_in_interpolation.rb +50 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/syntax.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/unreachable_code.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/unused_block_argument.rb +80 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/unused_method_argument.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/useless_access_modifier.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/useless_assignment.rb +113 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/useless_comparison.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/useless_else_without_rescue.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/useless_setter_call.rb +157 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/lint/void.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/block_nesting.rb +54 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/class_length.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/line_length.rb +88 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/method_length.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/parameter_lists.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/metrics/perceived_complexity.rb +61 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/access_modifier_node.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/annotation_comment.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/array_syntax.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/autocorrect_alignment.rb +112 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/autocorrect_unless_changing_ast.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/check_assignment.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/code_length.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/configurable_enforced_style.rb +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/configurable_max.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/configurable_naming.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/end_keyword_alignment.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/if_node.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/method_complexity.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/negative_conditional.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/on_method.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/on_normal_if_unless.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/parser_diagnostic.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/percent_literal.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/safe_assignment.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/space_after_punctuation.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/space_before_punctuation.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/space_inside.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/statement_modifier.rb +58 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/string_help.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/surrounding_space.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/unused_argument.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/offense.rb +132 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/action_filter.rb +71 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/default_scope.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/delegate.rb +111 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/output.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/read_write_attribute.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/scope_args.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/rails/validation.rb +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/severity.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/access_modifier_indentation.rb +87 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/accessor_method_name.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/alias.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/align_array.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/align_hash.rb +265 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/align_parameters.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/and_or.rb +85 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/array_join.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/ascii_comments.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/ascii_identifiers.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/attr.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/bare_percent_literals.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/begin_block.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/block_comments.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/block_end_newline.rb +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/blocks.rb +80 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/braces_around_hash_parameters.rb +94 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/case_equality.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/case_indentation.rb +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/character_literal.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/class_and_module_camel_case.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/class_and_module_children.rb +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/class_check.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/class_methods.rb +54 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/class_vars.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/collection_methods.rb +70 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/colon_method_call.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/comment_annotation.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/comment_indentation.rb +66 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/constant_name.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/def_with_parentheses.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/deprecated_hash_methods.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/documentation.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/dot_position.rb +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/double_negation.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/each_with_object.rb +58 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/empty_line_between_defs.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/empty_lines.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +74 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/empty_lines_around_body.rb +75 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/empty_literal.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/encoding.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/end_block.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/end_of_line.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/even_odd.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/file_name.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/flip_flop.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/for.rb +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/format_string.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/global_vars.rb +74 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/guard_clause.rb +79 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/hash_syntax.rb +89 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/if_unless_modifier.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/if_with_semicolon.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/indent_array.rb +64 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/indent_hash.rb +160 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/indentation_consistency.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/indentation_width.rb +217 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/infinite_loop.rb +57 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/inline_comment.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/lambda.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/lambda_call.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/leading_comment_space.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/line_end_concatenation.rb +89 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/method_call_parentheses.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/method_called_on_do_end_block.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/method_def_parentheses.rb +72 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/method_name.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/module_function.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/multiline_block_chain.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/multiline_block_layout.rb +73 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/multiline_if_then.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/multiline_ternary_operator.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/negated_if.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/negated_while.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/nested_ternary_operator.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/next.rb +97 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/nil_comparison.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/non_nil_check.rb +116 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/not.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/numeric_literals.rb +85 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/one_line_conditional.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/op_method.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/parentheses_around_condition.rb +72 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/percent_literal_delimiters.rb +151 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/percent_q_literals.rb +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/perl_backrefs.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/predicate_name.rb +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/proc.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/raise_args.rb +68 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/redundant_begin.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/redundant_exception.rb +32 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/redundant_return.rb +66 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/redundant_self.rb +144 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/regexp_literal.rb +81 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/rescue_modifier.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/self_assignment.rb +68 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/semicolon.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/signal_exception.rb +95 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/single_line_block_params.rb +61 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/single_line_methods.rb +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/single_space_before_first_arg.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_after_colon.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_after_comma.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_after_control_keyword.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_after_method_name.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_after_not.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_after_semicolon.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +66 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_around_operators.rb +83 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_before_block_braces.rb +64 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_before_comma.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_before_comment.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_before_modifier_keyword.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_before_semicolon.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_inside_block_braces.rb +156 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_inside_brackets.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +109 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_inside_parens.rb +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/space_inside_range_literal.rb +58 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/special_global_vars.rb +84 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/string_literals.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/symbol_array.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/symbol_proc.rb +71 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/tab.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/trailing_blank_lines.rb +58 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/trailing_comma.rb +153 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/trailing_whitespace.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/trivial_accessors.rb +144 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/unless_else.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/unneeded_capital_w.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/unneeded_percent_q.rb +58 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/unneeded_percent_x.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/variable_interpolation.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/variable_name.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/when_then.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/while_until_do.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/while_until_modifier.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/style/word_array.rb +87 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/team.rb +123 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/util.rb +188 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force/assignment.rb +95 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force/locatable.rb +183 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force/reference.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force/scope.rb +90 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force/variable.rb +102 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force/variable_table.rb +128 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/variable_force.rb +419 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/base_formatter.rb +119 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/clang_style_formatter.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/colorizable.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/disabled_config_formatter.rb +66 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/disabled_lines_formatter.rb +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/emacs_style_formatter.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/file_list_formatter.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/formatter_set.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/fuubar_style_formatter.rb +74 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/html_formatter.rb +90 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/json_formatter.rb +74 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/offense_count_formatter.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/progress_formatter.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/formatter/simple_text_formatter.rb +117 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/options.rb +203 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/path_util.rb +38 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/processed_source.rb +91 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/rake_task.rb +88 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/runner.rb +156 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/string_util.rb +153 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/target_finder.rb +98 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/token.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/version.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop.rb +284 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.19.0.md +94 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.19.1.md +16 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.20.0.md +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.20.1.md +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.21.0.md +56 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.22.0.md +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.23.0.md +79 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.24.0.md +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.24.1.md +15 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.25.0.md +91 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/relnotes/v0.26.0.md +89 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/rubocop.gemspec +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/isolated_environment_spec.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/project_spec.rb +118 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cli_spec.rb +2246 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/comment_config_spec.rb +105 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/config_loader_spec.rb +356 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/config_spec.rb +235 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/config_store_spec.rb +53 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/commissioner_spec.rb +85 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/cop_spec.rb +135 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/corrector_spec.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/force_spec.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/ambiguous_operator_spec.rb +113 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb +35 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/assignment_in_condition_spec.rb +107 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/block_alignment_spec.rb +534 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/condition_position_spec.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/debugger_spec.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/def_end_alignment_spec.rb +108 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/deprecated_class_methods_spec.rb +38 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/else_layout_spec.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/empty_ensure_spec.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/empty_interpolation_spec.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/end_alignment_spec.rb +91 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/end_in_method_spec.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/ensure_return_spec.rb +39 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/eval_spec.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/handle_exceptions_spec.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/invalid_character_literal_spec.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/literal_in_condition_spec.rb +154 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/literal_in_interpolation_spec.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/loop_spec.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +57 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/require_parentheses_spec.rb +82 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/rescue_exception_spec.rb +159 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb +237 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/space_before_first_arg_spec.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/string_conversion_in_interpolation_spec.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/syntax_spec.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/underscore_prefixed_variable_name_spec.rb +179 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/unreachable_code_spec.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/unused_block_argument_spec.rb +231 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/unused_method_argument_spec.rb +278 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/useless_access_modifier_spec.rb +192 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/useless_assignment_spec.rb +1785 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/useless_comparison_spec.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/useless_setter_call_spec.rb +199 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/lint/void_spec.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/block_nesting_spec.rb +156 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/class_length_spec.rb +131 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb +204 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/if_unless_modifier_spec.rb +146 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/line_length_spec.rb +108 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/method_length_spec.rb +147 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/parameter_lists_spec.rb +44 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/perceived_complexity_spec.rb +222 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/metrics/while_until_modifier_spec.rb +93 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/offense_spec.rb +133 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/action_filter_spec.rb +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/default_scope_spec.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/delegate_spec.rb +169 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/output_spec.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/read_write_attribute_spec.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/scope_args_spec.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/rails/validation_spec.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/severity_spec.rb +113 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +399 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/accessor_method_name_spec.rb +81 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/alias_spec.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/align_array_spec.rb +123 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/align_hash_spec.rb +398 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/align_parameters_spec.rb +420 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/and_or_spec.rb +250 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/array_join_spec.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/ascii_comments_spec.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/ascii_identifiers_spec.rb +36 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/attr_spec.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/bare_percent_literals_spec.rb +132 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/begin_block_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/block_comments_spec.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/block_end_newline_spec.rb +61 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/blocks_spec.rb +105 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +302 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/case_equality_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/case_indentation_spec.rb +292 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/character_literal_spec.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +40 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/class_and_module_children_spec.rb +131 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/class_check_spec.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/class_methods_spec.rb +68 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/class_vars_spec.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/collection_methods_spec.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/colon_method_call_spec.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/comment_annotation_spec.rb +86 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/comment_indentation_spec.rb +174 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/constant_name_spec.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/def_with_parentheses_spec.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/deprecated_hash_methods_spec.rb +45 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/documentation_spec.rb +147 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/dot_position_spec.rb +130 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/double_negation_spec.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/each_with_object_spec.rb +73 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +135 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +100 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +131 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/empty_lines_spec.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/empty_literal_spec.rb +100 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/encoding_spec.rb +139 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/end_block_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/end_of_line_spec.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/even_odd_spec.rb +75 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/file_name_spec.rb +84 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/flip_flop_spec.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/for_spec.rb +105 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/format_string_spec.rb +148 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/global_vars_spec.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/guard_clause_spec.rb +155 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/hash_syntax_spec.rb +137 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/if_with_semicolon_spec.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/indent_array_spec.rb +171 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/indent_hash_spec.rb +366 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/indentation_consistency_spec.rb +510 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/indentation_width_spec.rb +843 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/infinite_loop_spec.rb +48 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/inline_comment_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/lambda_call_spec.rb +65 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/lambda_spec.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/leading_comment_space_spec.rb +64 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/line_end_concatenation_spec.rb +136 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/method_call_parentheses_spec.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/method_def_parentheses_spec.rb +108 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/method_name_spec.rb +125 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/module_function_spec.rb +24 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/multiline_block_chain_spec.rb +78 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/multiline_block_layout_spec.rb +138 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/multiline_if_then_spec.rb +116 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/multiline_ternary_operator_spec.rb +18 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/negated_if_spec.rb +102 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/negated_while_spec.rb +62 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/nested_ternary_operator_spec.rb +21 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/next_spec.rb +285 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/nil_comparison_spec.rb +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/non_nil_check_spec.rb +101 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/not_spec.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/numeric_literals_spec.rb +80 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/one_line_conditional_spec.rb +13 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/op_method_spec.rb +82 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +143 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb +316 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/percent_q_literals_spec.rb +122 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/perl_backrefs_spec.rb +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/predicate_name_spec.rb +57 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/proc_spec.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/raise_args_spec.rb +87 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/redundant_begin_spec.rb +121 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/redundant_exception_spec.rb +27 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/redundant_return_spec.rb +171 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/redundant_self_spec.rb +142 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/regexp_literal_spec.rb +188 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/rescue_modifier_spec.rb +116 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/self_assignment_spec.rb +43 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/semicolon_spec.rb +114 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/signal_exception_spec.rb +290 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/single_line_block_params_spec.rb +70 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/single_line_methods_spec.rb +90 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/single_space_before_first_arg_spec.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_after_colon_spec.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_after_comma_spec.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_after_control_keyword_spec.rb +84 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_after_method_name_spec.rb +70 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_after_not_spec.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_after_semicolon_spec.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_around_equals_in_parameter_default_spec.rb +86 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_around_operators_spec.rb +327 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_before_block_braces_spec.rb +72 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_before_comma_spec.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_before_comment_spec.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb +70 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_before_semicolon_spec.rb +28 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_inside_block_braces_spec.rb +307 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_inside_brackets_spec.rb +83 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +147 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_inside_parens_spec.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/space_inside_range_literal_spec.rb +52 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/special_global_vars_spec.rb +57 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/string_literals_spec.rb +218 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/symbol_array_spec.rb +37 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/symbol_proc_spec.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/tab_spec.rb +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/trailing_blank_lines_spec.rb +83 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/trailing_comma_spec.rb +390 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/trailing_whitespace_spec.rb +31 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/trivial_accessors_spec.rb +542 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/unless_else_spec.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/unneeded_capital_w_spec.rb +96 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/unneeded_percent_q_spec.rb +127 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/unneeded_percent_x_spec.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/variable_interpolation_spec.rb +76 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/variable_name_spec.rb +107 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/when_then_spec.rb +42 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/while_until_do_spec.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/style/word_array_spec.rb +103 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/team_spec.rb +190 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/util_spec.rb +51 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force/assignment_spec.rb +200 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force/locatable_spec.rb +699 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force/scope_spec.rb +319 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force/variable_spec.rb +59 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force/variable_table_spec.rb +269 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/cop/variable_force_spec.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/base_formatter_spec.rb +191 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/clang_style_formatter_spec.rb +114 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/colorizable_spec.rb +107 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/disabled_config_formatter_spec.rb +50 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/disabled_lines_formatter_spec.rb +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/emacs_style_formatter_spec.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/file_list_formatter_spec.rb +33 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/formatter_set_spec.rb +132 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/fuubar_style_formatter_spec.rb +129 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/html_formatter_spec.rb +145 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/json_formatter_spec.rb +152 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/offense_count_formatter_spec.rb +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/progress_formatter_spec.rb +182 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/formatter/simple_text_formatter_spec.rb +135 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/options_spec.rb +173 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/path_util_spec.rb +77 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/processed_source_spec.rb +184 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/runner_spec.rb +64 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/string_util_spec.rb +46 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/target_finder_spec.rb +211 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/rubocop/token_spec.rb +25 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/spec_helper.rb +154 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/file_helper.rb +23 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/isolated_environment.rb +34 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/mri_syntax_checker.rb +73 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/offenses_matcher.rb +30 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/shared_context.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/shared_examples.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/spec/support/statement_modifier_helper.rb +41 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/LICENSE +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/README.md +440 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/base.rb +212 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/bar.rb +60 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/elapsed_timer.rb +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/estimated_timer.rb +86 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/progressable.rb +105 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/rate.rb +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/throttle.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components/timer.rb +69 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/components.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/errors/invalid_progress_error.rb +4 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/format/base.rb +55 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/format/molecule.rb +38 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/format.rb +2 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/formatter.rb +103 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/length_calculator.rb +63 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/running_average_calculator.rb +7 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/time.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar/version.rb +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/lib/ruby-progressbar.rb +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/fixtures/benchmark.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/base_spec.rb +852 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/components/bar_spec.rb +210 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/components/elapsed_timer_spec.rb +91 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/components/estimated_timer_spec.rb +241 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/components/progressable_spec.rb +47 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/components/throttle_spec.rb +100 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/format/molecule_spec.rb +22 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/running_average_calculator_spec.rb +11 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/lib/ruby-progressbar/time_spec.rb +49 -0
- data/vendor/bundle/ruby/2.1.0/gems/ruby-progressbar-1.5.1/spec/support/time.rb +19 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/CHANGES.md +309 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/Gemfile +3 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/LICENSE +20 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/README.md +202 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/Rakefile +29 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/lib/slop/commands.rb +196 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/lib/slop/option.rb +214 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/lib/slop.rb +687 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/slop.gemspec +17 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/test/commands_test.rb +26 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/test/helper.rb +12 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/test/option_test.rb +145 -0
- data/vendor/bundle/ruby/2.1.0/gems/slop-3.6.0/test/slop_test.rb +518 -0
- data/vendor/bundle/ruby/2.1.0/specifications/ast-2.0.0.gemspec +56 -0
- data/vendor/bundle/ruby/2.1.0/specifications/astrolabe-1.3.0.gemspec +62 -0
- data/vendor/bundle/ruby/2.1.0/specifications/builder-3.2.2.gemspec +23 -0
- data/vendor/bundle/ruby/2.1.0/specifications/mini_portile-0.6.0.gemspec +24 -0
- data/vendor/bundle/ruby/2.1.0/specifications/nokogiri-1.6.3.1-x64-mingw32.gemspec +73 -0
- data/vendor/bundle/ruby/2.1.0/specifications/parser-2.2.0.pre.4.gemspec +79 -0
- data/vendor/bundle/ruby/2.1.0/specifications/powerpack-0.0.9.gemspec +41 -0
- data/vendor/bundle/ruby/2.1.0/specifications/rainbow-2.0.0.gemspec +39 -0
- data/vendor/bundle/ruby/2.1.0/specifications/rake-0.9.6.gemspec +37 -0
- data/vendor/bundle/ruby/2.1.0/specifications/rubocop-0.26.0.gemspec +63 -0
- data/vendor/bundle/ruby/2.1.0/specifications/ruby-progressbar-1.5.1.gemspec +47 -0
- data/vendor/bundle/ruby/2.1.0/specifications/slop-3.6.0.gemspec +36 -0
- metadata +1253 -2
|
@@ -0,0 +1,4872 @@
|
|
|
1
|
+
# encoding:utf-8
|
|
2
|
+
|
|
3
|
+
require 'helper'
|
|
4
|
+
require 'parse_helper'
|
|
5
|
+
|
|
6
|
+
class TestParser < Minitest::Test
|
|
7
|
+
include ParseHelper
|
|
8
|
+
|
|
9
|
+
def parser_for_ruby_version(version)
|
|
10
|
+
parser = super
|
|
11
|
+
parser.diagnostics.all_errors_are_fatal = true
|
|
12
|
+
|
|
13
|
+
%w(foo bar baz).each do |metasyntactic_var|
|
|
14
|
+
parser.static_env.declare(metasyntactic_var)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
parser
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Guidelines for test naming:
|
|
21
|
+
# * Test structure follows structure of AST_FORMAT.md.
|
|
22
|
+
# * Test names follow node names.
|
|
23
|
+
# * Structurally similar sources may be grouped into one test.
|
|
24
|
+
# * If, following the guidelines above, names clash, append
|
|
25
|
+
# an abbreviated disambiguator. E.g. `test_class` and
|
|
26
|
+
# `test_class_super`.
|
|
27
|
+
# * When writing a test for a bug, append unabbreviated (but
|
|
28
|
+
# concise) bug description. E.g. `test_class_bug_missing_newline`.
|
|
29
|
+
# * Do not append Ruby language version to the name.
|
|
30
|
+
# * When in doubt, look at existing test names.
|
|
31
|
+
#
|
|
32
|
+
# Guidelines for writing assertions:
|
|
33
|
+
# * Don't check for structurally same source mapping information
|
|
34
|
+
# more than once or twice in the entire file. It clutters the
|
|
35
|
+
# source for no reason.
|
|
36
|
+
# * Don't forget to check for optional delimiters. `()`, `then`, etc.
|
|
37
|
+
# * When in doubt, look at existing assertions.
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# Literals
|
|
41
|
+
#
|
|
42
|
+
|
|
43
|
+
def test_empty_stmt
|
|
44
|
+
assert_parses(
|
|
45
|
+
nil,
|
|
46
|
+
%q{})
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def test_nil
|
|
50
|
+
assert_parses(
|
|
51
|
+
s(:nil),
|
|
52
|
+
%q{nil},
|
|
53
|
+
%q{~~~ expression})
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def test_nil_expression
|
|
57
|
+
assert_parses(
|
|
58
|
+
s(:begin),
|
|
59
|
+
%q{()},
|
|
60
|
+
%q{^ begin
|
|
61
|
+
| ^ end
|
|
62
|
+
|~~ expression})
|
|
63
|
+
|
|
64
|
+
assert_parses(
|
|
65
|
+
s(:kwbegin),
|
|
66
|
+
%q{begin end},
|
|
67
|
+
%q{~~~~~ begin
|
|
68
|
+
| ~~~ end
|
|
69
|
+
|~~~~~~~~~ expression})
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def test_true
|
|
73
|
+
assert_parses(
|
|
74
|
+
s(:true),
|
|
75
|
+
%q{true},
|
|
76
|
+
%q{~~~~ expression})
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def test_false
|
|
80
|
+
assert_parses(
|
|
81
|
+
s(:false),
|
|
82
|
+
%q{false},
|
|
83
|
+
%q{~~~~~ expression})
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def test_int
|
|
87
|
+
assert_parses(
|
|
88
|
+
s(:int, 42),
|
|
89
|
+
%q{42},
|
|
90
|
+
%q{~~ expression})
|
|
91
|
+
|
|
92
|
+
assert_parses(
|
|
93
|
+
s(:int, -42),
|
|
94
|
+
%q{-42},
|
|
95
|
+
%q{^ operator
|
|
96
|
+
|~~~ expression})
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def test_int___LINE__
|
|
100
|
+
assert_parses(
|
|
101
|
+
s(:int, 1),
|
|
102
|
+
%q{__LINE__},
|
|
103
|
+
%q{~~~~~~~~ expression})
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def test_float
|
|
107
|
+
assert_parses(
|
|
108
|
+
s(:float, 1.33),
|
|
109
|
+
%q{1.33},
|
|
110
|
+
%q{~~~~ expression})
|
|
111
|
+
|
|
112
|
+
assert_parses(
|
|
113
|
+
s(:float, -1.33),
|
|
114
|
+
%q{-1.33},
|
|
115
|
+
%q{^ operator
|
|
116
|
+
|~~~~~ expression})
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def test_rational
|
|
120
|
+
assert_parses(
|
|
121
|
+
s(:rational, Rational(42)),
|
|
122
|
+
%q{42r},
|
|
123
|
+
%q{~~~ expression},
|
|
124
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
125
|
+
|
|
126
|
+
assert_parses(
|
|
127
|
+
s(:rational, Rational(421, 10)),
|
|
128
|
+
%q{42.1r},
|
|
129
|
+
%q{~~~~~ expression},
|
|
130
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def test_complex
|
|
134
|
+
assert_parses(
|
|
135
|
+
s(:complex, Complex(0, 42)),
|
|
136
|
+
%q{42i},
|
|
137
|
+
%q{~~~ expression},
|
|
138
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
139
|
+
|
|
140
|
+
assert_parses(
|
|
141
|
+
s(:complex, Complex(0, Rational(42))),
|
|
142
|
+
%q{42ri},
|
|
143
|
+
%q{~~~~ expression},
|
|
144
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
145
|
+
|
|
146
|
+
assert_parses(
|
|
147
|
+
s(:complex, Complex(0, 42.1)),
|
|
148
|
+
%q{42.1i},
|
|
149
|
+
%q{~~~~~ expression},
|
|
150
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
151
|
+
|
|
152
|
+
assert_parses(
|
|
153
|
+
s(:complex, Complex(0, Rational(421, 10))),
|
|
154
|
+
%q{42.1ri},
|
|
155
|
+
%q{~~~~~~ expression},
|
|
156
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Strings
|
|
160
|
+
|
|
161
|
+
def test_string_plain
|
|
162
|
+
assert_parses(
|
|
163
|
+
s(:str, 'foobar'),
|
|
164
|
+
%q{'foobar'},
|
|
165
|
+
%q{^ begin
|
|
166
|
+
| ^ end
|
|
167
|
+
|~~~~~~~~ expression})
|
|
168
|
+
|
|
169
|
+
assert_parses(
|
|
170
|
+
s(:str, 'foobar'),
|
|
171
|
+
%q{%q(foobar)},
|
|
172
|
+
%q{^^^ begin
|
|
173
|
+
| ^ end
|
|
174
|
+
|~~~~~~~~~~ expression})
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def test_string_interp
|
|
178
|
+
assert_parses(
|
|
179
|
+
s(:dstr,
|
|
180
|
+
s(:str, 'foo'),
|
|
181
|
+
s(:begin, s(:lvar, :bar)),
|
|
182
|
+
s(:str, 'baz')),
|
|
183
|
+
%q{"foo#{bar}baz"},
|
|
184
|
+
%q{^ begin
|
|
185
|
+
| ^ end
|
|
186
|
+
| ^^ begin (begin)
|
|
187
|
+
| ^ end (begin)
|
|
188
|
+
| ~~~~~~ expression (begin)
|
|
189
|
+
|~~~~~~~~~~~~~~ expression})
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
def test_string_dvar
|
|
193
|
+
assert_parses(
|
|
194
|
+
s(:dstr,
|
|
195
|
+
s(:ivar, :@a),
|
|
196
|
+
s(:str, ' '),
|
|
197
|
+
s(:cvar, :@@a),
|
|
198
|
+
s(:str, ' '),
|
|
199
|
+
s(:gvar, :$a)),
|
|
200
|
+
%q{"#@a #@@a #$a"})
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
def test_string_concat
|
|
204
|
+
assert_parses(
|
|
205
|
+
s(:dstr,
|
|
206
|
+
s(:dstr,
|
|
207
|
+
s(:str, 'foo'),
|
|
208
|
+
s(:ivar, :@a)),
|
|
209
|
+
s(:str, 'bar')),
|
|
210
|
+
%q{"foo#@a" "bar"},
|
|
211
|
+
%q{^ begin (dstr)
|
|
212
|
+
| ^ end (dstr)
|
|
213
|
+
| ^ begin (str)
|
|
214
|
+
| ^ end (str)
|
|
215
|
+
|~~~~~~~~~~~~~~ expression})
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
def test_string___FILE__
|
|
219
|
+
assert_parses(
|
|
220
|
+
s(:str, '(assert_parses)'),
|
|
221
|
+
%q{__FILE__},
|
|
222
|
+
%q{~~~~~~~~ expression})
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
def test_character
|
|
226
|
+
assert_parses(
|
|
227
|
+
s(:str, 'a'),
|
|
228
|
+
%q{?a},
|
|
229
|
+
%q{^ begin
|
|
230
|
+
|~~ expression},
|
|
231
|
+
ALL_VERSIONS - %w(1.8))
|
|
232
|
+
|
|
233
|
+
assert_parses(
|
|
234
|
+
s(:int, 97),
|
|
235
|
+
%q{?a},
|
|
236
|
+
%q{~~ expression},
|
|
237
|
+
%w(1.8))
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def test_heredoc
|
|
241
|
+
assert_parses(
|
|
242
|
+
s(:dstr, s(:str, "foo\n"), s(:str, "bar\n")),
|
|
243
|
+
%Q{<<HERE!foo!bar!HERE}.gsub('!', "\n"),
|
|
244
|
+
%q{~~~~~~ expression
|
|
245
|
+
| ~~~~~~~~ heredoc_body
|
|
246
|
+
| ~~~~ heredoc_end})
|
|
247
|
+
|
|
248
|
+
assert_parses(
|
|
249
|
+
s(:dstr, s(:str, "foo\n"), s(:str, "bar\n")),
|
|
250
|
+
%Q{<<'HERE'!foo!bar!HERE}.gsub('!', "\n"),
|
|
251
|
+
%q{~~~~~~~~ expression
|
|
252
|
+
| ~~~~~~~~ heredoc_body
|
|
253
|
+
| ~~~~ heredoc_end})
|
|
254
|
+
|
|
255
|
+
assert_parses(
|
|
256
|
+
s(:xstr, s(:str, "foo\n"), s(:str, "bar\n")),
|
|
257
|
+
%Q{<<`HERE`!foo!bar!HERE}.gsub('!', "\n"),
|
|
258
|
+
%q{~~~~~~~~ expression
|
|
259
|
+
| ~~~~~~~~ heredoc_body
|
|
260
|
+
| ~~~~ heredoc_end})
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Symbols
|
|
264
|
+
|
|
265
|
+
def test_symbol_plain
|
|
266
|
+
assert_parses(
|
|
267
|
+
s(:sym, :foo),
|
|
268
|
+
%q{:foo},
|
|
269
|
+
%q{~ begin
|
|
270
|
+
|~~~~ expression})
|
|
271
|
+
|
|
272
|
+
assert_parses(
|
|
273
|
+
s(:sym, :foo),
|
|
274
|
+
%q{:'foo'},
|
|
275
|
+
%q{^^ begin
|
|
276
|
+
| ^ end
|
|
277
|
+
|~~~~~~ expression})
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
def test_symbol_interp
|
|
281
|
+
assert_parses(
|
|
282
|
+
s(:dsym,
|
|
283
|
+
s(:str, 'foo'),
|
|
284
|
+
s(:begin, s(:lvar, :bar)),
|
|
285
|
+
s(:str, 'baz')),
|
|
286
|
+
%q{:"foo#{bar}baz"},
|
|
287
|
+
%q{^^ begin
|
|
288
|
+
| ^ end
|
|
289
|
+
| ^^ begin (begin)
|
|
290
|
+
| ^ end (begin)
|
|
291
|
+
| ~~~~~~ expression (begin)
|
|
292
|
+
|~~~~~~~~~~~~~~~ expression})
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
def test_symbol_empty
|
|
296
|
+
assert_diagnoses(
|
|
297
|
+
[:error, :empty_symbol],
|
|
298
|
+
%q{:''},
|
|
299
|
+
%q{^^^ location},
|
|
300
|
+
%w(1.8))
|
|
301
|
+
|
|
302
|
+
assert_diagnoses(
|
|
303
|
+
[:error, :empty_symbol],
|
|
304
|
+
%q{:""},
|
|
305
|
+
%q{^^^ location},
|
|
306
|
+
%w(1.8))
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Execute-strings
|
|
310
|
+
|
|
311
|
+
def test_xstring_plain
|
|
312
|
+
assert_parses(
|
|
313
|
+
s(:xstr, s(:str, 'foobar')),
|
|
314
|
+
%q{`foobar`},
|
|
315
|
+
%q{^ begin
|
|
316
|
+
| ^ end
|
|
317
|
+
|~~~~~~~~ expression})
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
def test_xstring_interp
|
|
321
|
+
assert_parses(
|
|
322
|
+
s(:xstr,
|
|
323
|
+
s(:str, 'foo'),
|
|
324
|
+
s(:begin, s(:lvar, :bar)),
|
|
325
|
+
s(:str, 'baz')),
|
|
326
|
+
%q{`foo#{bar}baz`},
|
|
327
|
+
%q{^ begin
|
|
328
|
+
| ^ end
|
|
329
|
+
| ^^ begin (begin)
|
|
330
|
+
| ^ end (begin)
|
|
331
|
+
| ~~~~~~ expression (begin)
|
|
332
|
+
|~~~~~~~~~~~~~~ expression})
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
# Regexp
|
|
336
|
+
|
|
337
|
+
def test_regex_plain
|
|
338
|
+
assert_parses(
|
|
339
|
+
s(:regexp, s(:str, 'source'), s(:regopt, :i, :m)),
|
|
340
|
+
%q{/source/im},
|
|
341
|
+
%q{^ begin
|
|
342
|
+
| ^ end
|
|
343
|
+
| ~~ expression (regopt)
|
|
344
|
+
|~~~~~~~~~~ expression})
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def test_regex_interp
|
|
348
|
+
assert_parses(
|
|
349
|
+
s(:regexp,
|
|
350
|
+
s(:str, 'foo'),
|
|
351
|
+
s(:begin, s(:lvar, :bar)),
|
|
352
|
+
s(:str, 'baz'),
|
|
353
|
+
s(:regopt)),
|
|
354
|
+
%q{/foo#{bar}baz/},
|
|
355
|
+
%q{^ begin
|
|
356
|
+
| ^^ begin (begin)
|
|
357
|
+
| ^ end (begin)
|
|
358
|
+
| ~~~~~~ expression (begin)
|
|
359
|
+
| ^ end
|
|
360
|
+
|~~~~~~~~~~~~~~ expression})
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# Arrays
|
|
364
|
+
|
|
365
|
+
def test_array_plain
|
|
366
|
+
assert_parses(
|
|
367
|
+
s(:array, s(:int, 1), s(:int, 2)),
|
|
368
|
+
%q{[1, 2]},
|
|
369
|
+
%q{^ begin
|
|
370
|
+
| ^ end
|
|
371
|
+
|~~~~~~ expression})
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def test_array_splat
|
|
375
|
+
assert_parses(
|
|
376
|
+
s(:array,
|
|
377
|
+
s(:int, 1),
|
|
378
|
+
s(:splat, s(:lvar, :foo)),
|
|
379
|
+
s(:int, 2)),
|
|
380
|
+
%q{[1, *foo, 2]},
|
|
381
|
+
%q{^ begin
|
|
382
|
+
| ^ end
|
|
383
|
+
| ^ operator (splat)
|
|
384
|
+
| ~~~~ expression (splat)
|
|
385
|
+
|~~~~~~~~~~~~ expression},
|
|
386
|
+
ALL_VERSIONS - %w(1.8))
|
|
387
|
+
|
|
388
|
+
assert_parses(
|
|
389
|
+
s(:array,
|
|
390
|
+
s(:int, 1),
|
|
391
|
+
s(:splat, s(:lvar, :foo))),
|
|
392
|
+
%q{[1, *foo]},
|
|
393
|
+
%q{^ begin
|
|
394
|
+
| ^ end
|
|
395
|
+
| ^ operator (splat)
|
|
396
|
+
| ~~~~ expression (splat)
|
|
397
|
+
|~~~~~~~~~ expression})
|
|
398
|
+
|
|
399
|
+
assert_parses(
|
|
400
|
+
s(:array,
|
|
401
|
+
s(:splat, s(:lvar, :foo))),
|
|
402
|
+
%q{[*foo]})
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
def test_array_assocs
|
|
406
|
+
assert_parses(
|
|
407
|
+
s(:array,
|
|
408
|
+
s(:hash, s(:pair, s(:int, 1), s(:int, 2)))),
|
|
409
|
+
%q{[ 1 => 2 ]},
|
|
410
|
+
%q{ ~~ operator (hash.pair)
|
|
411
|
+
| ~~~~~~ expression (hash.pair)
|
|
412
|
+
| ~~~~~~ expression (hash)})
|
|
413
|
+
|
|
414
|
+
assert_parses(
|
|
415
|
+
s(:array,
|
|
416
|
+
s(:int, 1),
|
|
417
|
+
s(:hash, s(:pair, s(:int, 2), s(:int, 3)))),
|
|
418
|
+
%q{[ 1, 2 => 3 ]},
|
|
419
|
+
%q{},
|
|
420
|
+
ALL_VERSIONS - %w(1.8))
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
def test_array_words
|
|
424
|
+
assert_parses(
|
|
425
|
+
s(:array, s(:str, 'foo'), s(:str, 'bar')),
|
|
426
|
+
%q{%w[foo bar]},
|
|
427
|
+
%q{^^^ begin
|
|
428
|
+
| ^ end
|
|
429
|
+
| ~~~ expression (str)
|
|
430
|
+
|~~~~~~~~~~~ expression})
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
def test_array_words_interp
|
|
434
|
+
assert_parses(
|
|
435
|
+
s(:array,
|
|
436
|
+
s(:str, 'foo'),
|
|
437
|
+
s(:dstr, s(:begin, s(:lvar, :bar)))),
|
|
438
|
+
%q{%W[foo #{bar}]},
|
|
439
|
+
%q{^^^ begin
|
|
440
|
+
| ^^ begin (dstr.begin)
|
|
441
|
+
| ^ end (dstr.begin)
|
|
442
|
+
| ~~~~~~ expression (dstr.begin)
|
|
443
|
+
| ^ end
|
|
444
|
+
| ~~~ expression (str)
|
|
445
|
+
| ~~~ expression (dstr.begin.lvar)
|
|
446
|
+
|~~~~~~~~~~~~~~ expression})
|
|
447
|
+
|
|
448
|
+
assert_parses(
|
|
449
|
+
s(:array,
|
|
450
|
+
s(:str, 'foo'),
|
|
451
|
+
s(:dstr,
|
|
452
|
+
s(:begin, s(:lvar, :bar)),
|
|
453
|
+
s(:str, 'foo'),
|
|
454
|
+
s(:ivar, :@baz))),
|
|
455
|
+
%q{%W[foo #{bar}foo#@baz]})
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
def test_array_words_empty
|
|
459
|
+
assert_parses(
|
|
460
|
+
s(:array),
|
|
461
|
+
%q{%w[]},
|
|
462
|
+
%q{^^^ begin
|
|
463
|
+
| ^ end
|
|
464
|
+
|~~~~ expression})
|
|
465
|
+
|
|
466
|
+
assert_parses(
|
|
467
|
+
s(:array),
|
|
468
|
+
%q{%W()})
|
|
469
|
+
end
|
|
470
|
+
|
|
471
|
+
def test_array_symbols
|
|
472
|
+
assert_parses(
|
|
473
|
+
s(:array, s(:sym, :foo), s(:sym, :bar)),
|
|
474
|
+
%q{%i[foo bar]},
|
|
475
|
+
%q{^^^ begin
|
|
476
|
+
| ^ end
|
|
477
|
+
| ~~~ expression (sym)
|
|
478
|
+
|~~~~~~~~~~~ expression},
|
|
479
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
def test_array_symbols_interp
|
|
483
|
+
assert_parses(
|
|
484
|
+
s(:array,
|
|
485
|
+
s(:sym, :foo),
|
|
486
|
+
s(:dsym, s(:begin, s(:lvar, :bar)))),
|
|
487
|
+
%q{%I[foo #{bar}]},
|
|
488
|
+
%q{^^^ begin
|
|
489
|
+
| ^ end
|
|
490
|
+
| ~~~ expression (sym)
|
|
491
|
+
| ^^ begin (dsym.begin)
|
|
492
|
+
| ^ end (dsym.begin)
|
|
493
|
+
| ~~~~~~ expression (dsym.begin)
|
|
494
|
+
| ~~~ expression (dsym.begin.lvar)
|
|
495
|
+
|~~~~~~~~~~~~~~ expression},
|
|
496
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
497
|
+
|
|
498
|
+
assert_parses(
|
|
499
|
+
s(:array,
|
|
500
|
+
s(:dsym,
|
|
501
|
+
s(:str, 'foo'),
|
|
502
|
+
s(:begin, s(:lvar, :bar)))),
|
|
503
|
+
%q{%I[foo#{bar}]},
|
|
504
|
+
%q{},
|
|
505
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
def test_array_symbols_empty
|
|
509
|
+
assert_parses(
|
|
510
|
+
s(:array),
|
|
511
|
+
%q{%i[]},
|
|
512
|
+
%q{^^^ begin
|
|
513
|
+
| ^ end
|
|
514
|
+
|~~~~ expression},
|
|
515
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
516
|
+
|
|
517
|
+
assert_parses(
|
|
518
|
+
s(:array),
|
|
519
|
+
%q{%I()},
|
|
520
|
+
%q{},
|
|
521
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
522
|
+
end
|
|
523
|
+
|
|
524
|
+
# Hashes
|
|
525
|
+
|
|
526
|
+
def test_hash_empty
|
|
527
|
+
assert_parses(
|
|
528
|
+
s(:hash),
|
|
529
|
+
%q[{ }],
|
|
530
|
+
%q{^ begin
|
|
531
|
+
| ^ end
|
|
532
|
+
|~~~ expression})
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
def test_hash_hashrocket
|
|
536
|
+
assert_parses(
|
|
537
|
+
s(:hash, s(:pair, s(:int, 1), s(:int, 2))),
|
|
538
|
+
%q[{ 1 => 2 }],
|
|
539
|
+
%q{^ begin
|
|
540
|
+
| ^ end
|
|
541
|
+
| ^^ operator (pair)
|
|
542
|
+
| ~~~~~~ expression (pair)
|
|
543
|
+
|~~~~~~~~~~ expression})
|
|
544
|
+
|
|
545
|
+
assert_parses(
|
|
546
|
+
s(:hash,
|
|
547
|
+
s(:pair, s(:int, 1), s(:int, 2)),
|
|
548
|
+
s(:pair, s(:sym, :foo), s(:str, 'bar'))),
|
|
549
|
+
%q[{ 1 => 2, :foo => "bar" }])
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
def test_hash_label
|
|
553
|
+
assert_parses(
|
|
554
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 2))),
|
|
555
|
+
%q[{ foo: 2 }],
|
|
556
|
+
%q{^ begin
|
|
557
|
+
| ^ end
|
|
558
|
+
| ^ operator (pair)
|
|
559
|
+
| ~~~ expression (pair.sym)
|
|
560
|
+
| ~~~~~~ expression (pair)
|
|
561
|
+
|~~~~~~~~~~ expression},
|
|
562
|
+
ALL_VERSIONS - %w(1.8))
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
def test_hash_kwsplat
|
|
566
|
+
assert_parses(
|
|
567
|
+
s(:hash,
|
|
568
|
+
s(:pair, s(:sym, :foo), s(:int, 2)),
|
|
569
|
+
s(:kwsplat, s(:lvar, :bar))),
|
|
570
|
+
%q[{ foo: 2, **bar }],
|
|
571
|
+
%q{ ^^ operator (kwsplat)
|
|
572
|
+
| ~~~~~ expression (kwsplat)},
|
|
573
|
+
%w(2.0))
|
|
574
|
+
end
|
|
575
|
+
|
|
576
|
+
def test_hash_no_hashrocket
|
|
577
|
+
assert_parses(
|
|
578
|
+
s(:hash, s(:pair, s(:int, 1), s(:int, 2))),
|
|
579
|
+
%q[{ 1, 2 }],
|
|
580
|
+
%q{^ begin
|
|
581
|
+
| ^ end
|
|
582
|
+
| ~~~~ expression (pair)
|
|
583
|
+
|~~~~~~~~ expression},
|
|
584
|
+
%w(1.8))
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
def test_hash_no_hashrocket_odd
|
|
588
|
+
assert_diagnoses(
|
|
589
|
+
[:error, :odd_hash],
|
|
590
|
+
%q[{ 1, 2, 3 }],
|
|
591
|
+
%q( ~ location),
|
|
592
|
+
%w(1.8))
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
# Range
|
|
596
|
+
|
|
597
|
+
def test_range_inclusive
|
|
598
|
+
assert_parses(
|
|
599
|
+
s(:irange, s(:int, 1), s(:int, 2)),
|
|
600
|
+
%q{1..2},
|
|
601
|
+
%q{ ~~ operator
|
|
602
|
+
|~~~~ expression})
|
|
603
|
+
end
|
|
604
|
+
|
|
605
|
+
def test_range_exclusive
|
|
606
|
+
assert_parses(
|
|
607
|
+
s(:erange, s(:int, 1), s(:int, 2)),
|
|
608
|
+
%q{1...2},
|
|
609
|
+
%q{ ~~~ operator
|
|
610
|
+
|~~~~~ expression})
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
#
|
|
614
|
+
# Access
|
|
615
|
+
#
|
|
616
|
+
|
|
617
|
+
# Variables and pseudovariables
|
|
618
|
+
|
|
619
|
+
def test_self
|
|
620
|
+
assert_parses(
|
|
621
|
+
s(:self),
|
|
622
|
+
%q{self},
|
|
623
|
+
%q{~~~~ expression})
|
|
624
|
+
end
|
|
625
|
+
|
|
626
|
+
def test_lvar
|
|
627
|
+
assert_parses(
|
|
628
|
+
s(:lvar, :foo),
|
|
629
|
+
%q{foo},
|
|
630
|
+
%q{~~~ expression})
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
def test_ivar
|
|
634
|
+
assert_parses(
|
|
635
|
+
s(:ivar, :@foo),
|
|
636
|
+
%q{@foo},
|
|
637
|
+
%q{~~~~ expression})
|
|
638
|
+
end
|
|
639
|
+
|
|
640
|
+
def test_cvar
|
|
641
|
+
assert_parses(
|
|
642
|
+
s(:cvar, :@@foo),
|
|
643
|
+
%q{@@foo},
|
|
644
|
+
%q{~~~~~ expression})
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
def test_gvar
|
|
648
|
+
assert_parses(
|
|
649
|
+
s(:gvar, :$foo),
|
|
650
|
+
%q{$foo},
|
|
651
|
+
%q{~~~~ expression})
|
|
652
|
+
end
|
|
653
|
+
|
|
654
|
+
def test_gvar_dash_empty
|
|
655
|
+
assert_diagnoses(
|
|
656
|
+
[:fatal, :unexpected, { :character => '$' }],
|
|
657
|
+
%q{$- },
|
|
658
|
+
%q{^ location},
|
|
659
|
+
%w(2.1))
|
|
660
|
+
end
|
|
661
|
+
|
|
662
|
+
def test_back_ref
|
|
663
|
+
assert_parses(
|
|
664
|
+
s(:back_ref, :$+),
|
|
665
|
+
%q{$+},
|
|
666
|
+
%q{~~ expression})
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
def test_nth_ref
|
|
670
|
+
assert_parses(
|
|
671
|
+
s(:nth_ref, 10),
|
|
672
|
+
%q{$10},
|
|
673
|
+
%q{~~~ expression})
|
|
674
|
+
end
|
|
675
|
+
|
|
676
|
+
# Constants
|
|
677
|
+
|
|
678
|
+
def test_const_toplevel
|
|
679
|
+
assert_parses(
|
|
680
|
+
s(:const, s(:cbase), :Foo),
|
|
681
|
+
%q{::Foo},
|
|
682
|
+
%q{ ~~~ name
|
|
683
|
+
|~~ double_colon
|
|
684
|
+
|~~~~~ expression})
|
|
685
|
+
end
|
|
686
|
+
|
|
687
|
+
def test_const_scoped
|
|
688
|
+
assert_parses(
|
|
689
|
+
s(:const, s(:const, nil, :Bar), :Foo),
|
|
690
|
+
%q{Bar::Foo},
|
|
691
|
+
%q{ ~~~ name
|
|
692
|
+
| ~~ double_colon
|
|
693
|
+
|~~~~~~~~ expression})
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
def test_const_unscoped
|
|
697
|
+
assert_parses(
|
|
698
|
+
s(:const, nil, :Foo),
|
|
699
|
+
%q{Foo},
|
|
700
|
+
%q{~~~ name
|
|
701
|
+
|~~~ expression})
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
def test___ENCODING__
|
|
705
|
+
assert_parses(
|
|
706
|
+
s(:const, s(:const, nil, :Encoding), :UTF_8),
|
|
707
|
+
%q{__ENCODING__},
|
|
708
|
+
%q{~~~~~~~~~~~~ expression},
|
|
709
|
+
ALL_VERSIONS - %w(1.8))
|
|
710
|
+
end
|
|
711
|
+
|
|
712
|
+
# defined?
|
|
713
|
+
|
|
714
|
+
def test_defined
|
|
715
|
+
assert_parses(
|
|
716
|
+
s(:defined?, s(:lvar, :foo)),
|
|
717
|
+
%q{defined? foo},
|
|
718
|
+
%q{~~~~~~~~ keyword
|
|
719
|
+
|~~~~~~~~~~~~ expression})
|
|
720
|
+
|
|
721
|
+
assert_parses(
|
|
722
|
+
s(:defined?, s(:lvar, :foo)),
|
|
723
|
+
%q{defined?(foo)},
|
|
724
|
+
%q{~~~~~~~~ keyword
|
|
725
|
+
| ^ begin
|
|
726
|
+
| ^ end
|
|
727
|
+
|~~~~~~~~~~~~~ expression})
|
|
728
|
+
|
|
729
|
+
assert_parses(
|
|
730
|
+
s(:defined?, s(:ivar, :@foo)),
|
|
731
|
+
%q{defined? @foo})
|
|
732
|
+
end
|
|
733
|
+
|
|
734
|
+
#
|
|
735
|
+
# Assignment
|
|
736
|
+
#
|
|
737
|
+
|
|
738
|
+
# Variables
|
|
739
|
+
|
|
740
|
+
def test_lvasgn
|
|
741
|
+
assert_parses(
|
|
742
|
+
s(:begin,
|
|
743
|
+
s(:lvasgn, :var, s(:int, 10)),
|
|
744
|
+
s(:lvar, :var)),
|
|
745
|
+
%q{var = 10; var},
|
|
746
|
+
%q{~~~ name (lvasgn)
|
|
747
|
+
| ^ operator (lvasgn)
|
|
748
|
+
|~~~~~~~~ expression (lvasgn)
|
|
749
|
+
})
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
def test_ivasgn
|
|
753
|
+
assert_parses(
|
|
754
|
+
s(:ivasgn, :@var, s(:int, 10)),
|
|
755
|
+
%q{@var = 10},
|
|
756
|
+
%q{~~~~ name
|
|
757
|
+
| ^ operator
|
|
758
|
+
|~~~~~~~~~ expression
|
|
759
|
+
})
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
def test_cvasgn
|
|
763
|
+
assert_parses(
|
|
764
|
+
s(:cvasgn, :@@var, s(:int, 10)),
|
|
765
|
+
%q{@@var = 10},
|
|
766
|
+
%q{~~~~~ name
|
|
767
|
+
| ^ operator
|
|
768
|
+
|~~~~~~~~~~ expression
|
|
769
|
+
})
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
def test_gvasgn
|
|
773
|
+
assert_parses(
|
|
774
|
+
s(:gvasgn, :$var, s(:int, 10)),
|
|
775
|
+
%q{$var = 10},
|
|
776
|
+
%q{~~~~ name
|
|
777
|
+
| ^ operator
|
|
778
|
+
|~~~~~~~~~ expression
|
|
779
|
+
})
|
|
780
|
+
end
|
|
781
|
+
|
|
782
|
+
def test_asgn_cmd
|
|
783
|
+
assert_parses(
|
|
784
|
+
s(:lvasgn, :foo, s(:send, nil, :m, s(:lvar, :foo))),
|
|
785
|
+
%q{foo = m foo})
|
|
786
|
+
|
|
787
|
+
assert_parses(
|
|
788
|
+
s(:lvasgn, :foo,
|
|
789
|
+
s(:lvasgn, :bar,
|
|
790
|
+
s(:send, nil, :m, s(:lvar, :foo)))),
|
|
791
|
+
%q{foo = bar = m foo},
|
|
792
|
+
%q{},
|
|
793
|
+
ALL_VERSIONS - %w(1.8))
|
|
794
|
+
end
|
|
795
|
+
|
|
796
|
+
def test_asgn_keyword_invalid
|
|
797
|
+
assert_diagnoses(
|
|
798
|
+
[:error, :invalid_assignment],
|
|
799
|
+
%q{nil = foo},
|
|
800
|
+
%q{~~~ location})
|
|
801
|
+
|
|
802
|
+
assert_diagnoses(
|
|
803
|
+
[:error, :invalid_assignment],
|
|
804
|
+
%q{self = foo},
|
|
805
|
+
%q{~~~~ location})
|
|
806
|
+
|
|
807
|
+
assert_diagnoses(
|
|
808
|
+
[:error, :invalid_assignment],
|
|
809
|
+
%q{true = foo},
|
|
810
|
+
%q{~~~~ location})
|
|
811
|
+
|
|
812
|
+
assert_diagnoses(
|
|
813
|
+
[:error, :invalid_assignment],
|
|
814
|
+
%q{false = foo},
|
|
815
|
+
%q{~~~~~ location})
|
|
816
|
+
|
|
817
|
+
assert_diagnoses(
|
|
818
|
+
[:error, :invalid_assignment],
|
|
819
|
+
%q{__FILE__ = foo},
|
|
820
|
+
%q{~~~~~~~~ location})
|
|
821
|
+
|
|
822
|
+
assert_diagnoses(
|
|
823
|
+
[:error, :invalid_assignment],
|
|
824
|
+
%q{__LINE__ = foo},
|
|
825
|
+
%q{~~~~~~~~ location})
|
|
826
|
+
end
|
|
827
|
+
|
|
828
|
+
def test_asgn_backref_invalid
|
|
829
|
+
assert_diagnoses(
|
|
830
|
+
[:error, :backref_assignment],
|
|
831
|
+
%q{$1 = foo},
|
|
832
|
+
%q{~~ location})
|
|
833
|
+
end
|
|
834
|
+
|
|
835
|
+
# Constants
|
|
836
|
+
|
|
837
|
+
def test_casgn_toplevel
|
|
838
|
+
assert_parses(
|
|
839
|
+
s(:casgn, s(:cbase), :Foo, s(:int, 10)),
|
|
840
|
+
%q{::Foo = 10},
|
|
841
|
+
%q{ ~~~ name
|
|
842
|
+
| ^ operator
|
|
843
|
+
|~~ double_colon
|
|
844
|
+
|~~~~~~~~~~ expression
|
|
845
|
+
})
|
|
846
|
+
end
|
|
847
|
+
|
|
848
|
+
def test_casgn_scoped
|
|
849
|
+
assert_parses(
|
|
850
|
+
s(:casgn, s(:const, nil, :Bar), :Foo, s(:int, 10)),
|
|
851
|
+
%q{Bar::Foo = 10},
|
|
852
|
+
%q{ ~~~ name
|
|
853
|
+
| ^ operator
|
|
854
|
+
| ~~ double_colon
|
|
855
|
+
|~~~~~~~~~~~~~ expression
|
|
856
|
+
})
|
|
857
|
+
end
|
|
858
|
+
|
|
859
|
+
def test_casgn_unscoped
|
|
860
|
+
assert_parses(
|
|
861
|
+
s(:casgn, nil, :Foo, s(:int, 10)),
|
|
862
|
+
%q{Foo = 10},
|
|
863
|
+
%q{~~~ name
|
|
864
|
+
| ^ operator
|
|
865
|
+
|~~~~~~~~ expression
|
|
866
|
+
})
|
|
867
|
+
end
|
|
868
|
+
|
|
869
|
+
def test_casgn_invalid
|
|
870
|
+
assert_diagnoses(
|
|
871
|
+
[:error, :dynamic_const],
|
|
872
|
+
%q{def f; Foo = 1; end},
|
|
873
|
+
%q{ ~~~ location})
|
|
874
|
+
|
|
875
|
+
assert_diagnoses(
|
|
876
|
+
[:error, :dynamic_const],
|
|
877
|
+
%q{def f; Foo::Bar = 1; end},
|
|
878
|
+
%q{ ~~~~~~~~ location})
|
|
879
|
+
|
|
880
|
+
assert_diagnoses(
|
|
881
|
+
[:error, :dynamic_const],
|
|
882
|
+
%q{def f; ::Bar = 1; end},
|
|
883
|
+
%q{ ~~~~~ location})
|
|
884
|
+
end
|
|
885
|
+
|
|
886
|
+
# Multiple assignment
|
|
887
|
+
|
|
888
|
+
def test_masgn
|
|
889
|
+
assert_parses(
|
|
890
|
+
s(:masgn,
|
|
891
|
+
s(:mlhs, s(:lvasgn, :foo), s(:lvasgn, :bar)),
|
|
892
|
+
s(:array, s(:int, 1), s(:int, 2))),
|
|
893
|
+
%q{foo, bar = 1, 2},
|
|
894
|
+
%q{ ^ operator
|
|
895
|
+
|~~~~~~~~ expression (mlhs)
|
|
896
|
+
| ~~~~ expression (array)
|
|
897
|
+
|~~~~~~~~~~~~~~~ expression
|
|
898
|
+
})
|
|
899
|
+
|
|
900
|
+
assert_parses(
|
|
901
|
+
s(:masgn,
|
|
902
|
+
s(:mlhs, s(:lvasgn, :foo), s(:lvasgn, :bar)),
|
|
903
|
+
s(:array, s(:int, 1), s(:int, 2))),
|
|
904
|
+
%q{(foo, bar) = 1, 2},
|
|
905
|
+
%q{^ begin (mlhs)
|
|
906
|
+
| ^ end (mlhs)
|
|
907
|
+
|~~~~~~~~~~ expression (mlhs)
|
|
908
|
+
|~~~~~~~~~~~~~~~~~ expression})
|
|
909
|
+
|
|
910
|
+
assert_parses(
|
|
911
|
+
s(:masgn,
|
|
912
|
+
s(:mlhs,
|
|
913
|
+
s(:lvasgn, :foo),
|
|
914
|
+
s(:lvasgn, :bar),
|
|
915
|
+
s(:lvasgn, :baz)),
|
|
916
|
+
s(:array, s(:int, 1), s(:int, 2))),
|
|
917
|
+
%q{foo, bar, baz = 1, 2})
|
|
918
|
+
end
|
|
919
|
+
|
|
920
|
+
def test_masgn_splat
|
|
921
|
+
assert_parses(
|
|
922
|
+
s(:masgn,
|
|
923
|
+
s(:mlhs, s(:ivasgn, :@foo), s(:cvasgn, :@@bar)),
|
|
924
|
+
s(:array, s(:splat, s(:lvar, :foo)))),
|
|
925
|
+
%q{@foo, @@bar = *foo},
|
|
926
|
+
%q{ ^ operator (array.splat)
|
|
927
|
+
| ~~~~ expression (array.splat)
|
|
928
|
+
})
|
|
929
|
+
|
|
930
|
+
assert_parses(
|
|
931
|
+
s(:masgn,
|
|
932
|
+
s(:mlhs, s(:lvasgn, :a), s(:lvasgn, :b)),
|
|
933
|
+
s(:array, s(:splat, s(:lvar, :foo)), s(:lvar, :bar))),
|
|
934
|
+
%q{a, b = *foo, bar},
|
|
935
|
+
%q{},
|
|
936
|
+
ALL_VERSIONS - %w(1.8))
|
|
937
|
+
|
|
938
|
+
assert_parses(
|
|
939
|
+
s(:masgn,
|
|
940
|
+
s(:mlhs, s(:lvasgn, :a), s(:splat, s(:lvasgn, :b))),
|
|
941
|
+
s(:lvar, :bar)),
|
|
942
|
+
%q{a, *b = bar})
|
|
943
|
+
|
|
944
|
+
assert_parses(
|
|
945
|
+
s(:masgn,
|
|
946
|
+
s(:mlhs,
|
|
947
|
+
s(:lvasgn, :a),
|
|
948
|
+
s(:splat, s(:lvasgn, :b)),
|
|
949
|
+
s(:lvasgn, :c)),
|
|
950
|
+
s(:lvar, :bar)),
|
|
951
|
+
%q{a, *b, c = bar},
|
|
952
|
+
%q{},
|
|
953
|
+
ALL_VERSIONS - %w(1.8))
|
|
954
|
+
|
|
955
|
+
assert_parses(
|
|
956
|
+
s(:masgn,
|
|
957
|
+
s(:mlhs, s(:lvasgn, :a), s(:splat)),
|
|
958
|
+
s(:lvar, :bar)),
|
|
959
|
+
%q{a, * = bar})
|
|
960
|
+
|
|
961
|
+
assert_parses(
|
|
962
|
+
s(:masgn,
|
|
963
|
+
s(:mlhs,
|
|
964
|
+
s(:lvasgn, :a),
|
|
965
|
+
s(:splat),
|
|
966
|
+
s(:lvasgn, :c)),
|
|
967
|
+
s(:lvar, :bar)),
|
|
968
|
+
%q{a, *, c = bar},
|
|
969
|
+
%q{},
|
|
970
|
+
ALL_VERSIONS - %w(1.8))
|
|
971
|
+
|
|
972
|
+
assert_parses(
|
|
973
|
+
s(:masgn,
|
|
974
|
+
s(:mlhs, s(:splat, s(:lvasgn, :b))),
|
|
975
|
+
s(:lvar, :bar)),
|
|
976
|
+
%q{*b = bar})
|
|
977
|
+
|
|
978
|
+
assert_parses(
|
|
979
|
+
s(:masgn,
|
|
980
|
+
s(:mlhs,
|
|
981
|
+
s(:splat, s(:lvasgn, :b)),
|
|
982
|
+
s(:lvasgn, :c)),
|
|
983
|
+
s(:lvar, :bar)),
|
|
984
|
+
%q{*b, c = bar},
|
|
985
|
+
%q{},
|
|
986
|
+
ALL_VERSIONS - %w(1.8))
|
|
987
|
+
|
|
988
|
+
assert_parses(
|
|
989
|
+
s(:masgn,
|
|
990
|
+
s(:mlhs, s(:splat)),
|
|
991
|
+
s(:lvar, :bar)),
|
|
992
|
+
%q{* = bar})
|
|
993
|
+
|
|
994
|
+
assert_parses(
|
|
995
|
+
s(:masgn,
|
|
996
|
+
s(:mlhs,
|
|
997
|
+
s(:splat),
|
|
998
|
+
s(:lvasgn, :c),
|
|
999
|
+
s(:lvasgn, :d)),
|
|
1000
|
+
s(:lvar, :bar)),
|
|
1001
|
+
%q{*, c, d = bar},
|
|
1002
|
+
%q{},
|
|
1003
|
+
ALL_VERSIONS - %w(1.8))
|
|
1004
|
+
end
|
|
1005
|
+
|
|
1006
|
+
def test_masgn_nested
|
|
1007
|
+
assert_parses(
|
|
1008
|
+
s(:masgn,
|
|
1009
|
+
s(:mlhs,
|
|
1010
|
+
s(:lvasgn, :a),
|
|
1011
|
+
s(:mlhs,
|
|
1012
|
+
s(:lvasgn, :b),
|
|
1013
|
+
s(:lvasgn, :c))),
|
|
1014
|
+
s(:lvar, :foo)),
|
|
1015
|
+
%q{a, (b, c) = foo},
|
|
1016
|
+
%q{ ^ begin (mlhs.mlhs)
|
|
1017
|
+
| ^ end (mlhs.mlhs)
|
|
1018
|
+
| ~~~~~~ expression (mlhs.mlhs)
|
|
1019
|
+
})
|
|
1020
|
+
|
|
1021
|
+
assert_parses(
|
|
1022
|
+
s(:masgn,
|
|
1023
|
+
s(:mlhs,
|
|
1024
|
+
s(:lvasgn, :b)),
|
|
1025
|
+
s(:lvar, :foo)),
|
|
1026
|
+
%q{((b, )) = foo},
|
|
1027
|
+
%q{^ begin (mlhs)
|
|
1028
|
+
| ^ end (mlhs)})
|
|
1029
|
+
end
|
|
1030
|
+
|
|
1031
|
+
def test_masgn_attr
|
|
1032
|
+
assert_parses(
|
|
1033
|
+
s(:masgn,
|
|
1034
|
+
s(:mlhs,
|
|
1035
|
+
s(:send, s(:self), :a=),
|
|
1036
|
+
s(:send, s(:self), :[]=, s(:int, 1), s(:int, 2))),
|
|
1037
|
+
s(:lvar, :foo)),
|
|
1038
|
+
%q{self.a, self[1, 2] = foo},
|
|
1039
|
+
%q{~~~~~~ expression (mlhs.send/1)
|
|
1040
|
+
| ~ selector (mlhs.send/1)
|
|
1041
|
+
| ~~~~~~ selector (mlhs.send/2)
|
|
1042
|
+
| ~~~~~~~~~~ expression (mlhs.send/2)})
|
|
1043
|
+
|
|
1044
|
+
assert_parses(
|
|
1045
|
+
s(:masgn,
|
|
1046
|
+
s(:mlhs,
|
|
1047
|
+
s(:send, s(:self), :a=),
|
|
1048
|
+
s(:lvasgn, :foo)),
|
|
1049
|
+
s(:lvar, :foo)),
|
|
1050
|
+
%q{self::a, foo = foo})
|
|
1051
|
+
|
|
1052
|
+
assert_parses(
|
|
1053
|
+
s(:masgn,
|
|
1054
|
+
s(:mlhs,
|
|
1055
|
+
s(:send, s(:self), :A=),
|
|
1056
|
+
s(:lvasgn, :foo)),
|
|
1057
|
+
s(:lvar, :foo)),
|
|
1058
|
+
%q{self.A, foo = foo})
|
|
1059
|
+
end
|
|
1060
|
+
|
|
1061
|
+
def test_masgn_const
|
|
1062
|
+
assert_parses(
|
|
1063
|
+
s(:masgn,
|
|
1064
|
+
s(:mlhs,
|
|
1065
|
+
s(:casgn, s(:self), :A),
|
|
1066
|
+
s(:lvasgn, :foo)),
|
|
1067
|
+
s(:lvar, :foo)),
|
|
1068
|
+
%q{self::A, foo = foo})
|
|
1069
|
+
|
|
1070
|
+
assert_parses(
|
|
1071
|
+
s(:masgn,
|
|
1072
|
+
s(:mlhs,
|
|
1073
|
+
s(:casgn, s(:cbase), :A),
|
|
1074
|
+
s(:lvasgn, :foo)),
|
|
1075
|
+
s(:lvar, :foo)),
|
|
1076
|
+
%q{::A, foo = foo})
|
|
1077
|
+
end
|
|
1078
|
+
|
|
1079
|
+
def test_masgn_cmd
|
|
1080
|
+
assert_parses(
|
|
1081
|
+
s(:masgn,
|
|
1082
|
+
s(:mlhs,
|
|
1083
|
+
s(:lvasgn, :foo),
|
|
1084
|
+
s(:lvasgn, :bar)),
|
|
1085
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1086
|
+
%q{foo, bar = m foo})
|
|
1087
|
+
end
|
|
1088
|
+
|
|
1089
|
+
def test_asgn_mrhs
|
|
1090
|
+
assert_parses(
|
|
1091
|
+
s(:lvasgn, :foo,
|
|
1092
|
+
s(:array, s(:lvar, :bar), s(:int, 1))),
|
|
1093
|
+
%q{foo = bar, 1},
|
|
1094
|
+
%q{ ~~~~~~ expression (array)
|
|
1095
|
+
|~~~~~~~~~~~~ expression})
|
|
1096
|
+
|
|
1097
|
+
assert_parses(
|
|
1098
|
+
s(:lvasgn, :foo,
|
|
1099
|
+
s(:array, s(:splat, s(:lvar, :bar)))),
|
|
1100
|
+
%q{foo = *bar})
|
|
1101
|
+
|
|
1102
|
+
assert_parses(
|
|
1103
|
+
s(:lvasgn, :foo,
|
|
1104
|
+
s(:array,
|
|
1105
|
+
s(:lvar, :baz),
|
|
1106
|
+
s(:splat, s(:lvar, :bar)))),
|
|
1107
|
+
%q{foo = baz, *bar})
|
|
1108
|
+
end
|
|
1109
|
+
|
|
1110
|
+
def test_masgn_keyword_invalid
|
|
1111
|
+
assert_diagnoses(
|
|
1112
|
+
[:error, :invalid_assignment],
|
|
1113
|
+
%q{nil, foo = bar},
|
|
1114
|
+
%q{~~~ location})
|
|
1115
|
+
end
|
|
1116
|
+
|
|
1117
|
+
def test_masgn_backref_invalid
|
|
1118
|
+
assert_diagnoses(
|
|
1119
|
+
[:error, :backref_assignment],
|
|
1120
|
+
%q{$1, = foo},
|
|
1121
|
+
%q{~~ location})
|
|
1122
|
+
end
|
|
1123
|
+
|
|
1124
|
+
def test_masgn_const_invalid
|
|
1125
|
+
assert_diagnoses(
|
|
1126
|
+
[:error, :dynamic_const],
|
|
1127
|
+
%q{def f; self::A, foo = foo; end},
|
|
1128
|
+
%q{ ~~~~~~~ location})
|
|
1129
|
+
|
|
1130
|
+
assert_diagnoses(
|
|
1131
|
+
[:error, :dynamic_const],
|
|
1132
|
+
%q{def f; ::A, foo = foo; end},
|
|
1133
|
+
%q{ ~~~ location})
|
|
1134
|
+
end
|
|
1135
|
+
|
|
1136
|
+
# Variable binary operator-assignment
|
|
1137
|
+
|
|
1138
|
+
def test_var_op_asgn
|
|
1139
|
+
assert_parses(
|
|
1140
|
+
s(:op_asgn, s(:lvasgn, :a), :+, s(:int, 1)),
|
|
1141
|
+
%q{a += 1},
|
|
1142
|
+
%q{ ^^ operator
|
|
1143
|
+
|~~~~~~ expression})
|
|
1144
|
+
|
|
1145
|
+
assert_parses(
|
|
1146
|
+
s(:op_asgn, s(:ivasgn, :@a), :|, s(:int, 1)),
|
|
1147
|
+
%q{@a |= 1},
|
|
1148
|
+
%q{ ^^ operator
|
|
1149
|
+
|~~~~~~~ expression})
|
|
1150
|
+
|
|
1151
|
+
assert_parses(
|
|
1152
|
+
s(:op_asgn, s(:cvasgn, :@@var), :|, s(:int, 10)),
|
|
1153
|
+
%q{@@var |= 10})
|
|
1154
|
+
|
|
1155
|
+
assert_parses(
|
|
1156
|
+
s(:def, :a, s(:args),
|
|
1157
|
+
s(:op_asgn, s(:cvasgn, :@@var), :|, s(:int, 10))),
|
|
1158
|
+
%q{def a; @@var |= 10; end})
|
|
1159
|
+
end
|
|
1160
|
+
|
|
1161
|
+
def test_var_op_asgn_cmd
|
|
1162
|
+
assert_parses(
|
|
1163
|
+
s(:op_asgn,
|
|
1164
|
+
s(:lvasgn, :foo), :+,
|
|
1165
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1166
|
+
%q{foo += m foo})
|
|
1167
|
+
end
|
|
1168
|
+
|
|
1169
|
+
def test_var_op_asgn_keyword_invalid
|
|
1170
|
+
assert_diagnoses(
|
|
1171
|
+
[:error, :invalid_assignment],
|
|
1172
|
+
%q{nil += foo},
|
|
1173
|
+
%q{~~~ location})
|
|
1174
|
+
end
|
|
1175
|
+
|
|
1176
|
+
def test_const_op_asgn
|
|
1177
|
+
assert_parses(
|
|
1178
|
+
s(:op_asgn,
|
|
1179
|
+
s(:casgn, nil, :A), :+,
|
|
1180
|
+
s(:int, 1)),
|
|
1181
|
+
%q{A += 1})
|
|
1182
|
+
|
|
1183
|
+
assert_parses(
|
|
1184
|
+
s(:op_asgn,
|
|
1185
|
+
s(:casgn, s(:cbase), :A), :+,
|
|
1186
|
+
s(:int, 1)),
|
|
1187
|
+
%q{::A += 1},
|
|
1188
|
+
%q{},
|
|
1189
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1190
|
+
|
|
1191
|
+
assert_parses(
|
|
1192
|
+
s(:op_asgn,
|
|
1193
|
+
s(:casgn, s(:const, nil, :B), :A), :+,
|
|
1194
|
+
s(:int, 1)),
|
|
1195
|
+
%q{B::A += 1},
|
|
1196
|
+
%q{},
|
|
1197
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1198
|
+
|
|
1199
|
+
assert_parses(
|
|
1200
|
+
s(:def, :x, s(:args),
|
|
1201
|
+
s(:or_asgn,
|
|
1202
|
+
s(:casgn, s(:self), :A),
|
|
1203
|
+
s(:int, 1))),
|
|
1204
|
+
%q{def x; self::A ||= 1; end},
|
|
1205
|
+
%q{},
|
|
1206
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1207
|
+
|
|
1208
|
+
assert_parses(
|
|
1209
|
+
s(:def, :x, s(:args),
|
|
1210
|
+
s(:or_asgn,
|
|
1211
|
+
s(:casgn, s(:cbase), :A),
|
|
1212
|
+
s(:int, 1))),
|
|
1213
|
+
%q{def x; ::A ||= 1; end},
|
|
1214
|
+
%q{},
|
|
1215
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1216
|
+
end
|
|
1217
|
+
|
|
1218
|
+
def test_const_op_asgn_invalid
|
|
1219
|
+
assert_diagnoses(
|
|
1220
|
+
[:error, :dynamic_const],
|
|
1221
|
+
%q{Foo::Bar += 1},
|
|
1222
|
+
%q{ ~~~ location},
|
|
1223
|
+
%w(1.8 1.9))
|
|
1224
|
+
|
|
1225
|
+
assert_diagnoses(
|
|
1226
|
+
[:error, :dynamic_const],
|
|
1227
|
+
%q{::Bar += 1},
|
|
1228
|
+
%q{ ~~~ location},
|
|
1229
|
+
%w(1.8 1.9))
|
|
1230
|
+
|
|
1231
|
+
assert_diagnoses(
|
|
1232
|
+
[:error, :dynamic_const],
|
|
1233
|
+
%q{def foo; Foo::Bar += 1; end},
|
|
1234
|
+
%q{ ~~~ location},
|
|
1235
|
+
%w(1.8 1.9))
|
|
1236
|
+
|
|
1237
|
+
assert_diagnoses(
|
|
1238
|
+
[:error, :dynamic_const],
|
|
1239
|
+
%q{def foo; ::Bar += 1; end},
|
|
1240
|
+
%q{ ~~~ location},
|
|
1241
|
+
%w(1.8 1.9))
|
|
1242
|
+
end
|
|
1243
|
+
|
|
1244
|
+
# Method binary operator-assignment
|
|
1245
|
+
|
|
1246
|
+
def test_op_asgn
|
|
1247
|
+
assert_parses(
|
|
1248
|
+
s(:op_asgn,
|
|
1249
|
+
s(:send, s(:lvar, :foo), :a), :+,
|
|
1250
|
+
s(:int, 1)),
|
|
1251
|
+
%q{foo.a += 1},
|
|
1252
|
+
%q{ ^^ operator
|
|
1253
|
+
| ~ selector (send)
|
|
1254
|
+
|~~~~~ expression (send)
|
|
1255
|
+
|~~~~~~~~~~ expression})
|
|
1256
|
+
|
|
1257
|
+
assert_parses(
|
|
1258
|
+
s(:op_asgn,
|
|
1259
|
+
s(:send, s(:lvar, :foo), :a), :+,
|
|
1260
|
+
s(:int, 1)),
|
|
1261
|
+
%q{foo::a += 1})
|
|
1262
|
+
|
|
1263
|
+
assert_parses(
|
|
1264
|
+
s(:op_asgn,
|
|
1265
|
+
s(:send, s(:lvar, :foo), :A), :+,
|
|
1266
|
+
s(:int, 1)),
|
|
1267
|
+
%q{foo.A += 1})
|
|
1268
|
+
end
|
|
1269
|
+
|
|
1270
|
+
def test_op_asgn_cmd
|
|
1271
|
+
assert_parses(
|
|
1272
|
+
s(:op_asgn,
|
|
1273
|
+
s(:send, s(:lvar, :foo), :a), :+,
|
|
1274
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1275
|
+
%q{foo.a += m foo})
|
|
1276
|
+
|
|
1277
|
+
assert_parses(
|
|
1278
|
+
s(:op_asgn,
|
|
1279
|
+
s(:send, s(:lvar, :foo), :a), :+,
|
|
1280
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1281
|
+
%q{foo::a += m foo})
|
|
1282
|
+
|
|
1283
|
+
assert_parses(
|
|
1284
|
+
s(:op_asgn,
|
|
1285
|
+
s(:send, s(:lvar, :foo), :A), :+,
|
|
1286
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1287
|
+
%q{foo.A += m foo})
|
|
1288
|
+
|
|
1289
|
+
assert_parses(
|
|
1290
|
+
s(:op_asgn,
|
|
1291
|
+
s(:send, s(:lvar, :foo), :A), :+,
|
|
1292
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1293
|
+
%q{foo::A += m foo},
|
|
1294
|
+
%q{},
|
|
1295
|
+
ALL_VERSIONS - %w(1.8))
|
|
1296
|
+
end
|
|
1297
|
+
|
|
1298
|
+
def test_op_asgn_index
|
|
1299
|
+
assert_parses(
|
|
1300
|
+
s(:op_asgn,
|
|
1301
|
+
s(:send, s(:lvar, :foo), :[],
|
|
1302
|
+
s(:int, 0), s(:int, 1)), :+,
|
|
1303
|
+
s(:int, 2)),
|
|
1304
|
+
%q{foo[0, 1] += 2},
|
|
1305
|
+
%q{ ^^ operator
|
|
1306
|
+
| ~~~~~~ selector (send)
|
|
1307
|
+
|~~~~~~~~~ expression (send)
|
|
1308
|
+
|~~~~~~~~~~~~~~ expression})
|
|
1309
|
+
end
|
|
1310
|
+
|
|
1311
|
+
def test_op_asgn_index_cmd
|
|
1312
|
+
assert_parses(
|
|
1313
|
+
s(:op_asgn,
|
|
1314
|
+
s(:send, s(:lvar, :foo), :[],
|
|
1315
|
+
s(:int, 0), s(:int, 1)), :+,
|
|
1316
|
+
s(:send, nil, :m, s(:lvar, :foo))),
|
|
1317
|
+
%q{foo[0, 1] += m foo})
|
|
1318
|
+
end
|
|
1319
|
+
|
|
1320
|
+
def test_op_asgn_invalid
|
|
1321
|
+
assert_diagnoses(
|
|
1322
|
+
[:error, :backref_assignment],
|
|
1323
|
+
%q{$1 |= 1},
|
|
1324
|
+
%q{~~ location})
|
|
1325
|
+
|
|
1326
|
+
assert_diagnoses(
|
|
1327
|
+
[:error, :backref_assignment],
|
|
1328
|
+
%q{$+ |= 1},
|
|
1329
|
+
%q{~~ location})
|
|
1330
|
+
|
|
1331
|
+
assert_diagnoses(
|
|
1332
|
+
[:error, :backref_assignment],
|
|
1333
|
+
%q{$+ |= m foo},
|
|
1334
|
+
%q{~~ location})
|
|
1335
|
+
end
|
|
1336
|
+
|
|
1337
|
+
# Variable logical operator-assignment
|
|
1338
|
+
|
|
1339
|
+
def test_var_or_asgn
|
|
1340
|
+
assert_parses(
|
|
1341
|
+
s(:or_asgn, s(:lvasgn, :a), s(:int, 1)),
|
|
1342
|
+
%q{a ||= 1},
|
|
1343
|
+
%q{ ^^^ operator
|
|
1344
|
+
|~~~~~~~ expression})
|
|
1345
|
+
end
|
|
1346
|
+
|
|
1347
|
+
def test_var_and_asgn
|
|
1348
|
+
assert_parses(
|
|
1349
|
+
s(:and_asgn, s(:lvasgn, :a), s(:int, 1)),
|
|
1350
|
+
%q{a &&= 1},
|
|
1351
|
+
%q{ ^^^ operator
|
|
1352
|
+
|~~~~~~~ expression})
|
|
1353
|
+
end
|
|
1354
|
+
|
|
1355
|
+
# Method logical operator-assignment
|
|
1356
|
+
|
|
1357
|
+
def test_or_asgn
|
|
1358
|
+
assert_parses(
|
|
1359
|
+
s(:or_asgn,
|
|
1360
|
+
s(:send, s(:lvar, :foo), :a),
|
|
1361
|
+
s(:int, 1)),
|
|
1362
|
+
%q{foo.a ||= 1},
|
|
1363
|
+
%q{ ^^^ operator
|
|
1364
|
+
| ~ selector (send)
|
|
1365
|
+
|~~~~~ expression (send)
|
|
1366
|
+
|~~~~~~~~~~~ expression})
|
|
1367
|
+
|
|
1368
|
+
assert_parses(
|
|
1369
|
+
s(:or_asgn,
|
|
1370
|
+
s(:send, s(:lvar, :foo), :[],
|
|
1371
|
+
s(:int, 0), s(:int, 1)),
|
|
1372
|
+
s(:int, 2)),
|
|
1373
|
+
%q{foo[0, 1] ||= 2},
|
|
1374
|
+
%q{ ^^^ operator
|
|
1375
|
+
| ~~~~~~ selector (send)
|
|
1376
|
+
|~~~~~~~~~ expression (send)
|
|
1377
|
+
|~~~~~~~~~~~~~~~ expression})
|
|
1378
|
+
end
|
|
1379
|
+
|
|
1380
|
+
def test_and_asgn
|
|
1381
|
+
assert_parses(
|
|
1382
|
+
s(:and_asgn,
|
|
1383
|
+
s(:send, s(:lvar, :foo), :a),
|
|
1384
|
+
s(:int, 1)),
|
|
1385
|
+
%q{foo.a &&= 1},
|
|
1386
|
+
%q{ ^^^ operator
|
|
1387
|
+
| ~ selector (send)
|
|
1388
|
+
|~~~~~ expression (send)
|
|
1389
|
+
|~~~~~~~~~~~ expression})
|
|
1390
|
+
|
|
1391
|
+
assert_parses(
|
|
1392
|
+
s(:and_asgn,
|
|
1393
|
+
s(:send, s(:lvar, :foo), :[],
|
|
1394
|
+
s(:int, 0), s(:int, 1)),
|
|
1395
|
+
s(:int, 2)),
|
|
1396
|
+
%q{foo[0, 1] &&= 2},
|
|
1397
|
+
%q{ ^^^ operator
|
|
1398
|
+
| ~~~~~~ selector (send)
|
|
1399
|
+
|~~~~~~~~~ expression (send)
|
|
1400
|
+
|~~~~~~~~~~~~~~~ expression})
|
|
1401
|
+
end
|
|
1402
|
+
|
|
1403
|
+
def test_log_asgn_invalid
|
|
1404
|
+
assert_diagnoses(
|
|
1405
|
+
[:error, :backref_assignment],
|
|
1406
|
+
%q{$1 &&= 1},
|
|
1407
|
+
%q{~~ location})
|
|
1408
|
+
|
|
1409
|
+
assert_diagnoses(
|
|
1410
|
+
[:error, :backref_assignment],
|
|
1411
|
+
%q{$+ ||= 1},
|
|
1412
|
+
%q{~~ location})
|
|
1413
|
+
end
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
#
|
|
1417
|
+
# Class and module definitions
|
|
1418
|
+
#
|
|
1419
|
+
|
|
1420
|
+
def test_module
|
|
1421
|
+
assert_parses(
|
|
1422
|
+
s(:module,
|
|
1423
|
+
s(:const, nil, :Foo),
|
|
1424
|
+
nil),
|
|
1425
|
+
%q{module Foo; end},
|
|
1426
|
+
%q{~~~~~~ keyword
|
|
1427
|
+
| ~~~ name
|
|
1428
|
+
| ~~~ end})
|
|
1429
|
+
end
|
|
1430
|
+
|
|
1431
|
+
def test_module_invalid
|
|
1432
|
+
assert_diagnoses(
|
|
1433
|
+
[:error, :module_in_def],
|
|
1434
|
+
%q{def a; module Foo; end; end},
|
|
1435
|
+
%q{ ^^^^^^ location})
|
|
1436
|
+
end
|
|
1437
|
+
|
|
1438
|
+
def test_cpath
|
|
1439
|
+
assert_parses(
|
|
1440
|
+
s(:module,
|
|
1441
|
+
s(:const, s(:cbase), :Foo),
|
|
1442
|
+
nil),
|
|
1443
|
+
%q{module ::Foo; end})
|
|
1444
|
+
|
|
1445
|
+
assert_parses(
|
|
1446
|
+
s(:module,
|
|
1447
|
+
s(:const, s(:const, nil, :Bar), :Foo),
|
|
1448
|
+
nil),
|
|
1449
|
+
%q{module Bar::Foo; end})
|
|
1450
|
+
end
|
|
1451
|
+
|
|
1452
|
+
def test_cpath_invalid
|
|
1453
|
+
assert_diagnoses(
|
|
1454
|
+
[:error, :module_name_const],
|
|
1455
|
+
%q{module foo; end})
|
|
1456
|
+
end
|
|
1457
|
+
|
|
1458
|
+
def test_class
|
|
1459
|
+
assert_parses(
|
|
1460
|
+
s(:class,
|
|
1461
|
+
s(:const, nil, :Foo),
|
|
1462
|
+
nil,
|
|
1463
|
+
nil),
|
|
1464
|
+
%q{class Foo; end},
|
|
1465
|
+
%q{~~~~~ keyword
|
|
1466
|
+
| ~~~ name
|
|
1467
|
+
| ~~~ end})
|
|
1468
|
+
end
|
|
1469
|
+
|
|
1470
|
+
def test_class_super
|
|
1471
|
+
assert_parses(
|
|
1472
|
+
s(:class,
|
|
1473
|
+
s(:const, nil, :Foo),
|
|
1474
|
+
s(:const, nil, :Bar),
|
|
1475
|
+
nil),
|
|
1476
|
+
%q{class Foo < Bar; end},
|
|
1477
|
+
%q{~~~~~ keyword
|
|
1478
|
+
| ^ operator
|
|
1479
|
+
| ~~~ end})
|
|
1480
|
+
end
|
|
1481
|
+
|
|
1482
|
+
def test_class_super_label
|
|
1483
|
+
assert_parses(
|
|
1484
|
+
s(:class,
|
|
1485
|
+
s(:const, nil, :Foo),
|
|
1486
|
+
s(:send, nil, :a,
|
|
1487
|
+
s(:sym, :b)),
|
|
1488
|
+
nil),
|
|
1489
|
+
%q{class Foo < a:b; end},
|
|
1490
|
+
%q{},
|
|
1491
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1492
|
+
end
|
|
1493
|
+
|
|
1494
|
+
def test_class_invalid
|
|
1495
|
+
assert_diagnoses(
|
|
1496
|
+
[:error, :class_in_def],
|
|
1497
|
+
%q{def a; class Foo; end; end},
|
|
1498
|
+
%q{ ^^^^^ location})
|
|
1499
|
+
end
|
|
1500
|
+
|
|
1501
|
+
def test_sclass
|
|
1502
|
+
assert_parses(
|
|
1503
|
+
s(:sclass,
|
|
1504
|
+
s(:lvar, :foo),
|
|
1505
|
+
s(:nil)),
|
|
1506
|
+
%q{class << foo; nil; end},
|
|
1507
|
+
%q{~~~~~ keyword
|
|
1508
|
+
| ^^ operator
|
|
1509
|
+
| ~~~ end})
|
|
1510
|
+
end
|
|
1511
|
+
|
|
1512
|
+
#
|
|
1513
|
+
# Method (un)definition
|
|
1514
|
+
#
|
|
1515
|
+
|
|
1516
|
+
def test_def
|
|
1517
|
+
assert_parses(
|
|
1518
|
+
s(:def, :foo, s(:args), nil),
|
|
1519
|
+
%q{def foo; end},
|
|
1520
|
+
%q{~~~ keyword
|
|
1521
|
+
| ~~~ name
|
|
1522
|
+
| ~~~ end})
|
|
1523
|
+
|
|
1524
|
+
assert_parses(
|
|
1525
|
+
s(:def, :String, s(:args), nil),
|
|
1526
|
+
%q{def String; end})
|
|
1527
|
+
|
|
1528
|
+
assert_parses(
|
|
1529
|
+
s(:def, :String=, s(:args), nil),
|
|
1530
|
+
%q{def String=; end})
|
|
1531
|
+
|
|
1532
|
+
assert_parses(
|
|
1533
|
+
s(:def, :until, s(:args), nil),
|
|
1534
|
+
%q{def until; end})
|
|
1535
|
+
end
|
|
1536
|
+
|
|
1537
|
+
def test_defs
|
|
1538
|
+
assert_parses(
|
|
1539
|
+
s(:defs, s(:self), :foo, s(:args), nil),
|
|
1540
|
+
%q{def self.foo; end},
|
|
1541
|
+
%q{~~~ keyword
|
|
1542
|
+
| ^ operator
|
|
1543
|
+
| ~~~ name
|
|
1544
|
+
| ~~~ end})
|
|
1545
|
+
|
|
1546
|
+
assert_parses(
|
|
1547
|
+
s(:defs, s(:self), :foo, s(:args), nil),
|
|
1548
|
+
%q{def self::foo; end},
|
|
1549
|
+
%q{~~~ keyword
|
|
1550
|
+
| ^^ operator
|
|
1551
|
+
| ~~~ name
|
|
1552
|
+
| ~~~ end})
|
|
1553
|
+
|
|
1554
|
+
assert_parses(
|
|
1555
|
+
s(:defs, s(:lvar, :foo), :foo, s(:args), nil),
|
|
1556
|
+
%q{def (foo).foo; end})
|
|
1557
|
+
|
|
1558
|
+
assert_parses(
|
|
1559
|
+
s(:defs, s(:const, nil, :String), :foo,
|
|
1560
|
+
s(:args), nil),
|
|
1561
|
+
%q{def String.foo; end})
|
|
1562
|
+
|
|
1563
|
+
assert_parses(
|
|
1564
|
+
s(:defs, s(:const, nil, :String), :foo,
|
|
1565
|
+
s(:args), nil),
|
|
1566
|
+
%q{def String::foo; end})
|
|
1567
|
+
end
|
|
1568
|
+
|
|
1569
|
+
def test_defs_invalid
|
|
1570
|
+
assert_diagnoses(
|
|
1571
|
+
[:error, :singleton_literal],
|
|
1572
|
+
%q{def (1).foo; end},
|
|
1573
|
+
%q{ ~ location})
|
|
1574
|
+
|
|
1575
|
+
assert_diagnoses(
|
|
1576
|
+
[:error, :singleton_literal],
|
|
1577
|
+
%q{def ("foo").foo; end},
|
|
1578
|
+
%q{ ~~~~~ location})
|
|
1579
|
+
|
|
1580
|
+
assert_diagnoses(
|
|
1581
|
+
[:error, :singleton_literal],
|
|
1582
|
+
%q{def ("foo#{bar}").foo; end},
|
|
1583
|
+
%q{ ~~~~~~~~~~~ location})
|
|
1584
|
+
|
|
1585
|
+
assert_diagnoses(
|
|
1586
|
+
[:error, :singleton_literal],
|
|
1587
|
+
%q{def (:foo).foo; end},
|
|
1588
|
+
%q{ ~~~~ location})
|
|
1589
|
+
|
|
1590
|
+
assert_diagnoses(
|
|
1591
|
+
[:error, :singleton_literal],
|
|
1592
|
+
%q{def (:"foo#{bar}").foo; end},
|
|
1593
|
+
%q{ ~~~~~~~~~~~~ location})
|
|
1594
|
+
|
|
1595
|
+
assert_diagnoses(
|
|
1596
|
+
[:error, :singleton_literal],
|
|
1597
|
+
%q{def ([]).foo; end},
|
|
1598
|
+
%q{ ~~ location})
|
|
1599
|
+
|
|
1600
|
+
assert_diagnoses(
|
|
1601
|
+
[:error, :singleton_literal],
|
|
1602
|
+
%q{def ({}).foo; end},
|
|
1603
|
+
%q{ ~~ location})
|
|
1604
|
+
|
|
1605
|
+
assert_diagnoses(
|
|
1606
|
+
[:error, :singleton_literal],
|
|
1607
|
+
%q{def (/foo/).foo; end},
|
|
1608
|
+
%q{ ~~~~~ location})
|
|
1609
|
+
end
|
|
1610
|
+
|
|
1611
|
+
def test_undef
|
|
1612
|
+
assert_parses(
|
|
1613
|
+
s(:undef,
|
|
1614
|
+
s(:sym, :foo),
|
|
1615
|
+
s(:sym, :bar),
|
|
1616
|
+
s(:dsym, s(:str, 'foo'), s(:begin, s(:int, 1)))),
|
|
1617
|
+
%q{undef foo, :bar, :"foo#{1}"},
|
|
1618
|
+
%q{~~~~~ keyword
|
|
1619
|
+
| ~~~ expression (sym/1)
|
|
1620
|
+
| ~~~~ expression (sym/2)
|
|
1621
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
1622
|
+
end
|
|
1623
|
+
|
|
1624
|
+
#
|
|
1625
|
+
# Aliasing
|
|
1626
|
+
#
|
|
1627
|
+
|
|
1628
|
+
def test_alias
|
|
1629
|
+
assert_parses(
|
|
1630
|
+
s(:alias, s(:sym, :foo), s(:sym, :bar)),
|
|
1631
|
+
%q{alias :foo bar},
|
|
1632
|
+
%q{~~~~~ keyword
|
|
1633
|
+
| ~~~~ expression (sym/1)
|
|
1634
|
+
| ~~~ expression (sym/2)
|
|
1635
|
+
|~~~~~~~~~~~~~~ expression})
|
|
1636
|
+
end
|
|
1637
|
+
|
|
1638
|
+
def test_alias_gvar
|
|
1639
|
+
assert_parses(
|
|
1640
|
+
s(:alias, s(:gvar, :$a), s(:gvar, :$b)),
|
|
1641
|
+
%q{alias $a $b},
|
|
1642
|
+
%q{ ~~ expression (gvar/1)})
|
|
1643
|
+
|
|
1644
|
+
assert_parses(
|
|
1645
|
+
s(:alias, s(:gvar, :$a), s(:back_ref, :$+)),
|
|
1646
|
+
%q{alias $a $+},
|
|
1647
|
+
%q{ ~~ expression (back_ref)})
|
|
1648
|
+
end
|
|
1649
|
+
|
|
1650
|
+
def test_alias_nth_ref
|
|
1651
|
+
assert_diagnoses(
|
|
1652
|
+
[:error, :nth_ref_alias],
|
|
1653
|
+
%q{alias $a $1},
|
|
1654
|
+
%q{ ~~ location})
|
|
1655
|
+
end
|
|
1656
|
+
|
|
1657
|
+
#
|
|
1658
|
+
# Formal arguments
|
|
1659
|
+
#
|
|
1660
|
+
|
|
1661
|
+
def test_arg
|
|
1662
|
+
assert_parses(
|
|
1663
|
+
s(:def, :f,
|
|
1664
|
+
s(:args, s(:arg, :foo)),
|
|
1665
|
+
nil),
|
|
1666
|
+
%q{def f(foo); end},
|
|
1667
|
+
%q{ ~~~ name (args.arg)
|
|
1668
|
+
| ~~~ expression (args.arg)
|
|
1669
|
+
| ^ begin (args)
|
|
1670
|
+
| ^ end (args)
|
|
1671
|
+
| ~~~~~ expression (args)})
|
|
1672
|
+
|
|
1673
|
+
assert_parses(
|
|
1674
|
+
s(:def, :f,
|
|
1675
|
+
s(:args, s(:arg, :foo), s(:arg, :bar)),
|
|
1676
|
+
nil),
|
|
1677
|
+
%q{def f(foo, bar); end})
|
|
1678
|
+
end
|
|
1679
|
+
|
|
1680
|
+
def test_optarg
|
|
1681
|
+
assert_parses(
|
|
1682
|
+
s(:def, :f,
|
|
1683
|
+
s(:args, s(:optarg, :foo, s(:int, 1))),
|
|
1684
|
+
nil),
|
|
1685
|
+
%q{def f foo = 1; end},
|
|
1686
|
+
%q{ ~~~ name (args.optarg)
|
|
1687
|
+
| ^ operator (args.optarg)
|
|
1688
|
+
| ~~~~~~~ expression (args.optarg)
|
|
1689
|
+
| ~~~~~~~ expression (args)})
|
|
1690
|
+
|
|
1691
|
+
assert_parses(
|
|
1692
|
+
s(:def, :f,
|
|
1693
|
+
s(:args,
|
|
1694
|
+
s(:optarg, :foo, s(:int, 1)),
|
|
1695
|
+
s(:optarg, :bar, s(:int, 2))),
|
|
1696
|
+
nil),
|
|
1697
|
+
%q{def f(foo=1, bar=2); end})
|
|
1698
|
+
end
|
|
1699
|
+
|
|
1700
|
+
def test_restarg_named
|
|
1701
|
+
assert_parses(
|
|
1702
|
+
s(:def, :f,
|
|
1703
|
+
s(:args, s(:restarg, :foo)),
|
|
1704
|
+
nil),
|
|
1705
|
+
%q{def f(*foo); end},
|
|
1706
|
+
%q{ ~~~ name (args.restarg)
|
|
1707
|
+
| ~~~~ expression (args.restarg)})
|
|
1708
|
+
end
|
|
1709
|
+
|
|
1710
|
+
def test_restarg_unnamed
|
|
1711
|
+
assert_parses(
|
|
1712
|
+
s(:def, :f,
|
|
1713
|
+
s(:args, s(:restarg)),
|
|
1714
|
+
nil),
|
|
1715
|
+
%q{def f(*); end},
|
|
1716
|
+
%q{ ~ expression (args.restarg)})
|
|
1717
|
+
end
|
|
1718
|
+
|
|
1719
|
+
def test_kwarg
|
|
1720
|
+
assert_parses(
|
|
1721
|
+
s(:def, :f,
|
|
1722
|
+
s(:args, s(:kwarg, :foo)),
|
|
1723
|
+
nil),
|
|
1724
|
+
%q{def f(foo:); end},
|
|
1725
|
+
%q{ ~~~ name (args.kwarg)
|
|
1726
|
+
| ~~~~ expression (args.kwarg)},
|
|
1727
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
1728
|
+
end
|
|
1729
|
+
|
|
1730
|
+
def test_kwoptarg
|
|
1731
|
+
assert_parses(
|
|
1732
|
+
s(:def, :f,
|
|
1733
|
+
s(:args, s(:kwoptarg, :foo, s(:int, 1))),
|
|
1734
|
+
nil),
|
|
1735
|
+
%q{def f(foo: 1); end},
|
|
1736
|
+
%q{ ~~~ name (args.kwoptarg)
|
|
1737
|
+
| ~~~~~~ expression (args.kwoptarg)},
|
|
1738
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1739
|
+
end
|
|
1740
|
+
|
|
1741
|
+
def test_kwrestarg_named
|
|
1742
|
+
assert_parses(
|
|
1743
|
+
s(:def, :f,
|
|
1744
|
+
s(:args, s(:kwrestarg, :foo)),
|
|
1745
|
+
nil),
|
|
1746
|
+
%q{def f(**foo); end},
|
|
1747
|
+
%q{ ~~~ name (args.kwrestarg)
|
|
1748
|
+
| ~~~~~ expression (args.kwrestarg)},
|
|
1749
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1750
|
+
end
|
|
1751
|
+
|
|
1752
|
+
def test_kwrestarg_unnamed
|
|
1753
|
+
assert_parses(
|
|
1754
|
+
s(:def, :f,
|
|
1755
|
+
s(:args, s(:kwrestarg)),
|
|
1756
|
+
nil),
|
|
1757
|
+
%q{def f(**); end},
|
|
1758
|
+
%q{ ~~ expression (args.kwrestarg)},
|
|
1759
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1760
|
+
end
|
|
1761
|
+
|
|
1762
|
+
def test_blockarg
|
|
1763
|
+
assert_parses(
|
|
1764
|
+
s(:def, :f,
|
|
1765
|
+
s(:args, s(:blockarg, :block)),
|
|
1766
|
+
nil),
|
|
1767
|
+
%q{def f(&block); end},
|
|
1768
|
+
%q{ ~~~~~ name (args.blockarg)
|
|
1769
|
+
| ~~~~~~ expression (args.blockarg)})
|
|
1770
|
+
end
|
|
1771
|
+
|
|
1772
|
+
def test_arg_scope
|
|
1773
|
+
# [ruby-core:61299] [Bug #9593]
|
|
1774
|
+
assert_parses(
|
|
1775
|
+
s(:def, :f,
|
|
1776
|
+
s(:args, s(:optarg, :var, s(:defined?, s(:lvar, :var)))),
|
|
1777
|
+
s(:lvar, :var)),
|
|
1778
|
+
%q{def f(var = defined?(var)) var end},
|
|
1779
|
+
%q{},
|
|
1780
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
1781
|
+
|
|
1782
|
+
assert_parses(
|
|
1783
|
+
s(:def, :f,
|
|
1784
|
+
s(:args, s(:kwoptarg, :var, s(:defined?, s(:lvar, :var)))),
|
|
1785
|
+
s(:lvar, :var)),
|
|
1786
|
+
%q{def f(var: defined?(var)) var end},
|
|
1787
|
+
%q{},
|
|
1788
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
1789
|
+
end
|
|
1790
|
+
|
|
1791
|
+
def assert_parses_args(ast, code, versions=ALL_VERSIONS)
|
|
1792
|
+
assert_parses(
|
|
1793
|
+
s(:def, :f, ast, nil),
|
|
1794
|
+
%Q{def f #{code}; end},
|
|
1795
|
+
%q{},
|
|
1796
|
+
versions)
|
|
1797
|
+
end
|
|
1798
|
+
|
|
1799
|
+
def test_arg_combinations
|
|
1800
|
+
# f_arg tCOMMA f_optarg tCOMMA f_rest_arg opt_f_block_arg
|
|
1801
|
+
assert_parses_args(
|
|
1802
|
+
s(:args,
|
|
1803
|
+
s(:arg, :a),
|
|
1804
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1805
|
+
s(:restarg, :r),
|
|
1806
|
+
s(:blockarg, :b)),
|
|
1807
|
+
%q{a, o=1, *r, &b})
|
|
1808
|
+
|
|
1809
|
+
# f_arg tCOMMA f_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
1810
|
+
assert_parses_args(
|
|
1811
|
+
s(:args,
|
|
1812
|
+
s(:arg, :a),
|
|
1813
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1814
|
+
s(:restarg, :r),
|
|
1815
|
+
s(:arg, :p),
|
|
1816
|
+
s(:blockarg, :b)),
|
|
1817
|
+
%q{a, o=1, *r, p, &b},
|
|
1818
|
+
ALL_VERSIONS - %w(1.8))
|
|
1819
|
+
|
|
1820
|
+
# f_arg tCOMMA f_optarg opt_f_block_arg
|
|
1821
|
+
assert_parses_args(
|
|
1822
|
+
s(:args,
|
|
1823
|
+
s(:arg, :a),
|
|
1824
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1825
|
+
s(:blockarg, :b)),
|
|
1826
|
+
%q{a, o=1, &b})
|
|
1827
|
+
|
|
1828
|
+
# f_arg tCOMMA f_optarg tCOMMA f_arg opt_f_block_arg
|
|
1829
|
+
assert_parses_args(
|
|
1830
|
+
s(:args,
|
|
1831
|
+
s(:arg, :a),
|
|
1832
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1833
|
+
s(:arg, :p),
|
|
1834
|
+
s(:blockarg, :b)),
|
|
1835
|
+
%q{a, o=1, p, &b},
|
|
1836
|
+
ALL_VERSIONS - %w(1.8))
|
|
1837
|
+
|
|
1838
|
+
# f_arg tCOMMA f_rest_arg opt_f_block_arg
|
|
1839
|
+
assert_parses_args(
|
|
1840
|
+
s(:args,
|
|
1841
|
+
s(:arg, :a),
|
|
1842
|
+
s(:restarg, :r),
|
|
1843
|
+
s(:blockarg, :b)),
|
|
1844
|
+
%q{a, *r, &b})
|
|
1845
|
+
|
|
1846
|
+
# f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
1847
|
+
assert_parses_args(
|
|
1848
|
+
s(:args,
|
|
1849
|
+
s(:arg, :a),
|
|
1850
|
+
s(:restarg, :r),
|
|
1851
|
+
s(:arg, :p),
|
|
1852
|
+
s(:blockarg, :b)),
|
|
1853
|
+
%q{a, *r, p, &b},
|
|
1854
|
+
ALL_VERSIONS - %w(1.8))
|
|
1855
|
+
|
|
1856
|
+
# f_arg opt_f_block_arg
|
|
1857
|
+
assert_parses_args(
|
|
1858
|
+
s(:args,
|
|
1859
|
+
s(:arg, :a),
|
|
1860
|
+
s(:blockarg, :b)),
|
|
1861
|
+
%q{a, &b})
|
|
1862
|
+
|
|
1863
|
+
# f_optarg tCOMMA f_rest_arg opt_f_block_arg
|
|
1864
|
+
assert_parses_args(
|
|
1865
|
+
s(:args,
|
|
1866
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1867
|
+
s(:restarg, :r),
|
|
1868
|
+
s(:blockarg, :b)),
|
|
1869
|
+
%q{o=1, *r, &b})
|
|
1870
|
+
|
|
1871
|
+
# f_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
1872
|
+
assert_parses_args(
|
|
1873
|
+
s(:args,
|
|
1874
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1875
|
+
s(:restarg, :r),
|
|
1876
|
+
s(:arg, :p),
|
|
1877
|
+
s(:blockarg, :b)),
|
|
1878
|
+
%q{o=1, *r, p, &b},
|
|
1879
|
+
ALL_VERSIONS - %w(1.8))
|
|
1880
|
+
|
|
1881
|
+
# f_optarg opt_f_block_arg
|
|
1882
|
+
assert_parses_args(
|
|
1883
|
+
s(:args,
|
|
1884
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1885
|
+
s(:blockarg, :b)),
|
|
1886
|
+
%q{o=1, &b})
|
|
1887
|
+
|
|
1888
|
+
# f_optarg tCOMMA f_arg opt_f_block_arg
|
|
1889
|
+
assert_parses_args(
|
|
1890
|
+
s(:args,
|
|
1891
|
+
s(:optarg, :o, s(:int, 1)),
|
|
1892
|
+
s(:arg, :p),
|
|
1893
|
+
s(:blockarg, :b)),
|
|
1894
|
+
%q{o=1, p, &b},
|
|
1895
|
+
ALL_VERSIONS - %w(1.8))
|
|
1896
|
+
|
|
1897
|
+
# f_rest_arg opt_f_block_arg
|
|
1898
|
+
assert_parses_args(
|
|
1899
|
+
s(:args,
|
|
1900
|
+
s(:restarg, :r),
|
|
1901
|
+
s(:blockarg, :b)),
|
|
1902
|
+
%q{*r, &b})
|
|
1903
|
+
|
|
1904
|
+
# f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
1905
|
+
assert_parses_args(
|
|
1906
|
+
s(:args,
|
|
1907
|
+
s(:restarg, :r),
|
|
1908
|
+
s(:arg, :p),
|
|
1909
|
+
s(:blockarg, :b)),
|
|
1910
|
+
%q{*r, p, &b},
|
|
1911
|
+
ALL_VERSIONS - %w(1.8))
|
|
1912
|
+
|
|
1913
|
+
# f_block_arg
|
|
1914
|
+
assert_parses_args(
|
|
1915
|
+
s(:args,
|
|
1916
|
+
s(:blockarg, :b)),
|
|
1917
|
+
%q{&b})
|
|
1918
|
+
|
|
1919
|
+
# (nothing)
|
|
1920
|
+
assert_parses_args(
|
|
1921
|
+
s(:args),
|
|
1922
|
+
%q{})
|
|
1923
|
+
end
|
|
1924
|
+
|
|
1925
|
+
def test_kwarg_combinations
|
|
1926
|
+
# f_kwarg tCOMMA f_kwrest opt_f_block_arg
|
|
1927
|
+
assert_parses_args(
|
|
1928
|
+
s(:args,
|
|
1929
|
+
s(:kwoptarg, :foo, s(:int, 1)),
|
|
1930
|
+
s(:kwoptarg, :bar, s(:int, 2)),
|
|
1931
|
+
s(:kwrestarg, :baz),
|
|
1932
|
+
s(:blockarg, :b)),
|
|
1933
|
+
%q{(foo: 1, bar: 2, **baz, &b)},
|
|
1934
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1935
|
+
|
|
1936
|
+
# f_kwarg opt_f_block_arg
|
|
1937
|
+
assert_parses_args(
|
|
1938
|
+
s(:args,
|
|
1939
|
+
s(:kwoptarg, :foo, s(:int, 1)),
|
|
1940
|
+
s(:blockarg, :b)),
|
|
1941
|
+
%q{(foo: 1, &b)},
|
|
1942
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1943
|
+
|
|
1944
|
+
# f_kwrest opt_f_block_arg
|
|
1945
|
+
assert_parses_args(
|
|
1946
|
+
s(:args,
|
|
1947
|
+
s(:kwrestarg, :baz),
|
|
1948
|
+
s(:blockarg, :b)),
|
|
1949
|
+
%q{**baz, &b},
|
|
1950
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
1951
|
+
end
|
|
1952
|
+
|
|
1953
|
+
def test_kwarg_no_paren
|
|
1954
|
+
assert_parses_args(
|
|
1955
|
+
s(:args,
|
|
1956
|
+
s(:kwarg, :foo)),
|
|
1957
|
+
%Q{foo:\n},
|
|
1958
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
1959
|
+
|
|
1960
|
+
assert_parses_args(
|
|
1961
|
+
s(:args,
|
|
1962
|
+
s(:kwoptarg, :foo, s(:int, -1))),
|
|
1963
|
+
%Q{foo: -1\n},
|
|
1964
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
1965
|
+
end
|
|
1966
|
+
|
|
1967
|
+
def assert_parses_margs(ast, code, versions=ALL_VERSIONS - %w(1.8))
|
|
1968
|
+
assert_parses_args(
|
|
1969
|
+
s(:args, ast),
|
|
1970
|
+
%Q{(#{code})},
|
|
1971
|
+
versions)
|
|
1972
|
+
end
|
|
1973
|
+
|
|
1974
|
+
def test_marg_combinations
|
|
1975
|
+
# tLPAREN f_margs rparen
|
|
1976
|
+
assert_parses_margs(
|
|
1977
|
+
s(:mlhs,
|
|
1978
|
+
s(:mlhs, s(:arg, :a))),
|
|
1979
|
+
%q{((a))})
|
|
1980
|
+
|
|
1981
|
+
# f_marg_list
|
|
1982
|
+
assert_parses_margs(
|
|
1983
|
+
s(:mlhs, s(:arg, :a), s(:arg, :a1)),
|
|
1984
|
+
%q{(a, a1)})
|
|
1985
|
+
|
|
1986
|
+
# f_marg_list tCOMMA tSTAR f_norm_arg
|
|
1987
|
+
assert_parses_margs(
|
|
1988
|
+
s(:mlhs, s(:arg, :a), s(:restarg, :r)),
|
|
1989
|
+
%q{(a, *r)})
|
|
1990
|
+
|
|
1991
|
+
# f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list
|
|
1992
|
+
assert_parses_margs(
|
|
1993
|
+
s(:mlhs, s(:arg, :a), s(:restarg, :r), s(:arg, :p)),
|
|
1994
|
+
%q{(a, *r, p)})
|
|
1995
|
+
|
|
1996
|
+
# f_marg_list tCOMMA tSTAR
|
|
1997
|
+
assert_parses_margs(
|
|
1998
|
+
s(:mlhs, s(:arg, :a), s(:restarg)),
|
|
1999
|
+
%q{(a, *)})
|
|
2000
|
+
|
|
2001
|
+
# f_marg_list tCOMMA tSTAR tCOMMA f_marg_list
|
|
2002
|
+
assert_parses_margs(
|
|
2003
|
+
s(:mlhs, s(:arg, :a), s(:restarg), s(:arg, :p)),
|
|
2004
|
+
%q{(a, *, p)})
|
|
2005
|
+
|
|
2006
|
+
# tSTAR f_norm_arg
|
|
2007
|
+
assert_parses_margs(
|
|
2008
|
+
s(:mlhs, s(:restarg, :r)),
|
|
2009
|
+
%q{(*r)})
|
|
2010
|
+
|
|
2011
|
+
# tSTAR f_norm_arg tCOMMA f_marg_list
|
|
2012
|
+
assert_parses_margs(
|
|
2013
|
+
s(:mlhs, s(:restarg, :r), s(:arg, :p)),
|
|
2014
|
+
%q{(*r, p)})
|
|
2015
|
+
|
|
2016
|
+
# tSTAR
|
|
2017
|
+
assert_parses_margs(
|
|
2018
|
+
s(:mlhs, s(:restarg)),
|
|
2019
|
+
%q{(*)})
|
|
2020
|
+
|
|
2021
|
+
# tSTAR tCOMMA f_marg_list
|
|
2022
|
+
assert_parses_margs(
|
|
2023
|
+
s(:mlhs, s(:restarg), s(:arg, :p)),
|
|
2024
|
+
%q{(*, p)})
|
|
2025
|
+
end
|
|
2026
|
+
|
|
2027
|
+
def assert_parses_blockargs(ast, code, versions=ALL_VERSIONS)
|
|
2028
|
+
assert_parses(
|
|
2029
|
+
s(:block,
|
|
2030
|
+
s(:send, nil, :f),
|
|
2031
|
+
ast, nil),
|
|
2032
|
+
%Q{f{ #{code} }},
|
|
2033
|
+
%q{},
|
|
2034
|
+
versions)
|
|
2035
|
+
end
|
|
2036
|
+
|
|
2037
|
+
def test_block_arg_combinations
|
|
2038
|
+
# none
|
|
2039
|
+
assert_parses_blockargs(
|
|
2040
|
+
s(:args),
|
|
2041
|
+
%q{})
|
|
2042
|
+
|
|
2043
|
+
# tPIPE tPIPE
|
|
2044
|
+
# tPIPE opt_bv_decl tPIPE
|
|
2045
|
+
assert_parses_blockargs(
|
|
2046
|
+
s(:args),
|
|
2047
|
+
%q{| |})
|
|
2048
|
+
|
|
2049
|
+
assert_parses_blockargs(
|
|
2050
|
+
s(:args, s(:shadowarg, :a)),
|
|
2051
|
+
%q{|;a|},
|
|
2052
|
+
ALL_VERSIONS - %w(1.8))
|
|
2053
|
+
|
|
2054
|
+
assert_parses_blockargs(
|
|
2055
|
+
s(:args, s(:shadowarg, :a)),
|
|
2056
|
+
%Q{|;\na\n|},
|
|
2057
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2058
|
+
|
|
2059
|
+
# tOROP
|
|
2060
|
+
assert_parses_blockargs(
|
|
2061
|
+
s(:args),
|
|
2062
|
+
%q{||})
|
|
2063
|
+
|
|
2064
|
+
# block_par
|
|
2065
|
+
# block_par tCOMMA
|
|
2066
|
+
# block_par tCOMMA tAMPER lhs
|
|
2067
|
+
# f_arg opt_f_block_arg
|
|
2068
|
+
# f_arg tCOMMA
|
|
2069
|
+
assert_parses_blockargs(
|
|
2070
|
+
s(:args, s(:arg, :a)),
|
|
2071
|
+
%q{|a|})
|
|
2072
|
+
|
|
2073
|
+
assert_parses_blockargs(
|
|
2074
|
+
s(:args, s(:arg, :a), s(:arg, :c)),
|
|
2075
|
+
%q{|a, c|})
|
|
2076
|
+
|
|
2077
|
+
assert_parses_blockargs(
|
|
2078
|
+
s(:args, s(:arg_expr, s(:ivasgn, :@a))),
|
|
2079
|
+
%q{|@a|},
|
|
2080
|
+
%w(1.8))
|
|
2081
|
+
|
|
2082
|
+
assert_parses_blockargs(
|
|
2083
|
+
s(:args, s(:arg, :a)),
|
|
2084
|
+
%q{|a,|})
|
|
2085
|
+
|
|
2086
|
+
assert_parses_blockargs(
|
|
2087
|
+
s(:args, s(:arg, :a), s(:blockarg, :b)),
|
|
2088
|
+
%q{|a, &b|})
|
|
2089
|
+
|
|
2090
|
+
assert_parses_blockargs(
|
|
2091
|
+
s(:args, s(:arg, :a), s(:blockarg_expr, s(:ivasgn, :@b))),
|
|
2092
|
+
%q{|a, &@b|},
|
|
2093
|
+
%w(1.8))
|
|
2094
|
+
|
|
2095
|
+
# block_par tCOMMA tSTAR lhs tCOMMA tAMPER lhs
|
|
2096
|
+
# block_par tCOMMA tSTAR tCOMMA tAMPER lhs
|
|
2097
|
+
# block_par tCOMMA tSTAR lhs
|
|
2098
|
+
# block_par tCOMMA tSTAR
|
|
2099
|
+
# f_arg tCOMMA f_rest_arg opt_f_block_arg
|
|
2100
|
+
assert_parses_blockargs(
|
|
2101
|
+
s(:args, s(:arg, :a), s(:restarg, :s), s(:blockarg, :b)),
|
|
2102
|
+
%q{|a, *s, &b|})
|
|
2103
|
+
|
|
2104
|
+
assert_parses_blockargs(
|
|
2105
|
+
s(:args, s(:arg, :a),
|
|
2106
|
+
s(:restarg_expr, s(:ivasgn, :@s)),
|
|
2107
|
+
s(:blockarg_expr, s(:ivasgn, :@b))),
|
|
2108
|
+
%q{|a, *@s, &@b|},
|
|
2109
|
+
%w(1.8))
|
|
2110
|
+
|
|
2111
|
+
assert_parses_blockargs(
|
|
2112
|
+
s(:args, s(:arg, :a), s(:restarg), s(:blockarg, :b)),
|
|
2113
|
+
%q{|a, *, &b|})
|
|
2114
|
+
|
|
2115
|
+
assert_parses_blockargs(
|
|
2116
|
+
s(:args, s(:arg, :a),
|
|
2117
|
+
s(:restarg),
|
|
2118
|
+
s(:blockarg_expr, s(:ivasgn, :@b))),
|
|
2119
|
+
%q{|a, *, &@b|},
|
|
2120
|
+
%w(1.8))
|
|
2121
|
+
|
|
2122
|
+
assert_parses_blockargs(
|
|
2123
|
+
s(:args, s(:arg, :a), s(:restarg, :s)),
|
|
2124
|
+
%q{|a, *s|})
|
|
2125
|
+
|
|
2126
|
+
assert_parses_blockargs(
|
|
2127
|
+
s(:args, s(:arg, :a),
|
|
2128
|
+
s(:restarg_expr, s(:ivasgn, :@s))),
|
|
2129
|
+
%q{|a, *@s|},
|
|
2130
|
+
%w(1.8))
|
|
2131
|
+
|
|
2132
|
+
assert_parses_blockargs(
|
|
2133
|
+
s(:args, s(:arg, :a), s(:restarg)),
|
|
2134
|
+
%q{|a, *|})
|
|
2135
|
+
|
|
2136
|
+
# tSTAR lhs tCOMMA tAMPER lhs
|
|
2137
|
+
# tSTAR lhs
|
|
2138
|
+
# tSTAR
|
|
2139
|
+
# tSTAR tCOMMA tAMPER lhs
|
|
2140
|
+
# f_rest_arg opt_f_block_arg
|
|
2141
|
+
assert_parses_blockargs(
|
|
2142
|
+
s(:args, s(:restarg, :s), s(:blockarg, :b)),
|
|
2143
|
+
%q{|*s, &b|})
|
|
2144
|
+
|
|
2145
|
+
assert_parses_blockargs(
|
|
2146
|
+
s(:args,
|
|
2147
|
+
s(:restarg_expr, s(:ivasgn, :@s)),
|
|
2148
|
+
s(:blockarg_expr, s(:ivasgn, :@b))),
|
|
2149
|
+
%q{|*@s, &@b|},
|
|
2150
|
+
%w(1.8))
|
|
2151
|
+
|
|
2152
|
+
assert_parses_blockargs(
|
|
2153
|
+
s(:args, s(:restarg), s(:blockarg, :b)),
|
|
2154
|
+
%q{|*, &b|})
|
|
2155
|
+
|
|
2156
|
+
assert_parses_blockargs(
|
|
2157
|
+
s(:args,
|
|
2158
|
+
s(:restarg),
|
|
2159
|
+
s(:blockarg_expr, s(:ivasgn, :@b))),
|
|
2160
|
+
%q{|*, &@b|},
|
|
2161
|
+
%w(1.8))
|
|
2162
|
+
|
|
2163
|
+
assert_parses_blockargs(
|
|
2164
|
+
s(:args, s(:restarg, :s)),
|
|
2165
|
+
%q{|*s|})
|
|
2166
|
+
|
|
2167
|
+
assert_parses_blockargs(
|
|
2168
|
+
s(:args,
|
|
2169
|
+
s(:restarg_expr, s(:ivasgn, :@s))),
|
|
2170
|
+
%q{|*@s|},
|
|
2171
|
+
%w(1.8))
|
|
2172
|
+
|
|
2173
|
+
assert_parses_blockargs(
|
|
2174
|
+
s(:args, s(:restarg)),
|
|
2175
|
+
%q{|*|})
|
|
2176
|
+
|
|
2177
|
+
# tAMPER lhs
|
|
2178
|
+
# f_block_arg
|
|
2179
|
+
assert_parses_blockargs(
|
|
2180
|
+
s(:args, s(:blockarg, :b)),
|
|
2181
|
+
%q{|&b|})
|
|
2182
|
+
|
|
2183
|
+
assert_parses_blockargs(
|
|
2184
|
+
s(:args,
|
|
2185
|
+
s(:blockarg_expr, s(:ivasgn, :@b))),
|
|
2186
|
+
%q{|&@b|},
|
|
2187
|
+
%w(1.8))
|
|
2188
|
+
|
|
2189
|
+
# f_arg tCOMMA f_block_optarg tCOMMA f_rest_arg opt_f_block_arg
|
|
2190
|
+
assert_parses_blockargs(
|
|
2191
|
+
s(:args,
|
|
2192
|
+
s(:arg, :a),
|
|
2193
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2194
|
+
s(:optarg, :o1, s(:int, 2)),
|
|
2195
|
+
s(:restarg, :r),
|
|
2196
|
+
s(:blockarg, :b)),
|
|
2197
|
+
%q{|a, o=1, o1=2, *r, &b|},
|
|
2198
|
+
ALL_VERSIONS - %w(1.8))
|
|
2199
|
+
|
|
2200
|
+
# f_arg tCOMMA f_block_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
2201
|
+
assert_parses_blockargs(
|
|
2202
|
+
s(:args,
|
|
2203
|
+
s(:arg, :a),
|
|
2204
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2205
|
+
s(:restarg, :r),
|
|
2206
|
+
s(:arg, :p),
|
|
2207
|
+
s(:blockarg, :b)),
|
|
2208
|
+
%q{|a, o=1, *r, p, &b|},
|
|
2209
|
+
ALL_VERSIONS - %w(1.8))
|
|
2210
|
+
|
|
2211
|
+
# f_arg tCOMMA f_block_optarg opt_f_block_arg
|
|
2212
|
+
assert_parses_blockargs(
|
|
2213
|
+
s(:args,
|
|
2214
|
+
s(:arg, :a),
|
|
2215
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2216
|
+
s(:blockarg, :b)),
|
|
2217
|
+
%q{|a, o=1, &b|},
|
|
2218
|
+
ALL_VERSIONS - %w(1.8))
|
|
2219
|
+
|
|
2220
|
+
# f_arg tCOMMA f_block_optarg tCOMMA f_arg opt_f_block_arg
|
|
2221
|
+
assert_parses_blockargs(
|
|
2222
|
+
s(:args,
|
|
2223
|
+
s(:arg, :a),
|
|
2224
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2225
|
+
s(:arg, :p),
|
|
2226
|
+
s(:blockarg, :b)),
|
|
2227
|
+
%q{|a, o=1, p, &b|},
|
|
2228
|
+
ALL_VERSIONS - %w(1.8))
|
|
2229
|
+
|
|
2230
|
+
# f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
2231
|
+
assert_parses_blockargs(
|
|
2232
|
+
s(:args,
|
|
2233
|
+
s(:arg, :a),
|
|
2234
|
+
s(:restarg, :r),
|
|
2235
|
+
s(:arg, :p),
|
|
2236
|
+
s(:blockarg, :b)),
|
|
2237
|
+
%q{|a, *r, p, &b|},
|
|
2238
|
+
ALL_VERSIONS - %w(1.8))
|
|
2239
|
+
|
|
2240
|
+
# f_block_optarg tCOMMA f_rest_arg opt_f_block_arg
|
|
2241
|
+
assert_parses_blockargs(
|
|
2242
|
+
s(:args,
|
|
2243
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2244
|
+
s(:restarg, :r),
|
|
2245
|
+
s(:blockarg, :b)),
|
|
2246
|
+
%q{|o=1, *r, &b|},
|
|
2247
|
+
ALL_VERSIONS - %w(1.8))
|
|
2248
|
+
|
|
2249
|
+
# f_block_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
2250
|
+
assert_parses_blockargs(
|
|
2251
|
+
s(:args,
|
|
2252
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2253
|
+
s(:restarg, :r),
|
|
2254
|
+
s(:arg, :p),
|
|
2255
|
+
s(:blockarg, :b)),
|
|
2256
|
+
%q{|o=1, *r, p, &b|},
|
|
2257
|
+
ALL_VERSIONS - %w(1.8))
|
|
2258
|
+
|
|
2259
|
+
# f_block_optarg opt_f_block_arg
|
|
2260
|
+
assert_parses_blockargs(
|
|
2261
|
+
s(:args,
|
|
2262
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2263
|
+
s(:blockarg, :b)),
|
|
2264
|
+
%q{|o=1, &b|},
|
|
2265
|
+
ALL_VERSIONS - %w(1.8))
|
|
2266
|
+
|
|
2267
|
+
# f_block_optarg tCOMMA f_arg opt_f_block_arg
|
|
2268
|
+
assert_parses_blockargs(
|
|
2269
|
+
s(:args,
|
|
2270
|
+
s(:optarg, :o, s(:int, 1)),
|
|
2271
|
+
s(:arg, :p),
|
|
2272
|
+
s(:blockarg, :b)),
|
|
2273
|
+
%q{|o=1, p, &b|},
|
|
2274
|
+
ALL_VERSIONS - %w(1.8))
|
|
2275
|
+
|
|
2276
|
+
# f_rest_arg tCOMMA f_arg opt_f_block_arg
|
|
2277
|
+
assert_parses_blockargs(
|
|
2278
|
+
s(:args,
|
|
2279
|
+
s(:restarg, :r),
|
|
2280
|
+
s(:arg, :p),
|
|
2281
|
+
s(:blockarg, :b)),
|
|
2282
|
+
%q{|*r, p, &b|},
|
|
2283
|
+
ALL_VERSIONS - %w(1.8))
|
|
2284
|
+
end
|
|
2285
|
+
|
|
2286
|
+
def test_block_kwarg_combinations
|
|
2287
|
+
# f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
|
|
2288
|
+
assert_parses_blockargs(
|
|
2289
|
+
s(:args,
|
|
2290
|
+
s(:kwoptarg, :foo, s(:int, 1)),
|
|
2291
|
+
s(:kwoptarg, :bar, s(:int, 2)),
|
|
2292
|
+
s(:kwrestarg, :baz),
|
|
2293
|
+
s(:blockarg, :b)),
|
|
2294
|
+
%q{|foo: 1, bar: 2, **baz, &b|},
|
|
2295
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2296
|
+
|
|
2297
|
+
# f_block_kwarg opt_f_block_arg
|
|
2298
|
+
assert_parses_blockargs(
|
|
2299
|
+
s(:args,
|
|
2300
|
+
s(:kwoptarg, :foo, s(:int, 1)),
|
|
2301
|
+
s(:blockarg, :b)),
|
|
2302
|
+
%q{|foo: 1, &b|},
|
|
2303
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2304
|
+
|
|
2305
|
+
# f_kwrest opt_f_block_arg
|
|
2306
|
+
assert_parses_blockargs(
|
|
2307
|
+
s(:args,
|
|
2308
|
+
s(:kwrestarg, :baz),
|
|
2309
|
+
s(:blockarg, :b)),
|
|
2310
|
+
%q{|**baz, &b|},
|
|
2311
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2312
|
+
end
|
|
2313
|
+
|
|
2314
|
+
def test_block_kwarg
|
|
2315
|
+
assert_parses_blockargs(
|
|
2316
|
+
s(:args,
|
|
2317
|
+
s(:kwarg, :foo)),
|
|
2318
|
+
%q{|foo:|},
|
|
2319
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
2320
|
+
end
|
|
2321
|
+
|
|
2322
|
+
def test_arg_invalid
|
|
2323
|
+
assert_diagnoses(
|
|
2324
|
+
[:error, :argument_const],
|
|
2325
|
+
%q{def foo(Abc); end},
|
|
2326
|
+
%q{ ~~~ location})
|
|
2327
|
+
|
|
2328
|
+
assert_diagnoses(
|
|
2329
|
+
[:error, :argument_ivar],
|
|
2330
|
+
%q{def foo(@abc); end},
|
|
2331
|
+
%q{ ~~~~ location})
|
|
2332
|
+
|
|
2333
|
+
assert_diagnoses(
|
|
2334
|
+
[:error, :argument_gvar],
|
|
2335
|
+
%q{def foo($abc); end},
|
|
2336
|
+
%q{ ~~~~ location})
|
|
2337
|
+
|
|
2338
|
+
assert_diagnoses(
|
|
2339
|
+
[:error, :argument_cvar],
|
|
2340
|
+
%q{def foo(@@abc); end},
|
|
2341
|
+
%q{ ~~~~~ location})
|
|
2342
|
+
end
|
|
2343
|
+
|
|
2344
|
+
def test_arg_duplicate
|
|
2345
|
+
assert_diagnoses(
|
|
2346
|
+
[:error, :duplicate_argument],
|
|
2347
|
+
%q{def foo(aa, aa); end},
|
|
2348
|
+
%q{ ^^ location
|
|
2349
|
+
| ~~ highlights (0)})
|
|
2350
|
+
|
|
2351
|
+
assert_diagnoses(
|
|
2352
|
+
[:error, :duplicate_argument],
|
|
2353
|
+
%q{def foo(aa, aa=1); end},
|
|
2354
|
+
%q{ ^^ location
|
|
2355
|
+
| ~~ highlights (0)})
|
|
2356
|
+
|
|
2357
|
+
assert_diagnoses(
|
|
2358
|
+
[:error, :duplicate_argument],
|
|
2359
|
+
%q{def foo(aa, *aa); end},
|
|
2360
|
+
%q{ ^^ location
|
|
2361
|
+
| ~~ highlights (0)})
|
|
2362
|
+
|
|
2363
|
+
assert_diagnoses(
|
|
2364
|
+
[:error, :duplicate_argument],
|
|
2365
|
+
%q{def foo(aa, &aa); end},
|
|
2366
|
+
%q{ ^^ location
|
|
2367
|
+
| ~~ highlights (0)})
|
|
2368
|
+
|
|
2369
|
+
assert_diagnoses(
|
|
2370
|
+
[:error, :duplicate_argument],
|
|
2371
|
+
%q{def foo(aa, (bb, aa)); end},
|
|
2372
|
+
%q{ ^^ location
|
|
2373
|
+
| ~~ highlights (0)},
|
|
2374
|
+
ALL_VERSIONS - %w(1.8))
|
|
2375
|
+
|
|
2376
|
+
assert_diagnoses(
|
|
2377
|
+
[:error, :duplicate_argument],
|
|
2378
|
+
%q{def foo(aa, *r, aa); end},
|
|
2379
|
+
%q{ ^^ location
|
|
2380
|
+
| ~~ highlights (0)},
|
|
2381
|
+
ALL_VERSIONS - %w(1.8))
|
|
2382
|
+
|
|
2383
|
+
|
|
2384
|
+
assert_diagnoses(
|
|
2385
|
+
[:error, :duplicate_argument],
|
|
2386
|
+
%q{lambda do |aa; aa| end},
|
|
2387
|
+
%q{ ^^ location
|
|
2388
|
+
| ~~ highlights (0)},
|
|
2389
|
+
ALL_VERSIONS - %w(1.8))
|
|
2390
|
+
|
|
2391
|
+
assert_diagnoses(
|
|
2392
|
+
[:error, :duplicate_argument],
|
|
2393
|
+
%q{def foo(aa, aa: 1); end},
|
|
2394
|
+
%q{ ^^ location
|
|
2395
|
+
| ~~ highlights (0)},
|
|
2396
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2397
|
+
|
|
2398
|
+
assert_diagnoses(
|
|
2399
|
+
[:error, :duplicate_argument],
|
|
2400
|
+
%q{def foo(aa, **aa); end},
|
|
2401
|
+
%q{ ^^ location
|
|
2402
|
+
| ~~ highlights (0)},
|
|
2403
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2404
|
+
|
|
2405
|
+
assert_diagnoses(
|
|
2406
|
+
[:error, :duplicate_argument],
|
|
2407
|
+
%q{def foo(aa, aa:); end},
|
|
2408
|
+
%q{ ^^ location
|
|
2409
|
+
| ~~ highlights (0)},
|
|
2410
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
2411
|
+
end
|
|
2412
|
+
|
|
2413
|
+
def test_arg_duplicate_ignored
|
|
2414
|
+
assert_diagnoses(
|
|
2415
|
+
[:error, :duplicate_argument],
|
|
2416
|
+
%q{def foo(_, _); end},
|
|
2417
|
+
%q{},
|
|
2418
|
+
%w(1.8))
|
|
2419
|
+
|
|
2420
|
+
assert_parses(
|
|
2421
|
+
s(:def, :foo,
|
|
2422
|
+
s(:args, s(:arg, :_), s(:arg, :_)),
|
|
2423
|
+
nil),
|
|
2424
|
+
%q{def foo(_, _); end},
|
|
2425
|
+
%q{},
|
|
2426
|
+
ALL_VERSIONS - %w(1.8))
|
|
2427
|
+
|
|
2428
|
+
assert_diagnoses(
|
|
2429
|
+
[:error, :duplicate_argument],
|
|
2430
|
+
%q{def foo(_a, _a); end},
|
|
2431
|
+
%q{},
|
|
2432
|
+
%w(1.8 1.9))
|
|
2433
|
+
|
|
2434
|
+
assert_parses(
|
|
2435
|
+
s(:def, :foo,
|
|
2436
|
+
s(:args, s(:arg, :_a), s(:arg, :_a)),
|
|
2437
|
+
nil),
|
|
2438
|
+
%q{def foo(_a, _a); end},
|
|
2439
|
+
%q{},
|
|
2440
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2441
|
+
end
|
|
2442
|
+
|
|
2443
|
+
def test_arg_duplicate_proc
|
|
2444
|
+
assert_parses(
|
|
2445
|
+
s(:block, s(:send, nil, :proc),
|
|
2446
|
+
s(:args, s(:arg, :a), s(:arg, :a)),
|
|
2447
|
+
nil),
|
|
2448
|
+
%q{proc{|a,a|}},
|
|
2449
|
+
%q{},
|
|
2450
|
+
%w(1.8))
|
|
2451
|
+
|
|
2452
|
+
assert_diagnoses(
|
|
2453
|
+
[:error, :duplicate_argument],
|
|
2454
|
+
%q{proc{|a,a|}},
|
|
2455
|
+
%q{},
|
|
2456
|
+
ALL_VERSIONS - %w(1.8))
|
|
2457
|
+
end
|
|
2458
|
+
|
|
2459
|
+
def test_kwarg_invalid
|
|
2460
|
+
assert_diagnoses(
|
|
2461
|
+
[:error, :argument_const],
|
|
2462
|
+
%q{def foo(Abc: 1); end},
|
|
2463
|
+
%q{ ~~~~ location},
|
|
2464
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2465
|
+
|
|
2466
|
+
assert_diagnoses(
|
|
2467
|
+
[:error, :argument_const],
|
|
2468
|
+
%q{def foo(Abc:); end},
|
|
2469
|
+
%q{ ~~~~ location},
|
|
2470
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0))
|
|
2471
|
+
end
|
|
2472
|
+
|
|
2473
|
+
def test_arg_label
|
|
2474
|
+
assert_parses(
|
|
2475
|
+
s(:def, :foo, s(:args),
|
|
2476
|
+
s(:send, nil, :a, s(:sym, :b))),
|
|
2477
|
+
%q{def foo() a:b end},
|
|
2478
|
+
%q{},
|
|
2479
|
+
ALL_VERSIONS - %w(1.8))
|
|
2480
|
+
|
|
2481
|
+
assert_parses(
|
|
2482
|
+
s(:def, :foo, s(:args),
|
|
2483
|
+
s(:send, nil, :a, s(:sym, :b))),
|
|
2484
|
+
%Q{def foo\n a:b end},
|
|
2485
|
+
%q{},
|
|
2486
|
+
ALL_VERSIONS - %w(1.8))
|
|
2487
|
+
|
|
2488
|
+
assert_parses(
|
|
2489
|
+
s(:block,
|
|
2490
|
+
s(:send, nil, :f),
|
|
2491
|
+
s(:args),
|
|
2492
|
+
s(:send, nil, :a,
|
|
2493
|
+
s(:sym, :b))),
|
|
2494
|
+
%Q{f { || a:b }},
|
|
2495
|
+
%q{},
|
|
2496
|
+
ALL_VERSIONS - %w(1.8))
|
|
2497
|
+
end
|
|
2498
|
+
|
|
2499
|
+
#
|
|
2500
|
+
# Sends
|
|
2501
|
+
#
|
|
2502
|
+
|
|
2503
|
+
# To self
|
|
2504
|
+
|
|
2505
|
+
def test_send_self
|
|
2506
|
+
assert_parses(
|
|
2507
|
+
s(:send, nil, :fun),
|
|
2508
|
+
%q{fun},
|
|
2509
|
+
%q{~~~ selector
|
|
2510
|
+
|~~~ expression})
|
|
2511
|
+
|
|
2512
|
+
assert_parses(
|
|
2513
|
+
s(:send, nil, :fun!),
|
|
2514
|
+
%q{fun!},
|
|
2515
|
+
%q{~~~~ selector
|
|
2516
|
+
|~~~~ expression})
|
|
2517
|
+
|
|
2518
|
+
assert_parses(
|
|
2519
|
+
s(:send, nil, :fun, s(:int, 1)),
|
|
2520
|
+
%q{fun(1)},
|
|
2521
|
+
%q{~~~ selector
|
|
2522
|
+
| ^ begin
|
|
2523
|
+
| ^ end
|
|
2524
|
+
|~~~~~~ expression})
|
|
2525
|
+
end
|
|
2526
|
+
|
|
2527
|
+
def test_send_self_block
|
|
2528
|
+
assert_parses(
|
|
2529
|
+
s(:block, s(:send, nil, :fun), s(:args), nil),
|
|
2530
|
+
%q{fun { }})
|
|
2531
|
+
|
|
2532
|
+
assert_parses(
|
|
2533
|
+
s(:block, s(:send, nil, :fun), s(:args), nil),
|
|
2534
|
+
%q{fun() { }})
|
|
2535
|
+
|
|
2536
|
+
assert_parses(
|
|
2537
|
+
s(:block, s(:send, nil, :fun, s(:int, 1)), s(:args), nil),
|
|
2538
|
+
%q{fun(1) { }})
|
|
2539
|
+
|
|
2540
|
+
assert_parses(
|
|
2541
|
+
s(:block, s(:send, nil, :fun), s(:args), nil),
|
|
2542
|
+
%q{fun do end})
|
|
2543
|
+
end
|
|
2544
|
+
|
|
2545
|
+
def test_send_block_blockarg
|
|
2546
|
+
assert_diagnoses(
|
|
2547
|
+
[:error, :block_and_blockarg],
|
|
2548
|
+
%q{fun(&bar) do end},
|
|
2549
|
+
%q{ ~~~~ location
|
|
2550
|
+
| ~~ highlights (0)})
|
|
2551
|
+
end
|
|
2552
|
+
|
|
2553
|
+
# To receiver
|
|
2554
|
+
|
|
2555
|
+
def test_send_plain
|
|
2556
|
+
assert_parses(
|
|
2557
|
+
s(:send, s(:lvar, :foo), :fun),
|
|
2558
|
+
%q{foo.fun},
|
|
2559
|
+
%q{ ~~~ selector
|
|
2560
|
+
| ^ dot
|
|
2561
|
+
|~~~~~~~ expression})
|
|
2562
|
+
|
|
2563
|
+
assert_parses(
|
|
2564
|
+
s(:send, s(:lvar, :foo), :fun),
|
|
2565
|
+
%q{foo::fun},
|
|
2566
|
+
%q{ ~~~ selector
|
|
2567
|
+
| ^^ dot
|
|
2568
|
+
|~~~~~~~~ expression})
|
|
2569
|
+
|
|
2570
|
+
assert_parses(
|
|
2571
|
+
s(:send, s(:lvar, :foo), :Fun),
|
|
2572
|
+
%q{foo::Fun()},
|
|
2573
|
+
%q{ ~~~ selector
|
|
2574
|
+
| ^^ dot
|
|
2575
|
+
|~~~~~~~~~~ expression})
|
|
2576
|
+
end
|
|
2577
|
+
|
|
2578
|
+
def test_send_plain_cmd
|
|
2579
|
+
assert_parses(
|
|
2580
|
+
s(:send, s(:lvar, :foo), :fun, s(:lvar, :bar)),
|
|
2581
|
+
%q{foo.fun bar},
|
|
2582
|
+
%q{ ~~~ selector
|
|
2583
|
+
| ^ dot
|
|
2584
|
+
|~~~~~~~~~~~ expression})
|
|
2585
|
+
|
|
2586
|
+
assert_parses(
|
|
2587
|
+
s(:send, s(:lvar, :foo), :fun, s(:lvar, :bar)),
|
|
2588
|
+
%q{foo::fun bar},
|
|
2589
|
+
%q{ ~~~ selector
|
|
2590
|
+
| ^^ dot
|
|
2591
|
+
|~~~~~~~~~~~~ expression})
|
|
2592
|
+
|
|
2593
|
+
assert_parses(
|
|
2594
|
+
s(:send, s(:lvar, :foo), :Fun, s(:lvar, :bar)),
|
|
2595
|
+
%q{foo::Fun bar},
|
|
2596
|
+
%q{ ~~~ selector
|
|
2597
|
+
| ^^ dot
|
|
2598
|
+
|~~~~~~~~~~~~ expression})
|
|
2599
|
+
end
|
|
2600
|
+
|
|
2601
|
+
def test_send_plain_cmd_ambiguous_literal
|
|
2602
|
+
assert_diagnoses(
|
|
2603
|
+
[:warning, :ambiguous_literal],
|
|
2604
|
+
%q{m /foo/},
|
|
2605
|
+
%q{ ^ location})
|
|
2606
|
+
|
|
2607
|
+
refute_diagnoses(
|
|
2608
|
+
%q{m %[1]})
|
|
2609
|
+
end
|
|
2610
|
+
|
|
2611
|
+
def test_send_plain_cmd_ambiguous_prefix
|
|
2612
|
+
assert_diagnoses(
|
|
2613
|
+
[:warning, :ambiguous_prefix, { :prefix => '+' }],
|
|
2614
|
+
%q{m +foo},
|
|
2615
|
+
%q{ ^ location})
|
|
2616
|
+
|
|
2617
|
+
assert_diagnoses(
|
|
2618
|
+
[:warning, :ambiguous_prefix, { :prefix => '-' }],
|
|
2619
|
+
%q{m -foo},
|
|
2620
|
+
%q{ ^ location})
|
|
2621
|
+
|
|
2622
|
+
assert_diagnoses(
|
|
2623
|
+
[:warning, :ambiguous_prefix, { :prefix => '&' }],
|
|
2624
|
+
%q{m &foo},
|
|
2625
|
+
%q{ ^ location})
|
|
2626
|
+
|
|
2627
|
+
assert_diagnoses(
|
|
2628
|
+
[:warning, :ambiguous_prefix, { :prefix => '*' }],
|
|
2629
|
+
%q{m *foo},
|
|
2630
|
+
%q{ ^ location})
|
|
2631
|
+
|
|
2632
|
+
assert_diagnoses(
|
|
2633
|
+
[:warning, :ambiguous_prefix, { :prefix => '**' }],
|
|
2634
|
+
%q{m **foo},
|
|
2635
|
+
%q{ ^^ location},
|
|
2636
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2637
|
+
end
|
|
2638
|
+
|
|
2639
|
+
def test_send_block_chain_cmd
|
|
2640
|
+
assert_parses(
|
|
2641
|
+
s(:send,
|
|
2642
|
+
s(:block,
|
|
2643
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2644
|
+
s(:args), nil),
|
|
2645
|
+
:fun, s(:lvar, :bar)),
|
|
2646
|
+
%q{meth 1 do end.fun bar},
|
|
2647
|
+
%q{ ~~~ selector
|
|
2648
|
+
| ^ dot
|
|
2649
|
+
|~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
2650
|
+
|
|
2651
|
+
assert_parses(
|
|
2652
|
+
s(:send,
|
|
2653
|
+
s(:block,
|
|
2654
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2655
|
+
s(:args), nil),
|
|
2656
|
+
:fun, s(:lvar, :bar)),
|
|
2657
|
+
%q{meth 1 do end.fun(bar)},
|
|
2658
|
+
%q{ ~~~ selector
|
|
2659
|
+
| ^ dot
|
|
2660
|
+
| ^ begin
|
|
2661
|
+
| ^ end
|
|
2662
|
+
|~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
2663
|
+
|
|
2664
|
+
assert_parses(
|
|
2665
|
+
s(:send,
|
|
2666
|
+
s(:block,
|
|
2667
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2668
|
+
s(:args), nil),
|
|
2669
|
+
:fun, s(:lvar, :bar)),
|
|
2670
|
+
%q{meth 1 do end::fun bar},
|
|
2671
|
+
%q{ ~~~ selector
|
|
2672
|
+
| ^^ dot
|
|
2673
|
+
|~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
2674
|
+
|
|
2675
|
+
assert_parses(
|
|
2676
|
+
s(:send,
|
|
2677
|
+
s(:block,
|
|
2678
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2679
|
+
s(:args), nil),
|
|
2680
|
+
:fun, s(:lvar, :bar)),
|
|
2681
|
+
%q{meth 1 do end::fun(bar)},
|
|
2682
|
+
%q{ ~~~ selector
|
|
2683
|
+
| ^ begin
|
|
2684
|
+
| ^ end
|
|
2685
|
+
| ^^ dot
|
|
2686
|
+
|~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
2687
|
+
|
|
2688
|
+
assert_parses(
|
|
2689
|
+
s(:block,
|
|
2690
|
+
s(:send,
|
|
2691
|
+
s(:block,
|
|
2692
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2693
|
+
s(:args), nil),
|
|
2694
|
+
:fun, s(:lvar, :bar)),
|
|
2695
|
+
s(:args), nil),
|
|
2696
|
+
%q{meth 1 do end.fun bar do end},
|
|
2697
|
+
%q{},
|
|
2698
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2699
|
+
|
|
2700
|
+
assert_parses(
|
|
2701
|
+
s(:block,
|
|
2702
|
+
s(:send,
|
|
2703
|
+
s(:block,
|
|
2704
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2705
|
+
s(:args), nil),
|
|
2706
|
+
:fun, s(:lvar, :bar)),
|
|
2707
|
+
s(:args), nil),
|
|
2708
|
+
%q{meth 1 do end.fun(bar) {}},
|
|
2709
|
+
%q{},
|
|
2710
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2711
|
+
|
|
2712
|
+
assert_parses(
|
|
2713
|
+
s(:block,
|
|
2714
|
+
s(:send,
|
|
2715
|
+
s(:block,
|
|
2716
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2717
|
+
s(:args), nil),
|
|
2718
|
+
:fun),
|
|
2719
|
+
s(:args), nil),
|
|
2720
|
+
%q{meth 1 do end.fun {}},
|
|
2721
|
+
%q{},
|
|
2722
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
2723
|
+
end
|
|
2724
|
+
|
|
2725
|
+
def test_send_paren_block_cmd
|
|
2726
|
+
assert_parses(
|
|
2727
|
+
s(:send, nil, :foo,
|
|
2728
|
+
s(:block,
|
|
2729
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2730
|
+
s(:args), nil)),
|
|
2731
|
+
%q{foo(meth 1 do end)},
|
|
2732
|
+
%q{},
|
|
2733
|
+
%w(1.8))
|
|
2734
|
+
|
|
2735
|
+
assert_parses(
|
|
2736
|
+
s(:send, nil, :foo,
|
|
2737
|
+
s(:int, 1),
|
|
2738
|
+
s(:block,
|
|
2739
|
+
s(:send, nil, :meth, s(:int, 1)),
|
|
2740
|
+
s(:args), nil)),
|
|
2741
|
+
%q{foo(1, meth 1 do end)},
|
|
2742
|
+
%q{},
|
|
2743
|
+
%w(1.8))
|
|
2744
|
+
end
|
|
2745
|
+
|
|
2746
|
+
def test_send_binary_op
|
|
2747
|
+
assert_parses(
|
|
2748
|
+
s(:send, s(:lvar, :foo), :+, s(:int, 1)),
|
|
2749
|
+
%q{foo + 1},
|
|
2750
|
+
%q{ ~ selector
|
|
2751
|
+
|~~~~~~~ expression})
|
|
2752
|
+
|
|
2753
|
+
assert_parses(
|
|
2754
|
+
s(:send, s(:lvar, :foo), :-, s(:int, 1)),
|
|
2755
|
+
%q{foo - 1})
|
|
2756
|
+
|
|
2757
|
+
assert_parses(
|
|
2758
|
+
s(:send, s(:lvar, :foo), :*, s(:int, 1)),
|
|
2759
|
+
%q{foo * 1})
|
|
2760
|
+
|
|
2761
|
+
assert_parses(
|
|
2762
|
+
s(:send, s(:lvar, :foo), :/, s(:int, 1)),
|
|
2763
|
+
%q{foo / 1})
|
|
2764
|
+
|
|
2765
|
+
assert_parses(
|
|
2766
|
+
s(:send, s(:lvar, :foo), :%, s(:int, 1)),
|
|
2767
|
+
%q{foo % 1})
|
|
2768
|
+
|
|
2769
|
+
assert_parses(
|
|
2770
|
+
s(:send, s(:lvar, :foo), :**, s(:int, 1)),
|
|
2771
|
+
%q{foo ** 1})
|
|
2772
|
+
|
|
2773
|
+
assert_parses(
|
|
2774
|
+
s(:send, s(:lvar, :foo), :|, s(:int, 1)),
|
|
2775
|
+
%q{foo | 1})
|
|
2776
|
+
|
|
2777
|
+
assert_parses(
|
|
2778
|
+
s(:send, s(:lvar, :foo), :^, s(:int, 1)),
|
|
2779
|
+
%q{foo ^ 1})
|
|
2780
|
+
|
|
2781
|
+
assert_parses(
|
|
2782
|
+
s(:send, s(:lvar, :foo), :&, s(:int, 1)),
|
|
2783
|
+
%q{foo & 1})
|
|
2784
|
+
|
|
2785
|
+
assert_parses(
|
|
2786
|
+
s(:send, s(:lvar, :foo), :<=>, s(:int, 1)),
|
|
2787
|
+
%q{foo <=> 1})
|
|
2788
|
+
|
|
2789
|
+
assert_parses(
|
|
2790
|
+
s(:send, s(:lvar, :foo), :<, s(:int, 1)),
|
|
2791
|
+
%q{foo < 1})
|
|
2792
|
+
|
|
2793
|
+
assert_parses(
|
|
2794
|
+
s(:send, s(:lvar, :foo), :<=, s(:int, 1)),
|
|
2795
|
+
%q{foo <= 1})
|
|
2796
|
+
|
|
2797
|
+
assert_parses(
|
|
2798
|
+
s(:send, s(:lvar, :foo), :>, s(:int, 1)),
|
|
2799
|
+
%q{foo > 1})
|
|
2800
|
+
|
|
2801
|
+
assert_parses(
|
|
2802
|
+
s(:send, s(:lvar, :foo), :>=, s(:int, 1)),
|
|
2803
|
+
%q{foo >= 1})
|
|
2804
|
+
|
|
2805
|
+
assert_parses(
|
|
2806
|
+
s(:send, s(:lvar, :foo), :==, s(:int, 1)),
|
|
2807
|
+
%q{foo == 1})
|
|
2808
|
+
|
|
2809
|
+
assert_parses(
|
|
2810
|
+
s(:not, s(:send, s(:lvar, :foo), :==, s(:int, 1))),
|
|
2811
|
+
%q{foo != 1},
|
|
2812
|
+
%q{},
|
|
2813
|
+
%w(1.8))
|
|
2814
|
+
|
|
2815
|
+
assert_parses(
|
|
2816
|
+
s(:send, s(:lvar, :foo), :'!=', s(:int, 1)),
|
|
2817
|
+
%q{foo != 1},
|
|
2818
|
+
%q{},
|
|
2819
|
+
ALL_VERSIONS - %w(1.8))
|
|
2820
|
+
|
|
2821
|
+
assert_parses(
|
|
2822
|
+
s(:send, s(:lvar, :foo), :===, s(:int, 1)),
|
|
2823
|
+
%q{foo === 1})
|
|
2824
|
+
|
|
2825
|
+
assert_parses(
|
|
2826
|
+
s(:send, s(:lvar, :foo), :=~, s(:int, 1)),
|
|
2827
|
+
%q{foo =~ 1})
|
|
2828
|
+
|
|
2829
|
+
assert_parses(
|
|
2830
|
+
s(:not, s(:send, s(:lvar, :foo), :=~, s(:int, 1))),
|
|
2831
|
+
%q{foo !~ 1},
|
|
2832
|
+
%q{},
|
|
2833
|
+
%w(1.8))
|
|
2834
|
+
|
|
2835
|
+
assert_parses(
|
|
2836
|
+
s(:send, s(:lvar, :foo), :'!~', s(:int, 1)),
|
|
2837
|
+
%q{foo !~ 1},
|
|
2838
|
+
%q{},
|
|
2839
|
+
ALL_VERSIONS - %w(1.8))
|
|
2840
|
+
|
|
2841
|
+
assert_parses(
|
|
2842
|
+
s(:send, s(:lvar, :foo), :<<, s(:int, 1)),
|
|
2843
|
+
%q{foo << 1})
|
|
2844
|
+
|
|
2845
|
+
assert_parses(
|
|
2846
|
+
s(:send, s(:lvar, :foo), :>>, s(:int, 1)),
|
|
2847
|
+
%q{foo >> 1})
|
|
2848
|
+
end
|
|
2849
|
+
|
|
2850
|
+
def test_send_unary_op
|
|
2851
|
+
assert_parses(
|
|
2852
|
+
s(:send, s(:lvar, :foo), :-@),
|
|
2853
|
+
%q{-foo},
|
|
2854
|
+
%q{~ selector
|
|
2855
|
+
|~~~~ expression})
|
|
2856
|
+
|
|
2857
|
+
assert_parses(
|
|
2858
|
+
s(:send, s(:lvar, :foo), :+@),
|
|
2859
|
+
%q{+foo})
|
|
2860
|
+
|
|
2861
|
+
assert_parses(
|
|
2862
|
+
s(:send, s(:lvar, :foo), :~),
|
|
2863
|
+
%q{~foo})
|
|
2864
|
+
end
|
|
2865
|
+
|
|
2866
|
+
def test_bang
|
|
2867
|
+
assert_parses(
|
|
2868
|
+
s(:not, s(:lvar, :foo)),
|
|
2869
|
+
%q{!foo},
|
|
2870
|
+
%{},
|
|
2871
|
+
%w(1.8))
|
|
2872
|
+
|
|
2873
|
+
assert_parses(
|
|
2874
|
+
s(:send, s(:lvar, :foo), :'!'),
|
|
2875
|
+
%q{!foo},
|
|
2876
|
+
%{},
|
|
2877
|
+
ALL_VERSIONS - %w(1.8))
|
|
2878
|
+
end
|
|
2879
|
+
|
|
2880
|
+
def test_bang_cmd
|
|
2881
|
+
assert_parses(
|
|
2882
|
+
s(:not, s(:send, nil, :m, s(:lvar, :foo))),
|
|
2883
|
+
%q{!m foo},
|
|
2884
|
+
%{},
|
|
2885
|
+
%w(1.8))
|
|
2886
|
+
|
|
2887
|
+
assert_parses(
|
|
2888
|
+
s(:send, s(:send, nil, :m, s(:lvar, :foo)), :'!'),
|
|
2889
|
+
%q{!m foo},
|
|
2890
|
+
%{},
|
|
2891
|
+
ALL_VERSIONS - %w(1.8))
|
|
2892
|
+
end
|
|
2893
|
+
|
|
2894
|
+
def test_not
|
|
2895
|
+
assert_parses(
|
|
2896
|
+
s(:not, s(:lvar, :foo)),
|
|
2897
|
+
%q{not foo},
|
|
2898
|
+
%{},
|
|
2899
|
+
%w(1.8))
|
|
2900
|
+
|
|
2901
|
+
assert_parses(
|
|
2902
|
+
s(:send, s(:lvar, :foo), :'!'),
|
|
2903
|
+
%q{not foo},
|
|
2904
|
+
%{},
|
|
2905
|
+
ALL_VERSIONS - %w(1.8))
|
|
2906
|
+
|
|
2907
|
+
assert_parses(
|
|
2908
|
+
s(:send, s(:lvar, :foo), :'!'),
|
|
2909
|
+
%q{not(foo)},
|
|
2910
|
+
%q{~~~~~~~~ expression},
|
|
2911
|
+
ALL_VERSIONS - %w(1.8))
|
|
2912
|
+
|
|
2913
|
+
assert_parses(
|
|
2914
|
+
s(:send, s(:begin), :'!'),
|
|
2915
|
+
%q{not()},
|
|
2916
|
+
%q{~~~~~ expression},
|
|
2917
|
+
ALL_VERSIONS - %w(1.8))
|
|
2918
|
+
end
|
|
2919
|
+
|
|
2920
|
+
def test_not_cmd
|
|
2921
|
+
assert_parses(
|
|
2922
|
+
s(:not, s(:send, nil, :m, s(:lvar, :foo))),
|
|
2923
|
+
%q{not m foo},
|
|
2924
|
+
%{},
|
|
2925
|
+
%w(1.8))
|
|
2926
|
+
|
|
2927
|
+
assert_parses(
|
|
2928
|
+
s(:send, s(:send, nil, :m, s(:lvar, :foo)), :'!'),
|
|
2929
|
+
%q{not m foo},
|
|
2930
|
+
%{},
|
|
2931
|
+
ALL_VERSIONS - %w(1.8))
|
|
2932
|
+
end
|
|
2933
|
+
|
|
2934
|
+
def test_pow_precedence
|
|
2935
|
+
assert_parses(
|
|
2936
|
+
s(:send, s(:send, s(:int, 2), :**, s(:int, 10)), :-@),
|
|
2937
|
+
%q{-2 ** 10})
|
|
2938
|
+
|
|
2939
|
+
assert_parses(
|
|
2940
|
+
s(:send, s(:send, s(:float, 2.0), :**, s(:int, 10)), :-@),
|
|
2941
|
+
%q{-2.0 ** 10})
|
|
2942
|
+
end
|
|
2943
|
+
|
|
2944
|
+
def test_send_attr_asgn
|
|
2945
|
+
assert_parses(
|
|
2946
|
+
s(:send, s(:lvar, :foo), :a=, s(:int, 1)),
|
|
2947
|
+
%q{foo.a = 1},
|
|
2948
|
+
%q{ ~ selector
|
|
2949
|
+
| ^ dot
|
|
2950
|
+
| ^ operator
|
|
2951
|
+
|~~~~~~~~~ expression})
|
|
2952
|
+
|
|
2953
|
+
assert_parses(
|
|
2954
|
+
s(:send, s(:lvar, :foo), :a=, s(:int, 1)),
|
|
2955
|
+
%q{foo::a = 1},
|
|
2956
|
+
%q{ ~ selector
|
|
2957
|
+
| ^^ dot
|
|
2958
|
+
| ^ operator
|
|
2959
|
+
|~~~~~~~~~~ expression})
|
|
2960
|
+
|
|
2961
|
+
assert_parses(
|
|
2962
|
+
s(:send, s(:lvar, :foo), :A=, s(:int, 1)),
|
|
2963
|
+
%q{foo.A = 1},
|
|
2964
|
+
%q{ ~ selector
|
|
2965
|
+
| ^ dot
|
|
2966
|
+
| ^ operator
|
|
2967
|
+
|~~~~~~~~~ expression})
|
|
2968
|
+
|
|
2969
|
+
assert_parses(
|
|
2970
|
+
s(:casgn, s(:lvar, :foo), :A, s(:int, 1)),
|
|
2971
|
+
%q{foo::A = 1},
|
|
2972
|
+
%q{ ~ name
|
|
2973
|
+
| ^^ double_colon
|
|
2974
|
+
| ^ operator
|
|
2975
|
+
|~~~~~~~~~~ expression})
|
|
2976
|
+
end
|
|
2977
|
+
|
|
2978
|
+
def test_send_index
|
|
2979
|
+
assert_parses(
|
|
2980
|
+
s(:send, s(:lvar, :foo), :[],
|
|
2981
|
+
s(:int, 1), s(:int, 2)),
|
|
2982
|
+
%q{foo[1, 2]},
|
|
2983
|
+
%q{ ~~~~~~ selector
|
|
2984
|
+
|~~~~~~~~~ expression})
|
|
2985
|
+
end
|
|
2986
|
+
|
|
2987
|
+
def test_send_index_cmd
|
|
2988
|
+
assert_parses(
|
|
2989
|
+
s(:send, s(:lvar, :foo), :[],
|
|
2990
|
+
s(:send, nil, :m, s(:lvar, :bar))),
|
|
2991
|
+
%q{foo[m bar]})
|
|
2992
|
+
end
|
|
2993
|
+
|
|
2994
|
+
def test_send_index_asgn
|
|
2995
|
+
assert_parses(
|
|
2996
|
+
s(:send, s(:lvar, :foo), :[]=,
|
|
2997
|
+
s(:int, 1), s(:int, 2), s(:int, 3)),
|
|
2998
|
+
%q{foo[1, 2] = 3},
|
|
2999
|
+
%q{ ~~~~~~ selector
|
|
3000
|
+
| ^ operator
|
|
3001
|
+
|~~~~~~~~~~~~~ expression})
|
|
3002
|
+
end
|
|
3003
|
+
|
|
3004
|
+
def test_send_lambda
|
|
3005
|
+
assert_parses(
|
|
3006
|
+
s(:block, s(:send, nil, :lambda),
|
|
3007
|
+
s(:args), nil),
|
|
3008
|
+
%q{->{ }},
|
|
3009
|
+
%q{~~ selector (send)
|
|
3010
|
+
| ^ begin
|
|
3011
|
+
| ^ end
|
|
3012
|
+
|~~~~~ expression},
|
|
3013
|
+
ALL_VERSIONS - %w(1.8))
|
|
3014
|
+
|
|
3015
|
+
assert_parses(
|
|
3016
|
+
s(:block, s(:send, nil, :lambda),
|
|
3017
|
+
s(:args, s(:restarg)), nil),
|
|
3018
|
+
%q{-> * { }},
|
|
3019
|
+
%q{~~ selector (send)
|
|
3020
|
+
| ^ begin
|
|
3021
|
+
| ^ end
|
|
3022
|
+
| ^ expression (args.restarg)
|
|
3023
|
+
|~~~~~~~~ expression},
|
|
3024
|
+
ALL_VERSIONS - %w(1.8))
|
|
3025
|
+
|
|
3026
|
+
assert_parses(
|
|
3027
|
+
s(:block, s(:send, nil, :lambda),
|
|
3028
|
+
s(:args), nil),
|
|
3029
|
+
%q{-> do end},
|
|
3030
|
+
%q{~~ selector (send)
|
|
3031
|
+
| ^^ begin
|
|
3032
|
+
| ^^^ end
|
|
3033
|
+
|~~~~~~~~~ expression},
|
|
3034
|
+
ALL_VERSIONS - %w(1.8))
|
|
3035
|
+
end
|
|
3036
|
+
|
|
3037
|
+
def test_send_lambda_args
|
|
3038
|
+
assert_parses(
|
|
3039
|
+
s(:block, s(:send, nil, :lambda),
|
|
3040
|
+
s(:args,
|
|
3041
|
+
s(:arg, :a)),
|
|
3042
|
+
nil),
|
|
3043
|
+
%q{->(a) { }},
|
|
3044
|
+
%q{~~ selector (send)
|
|
3045
|
+
| ^ begin (args)
|
|
3046
|
+
| ^ end (args)
|
|
3047
|
+
| ^ begin
|
|
3048
|
+
| ^ end
|
|
3049
|
+
|~~~~~~~~~ expression},
|
|
3050
|
+
ALL_VERSIONS - %w(1.8))
|
|
3051
|
+
|
|
3052
|
+
assert_parses(
|
|
3053
|
+
s(:block, s(:send, nil, :lambda),
|
|
3054
|
+
s(:args,
|
|
3055
|
+
s(:arg, :a)),
|
|
3056
|
+
nil),
|
|
3057
|
+
%q{-> (a) { }},
|
|
3058
|
+
%q{},
|
|
3059
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
3060
|
+
end
|
|
3061
|
+
|
|
3062
|
+
def test_send_lambda_args_shadow
|
|
3063
|
+
assert_parses(
|
|
3064
|
+
s(:block, s(:send, nil, :lambda),
|
|
3065
|
+
s(:args,
|
|
3066
|
+
s(:arg, :a),
|
|
3067
|
+
s(:shadowarg, :foo),
|
|
3068
|
+
s(:shadowarg, :bar)),
|
|
3069
|
+
nil),
|
|
3070
|
+
%q{->(a; foo, bar) { }},
|
|
3071
|
+
%q{ ~~~ expression (args.shadowarg)},
|
|
3072
|
+
ALL_VERSIONS - %w(1.8))
|
|
3073
|
+
end
|
|
3074
|
+
|
|
3075
|
+
def test_send_call
|
|
3076
|
+
assert_parses(
|
|
3077
|
+
s(:send, s(:lvar, :foo), :call,
|
|
3078
|
+
s(:int, 1)),
|
|
3079
|
+
%q{foo.(1)},
|
|
3080
|
+
%q{ ^ begin
|
|
3081
|
+
| ^ end
|
|
3082
|
+
| ^ dot
|
|
3083
|
+
|~~~~~~~ expression},
|
|
3084
|
+
ALL_VERSIONS - %w(1.8))
|
|
3085
|
+
|
|
3086
|
+
assert_parses(
|
|
3087
|
+
s(:send, s(:lvar, :foo), :call,
|
|
3088
|
+
s(:int, 1)),
|
|
3089
|
+
%q{foo::(1)},
|
|
3090
|
+
%q{ ^ begin
|
|
3091
|
+
| ^ end
|
|
3092
|
+
| ^^ dot
|
|
3093
|
+
|~~~~~~~~ expression},
|
|
3094
|
+
ALL_VERSIONS - %w(1.8))
|
|
3095
|
+
end
|
|
3096
|
+
|
|
3097
|
+
def test_lvar_injecting_match
|
|
3098
|
+
assert_parses(
|
|
3099
|
+
s(:begin,
|
|
3100
|
+
s(:match_with_lvasgn,
|
|
3101
|
+
s(:regexp,
|
|
3102
|
+
s(:str, '(?<match>bar)'),
|
|
3103
|
+
s(:regopt)),
|
|
3104
|
+
s(:str, 'bar')),
|
|
3105
|
+
s(:lvar, :match)),
|
|
3106
|
+
%q{/(?<match>bar)/ =~ 'bar'; match},
|
|
3107
|
+
%q{ ~~ selector (match_with_lvasgn)
|
|
3108
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~ expression (match_with_lvasgn)},
|
|
3109
|
+
ALL_VERSIONS - %w(1.8))
|
|
3110
|
+
end
|
|
3111
|
+
|
|
3112
|
+
def test_non_lvar_injecting_match
|
|
3113
|
+
assert_parses(
|
|
3114
|
+
s(:send,
|
|
3115
|
+
s(:regexp,
|
|
3116
|
+
s(:begin, s(:str, '(?<match>bar)')),
|
|
3117
|
+
s(:regopt)),
|
|
3118
|
+
:=~,
|
|
3119
|
+
s(:str, 'bar')),
|
|
3120
|
+
%q{/#{'(?<match>bar)'}/ =~ 'bar'})
|
|
3121
|
+
end
|
|
3122
|
+
|
|
3123
|
+
# To superclass
|
|
3124
|
+
|
|
3125
|
+
def test_super
|
|
3126
|
+
assert_parses(
|
|
3127
|
+
s(:super, s(:lvar, :foo)),
|
|
3128
|
+
%q{super(foo)},
|
|
3129
|
+
%q{~~~~~ keyword
|
|
3130
|
+
| ^ begin
|
|
3131
|
+
| ^ end
|
|
3132
|
+
|~~~~~~~~~~ expression})
|
|
3133
|
+
|
|
3134
|
+
assert_parses(
|
|
3135
|
+
s(:super, s(:lvar, :foo)),
|
|
3136
|
+
%q{super foo},
|
|
3137
|
+
%q{~~~~~ keyword
|
|
3138
|
+
|~~~~~~~~~ expression})
|
|
3139
|
+
|
|
3140
|
+
assert_parses(
|
|
3141
|
+
s(:super),
|
|
3142
|
+
%q{super()},
|
|
3143
|
+
%q{~~~~~ keyword
|
|
3144
|
+
| ^ begin
|
|
3145
|
+
| ^ end
|
|
3146
|
+
|~~~~~~~ expression})
|
|
3147
|
+
end
|
|
3148
|
+
|
|
3149
|
+
def test_zsuper
|
|
3150
|
+
assert_parses(
|
|
3151
|
+
s(:zsuper),
|
|
3152
|
+
%q{super},
|
|
3153
|
+
%q{~~~~~ keyword
|
|
3154
|
+
|~~~~~ expression})
|
|
3155
|
+
end
|
|
3156
|
+
|
|
3157
|
+
def test_super_block
|
|
3158
|
+
assert_parses(
|
|
3159
|
+
s(:block,
|
|
3160
|
+
s(:super, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3161
|
+
s(:args), nil),
|
|
3162
|
+
%q{super foo, bar do end})
|
|
3163
|
+
|
|
3164
|
+
assert_parses(
|
|
3165
|
+
s(:block,
|
|
3166
|
+
s(:zsuper),
|
|
3167
|
+
s(:args), nil),
|
|
3168
|
+
%q{super do end})
|
|
3169
|
+
end
|
|
3170
|
+
|
|
3171
|
+
# To block argument
|
|
3172
|
+
|
|
3173
|
+
def test_yield
|
|
3174
|
+
assert_parses(
|
|
3175
|
+
s(:yield, s(:lvar, :foo)),
|
|
3176
|
+
%q{yield(foo)},
|
|
3177
|
+
%q{~~~~~ keyword
|
|
3178
|
+
| ^ begin
|
|
3179
|
+
| ^ end
|
|
3180
|
+
|~~~~~~~~~~ expression})
|
|
3181
|
+
|
|
3182
|
+
assert_parses(
|
|
3183
|
+
s(:yield, s(:lvar, :foo)),
|
|
3184
|
+
%q{yield foo},
|
|
3185
|
+
%q{~~~~~ keyword
|
|
3186
|
+
|~~~~~~~~~ expression})
|
|
3187
|
+
|
|
3188
|
+
assert_parses(
|
|
3189
|
+
s(:yield),
|
|
3190
|
+
%q{yield()},
|
|
3191
|
+
%q{~~~~~ keyword
|
|
3192
|
+
| ^ begin
|
|
3193
|
+
| ^ end
|
|
3194
|
+
|~~~~~~~ expression})
|
|
3195
|
+
|
|
3196
|
+
assert_parses(
|
|
3197
|
+
s(:yield),
|
|
3198
|
+
%q{yield},
|
|
3199
|
+
%q{~~~~~ keyword
|
|
3200
|
+
|~~~~~ expression})
|
|
3201
|
+
end
|
|
3202
|
+
|
|
3203
|
+
def test_yield_block
|
|
3204
|
+
assert_diagnoses(
|
|
3205
|
+
[:error, :block_given_to_yield],
|
|
3206
|
+
%q{yield foo do end},
|
|
3207
|
+
%q{~~~~~ location
|
|
3208
|
+
| ~~ highlights (0)})
|
|
3209
|
+
|
|
3210
|
+
assert_diagnoses(
|
|
3211
|
+
[:error, :block_given_to_yield],
|
|
3212
|
+
%q{yield(&foo)},
|
|
3213
|
+
%q{~~~~~ location
|
|
3214
|
+
| ~~~~ highlights (0)})
|
|
3215
|
+
end
|
|
3216
|
+
|
|
3217
|
+
# Call arguments
|
|
3218
|
+
|
|
3219
|
+
def test_args_cmd
|
|
3220
|
+
assert_parses(
|
|
3221
|
+
s(:send, nil, :fun,
|
|
3222
|
+
s(:send, nil, :f, s(:lvar, :bar))),
|
|
3223
|
+
%q{fun(f bar)})
|
|
3224
|
+
end
|
|
3225
|
+
|
|
3226
|
+
def test_args_args_star
|
|
3227
|
+
assert_parses(
|
|
3228
|
+
s(:send, nil, :fun,
|
|
3229
|
+
s(:lvar, :foo), s(:splat, s(:lvar, :bar))),
|
|
3230
|
+
%q{fun(foo, *bar)})
|
|
3231
|
+
|
|
3232
|
+
assert_parses(
|
|
3233
|
+
s(:send, nil, :fun,
|
|
3234
|
+
s(:lvar, :foo), s(:splat, s(:lvar, :bar)),
|
|
3235
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3236
|
+
%q{fun(foo, *bar, &baz)})
|
|
3237
|
+
end
|
|
3238
|
+
|
|
3239
|
+
def test_args_star
|
|
3240
|
+
assert_parses(
|
|
3241
|
+
s(:send, nil, :fun,
|
|
3242
|
+
s(:splat, s(:lvar, :bar))),
|
|
3243
|
+
%q{fun(*bar)})
|
|
3244
|
+
|
|
3245
|
+
assert_parses(
|
|
3246
|
+
s(:send, nil, :fun,
|
|
3247
|
+
s(:splat, s(:lvar, :bar)),
|
|
3248
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3249
|
+
%q{fun(*bar, &baz)})
|
|
3250
|
+
end
|
|
3251
|
+
|
|
3252
|
+
def test_args_block_pass
|
|
3253
|
+
assert_parses(
|
|
3254
|
+
s(:send, nil, :fun,
|
|
3255
|
+
s(:block_pass, s(:lvar, :bar))),
|
|
3256
|
+
%q{fun(&bar)})
|
|
3257
|
+
end
|
|
3258
|
+
|
|
3259
|
+
def test_args_args_comma
|
|
3260
|
+
assert_parses(
|
|
3261
|
+
s(:send, s(:lvar, :foo), :[],
|
|
3262
|
+
s(:lvar, :bar)),
|
|
3263
|
+
%q{foo[bar,]},
|
|
3264
|
+
%q{},
|
|
3265
|
+
ALL_VERSIONS - %w(1.8))
|
|
3266
|
+
end
|
|
3267
|
+
|
|
3268
|
+
def test_args_assocs
|
|
3269
|
+
assert_parses(
|
|
3270
|
+
s(:send, nil, :fun,
|
|
3271
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1)))),
|
|
3272
|
+
%q{fun(:foo => 1)})
|
|
3273
|
+
|
|
3274
|
+
assert_parses(
|
|
3275
|
+
s(:send, nil, :fun,
|
|
3276
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3277
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3278
|
+
%q{fun(:foo => 1, &baz)})
|
|
3279
|
+
end
|
|
3280
|
+
|
|
3281
|
+
def test_args_assocs_star
|
|
3282
|
+
assert_parses(
|
|
3283
|
+
s(:send, nil, :fun,
|
|
3284
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3285
|
+
s(:splat, s(:lvar, :bar))),
|
|
3286
|
+
%q{fun(:foo => 1, *bar)},
|
|
3287
|
+
%q{},
|
|
3288
|
+
%w(1.8))
|
|
3289
|
+
|
|
3290
|
+
assert_parses(
|
|
3291
|
+
s(:send, nil, :fun,
|
|
3292
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3293
|
+
s(:splat, s(:lvar, :bar)),
|
|
3294
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3295
|
+
%q{fun(:foo => 1, *bar, &baz)},
|
|
3296
|
+
%q{},
|
|
3297
|
+
%w(1.8))
|
|
3298
|
+
end
|
|
3299
|
+
|
|
3300
|
+
def test_args_assocs_comma
|
|
3301
|
+
assert_parses(
|
|
3302
|
+
s(:send, s(:lvar, :foo), :[],
|
|
3303
|
+
s(:hash, s(:pair, s(:sym, :baz), s(:int, 1)))),
|
|
3304
|
+
%q{foo[:baz => 1,]},
|
|
3305
|
+
%q{},
|
|
3306
|
+
ALL_VERSIONS - %w(1.8))
|
|
3307
|
+
end
|
|
3308
|
+
|
|
3309
|
+
def test_args_args_assocs
|
|
3310
|
+
assert_parses(
|
|
3311
|
+
s(:send, nil, :fun,
|
|
3312
|
+
s(:lvar, :foo),
|
|
3313
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1)))),
|
|
3314
|
+
%q{fun(foo, :foo => 1)})
|
|
3315
|
+
|
|
3316
|
+
assert_parses(
|
|
3317
|
+
s(:send, nil, :fun,
|
|
3318
|
+
s(:lvar, :foo),
|
|
3319
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3320
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3321
|
+
%q{fun(foo, :foo => 1, &baz)})
|
|
3322
|
+
end
|
|
3323
|
+
|
|
3324
|
+
def test_args_args_assocs_comma
|
|
3325
|
+
assert_parses(
|
|
3326
|
+
s(:send, s(:lvar, :foo), :[],
|
|
3327
|
+
s(:lvar, :bar),
|
|
3328
|
+
s(:hash, s(:pair, s(:sym, :baz), s(:int, 1)))),
|
|
3329
|
+
%q{foo[bar, :baz => 1,]},
|
|
3330
|
+
%q{},
|
|
3331
|
+
ALL_VERSIONS - %w(1.8))
|
|
3332
|
+
end
|
|
3333
|
+
|
|
3334
|
+
def test_args_args_assocs_star
|
|
3335
|
+
assert_parses(
|
|
3336
|
+
s(:send, nil, :fun,
|
|
3337
|
+
s(:lvar, :foo),
|
|
3338
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3339
|
+
s(:splat, s(:lvar, :bar))),
|
|
3340
|
+
%q{fun(foo, :foo => 1, *bar)},
|
|
3341
|
+
%q{},
|
|
3342
|
+
%w(1.8))
|
|
3343
|
+
|
|
3344
|
+
assert_parses(
|
|
3345
|
+
s(:send, nil, :fun,
|
|
3346
|
+
s(:lvar, :foo),
|
|
3347
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3348
|
+
s(:splat, s(:lvar, :bar)),
|
|
3349
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3350
|
+
%q{fun(foo, :foo => 1, *bar, &baz)},
|
|
3351
|
+
%q{},
|
|
3352
|
+
%w(1.8))
|
|
3353
|
+
end
|
|
3354
|
+
|
|
3355
|
+
# Call arguments with whitespace
|
|
3356
|
+
|
|
3357
|
+
def test_space_args_cmd
|
|
3358
|
+
assert_parses(
|
|
3359
|
+
s(:send, nil, :fun,
|
|
3360
|
+
s(:begin, s(:send, nil, :f, s(:lvar, :bar)))),
|
|
3361
|
+
%q{fun (f bar)})
|
|
3362
|
+
end
|
|
3363
|
+
|
|
3364
|
+
def test_space_args_arg
|
|
3365
|
+
assert_parses(
|
|
3366
|
+
s(:send, nil, :fun, s(:begin, s(:int, 1))),
|
|
3367
|
+
%q{fun (1)})
|
|
3368
|
+
end
|
|
3369
|
+
|
|
3370
|
+
def test_space_args_arg_block
|
|
3371
|
+
assert_parses(
|
|
3372
|
+
s(:block,
|
|
3373
|
+
s(:send, nil, :fun, s(:begin, s(:int, 1))),
|
|
3374
|
+
s(:args), nil),
|
|
3375
|
+
%q{fun (1) {}})
|
|
3376
|
+
|
|
3377
|
+
assert_parses(
|
|
3378
|
+
s(:block,
|
|
3379
|
+
s(:send, s(:lvar, :foo), :fun, s(:int, 1)),
|
|
3380
|
+
s(:args), nil),
|
|
3381
|
+
%q{foo.fun (1) {}},
|
|
3382
|
+
%q{},
|
|
3383
|
+
%w(1.8))
|
|
3384
|
+
|
|
3385
|
+
assert_parses(
|
|
3386
|
+
s(:block,
|
|
3387
|
+
s(:send, s(:lvar, :foo), :fun, s(:begin, s(:int, 1))),
|
|
3388
|
+
s(:args), nil),
|
|
3389
|
+
%q{foo.fun (1) {}},
|
|
3390
|
+
%q{},
|
|
3391
|
+
ALL_VERSIONS - %w(1.8))
|
|
3392
|
+
|
|
3393
|
+
assert_parses(
|
|
3394
|
+
s(:block,
|
|
3395
|
+
s(:send, s(:lvar, :foo), :fun, s(:int, 1)),
|
|
3396
|
+
s(:args), nil),
|
|
3397
|
+
%q{foo::fun (1) {}},
|
|
3398
|
+
%q{},
|
|
3399
|
+
%w(1.8))
|
|
3400
|
+
|
|
3401
|
+
assert_parses(
|
|
3402
|
+
s(:block,
|
|
3403
|
+
s(:send, s(:lvar, :foo), :fun, s(:begin, s(:int, 1))),
|
|
3404
|
+
s(:args), nil),
|
|
3405
|
+
%q{foo::fun (1) {}},
|
|
3406
|
+
%q{},
|
|
3407
|
+
ALL_VERSIONS - %w(1.8))
|
|
3408
|
+
end
|
|
3409
|
+
|
|
3410
|
+
def test_space_args_arg_call
|
|
3411
|
+
assert_parses(
|
|
3412
|
+
s(:send, nil, :fun,
|
|
3413
|
+
s(:send, s(:begin, s(:int, 1)), :to_i)),
|
|
3414
|
+
%q{fun (1).to_i})
|
|
3415
|
+
end
|
|
3416
|
+
|
|
3417
|
+
def test_space_args_block_pass
|
|
3418
|
+
assert_parses(
|
|
3419
|
+
s(:send, nil, :fun,
|
|
3420
|
+
s(:block_pass, s(:lvar, :foo))),
|
|
3421
|
+
%q{fun (&foo)},
|
|
3422
|
+
%q{},
|
|
3423
|
+
%w(1.8))
|
|
3424
|
+
end
|
|
3425
|
+
|
|
3426
|
+
def test_space_args_arg_block_pass
|
|
3427
|
+
assert_parses(
|
|
3428
|
+
s(:send, nil, :fun,
|
|
3429
|
+
s(:lvar, :foo),
|
|
3430
|
+
s(:block_pass, s(:lvar, :bar))),
|
|
3431
|
+
%q{fun (foo, &bar)},
|
|
3432
|
+
%q{},
|
|
3433
|
+
%w(1.8))
|
|
3434
|
+
end
|
|
3435
|
+
|
|
3436
|
+
def test_space_args_args_star
|
|
3437
|
+
assert_parses(
|
|
3438
|
+
s(:send, nil, :fun,
|
|
3439
|
+
s(:lvar, :foo), s(:splat, s(:lvar, :bar))),
|
|
3440
|
+
%q{fun (foo, *bar)},
|
|
3441
|
+
%q{},
|
|
3442
|
+
%w(1.8))
|
|
3443
|
+
|
|
3444
|
+
assert_parses(
|
|
3445
|
+
s(:send, nil, :fun,
|
|
3446
|
+
s(:lvar, :foo), s(:splat, s(:lvar, :bar)),
|
|
3447
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3448
|
+
%q{fun (foo, *bar, &baz)},
|
|
3449
|
+
%q{},
|
|
3450
|
+
%w(1.8))
|
|
3451
|
+
|
|
3452
|
+
assert_parses(
|
|
3453
|
+
s(:send, nil, :fun,
|
|
3454
|
+
s(:lvar, :foo), s(:int, 1),
|
|
3455
|
+
s(:splat, s(:lvar, :bar))),
|
|
3456
|
+
%q{fun (foo, 1, *bar)},
|
|
3457
|
+
%q{},
|
|
3458
|
+
%w(1.8))
|
|
3459
|
+
|
|
3460
|
+
assert_parses(
|
|
3461
|
+
s(:send, nil, :fun,
|
|
3462
|
+
s(:lvar, :foo), s(:int, 1),
|
|
3463
|
+
s(:splat, s(:lvar, :bar)),
|
|
3464
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3465
|
+
%q{fun (foo, 1, *bar, &baz)},
|
|
3466
|
+
%q{},
|
|
3467
|
+
%w(1.8))
|
|
3468
|
+
end
|
|
3469
|
+
|
|
3470
|
+
def test_space_args_star
|
|
3471
|
+
assert_parses(
|
|
3472
|
+
s(:send, nil, :fun,
|
|
3473
|
+
s(:splat, s(:lvar, :bar))),
|
|
3474
|
+
%q{fun (*bar)},
|
|
3475
|
+
%q{},
|
|
3476
|
+
%w(1.8))
|
|
3477
|
+
|
|
3478
|
+
assert_parses(
|
|
3479
|
+
s(:send, nil, :fun,
|
|
3480
|
+
s(:splat, s(:lvar, :bar)),
|
|
3481
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3482
|
+
%q{fun (*bar, &baz)},
|
|
3483
|
+
%q{},
|
|
3484
|
+
%w(1.8))
|
|
3485
|
+
end
|
|
3486
|
+
|
|
3487
|
+
def test_space_args_assocs
|
|
3488
|
+
assert_parses(
|
|
3489
|
+
s(:send, nil, :fun,
|
|
3490
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1)))),
|
|
3491
|
+
%q{fun (:foo => 1)},
|
|
3492
|
+
%q{},
|
|
3493
|
+
%w(1.8))
|
|
3494
|
+
|
|
3495
|
+
assert_parses(
|
|
3496
|
+
s(:send, nil, :fun,
|
|
3497
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3498
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3499
|
+
%q{fun (:foo => 1, &baz)},
|
|
3500
|
+
%q{},
|
|
3501
|
+
%w(1.8))
|
|
3502
|
+
end
|
|
3503
|
+
|
|
3504
|
+
def test_space_args_assocs_star
|
|
3505
|
+
assert_parses(
|
|
3506
|
+
s(:send, nil, :fun,
|
|
3507
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3508
|
+
s(:splat, s(:lvar, :bar))),
|
|
3509
|
+
%q{fun (:foo => 1, *bar)},
|
|
3510
|
+
%q{},
|
|
3511
|
+
%w(1.8))
|
|
3512
|
+
|
|
3513
|
+
assert_parses(
|
|
3514
|
+
s(:send, nil, :fun,
|
|
3515
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3516
|
+
s(:splat, s(:lvar, :bar)),
|
|
3517
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3518
|
+
%q{fun (:foo => 1, *bar, &baz)},
|
|
3519
|
+
%q{},
|
|
3520
|
+
%w(1.8))
|
|
3521
|
+
end
|
|
3522
|
+
|
|
3523
|
+
def test_space_args_args_assocs
|
|
3524
|
+
assert_parses(
|
|
3525
|
+
s(:send, nil, :fun,
|
|
3526
|
+
s(:lvar, :foo),
|
|
3527
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1)))),
|
|
3528
|
+
%q{fun (foo, :foo => 1)},
|
|
3529
|
+
%q{},
|
|
3530
|
+
%w(1.8))
|
|
3531
|
+
|
|
3532
|
+
assert_parses(
|
|
3533
|
+
s(:send, nil, :fun,
|
|
3534
|
+
s(:lvar, :foo),
|
|
3535
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3536
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3537
|
+
%q{fun (foo, :foo => 1, &baz)},
|
|
3538
|
+
%q{},
|
|
3539
|
+
%w(1.8))
|
|
3540
|
+
|
|
3541
|
+
assert_parses(
|
|
3542
|
+
s(:send, nil, :fun,
|
|
3543
|
+
s(:lvar, :foo), s(:int, 1),
|
|
3544
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1)))),
|
|
3545
|
+
%q{fun (foo, 1, :foo => 1)},
|
|
3546
|
+
%q{},
|
|
3547
|
+
%w(1.8))
|
|
3548
|
+
|
|
3549
|
+
assert_parses(
|
|
3550
|
+
s(:send, nil, :fun,
|
|
3551
|
+
s(:lvar, :foo), s(:int, 1),
|
|
3552
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3553
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3554
|
+
%q{fun (foo, 1, :foo => 1, &baz)},
|
|
3555
|
+
%q{},
|
|
3556
|
+
%w(1.8))
|
|
3557
|
+
end
|
|
3558
|
+
|
|
3559
|
+
def test_space_args_args_assocs_star
|
|
3560
|
+
assert_parses(
|
|
3561
|
+
s(:send, nil, :fun,
|
|
3562
|
+
s(:lvar, :foo),
|
|
3563
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3564
|
+
s(:splat, s(:lvar, :bar))),
|
|
3565
|
+
%q{fun (foo, :foo => 1, *bar)},
|
|
3566
|
+
%q{},
|
|
3567
|
+
%w(1.8))
|
|
3568
|
+
|
|
3569
|
+
assert_parses(
|
|
3570
|
+
s(:send, nil, :fun,
|
|
3571
|
+
s(:lvar, :foo),
|
|
3572
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3573
|
+
s(:splat, s(:lvar, :bar)),
|
|
3574
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3575
|
+
%q{fun (foo, :foo => 1, *bar, &baz)},
|
|
3576
|
+
%q{},
|
|
3577
|
+
%w(1.8))
|
|
3578
|
+
|
|
3579
|
+
assert_parses(
|
|
3580
|
+
s(:send, nil, :fun,
|
|
3581
|
+
s(:lvar, :foo), s(:int, 1),
|
|
3582
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3583
|
+
s(:splat, s(:lvar, :bar))),
|
|
3584
|
+
%q{fun (foo, 1, :foo => 1, *bar)},
|
|
3585
|
+
%q{},
|
|
3586
|
+
%w(1.8))
|
|
3587
|
+
|
|
3588
|
+
assert_parses(
|
|
3589
|
+
s(:send, nil, :fun,
|
|
3590
|
+
s(:lvar, :foo), s(:int, 1),
|
|
3591
|
+
s(:hash, s(:pair, s(:sym, :foo), s(:int, 1))),
|
|
3592
|
+
s(:splat, s(:lvar, :bar)),
|
|
3593
|
+
s(:block_pass, s(:lvar, :baz))),
|
|
3594
|
+
%q{fun (foo, 1, :foo => 1, *bar, &baz)},
|
|
3595
|
+
%q{},
|
|
3596
|
+
%w(1.8))
|
|
3597
|
+
end
|
|
3598
|
+
|
|
3599
|
+
def test_space_args_arg_arg
|
|
3600
|
+
assert_parses(
|
|
3601
|
+
s(:send, nil, :fun, s(:int, 1), s(:int, 2)),
|
|
3602
|
+
%q{fun (1, 2)},
|
|
3603
|
+
%q{},
|
|
3604
|
+
%w(1.8))
|
|
3605
|
+
end
|
|
3606
|
+
|
|
3607
|
+
def test_space_args_none
|
|
3608
|
+
assert_parses(
|
|
3609
|
+
s(:send, nil, :fun),
|
|
3610
|
+
%q{fun ()},
|
|
3611
|
+
%q{},
|
|
3612
|
+
%w(1.8))
|
|
3613
|
+
end
|
|
3614
|
+
|
|
3615
|
+
def test_space_args_block
|
|
3616
|
+
assert_parses(
|
|
3617
|
+
s(:block,
|
|
3618
|
+
s(:send, nil, :fun),
|
|
3619
|
+
s(:args), nil),
|
|
3620
|
+
%q{fun () {}},
|
|
3621
|
+
%q{ ^ begin (send)
|
|
3622
|
+
| ^ end (send)},
|
|
3623
|
+
%w(1.8))
|
|
3624
|
+
|
|
3625
|
+
assert_parses(
|
|
3626
|
+
s(:block,
|
|
3627
|
+
s(:send, s(:lvar, :foo), :fun),
|
|
3628
|
+
s(:args), nil),
|
|
3629
|
+
%q{foo.fun () {}},
|
|
3630
|
+
%q{ ^ begin (send)
|
|
3631
|
+
| ^ end (send)},
|
|
3632
|
+
%w(1.8))
|
|
3633
|
+
|
|
3634
|
+
assert_parses(
|
|
3635
|
+
s(:block,
|
|
3636
|
+
s(:send, s(:lvar, :foo), :fun),
|
|
3637
|
+
s(:args), nil),
|
|
3638
|
+
%q{foo::fun () {}},
|
|
3639
|
+
%q{ ^ begin (send)
|
|
3640
|
+
| ^ end (send)},
|
|
3641
|
+
%w(1.8))
|
|
3642
|
+
|
|
3643
|
+
assert_parses(
|
|
3644
|
+
s(:block,
|
|
3645
|
+
s(:send, nil, :fun,
|
|
3646
|
+
s(:begin)),
|
|
3647
|
+
s(:args), nil),
|
|
3648
|
+
%q{fun () {}},
|
|
3649
|
+
%q{ ~~ expression (send.begin)},
|
|
3650
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
3651
|
+
end
|
|
3652
|
+
|
|
3653
|
+
#
|
|
3654
|
+
# Control flow
|
|
3655
|
+
#
|
|
3656
|
+
|
|
3657
|
+
# Operators
|
|
3658
|
+
|
|
3659
|
+
def test_and
|
|
3660
|
+
assert_parses(
|
|
3661
|
+
s(:and, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3662
|
+
%q{foo and bar},
|
|
3663
|
+
%q{ ~~~ operator
|
|
3664
|
+
|~~~~~~~~~~~ expression})
|
|
3665
|
+
|
|
3666
|
+
assert_parses(
|
|
3667
|
+
s(:and, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3668
|
+
%q{foo && bar},
|
|
3669
|
+
%q{ ~~ operator
|
|
3670
|
+
|~~~~~~~~~~ expression})
|
|
3671
|
+
end
|
|
3672
|
+
|
|
3673
|
+
def test_or
|
|
3674
|
+
assert_parses(
|
|
3675
|
+
s(:or, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3676
|
+
%q{foo or bar},
|
|
3677
|
+
%q{ ~~ operator
|
|
3678
|
+
|~~~~~~~~~~ expression})
|
|
3679
|
+
|
|
3680
|
+
assert_parses(
|
|
3681
|
+
s(:or, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3682
|
+
%q{foo || bar},
|
|
3683
|
+
%q{ ~~ operator
|
|
3684
|
+
|~~~~~~~~~~ expression})
|
|
3685
|
+
end
|
|
3686
|
+
|
|
3687
|
+
def test_and_or_masgn
|
|
3688
|
+
assert_parses(
|
|
3689
|
+
s(:and,
|
|
3690
|
+
s(:lvar, :foo),
|
|
3691
|
+
s(:begin,
|
|
3692
|
+
s(:masgn,
|
|
3693
|
+
s(:mlhs, s(:lvasgn, :a), s(:lvasgn, :b)),
|
|
3694
|
+
s(:lvar, :bar)))),
|
|
3695
|
+
%q{foo && (a, b = bar)})
|
|
3696
|
+
|
|
3697
|
+
assert_parses(
|
|
3698
|
+
s(:or,
|
|
3699
|
+
s(:lvar, :foo),
|
|
3700
|
+
s(:begin,
|
|
3701
|
+
s(:masgn,
|
|
3702
|
+
s(:mlhs, s(:lvasgn, :a), s(:lvasgn, :b)),
|
|
3703
|
+
s(:lvar, :bar)))),
|
|
3704
|
+
%q{foo || (a, b = bar)})
|
|
3705
|
+
end
|
|
3706
|
+
|
|
3707
|
+
# Branching
|
|
3708
|
+
|
|
3709
|
+
def test_if
|
|
3710
|
+
assert_parses(
|
|
3711
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar), nil),
|
|
3712
|
+
%q{if foo then bar; end},
|
|
3713
|
+
%q{~~ keyword
|
|
3714
|
+
| ~~~~ begin
|
|
3715
|
+
| ~~~ end
|
|
3716
|
+
|~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3717
|
+
|
|
3718
|
+
assert_parses(
|
|
3719
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar), nil),
|
|
3720
|
+
%q{if foo; bar; end},
|
|
3721
|
+
%q{~~ keyword
|
|
3722
|
+
| ~~~ end
|
|
3723
|
+
|~~~~~~~~~~~~~~~~ expression})
|
|
3724
|
+
end
|
|
3725
|
+
|
|
3726
|
+
def test_if_nl_then
|
|
3727
|
+
assert_parses(
|
|
3728
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar), nil),
|
|
3729
|
+
%Q{if foo\nthen bar end},
|
|
3730
|
+
%q{ ~~~~ begin})
|
|
3731
|
+
end
|
|
3732
|
+
|
|
3733
|
+
def test_if_mod
|
|
3734
|
+
assert_parses(
|
|
3735
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar), nil),
|
|
3736
|
+
%q{bar if foo},
|
|
3737
|
+
%q{ ~~ keyword
|
|
3738
|
+
|~~~~~~~~~~ expression})
|
|
3739
|
+
end
|
|
3740
|
+
|
|
3741
|
+
def test_unless
|
|
3742
|
+
assert_parses(
|
|
3743
|
+
s(:if, s(:lvar, :foo), nil, s(:lvar, :bar)),
|
|
3744
|
+
%q{unless foo then bar; end},
|
|
3745
|
+
%q{~~~~~~ keyword
|
|
3746
|
+
| ~~~~ begin
|
|
3747
|
+
| ~~~ end
|
|
3748
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3749
|
+
|
|
3750
|
+
assert_parses(
|
|
3751
|
+
s(:if, s(:lvar, :foo), nil, s(:lvar, :bar)),
|
|
3752
|
+
%q{unless foo; bar; end},
|
|
3753
|
+
%q{~~~~~~ keyword
|
|
3754
|
+
| ~~~ end
|
|
3755
|
+
|~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3756
|
+
end
|
|
3757
|
+
|
|
3758
|
+
def test_unless_mod
|
|
3759
|
+
assert_parses(
|
|
3760
|
+
s(:if, s(:lvar, :foo), nil, s(:lvar, :bar)),
|
|
3761
|
+
%q{bar unless foo},
|
|
3762
|
+
%q{ ~~~~~~ keyword
|
|
3763
|
+
|~~~~~~~~~~~~~~ expression})
|
|
3764
|
+
end
|
|
3765
|
+
|
|
3766
|
+
def test_if_else
|
|
3767
|
+
assert_parses(
|
|
3768
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar), s(:lvar, :baz)),
|
|
3769
|
+
%q{if foo then bar; else baz; end},
|
|
3770
|
+
%q{~~ keyword
|
|
3771
|
+
| ~~~~ begin
|
|
3772
|
+
| ~~~~ else
|
|
3773
|
+
| ~~~ end
|
|
3774
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3775
|
+
|
|
3776
|
+
assert_parses(
|
|
3777
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar), s(:lvar, :baz)),
|
|
3778
|
+
%q{if foo; bar; else baz; end},
|
|
3779
|
+
%q{~~ keyword
|
|
3780
|
+
| ~~~~ else
|
|
3781
|
+
| ~~~ end
|
|
3782
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3783
|
+
end
|
|
3784
|
+
|
|
3785
|
+
def test_unless_else
|
|
3786
|
+
assert_parses(
|
|
3787
|
+
s(:if, s(:lvar, :foo), s(:lvar, :baz), s(:lvar, :bar)),
|
|
3788
|
+
%q{unless foo then bar; else baz; end},
|
|
3789
|
+
%q{~~~~~~ keyword
|
|
3790
|
+
| ~~~~ begin
|
|
3791
|
+
| ~~~~ else
|
|
3792
|
+
| ~~~ end
|
|
3793
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3794
|
+
|
|
3795
|
+
assert_parses(
|
|
3796
|
+
s(:if, s(:lvar, :foo), s(:lvar, :baz), s(:lvar, :bar)),
|
|
3797
|
+
%q{unless foo; bar; else baz; end},
|
|
3798
|
+
%q{~~~~~~ keyword
|
|
3799
|
+
| ~~~~ else
|
|
3800
|
+
| ~~~ end
|
|
3801
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3802
|
+
end
|
|
3803
|
+
|
|
3804
|
+
def test_if_elsif
|
|
3805
|
+
assert_parses(
|
|
3806
|
+
s(:if, s(:lvar, :foo), s(:lvar, :bar),
|
|
3807
|
+
s(:if, s(:lvar, :baz), s(:int, 1), s(:int, 2))),
|
|
3808
|
+
%q{if foo; bar; elsif baz; 1; else 2; end},
|
|
3809
|
+
%q{~~ keyword
|
|
3810
|
+
| ~~~~~ else
|
|
3811
|
+
| ~~~~~ keyword (if)
|
|
3812
|
+
| ~~~~ else (if)
|
|
3813
|
+
| ~~~ end
|
|
3814
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3815
|
+
end
|
|
3816
|
+
|
|
3817
|
+
def test_ternary
|
|
3818
|
+
assert_parses(
|
|
3819
|
+
s(:if, s(:lvar, :foo), s(:int, 1), s(:int, 2)),
|
|
3820
|
+
%q{foo ? 1 : 2},
|
|
3821
|
+
%q{ ^ question
|
|
3822
|
+
| ^ colon
|
|
3823
|
+
|~~~~~~~~~~~ expression})
|
|
3824
|
+
end
|
|
3825
|
+
|
|
3826
|
+
def test_ternary_ambiguous_symbol
|
|
3827
|
+
assert_parses(
|
|
3828
|
+
s(:begin,
|
|
3829
|
+
s(:lvasgn, :t, s(:int, 1)),
|
|
3830
|
+
s(:if, s(:begin, s(:lvar, :foo)),
|
|
3831
|
+
s(:lvar, :t),
|
|
3832
|
+
s(:const, nil, :T))),
|
|
3833
|
+
%q{t=1;(foo)?t:T},
|
|
3834
|
+
%q{},
|
|
3835
|
+
ALL_VERSIONS - %w(1.8))
|
|
3836
|
+
end
|
|
3837
|
+
|
|
3838
|
+
def test_if_masgn
|
|
3839
|
+
assert_diagnoses(
|
|
3840
|
+
[:error, :masgn_as_condition],
|
|
3841
|
+
%q{if (a, b = foo); end},
|
|
3842
|
+
%q{ ~~~~~~~~~~ location})
|
|
3843
|
+
end
|
|
3844
|
+
|
|
3845
|
+
def test_if_mod_masgn
|
|
3846
|
+
assert_diagnoses(
|
|
3847
|
+
[:error, :masgn_as_condition],
|
|
3848
|
+
%q{1 if (a, b = foo)},
|
|
3849
|
+
%q{ ~~~~~~~~~~ location})
|
|
3850
|
+
end
|
|
3851
|
+
|
|
3852
|
+
def test_tern_masgn
|
|
3853
|
+
assert_diagnoses(
|
|
3854
|
+
[:error, :masgn_as_condition],
|
|
3855
|
+
%q{(a, b = foo) ? 1 : 2},
|
|
3856
|
+
%q{ ~~~~~~~~~~ location})
|
|
3857
|
+
end
|
|
3858
|
+
|
|
3859
|
+
def test_cond_begin
|
|
3860
|
+
assert_parses(
|
|
3861
|
+
s(:if,
|
|
3862
|
+
s(:begin, s(:lvar, :bar)),
|
|
3863
|
+
s(:lvar, :foo),
|
|
3864
|
+
nil),
|
|
3865
|
+
%q{if (bar); foo; end})
|
|
3866
|
+
end
|
|
3867
|
+
|
|
3868
|
+
def test_cond_begin_masgn
|
|
3869
|
+
assert_parses(
|
|
3870
|
+
s(:if,
|
|
3871
|
+
s(:begin,
|
|
3872
|
+
s(:lvar, :bar),
|
|
3873
|
+
s(:masgn,
|
|
3874
|
+
s(:mlhs, s(:lvasgn, :a), s(:lvasgn, :b)),
|
|
3875
|
+
s(:lvar, :foo))),
|
|
3876
|
+
nil, nil),
|
|
3877
|
+
%q{if (bar; a, b = foo); end})
|
|
3878
|
+
end
|
|
3879
|
+
|
|
3880
|
+
def test_cond_begin_and_or_masgn
|
|
3881
|
+
assert_diagnoses(
|
|
3882
|
+
[:error, :masgn_as_condition],
|
|
3883
|
+
%q{if foo && (a, b = bar); end},
|
|
3884
|
+
%q{ ~~~~~~~~~~ location},
|
|
3885
|
+
ALL_VERSIONS - %w(1.8))
|
|
3886
|
+
|
|
3887
|
+
assert_diagnoses(
|
|
3888
|
+
[:error, :masgn_as_condition],
|
|
3889
|
+
%q{if foo || (a, b = bar); end},
|
|
3890
|
+
%q{ ~~~~~~~~~~ location},
|
|
3891
|
+
ALL_VERSIONS - %w(1.8))
|
|
3892
|
+
|
|
3893
|
+
assert_parses(
|
|
3894
|
+
s(:if,
|
|
3895
|
+
s(:and,
|
|
3896
|
+
s(:begin,
|
|
3897
|
+
s(:masgn,
|
|
3898
|
+
s(:mlhs,
|
|
3899
|
+
s(:lvasgn, :a), s(:lvasgn, :b)),
|
|
3900
|
+
s(:lvar, :foo))),
|
|
3901
|
+
s(:lvar, :bar)),
|
|
3902
|
+
nil, nil),
|
|
3903
|
+
%q{if (a, b = foo) && bar; end},
|
|
3904
|
+
%q{},
|
|
3905
|
+
%w(1.8))
|
|
3906
|
+
end
|
|
3907
|
+
|
|
3908
|
+
def test_cond_iflipflop
|
|
3909
|
+
assert_parses(
|
|
3910
|
+
s(:if, s(:iflipflop, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3911
|
+
nil, nil),
|
|
3912
|
+
%q{if foo..bar; end},
|
|
3913
|
+
%q{ ~~~~~~~~ expression (iflipflop)
|
|
3914
|
+
| ~~ operator (iflipflop)})
|
|
3915
|
+
end
|
|
3916
|
+
|
|
3917
|
+
def test_cond_eflipflop
|
|
3918
|
+
assert_parses(
|
|
3919
|
+
s(:if, s(:eflipflop, s(:lvar, :foo), s(:lvar, :bar)),
|
|
3920
|
+
nil, nil),
|
|
3921
|
+
%q{if foo...bar; end},
|
|
3922
|
+
%q{ ~~~~~~~~~ expression (eflipflop)
|
|
3923
|
+
| ~~~ operator (eflipflop)})
|
|
3924
|
+
end
|
|
3925
|
+
|
|
3926
|
+
def test_cond_match_current_line
|
|
3927
|
+
assert_parses(
|
|
3928
|
+
s(:if,
|
|
3929
|
+
s(:match_current_line,
|
|
3930
|
+
s(:regexp,
|
|
3931
|
+
s(:str, 'wat'),
|
|
3932
|
+
s(:regopt))),
|
|
3933
|
+
nil, nil),
|
|
3934
|
+
%q{if /wat/; end},
|
|
3935
|
+
%q{ ~~~~~ expression (match_current_line)})
|
|
3936
|
+
end
|
|
3937
|
+
|
|
3938
|
+
# Case matching
|
|
3939
|
+
|
|
3940
|
+
def test_case_expr
|
|
3941
|
+
assert_parses(
|
|
3942
|
+
s(:case, s(:lvar, :foo),
|
|
3943
|
+
s(:when, s(:str, 'bar'),
|
|
3944
|
+
s(:lvar, :bar)),
|
|
3945
|
+
nil),
|
|
3946
|
+
%q{case foo; when 'bar'; bar; end},
|
|
3947
|
+
%q{~~~~ keyword
|
|
3948
|
+
| ~~~~ keyword (when)
|
|
3949
|
+
| ~~~ end
|
|
3950
|
+
| ~~~~~~~~~~~~~~~ expression (when)
|
|
3951
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3952
|
+
end
|
|
3953
|
+
|
|
3954
|
+
def test_case_expr_else
|
|
3955
|
+
assert_parses(
|
|
3956
|
+
s(:case, s(:lvar, :foo),
|
|
3957
|
+
s(:when, s(:str, 'bar'),
|
|
3958
|
+
s(:lvar, :bar)),
|
|
3959
|
+
s(:lvar, :baz)),
|
|
3960
|
+
%q{case foo; when 'bar'; bar; else baz; end},
|
|
3961
|
+
%q{~~~~ keyword
|
|
3962
|
+
| ~~~~ keyword (when)
|
|
3963
|
+
| ~~~~ else
|
|
3964
|
+
| ~~~ end
|
|
3965
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3966
|
+
end
|
|
3967
|
+
|
|
3968
|
+
def test_case_cond
|
|
3969
|
+
assert_parses(
|
|
3970
|
+
s(:case, nil,
|
|
3971
|
+
s(:when, s(:lvar, :foo),
|
|
3972
|
+
s(:str, 'foo')),
|
|
3973
|
+
nil),
|
|
3974
|
+
%q{case; when foo; 'foo'; end},
|
|
3975
|
+
%q{~~~~ keyword
|
|
3976
|
+
| ~~~~ keyword (when)
|
|
3977
|
+
| ~~~ end
|
|
3978
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3979
|
+
end
|
|
3980
|
+
|
|
3981
|
+
def test_case_cond_else
|
|
3982
|
+
assert_parses(
|
|
3983
|
+
s(:case, nil,
|
|
3984
|
+
s(:when, s(:lvar, :foo),
|
|
3985
|
+
s(:str, 'foo')),
|
|
3986
|
+
s(:str, 'bar')),
|
|
3987
|
+
%q{case; when foo; 'foo'; else 'bar'; end},
|
|
3988
|
+
%q{~~~~ keyword
|
|
3989
|
+
| ~~~~ keyword (when)
|
|
3990
|
+
| ~~~~ else
|
|
3991
|
+
| ~~~ end
|
|
3992
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
3993
|
+
end
|
|
3994
|
+
|
|
3995
|
+
def test_case_cond_just_else
|
|
3996
|
+
assert_parses(
|
|
3997
|
+
s(:case, nil,
|
|
3998
|
+
s(:str, 'bar')),
|
|
3999
|
+
%q{case; else 'bar'; end},
|
|
4000
|
+
%q{~~~~ keyword
|
|
4001
|
+
| ~~~~ else
|
|
4002
|
+
| ~~~ end
|
|
4003
|
+
|~~~~~~~~~~~~~~~~~~~~~ expression},
|
|
4004
|
+
%w(1.8))
|
|
4005
|
+
end
|
|
4006
|
+
|
|
4007
|
+
def test_when_then
|
|
4008
|
+
assert_parses(
|
|
4009
|
+
s(:case, s(:lvar, :foo),
|
|
4010
|
+
s(:when, s(:str, 'bar'),
|
|
4011
|
+
s(:lvar, :bar)),
|
|
4012
|
+
nil),
|
|
4013
|
+
%q{case foo; when 'bar' then bar; end},
|
|
4014
|
+
%q{ ~~~~ keyword (when)
|
|
4015
|
+
| ~~~~ begin (when)
|
|
4016
|
+
| ~~~~~~~~~~~~~~~~~~~ expression (when)})
|
|
4017
|
+
end
|
|
4018
|
+
|
|
4019
|
+
def test_when_multi
|
|
4020
|
+
assert_parses(
|
|
4021
|
+
s(:case, s(:lvar, :foo),
|
|
4022
|
+
s(:when, s(:str, 'bar'), s(:str, 'baz'),
|
|
4023
|
+
s(:lvar, :bar)),
|
|
4024
|
+
nil),
|
|
4025
|
+
%q{case foo; when 'bar', 'baz'; bar; end})
|
|
4026
|
+
end
|
|
4027
|
+
|
|
4028
|
+
def test_when_splat
|
|
4029
|
+
assert_parses(
|
|
4030
|
+
s(:case, s(:lvar, :foo),
|
|
4031
|
+
s(:when,
|
|
4032
|
+
s(:int, 1),
|
|
4033
|
+
s(:splat, s(:lvar, :baz)),
|
|
4034
|
+
s(:lvar, :bar)),
|
|
4035
|
+
s(:when,
|
|
4036
|
+
s(:splat, s(:lvar, :foo)),
|
|
4037
|
+
nil),
|
|
4038
|
+
nil),
|
|
4039
|
+
%q{case foo; when 1, *baz; bar; when *foo; end},
|
|
4040
|
+
%q{ ^ operator (when/1.splat)
|
|
4041
|
+
| ~~~~ expression (when/1.splat)
|
|
4042
|
+
| ^ operator (when/2.splat)
|
|
4043
|
+
| ~~~~ expression (when/2.splat)})
|
|
4044
|
+
end
|
|
4045
|
+
|
|
4046
|
+
# Looping
|
|
4047
|
+
|
|
4048
|
+
def test_while
|
|
4049
|
+
assert_parses(
|
|
4050
|
+
s(:while, s(:lvar, :foo), s(:send, nil, :meth)),
|
|
4051
|
+
%q{while foo do meth end},
|
|
4052
|
+
%q{~~~~~ keyword
|
|
4053
|
+
| ~~ begin
|
|
4054
|
+
| ~~~ end
|
|
4055
|
+
|~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
4056
|
+
|
|
4057
|
+
assert_parses(
|
|
4058
|
+
s(:while, s(:lvar, :foo), s(:send, nil, :meth)),
|
|
4059
|
+
%q{while foo; meth end},
|
|
4060
|
+
%q{~~~~~ keyword
|
|
4061
|
+
| ~~~ end
|
|
4062
|
+
|~~~~~~~~~~~~~~~~~~~ expression})
|
|
4063
|
+
end
|
|
4064
|
+
|
|
4065
|
+
def test_while_mod
|
|
4066
|
+
assert_parses(
|
|
4067
|
+
s(:while, s(:lvar, :foo), s(:send, nil, :meth)),
|
|
4068
|
+
%q{meth while foo},
|
|
4069
|
+
%q{ ~~~~~ keyword})
|
|
4070
|
+
end
|
|
4071
|
+
|
|
4072
|
+
def test_until
|
|
4073
|
+
assert_parses(
|
|
4074
|
+
s(:until, s(:lvar, :foo), s(:send, nil, :meth)),
|
|
4075
|
+
%q{until foo do meth end},
|
|
4076
|
+
%q{~~~~~ keyword
|
|
4077
|
+
| ~~ begin
|
|
4078
|
+
| ~~~ end})
|
|
4079
|
+
|
|
4080
|
+
assert_parses(
|
|
4081
|
+
s(:until, s(:lvar, :foo), s(:send, nil, :meth)),
|
|
4082
|
+
%q{until foo; meth end},
|
|
4083
|
+
%q{~~~~~ keyword
|
|
4084
|
+
| ~~~ end})
|
|
4085
|
+
end
|
|
4086
|
+
|
|
4087
|
+
def test_until_mod
|
|
4088
|
+
assert_parses(
|
|
4089
|
+
s(:until, s(:lvar, :foo), s(:send, nil, :meth)),
|
|
4090
|
+
%q{meth until foo},
|
|
4091
|
+
%q{ ~~~~~ keyword})
|
|
4092
|
+
end
|
|
4093
|
+
|
|
4094
|
+
def test_while_post
|
|
4095
|
+
assert_parses(
|
|
4096
|
+
s(:while_post, s(:lvar, :foo),
|
|
4097
|
+
s(:kwbegin, s(:send, nil, :meth))),
|
|
4098
|
+
%q{begin meth end while foo},
|
|
4099
|
+
%q{ ~~~~~ keyword})
|
|
4100
|
+
end
|
|
4101
|
+
|
|
4102
|
+
def test_until_post
|
|
4103
|
+
assert_parses(
|
|
4104
|
+
s(:until_post, s(:lvar, :foo),
|
|
4105
|
+
s(:kwbegin, s(:send, nil, :meth))),
|
|
4106
|
+
%q{begin meth end until foo},
|
|
4107
|
+
%q{ ~~~~~ keyword})
|
|
4108
|
+
end
|
|
4109
|
+
|
|
4110
|
+
def test_while_masgn
|
|
4111
|
+
assert_diagnoses(
|
|
4112
|
+
[:error, :masgn_as_condition],
|
|
4113
|
+
%q{while (a, b = foo); end},
|
|
4114
|
+
%q{ ~~~~~~~~~~ location})
|
|
4115
|
+
end
|
|
4116
|
+
|
|
4117
|
+
def test_while_mod_masgn
|
|
4118
|
+
assert_diagnoses(
|
|
4119
|
+
[:error, :masgn_as_condition],
|
|
4120
|
+
%q{foo while (a, b = foo)},
|
|
4121
|
+
%q{ ~~~~~~~~~~ location})
|
|
4122
|
+
end
|
|
4123
|
+
|
|
4124
|
+
def test_for
|
|
4125
|
+
assert_parses(
|
|
4126
|
+
s(:for,
|
|
4127
|
+
s(:lvasgn, :a),
|
|
4128
|
+
s(:lvar, :foo),
|
|
4129
|
+
s(:send, nil, :p, s(:lvar, :a))),
|
|
4130
|
+
%q{for a in foo do p a; end},
|
|
4131
|
+
%q{~~~ keyword
|
|
4132
|
+
| ~~ in
|
|
4133
|
+
| ~~ begin
|
|
4134
|
+
| ~~~ end
|
|
4135
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
4136
|
+
|
|
4137
|
+
assert_parses(
|
|
4138
|
+
s(:for,
|
|
4139
|
+
s(:lvasgn, :a),
|
|
4140
|
+
s(:lvar, :foo),
|
|
4141
|
+
s(:send, nil, :p, s(:lvar, :a))),
|
|
4142
|
+
%q{for a in foo; p a; end})
|
|
4143
|
+
end
|
|
4144
|
+
|
|
4145
|
+
def test_for_mlhs
|
|
4146
|
+
assert_parses(
|
|
4147
|
+
s(:for,
|
|
4148
|
+
s(:mlhs,
|
|
4149
|
+
s(:lvasgn, :a),
|
|
4150
|
+
s(:lvasgn, :b)),
|
|
4151
|
+
s(:lvar, :foo),
|
|
4152
|
+
s(:send, nil, :p, s(:lvar, :a), s(:lvar, :b))),
|
|
4153
|
+
%q{for a, b in foo; p a, b; end},
|
|
4154
|
+
%q{ ~~~~ expression (mlhs)})
|
|
4155
|
+
end
|
|
4156
|
+
|
|
4157
|
+
# Control flow commands
|
|
4158
|
+
|
|
4159
|
+
def test_break
|
|
4160
|
+
assert_parses(
|
|
4161
|
+
s(:break, s(:begin, s(:lvar, :foo))),
|
|
4162
|
+
%q{break(foo)},
|
|
4163
|
+
%q{~~~~~ keyword
|
|
4164
|
+
|~~~~~~~~~~ expression},
|
|
4165
|
+
ALL_VERSIONS - %w(1.8))
|
|
4166
|
+
|
|
4167
|
+
assert_parses(
|
|
4168
|
+
s(:break, s(:begin, s(:lvar, :foo))),
|
|
4169
|
+
%q{break(foo)},
|
|
4170
|
+
%q{~~~~~ keyword
|
|
4171
|
+
|~~~~~~~~~~ expression},
|
|
4172
|
+
%w(1.8))
|
|
4173
|
+
|
|
4174
|
+
assert_parses(
|
|
4175
|
+
s(:break, s(:lvar, :foo)),
|
|
4176
|
+
%q{break foo},
|
|
4177
|
+
%q{~~~~~ keyword
|
|
4178
|
+
|~~~~~~~~~ expression})
|
|
4179
|
+
|
|
4180
|
+
assert_parses(
|
|
4181
|
+
s(:break, s(:begin)),
|
|
4182
|
+
%q{break()},
|
|
4183
|
+
%q{~~~~~ keyword
|
|
4184
|
+
|~~~~~~~ expression},
|
|
4185
|
+
ALL_VERSIONS - %w(1.8))
|
|
4186
|
+
|
|
4187
|
+
assert_parses(
|
|
4188
|
+
s(:break),
|
|
4189
|
+
%q{break},
|
|
4190
|
+
%q{~~~~~ keyword
|
|
4191
|
+
|~~~~~ expression})
|
|
4192
|
+
end
|
|
4193
|
+
|
|
4194
|
+
def test_break_block
|
|
4195
|
+
assert_parses(
|
|
4196
|
+
s(:break,
|
|
4197
|
+
s(:block,
|
|
4198
|
+
s(:send, nil, :fun, s(:lvar, :foo)),
|
|
4199
|
+
s(:args), nil)),
|
|
4200
|
+
%q{break fun foo do end},
|
|
4201
|
+
%q{ ~~~~~~~~~~~~~~ expression (block)
|
|
4202
|
+
|~~~~~~~~~~~~~~~~~~~~ expression},
|
|
4203
|
+
ALL_VERSIONS - %w(1.8))
|
|
4204
|
+
end
|
|
4205
|
+
|
|
4206
|
+
def test_return
|
|
4207
|
+
assert_parses(
|
|
4208
|
+
s(:return, s(:begin, s(:lvar, :foo))),
|
|
4209
|
+
%q{return(foo)},
|
|
4210
|
+
%q{~~~~~~ keyword
|
|
4211
|
+
|~~~~~~~~~~~ expression},
|
|
4212
|
+
ALL_VERSIONS - %w(1.8))
|
|
4213
|
+
|
|
4214
|
+
assert_parses(
|
|
4215
|
+
s(:return, s(:begin, s(:lvar, :foo))),
|
|
4216
|
+
%q{return(foo)},
|
|
4217
|
+
%q{~~~~~~ keyword
|
|
4218
|
+
|~~~~~~~~~~~ expression},
|
|
4219
|
+
%w(1.8))
|
|
4220
|
+
|
|
4221
|
+
assert_parses(
|
|
4222
|
+
s(:return, s(:lvar, :foo)),
|
|
4223
|
+
%q{return foo},
|
|
4224
|
+
%q{~~~~~~ keyword
|
|
4225
|
+
|~~~~~~~~~~ expression})
|
|
4226
|
+
|
|
4227
|
+
assert_parses(
|
|
4228
|
+
s(:return, s(:begin)),
|
|
4229
|
+
%q{return()},
|
|
4230
|
+
%q{~~~~~~ keyword
|
|
4231
|
+
|~~~~~~~~ expression},
|
|
4232
|
+
ALL_VERSIONS - %w(1.8))
|
|
4233
|
+
|
|
4234
|
+
assert_parses(
|
|
4235
|
+
s(:return),
|
|
4236
|
+
%q{return},
|
|
4237
|
+
%q{~~~~~~ keyword
|
|
4238
|
+
|~~~~~~ expression})
|
|
4239
|
+
end
|
|
4240
|
+
|
|
4241
|
+
def test_return_block
|
|
4242
|
+
assert_parses(
|
|
4243
|
+
s(:return,
|
|
4244
|
+
s(:block,
|
|
4245
|
+
s(:send, nil, :fun, s(:lvar, :foo)),
|
|
4246
|
+
s(:args), nil)),
|
|
4247
|
+
%q{return fun foo do end},
|
|
4248
|
+
%q{ ~~~~~~~~~~~~~~ expression (block)
|
|
4249
|
+
|~~~~~~~~~~~~~~~~~~~~~ expression},
|
|
4250
|
+
ALL_VERSIONS - %w(1.8))
|
|
4251
|
+
end
|
|
4252
|
+
|
|
4253
|
+
def test_next
|
|
4254
|
+
assert_parses(
|
|
4255
|
+
s(:next, s(:begin, s(:lvar, :foo))),
|
|
4256
|
+
%q{next(foo)},
|
|
4257
|
+
%q{~~~~ keyword
|
|
4258
|
+
|~~~~~~~~~ expression},
|
|
4259
|
+
ALL_VERSIONS - %w(1.8))
|
|
4260
|
+
|
|
4261
|
+
assert_parses(
|
|
4262
|
+
s(:next, s(:begin, s(:lvar, :foo))),
|
|
4263
|
+
%q{next(foo)},
|
|
4264
|
+
%q{~~~~ keyword
|
|
4265
|
+
|~~~~~~~~~ expression},
|
|
4266
|
+
%w(1.8))
|
|
4267
|
+
|
|
4268
|
+
assert_parses(
|
|
4269
|
+
s(:next, s(:lvar, :foo)),
|
|
4270
|
+
%q{next foo},
|
|
4271
|
+
%q{~~~~ keyword
|
|
4272
|
+
|~~~~~~~~ expression})
|
|
4273
|
+
|
|
4274
|
+
assert_parses(
|
|
4275
|
+
s(:next, s(:begin)),
|
|
4276
|
+
%q{next()},
|
|
4277
|
+
%q{~~~~ keyword
|
|
4278
|
+
|~~~~~~ expression},
|
|
4279
|
+
ALL_VERSIONS - %w(1.8))
|
|
4280
|
+
|
|
4281
|
+
assert_parses(
|
|
4282
|
+
s(:next),
|
|
4283
|
+
%q{next},
|
|
4284
|
+
%q{~~~~ keyword
|
|
4285
|
+
|~~~~ expression})
|
|
4286
|
+
end
|
|
4287
|
+
|
|
4288
|
+
def test_next_block
|
|
4289
|
+
assert_parses(
|
|
4290
|
+
s(:next,
|
|
4291
|
+
s(:block,
|
|
4292
|
+
s(:send, nil, :fun, s(:lvar, :foo)),
|
|
4293
|
+
s(:args), nil)),
|
|
4294
|
+
%q{next fun foo do end},
|
|
4295
|
+
%q{ ~~~~~~~~~~~~~~ expression (block)
|
|
4296
|
+
|~~~~~~~~~~~~~~~~~~~ expression},
|
|
4297
|
+
ALL_VERSIONS - %w(1.8))
|
|
4298
|
+
end
|
|
4299
|
+
|
|
4300
|
+
def test_redo
|
|
4301
|
+
assert_parses(
|
|
4302
|
+
s(:redo),
|
|
4303
|
+
%q{redo},
|
|
4304
|
+
%q{~~~~ keyword
|
|
4305
|
+
|~~~~ expression})
|
|
4306
|
+
end
|
|
4307
|
+
|
|
4308
|
+
# Exception handling
|
|
4309
|
+
|
|
4310
|
+
def test_rescue
|
|
4311
|
+
assert_parses(
|
|
4312
|
+
s(:kwbegin,
|
|
4313
|
+
s(:rescue, s(:send, nil, :meth),
|
|
4314
|
+
s(:resbody, nil, nil, s(:lvar, :foo)),
|
|
4315
|
+
nil)),
|
|
4316
|
+
%q{begin; meth; rescue; foo; end},
|
|
4317
|
+
%q{~~~~~ begin
|
|
4318
|
+
| ~~~~~~ keyword (rescue.resbody)
|
|
4319
|
+
| ~~~~~~~~~~~ expression (rescue.resbody)
|
|
4320
|
+
| ~~~~~~~~~~~~~~~~~ expression (rescue)
|
|
4321
|
+
| ~~~ end
|
|
4322
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
4323
|
+
end
|
|
4324
|
+
|
|
4325
|
+
def test_rescue_else
|
|
4326
|
+
assert_parses(
|
|
4327
|
+
s(:kwbegin,
|
|
4328
|
+
s(:rescue, s(:send, nil, :meth),
|
|
4329
|
+
s(:resbody, nil, nil, s(:lvar, :foo)),
|
|
4330
|
+
s(:lvar, :bar))),
|
|
4331
|
+
%q{begin; meth; rescue; foo; else; bar; end},
|
|
4332
|
+
%q{ ~~~~ else (rescue)
|
|
4333
|
+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression (rescue)})
|
|
4334
|
+
end
|
|
4335
|
+
|
|
4336
|
+
def test_rescue_else_useless
|
|
4337
|
+
assert_diagnoses(
|
|
4338
|
+
[:warning, :useless_else],
|
|
4339
|
+
%q{begin; 1; else; 2; end},
|
|
4340
|
+
%q{ ~~~~ location})
|
|
4341
|
+
end
|
|
4342
|
+
|
|
4343
|
+
def test_ensure
|
|
4344
|
+
assert_parses(
|
|
4345
|
+
s(:kwbegin,
|
|
4346
|
+
s(:ensure, s(:send, nil, :meth),
|
|
4347
|
+
s(:lvar, :bar))),
|
|
4348
|
+
%q{begin; meth; ensure; bar; end},
|
|
4349
|
+
%q{~~~~~ begin
|
|
4350
|
+
| ~~~~~~ keyword (ensure)
|
|
4351
|
+
| ~~~~~~~~~~~~~~~~~ expression (ensure)
|
|
4352
|
+
| ~~~ end
|
|
4353
|
+
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
4354
|
+
end
|
|
4355
|
+
|
|
4356
|
+
def test_ensure_empty
|
|
4357
|
+
assert_parses(
|
|
4358
|
+
s(:kwbegin,
|
|
4359
|
+
s(:ensure, nil, nil)),
|
|
4360
|
+
%q{begin ensure end},
|
|
4361
|
+
%q{~~~~~ begin
|
|
4362
|
+
| ~~~~~~ keyword (ensure)
|
|
4363
|
+
| ~~~~~~ expression (ensure)
|
|
4364
|
+
| ~~~ end
|
|
4365
|
+
|~~~~~~~~~~~~~~~~ expression})
|
|
4366
|
+
end
|
|
4367
|
+
|
|
4368
|
+
def test_rescue_ensure
|
|
4369
|
+
assert_parses(
|
|
4370
|
+
s(:kwbegin,
|
|
4371
|
+
s(:ensure,
|
|
4372
|
+
s(:rescue,
|
|
4373
|
+
s(:send, nil, :meth),
|
|
4374
|
+
s(:resbody, nil, nil, s(:lvar, :baz)),
|
|
4375
|
+
nil),
|
|
4376
|
+
s(:lvar, :bar))),
|
|
4377
|
+
%q{begin; meth; rescue; baz; ensure; bar; end},
|
|
4378
|
+
%q{ ~~~~~~ keyword (ensure)
|
|
4379
|
+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression (ensure)
|
|
4380
|
+
| ~~~~~~ keyword (ensure.rescue.resbody)
|
|
4381
|
+
| ~~~~~~~~~~~~~~~~~ expression (ensure.rescue)})
|
|
4382
|
+
end
|
|
4383
|
+
|
|
4384
|
+
def test_rescue_else_ensure
|
|
4385
|
+
assert_parses(
|
|
4386
|
+
s(:kwbegin,
|
|
4387
|
+
s(:ensure,
|
|
4388
|
+
s(:rescue,
|
|
4389
|
+
s(:send, nil, :meth),
|
|
4390
|
+
s(:resbody, nil, nil, s(:lvar, :baz)),
|
|
4391
|
+
s(:lvar, :foo)),
|
|
4392
|
+
s(:lvar, :bar))),
|
|
4393
|
+
%q{begin; meth; rescue; baz; else foo; ensure; bar end},
|
|
4394
|
+
%q{ ~~~~~~ keyword (ensure)
|
|
4395
|
+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression (ensure)
|
|
4396
|
+
| ~~~~~~ keyword (ensure.rescue.resbody)
|
|
4397
|
+
| ~~~~ else (ensure.rescue)
|
|
4398
|
+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression (ensure.rescue)})
|
|
4399
|
+
end
|
|
4400
|
+
|
|
4401
|
+
def test_rescue_mod
|
|
4402
|
+
assert_parses(
|
|
4403
|
+
s(:rescue,
|
|
4404
|
+
s(:send, nil, :meth),
|
|
4405
|
+
s(:resbody, nil, nil, s(:lvar, :bar)),
|
|
4406
|
+
nil),
|
|
4407
|
+
%q{meth rescue bar},
|
|
4408
|
+
%q{ ~~~~~~ keyword (resbody)
|
|
4409
|
+
| ~~~~~~~~~~ expression (resbody)
|
|
4410
|
+
|~~~~~~~~~~~~~~~ expression})
|
|
4411
|
+
end
|
|
4412
|
+
|
|
4413
|
+
def test_rescue_mod_asgn
|
|
4414
|
+
assert_parses(
|
|
4415
|
+
s(:lvasgn, :foo,
|
|
4416
|
+
s(:rescue,
|
|
4417
|
+
s(:send, nil, :meth),
|
|
4418
|
+
s(:resbody, nil, nil, s(:lvar, :bar)),
|
|
4419
|
+
nil)),
|
|
4420
|
+
%q{foo = meth rescue bar},
|
|
4421
|
+
%q{ ~~~~~~ keyword (rescue.resbody)
|
|
4422
|
+
| ~~~~~~~~~~ expression (rescue.resbody)
|
|
4423
|
+
| ~~~~~~~~~~~~~~~ expression (rescue)
|
|
4424
|
+
|~~~~~~~~~~~~~~~~~~~~~ expression})
|
|
4425
|
+
end
|
|
4426
|
+
|
|
4427
|
+
def test_rescue_mod_op_assign
|
|
4428
|
+
assert_parses(
|
|
4429
|
+
s(:op_asgn,
|
|
4430
|
+
s(:lvasgn, :foo), :+,
|
|
4431
|
+
s(:rescue,
|
|
4432
|
+
s(:send, nil, :meth),
|
|
4433
|
+
s(:resbody, nil, nil, s(:lvar, :bar)),
|
|
4434
|
+
nil)),
|
|
4435
|
+
%q{foo += meth rescue bar},
|
|
4436
|
+
%q{ ~~~~~~ keyword (rescue.resbody)
|
|
4437
|
+
| ~~~~~~~~~~ expression (rescue.resbody)
|
|
4438
|
+
| ~~~~~~~~~~~~~~~ expression (rescue)
|
|
4439
|
+
|~~~~~~~~~~~~~~~~~~~~~~ expression},
|
|
4440
|
+
ALL_VERSIONS - %w(1.8))
|
|
4441
|
+
end
|
|
4442
|
+
|
|
4443
|
+
def test_resbody_list
|
|
4444
|
+
assert_parses(
|
|
4445
|
+
s(:kwbegin,
|
|
4446
|
+
s(:rescue,
|
|
4447
|
+
s(:send, nil, :meth),
|
|
4448
|
+
s(:resbody,
|
|
4449
|
+
s(:array, s(:const, nil, :Exception)),
|
|
4450
|
+
nil,
|
|
4451
|
+
s(:lvar, :bar)),
|
|
4452
|
+
nil)),
|
|
4453
|
+
%q{begin; meth; rescue Exception; bar; end})
|
|
4454
|
+
end
|
|
4455
|
+
|
|
4456
|
+
def test_resbody_list_mrhs
|
|
4457
|
+
assert_parses(
|
|
4458
|
+
s(:kwbegin,
|
|
4459
|
+
s(:rescue,
|
|
4460
|
+
s(:send, nil, :meth),
|
|
4461
|
+
s(:resbody,
|
|
4462
|
+
s(:array,
|
|
4463
|
+
s(:const, nil, :Exception),
|
|
4464
|
+
s(:lvar, :foo)),
|
|
4465
|
+
nil,
|
|
4466
|
+
s(:lvar, :bar)),
|
|
4467
|
+
nil)),
|
|
4468
|
+
%q{begin; meth; rescue Exception, foo; bar; end})
|
|
4469
|
+
end
|
|
4470
|
+
|
|
4471
|
+
def test_resbody_var
|
|
4472
|
+
assert_parses(
|
|
4473
|
+
s(:kwbegin,
|
|
4474
|
+
s(:rescue,
|
|
4475
|
+
s(:send, nil, :meth),
|
|
4476
|
+
s(:resbody, nil, s(:lvasgn, :ex), s(:lvar, :bar)),
|
|
4477
|
+
nil)),
|
|
4478
|
+
%q{begin; meth; rescue => ex; bar; end})
|
|
4479
|
+
|
|
4480
|
+
assert_parses(
|
|
4481
|
+
s(:kwbegin,
|
|
4482
|
+
s(:rescue,
|
|
4483
|
+
s(:send, nil, :meth),
|
|
4484
|
+
s(:resbody, nil, s(:ivasgn, :@ex), s(:lvar, :bar)),
|
|
4485
|
+
nil)),
|
|
4486
|
+
%q{begin; meth; rescue => @ex; bar; end})
|
|
4487
|
+
end
|
|
4488
|
+
|
|
4489
|
+
def test_resbody_list_var
|
|
4490
|
+
assert_parses(
|
|
4491
|
+
s(:kwbegin,
|
|
4492
|
+
s(:rescue,
|
|
4493
|
+
s(:send, nil, :meth),
|
|
4494
|
+
s(:resbody,
|
|
4495
|
+
s(:array, s(:lvar, :foo)),
|
|
4496
|
+
s(:lvasgn, :ex),
|
|
4497
|
+
s(:lvar, :bar)),
|
|
4498
|
+
nil)),
|
|
4499
|
+
%q{begin; meth; rescue foo => ex; bar; end})
|
|
4500
|
+
end
|
|
4501
|
+
|
|
4502
|
+
def test_retry
|
|
4503
|
+
assert_parses(
|
|
4504
|
+
s(:retry),
|
|
4505
|
+
%q{retry},
|
|
4506
|
+
%q{~~~~~ keyword
|
|
4507
|
+
|~~~~~ expression})
|
|
4508
|
+
end
|
|
4509
|
+
|
|
4510
|
+
# BEGIN and END
|
|
4511
|
+
|
|
4512
|
+
def test_preexe
|
|
4513
|
+
assert_parses(
|
|
4514
|
+
s(:preexe, s(:int, 1)),
|
|
4515
|
+
%q{BEGIN { 1 }},
|
|
4516
|
+
%q{~~~~~ keyword
|
|
4517
|
+
| ^ begin
|
|
4518
|
+
| ^ end
|
|
4519
|
+
|~~~~~~~~~~~ expression})
|
|
4520
|
+
end
|
|
4521
|
+
|
|
4522
|
+
def test_preexe_invalid
|
|
4523
|
+
assert_diagnoses(
|
|
4524
|
+
[:error, :begin_in_method],
|
|
4525
|
+
%q{def f; BEGIN{}; end},
|
|
4526
|
+
%q{ ~~~~~ location},
|
|
4527
|
+
# Yes. *Exclude 1.9*. Sigh.
|
|
4528
|
+
ALL_VERSIONS - %w(1.9))
|
|
4529
|
+
end
|
|
4530
|
+
|
|
4531
|
+
def test_postexe
|
|
4532
|
+
assert_parses(
|
|
4533
|
+
s(:postexe, s(:int, 1)),
|
|
4534
|
+
%q{END { 1 }},
|
|
4535
|
+
%q{~~~ keyword
|
|
4536
|
+
| ^ begin
|
|
4537
|
+
| ^ end
|
|
4538
|
+
|~~~~~~~~~ expression})
|
|
4539
|
+
end
|
|
4540
|
+
|
|
4541
|
+
#
|
|
4542
|
+
# Miscellanea
|
|
4543
|
+
#
|
|
4544
|
+
|
|
4545
|
+
def test_kwbegin_compstmt
|
|
4546
|
+
assert_parses(
|
|
4547
|
+
s(:kwbegin,
|
|
4548
|
+
s(:send, nil, :foo!),
|
|
4549
|
+
s(:send, nil, :bar!)),
|
|
4550
|
+
%q{begin foo!; bar! end})
|
|
4551
|
+
end
|
|
4552
|
+
|
|
4553
|
+
def test_crlf_line_endings
|
|
4554
|
+
with_versions(ALL_VERSIONS) do |_ver, parser|
|
|
4555
|
+
source_file = Parser::Source::Buffer.new('(comments)')
|
|
4556
|
+
source_file.source = "\r\nfoo"
|
|
4557
|
+
|
|
4558
|
+
range = lambda do |from, to|
|
|
4559
|
+
Parser::Source::Range.new(source_file, from, to)
|
|
4560
|
+
end
|
|
4561
|
+
|
|
4562
|
+
ast = parser.parse(source_file)
|
|
4563
|
+
|
|
4564
|
+
assert_equal s(:lvar, :foo),
|
|
4565
|
+
ast
|
|
4566
|
+
|
|
4567
|
+
assert_equal range.call(1, 4),
|
|
4568
|
+
ast.loc.expression
|
|
4569
|
+
end
|
|
4570
|
+
end
|
|
4571
|
+
|
|
4572
|
+
def test_begin_cmdarg
|
|
4573
|
+
assert_parses(
|
|
4574
|
+
s(:send, nil, :p,
|
|
4575
|
+
s(:kwbegin,
|
|
4576
|
+
s(:block,
|
|
4577
|
+
s(:send, s(:int, 1), :times),
|
|
4578
|
+
s(:args),
|
|
4579
|
+
s(:int, 1)))),
|
|
4580
|
+
%q{p begin 1.times do 1 end end},
|
|
4581
|
+
%{},
|
|
4582
|
+
ALL_VERSIONS - %w(1.8 1.9))
|
|
4583
|
+
end
|
|
4584
|
+
|
|
4585
|
+
def test_bug_cmdarg
|
|
4586
|
+
assert_parses(
|
|
4587
|
+
s(:send, nil, :meth,
|
|
4588
|
+
s(:begin,
|
|
4589
|
+
s(:block,
|
|
4590
|
+
s(:send, nil, :lambda),
|
|
4591
|
+
s(:args), nil))),
|
|
4592
|
+
%q{meth (lambda do end)},
|
|
4593
|
+
%q{},
|
|
4594
|
+
%w(1.8))
|
|
4595
|
+
|
|
4596
|
+
assert_parses(
|
|
4597
|
+
s(:send, nil, :assert,
|
|
4598
|
+
s(:send, nil, :dogs)),
|
|
4599
|
+
%q{assert dogs})
|
|
4600
|
+
|
|
4601
|
+
assert_parses(
|
|
4602
|
+
s(:send, nil, :assert,
|
|
4603
|
+
s(:hash,
|
|
4604
|
+
s(:pair, s(:sym, :do), s(:true)))),
|
|
4605
|
+
%q{assert do: true},
|
|
4606
|
+
%q{},
|
|
4607
|
+
ALL_VERSIONS - %w(1.8))
|
|
4608
|
+
|
|
4609
|
+
assert_parses(
|
|
4610
|
+
s(:send, nil, :f,
|
|
4611
|
+
s(:hash,
|
|
4612
|
+
s(:pair,
|
|
4613
|
+
s(:sym, :x),
|
|
4614
|
+
s(:block,
|
|
4615
|
+
s(:send, nil, :lambda),
|
|
4616
|
+
s(:args),
|
|
4617
|
+
s(:block,
|
|
4618
|
+
s(:send, nil, :meth),
|
|
4619
|
+
s(:args), nil))))),
|
|
4620
|
+
%q{f x: -> do meth do end end},
|
|
4621
|
+
%q{},
|
|
4622
|
+
ALL_VERSIONS - %w(1.8))
|
|
4623
|
+
end
|
|
4624
|
+
|
|
4625
|
+
def test_file_line_non_literals
|
|
4626
|
+
with_versions(ALL_VERSIONS) do |_ver, parser|
|
|
4627
|
+
parser.builder.emit_file_line_as_literals = false
|
|
4628
|
+
|
|
4629
|
+
source_file = Parser::Source::Buffer.new('(comments)')
|
|
4630
|
+
source_file.source = "[__FILE__, __LINE__]"
|
|
4631
|
+
|
|
4632
|
+
ast = parser.parse(source_file)
|
|
4633
|
+
|
|
4634
|
+
assert_equal s(:array, s(:__FILE__), s(:__LINE__)), ast
|
|
4635
|
+
end
|
|
4636
|
+
end
|
|
4637
|
+
|
|
4638
|
+
if defined?(Encoding)
|
|
4639
|
+
def test_bom
|
|
4640
|
+
assert_parses(
|
|
4641
|
+
s(:int, 1),
|
|
4642
|
+
%Q{\xef\xbb\xbf1}.force_encoding(Encoding::BINARY),
|
|
4643
|
+
%q{},
|
|
4644
|
+
%w(1.9 2.0 2.1))
|
|
4645
|
+
end
|
|
4646
|
+
|
|
4647
|
+
def test_magic_encoding_comment
|
|
4648
|
+
assert_parses(
|
|
4649
|
+
s(:begin,
|
|
4650
|
+
s(:lvasgn, :"проверка", s(:int, 42)),
|
|
4651
|
+
s(:send, nil, :puts, s(:lvar, :"проверка"))),
|
|
4652
|
+
%Q{# coding:koi8-r
|
|
4653
|
+
\xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1 = 42
|
|
4654
|
+
puts \xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1}.
|
|
4655
|
+
force_encoding(Encoding::BINARY),
|
|
4656
|
+
%q{},
|
|
4657
|
+
%w(1.9 2.0 2.1))
|
|
4658
|
+
end
|
|
4659
|
+
|
|
4660
|
+
def test_regexp_encoding
|
|
4661
|
+
assert_parses(
|
|
4662
|
+
s(:match_with_lvasgn,
|
|
4663
|
+
s(:regexp,
|
|
4664
|
+
s(:str, "\\xa8"),
|
|
4665
|
+
s(:regopt, :n)),
|
|
4666
|
+
s(:str, "")),
|
|
4667
|
+
%q{/\xa8/n =~ ""}.force_encoding(Encoding::UTF_8),
|
|
4668
|
+
%{},
|
|
4669
|
+
ALL_VERSIONS - %w(1.8))
|
|
4670
|
+
end
|
|
4671
|
+
end
|
|
4672
|
+
|
|
4673
|
+
#
|
|
4674
|
+
# Error recovery
|
|
4675
|
+
#
|
|
4676
|
+
|
|
4677
|
+
def test_unknown_percent_str
|
|
4678
|
+
assert_diagnoses(
|
|
4679
|
+
[:error, :unexpected_percent_str, { :type => '%k' }],
|
|
4680
|
+
%q{%k[foo]},
|
|
4681
|
+
%q{~~ location})
|
|
4682
|
+
end
|
|
4683
|
+
|
|
4684
|
+
def test_unterminated_embedded_doc
|
|
4685
|
+
assert_diagnoses(
|
|
4686
|
+
[:fatal, :embedded_document],
|
|
4687
|
+
%Q{=begin\nfoo\nend},
|
|
4688
|
+
%q{~~~~~~ location})
|
|
4689
|
+
|
|
4690
|
+
assert_diagnoses(
|
|
4691
|
+
[:fatal, :embedded_document],
|
|
4692
|
+
%Q{=begin\nfoo\nend\n},
|
|
4693
|
+
%q{~~~~~~ location})
|
|
4694
|
+
end
|
|
4695
|
+
|
|
4696
|
+
def test_codepoint_too_large
|
|
4697
|
+
assert_diagnoses(
|
|
4698
|
+
[:error, :unicode_point_too_large],
|
|
4699
|
+
%q{"\u{120 120000}"},
|
|
4700
|
+
%q{ ~~~~~~ location},
|
|
4701
|
+
ALL_VERSIONS - %w(1.8))
|
|
4702
|
+
end
|
|
4703
|
+
|
|
4704
|
+
def test_on_error
|
|
4705
|
+
assert_diagnoses(
|
|
4706
|
+
[:error, :unexpected_token, { :token => 'tIDENTIFIER' }],
|
|
4707
|
+
%q{def foo(bar baz); end},
|
|
4708
|
+
%q{ ~~~ location})
|
|
4709
|
+
end
|
|
4710
|
+
|
|
4711
|
+
#
|
|
4712
|
+
# Token and comment extraction
|
|
4713
|
+
#
|
|
4714
|
+
|
|
4715
|
+
def assert_parses_with_comments(ast_pattern, source, comments_pattern)
|
|
4716
|
+
with_versions(ALL_VERSIONS) do |_ver, parser|
|
|
4717
|
+
source_file = Parser::Source::Buffer.new('(comments)')
|
|
4718
|
+
source_file.source = source
|
|
4719
|
+
|
|
4720
|
+
comments_pattern_here = comments_pattern.map do |(from, to)|
|
|
4721
|
+
range = Parser::Source::Range.new(source_file, from, to)
|
|
4722
|
+
Parser::Source::Comment.new(range)
|
|
4723
|
+
end
|
|
4724
|
+
|
|
4725
|
+
ast, comments = parser.parse_with_comments(source_file)
|
|
4726
|
+
|
|
4727
|
+
assert_equal ast_pattern, ast
|
|
4728
|
+
|
|
4729
|
+
assert_equal comments_pattern_here, comments
|
|
4730
|
+
end
|
|
4731
|
+
end
|
|
4732
|
+
|
|
4733
|
+
def test_comment_interleaved
|
|
4734
|
+
assert_parses_with_comments(
|
|
4735
|
+
s(:send, s(:int, 1), :+, s(:int, 2)),
|
|
4736
|
+
%Q{1 + # foo\n 2},
|
|
4737
|
+
[ [4, 9] ])
|
|
4738
|
+
end
|
|
4739
|
+
|
|
4740
|
+
def test_comment_single
|
|
4741
|
+
assert_parses_with_comments(
|
|
4742
|
+
s(:send, nil, :puts),
|
|
4743
|
+
%Q{puts # whatever},
|
|
4744
|
+
[ [5, 15] ])
|
|
4745
|
+
end
|
|
4746
|
+
|
|
4747
|
+
def test_tokenize
|
|
4748
|
+
with_versions(ALL_VERSIONS) do |_ver, parser|
|
|
4749
|
+
source_file = Parser::Source::Buffer.new('(tokenize)')
|
|
4750
|
+
source_file.source = "1 + # foo\n 2"
|
|
4751
|
+
|
|
4752
|
+
range = lambda do |from, to|
|
|
4753
|
+
Parser::Source::Range.new(source_file, from, to)
|
|
4754
|
+
end
|
|
4755
|
+
|
|
4756
|
+
ast, comments, tokens = parser.tokenize(source_file)
|
|
4757
|
+
|
|
4758
|
+
assert_equal s(:send, s(:int, 1), :+, s(:int, 2)),
|
|
4759
|
+
ast
|
|
4760
|
+
|
|
4761
|
+
assert_equal [
|
|
4762
|
+
Parser::Source::Comment.new(range.call(4, 9))
|
|
4763
|
+
], comments
|
|
4764
|
+
|
|
4765
|
+
assert_equal [
|
|
4766
|
+
[:tINTEGER, [ 1, range.call(0, 1) ]],
|
|
4767
|
+
[:tPLUS, [ '+', range.call(2, 3) ]],
|
|
4768
|
+
[:tCOMMENT, [ '# foo', range.call(4, 9) ]],
|
|
4769
|
+
[:tINTEGER, [ 2, range.call(11, 12) ]],
|
|
4770
|
+
], tokens
|
|
4771
|
+
end
|
|
4772
|
+
end
|
|
4773
|
+
|
|
4774
|
+
#
|
|
4775
|
+
# Bug-specific tests
|
|
4776
|
+
#
|
|
4777
|
+
|
|
4778
|
+
def test_bug_cmd_string_lookahead
|
|
4779
|
+
assert_parses(
|
|
4780
|
+
s(:block,
|
|
4781
|
+
s(:send, nil, :desc,
|
|
4782
|
+
s(:str, 'foo')),
|
|
4783
|
+
s(:args), nil),
|
|
4784
|
+
%q{desc "foo" do end})
|
|
4785
|
+
end
|
|
4786
|
+
|
|
4787
|
+
def test_bug_do_block_in_call_args
|
|
4788
|
+
# [ruby-core:59342] [Bug #9308]
|
|
4789
|
+
assert_parses(
|
|
4790
|
+
s(:send, nil, :bar,
|
|
4791
|
+
s(:def, :foo,
|
|
4792
|
+
s(:args),
|
|
4793
|
+
s(:block,
|
|
4794
|
+
s(:send, s(:self), :each),
|
|
4795
|
+
s(:args),
|
|
4796
|
+
nil))),
|
|
4797
|
+
%q{bar def foo; self.each do end end},
|
|
4798
|
+
%q{},
|
|
4799
|
+
ALL_VERSIONS - %w(1.8))
|
|
4800
|
+
end
|
|
4801
|
+
|
|
4802
|
+
def test_bug_do_block_in_cmdarg
|
|
4803
|
+
# [ruby-core:61950] [Bug #9726]
|
|
4804
|
+
assert_parses(
|
|
4805
|
+
s(:send, nil, :tap,
|
|
4806
|
+
s(:begin,
|
|
4807
|
+
s(:block,
|
|
4808
|
+
s(:send, nil, :proc),
|
|
4809
|
+
s(:args), nil))),
|
|
4810
|
+
%q{tap (proc do end)},
|
|
4811
|
+
%q{},
|
|
4812
|
+
ALL_VERSIONS - %w(1.8))
|
|
4813
|
+
end
|
|
4814
|
+
|
|
4815
|
+
def test_bug_interp_single
|
|
4816
|
+
assert_parses(
|
|
4817
|
+
s(:dstr, s(:begin, s(:int, 1))),
|
|
4818
|
+
%q{"#{1}"})
|
|
4819
|
+
|
|
4820
|
+
assert_parses(
|
|
4821
|
+
s(:array, s(:dstr, s(:begin, s(:int, 1)))),
|
|
4822
|
+
%q{%W"#{1}"})
|
|
4823
|
+
end
|
|
4824
|
+
|
|
4825
|
+
def test_bug_def_no_paren_eql_begin
|
|
4826
|
+
assert_parses(
|
|
4827
|
+
s(:def, :foo, s(:args), nil),
|
|
4828
|
+
%Q{def foo\n=begin\n=end\nend})
|
|
4829
|
+
end
|
|
4830
|
+
|
|
4831
|
+
def test_bug_while_not_parens_do
|
|
4832
|
+
assert_parses(
|
|
4833
|
+
s(:while, s(:send, s(:begin, s(:true)), :"!"), nil),
|
|
4834
|
+
%q{while not (true) do end},
|
|
4835
|
+
%q{},
|
|
4836
|
+
ALL_VERSIONS - %w(1.8))
|
|
4837
|
+
end
|
|
4838
|
+
|
|
4839
|
+
def test_bug_rescue_empty_else
|
|
4840
|
+
assert_parses(
|
|
4841
|
+
s(:kwbegin,
|
|
4842
|
+
s(:rescue, nil,
|
|
4843
|
+
s(:resbody,
|
|
4844
|
+
s(:array,
|
|
4845
|
+
s(:const, nil, :LoadError)), nil, nil), nil)),
|
|
4846
|
+
%q{begin; rescue LoadError; else; end},
|
|
4847
|
+
%q{ ~~~~ else (rescue)
|
|
4848
|
+
| ~~~~~~~~~~~~~~~~~~~~~~ expression (rescue)})
|
|
4849
|
+
end
|
|
4850
|
+
|
|
4851
|
+
def test_bug_heredoc_do
|
|
4852
|
+
assert_parses(
|
|
4853
|
+
s(:block,
|
|
4854
|
+
s(:send, nil, :f,
|
|
4855
|
+
s(:dstr)),
|
|
4856
|
+
s(:args), nil),
|
|
4857
|
+
%Q{f <<-TABLE do\nTABLE\nend})
|
|
4858
|
+
end
|
|
4859
|
+
|
|
4860
|
+
def test_bug_lambda_leakage
|
|
4861
|
+
assert_parses(
|
|
4862
|
+
s(:begin,
|
|
4863
|
+
s(:block,
|
|
4864
|
+
s(:send, nil, :lambda),
|
|
4865
|
+
s(:args,
|
|
4866
|
+
s(:arg, :scope)), nil),
|
|
4867
|
+
s(:send, nil, :scope)),
|
|
4868
|
+
%q{->(scope) {}; scope},
|
|
4869
|
+
%q{},
|
|
4870
|
+
ALL_VERSIONS - %w(1.8))
|
|
4871
|
+
end
|
|
4872
|
+
end
|