brakeman 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +8 -0
- data/bin/brakeman +2 -96
- data/bundle/load.rb +6 -6
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2/History.txt → ruby2ruby-2.4.0/History.rdoc} +15 -0
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2 → ruby2ruby-2.4.0}/Manifest.txt +2 -2
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2/README.txt → ruby2ruby-2.4.0/README.rdoc} +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2 → ruby2ruby-2.4.0}/Rakefile +1 -0
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2 → ruby2ruby-2.4.0}/bin/r2r_show +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2 → ruby2ruby-2.4.0}/lib/ruby2ruby.rb +427 -364
- data/bundle/ruby/2.3.0/gems/{ruby2ruby-2.3.2 → ruby2ruby-2.4.0}/test/test_ruby2ruby.rb +1 -4
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/History.rdoc +24 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/Manifest.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/README.rdoc +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/Rakefile +2 -2
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/bin/ruby_parse +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/bin/ruby_parse_extract_error +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/compare/normalize.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/rp_extensions.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby18_parser.rb +1604 -1602
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby18_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby19_parser.rb +1555 -1553
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby19_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby20_parser.rb +1760 -1756
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby20_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby21_parser.rb +1887 -1891
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby21_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby22_parser.rb +1861 -1861
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby22_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby23_parser.rb +1692 -1691
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby23_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby24_parser.rb +1692 -1691
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby24_parser.y +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby_lexer.rb +6 -4
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby_lexer.rex +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby_lexer.rex.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby_parser.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby_parser.yy +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/lib/ruby_parser_extras.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/test/test_ruby_lexer.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/test/test_ruby_parser.rb +9 -0
- data/bundle/ruby/2.3.0/gems/{ruby_parser-3.9.0 → ruby_parser-3.10.1}/test/test_ruby_parser_extras.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/CODE_OF_CONDUCT.md +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/CONTRIBUTING.md +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/MIT-LICENSE +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/README.md +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/REVISION +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/Rakefile +39 -10
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/VERSION +1 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/VERSION_DATE +1 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/VERSION_NAME +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/bin/sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/bin/sass-convert +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/bin/scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/extra/sass-spec-ref.sh +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/extra/update_watch.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/init.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass.rb +3 -3
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/cache_stores.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/cache_stores/base.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/cache_stores/chain.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/cache_stores/filesystem.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/cache_stores/memory.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/cache_stores/null.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/callbacks.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/css.rb +1 -1
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/lib/sass/deprecation.rb +55 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/engine.rb +13 -5
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/environment.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/error.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/exec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/exec/base.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/exec/sass_convert.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/exec/sass_scss.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/features.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/importers.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/importers/base.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/importers/deprecated_path.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/importers/filesystem.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/logger.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/logger/base.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/logger/delayed.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/logger/log_level.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/media.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/compiler.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/configuration.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/generic.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/merb.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/rack.rb +2 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/rails.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/plugin/staleness_checker.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/railtie.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/repl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/root.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/css_lexer.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/css_parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/css_variable_warning.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/functions.rb +2 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/lexer.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/parser.rb +4 -3
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/funcall.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/interpolation.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/list_literal.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/literal.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/map_literal.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/node.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/operation.rb +43 -16
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/selector.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/string_interpolation.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/unary_operation.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/tree/variable.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/arg_list.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/base.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/bool.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/color.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/helpers.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/list.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/map.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/null.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/number.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/script/value/string.rb +5 -12
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/scss.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/scss/css_parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/scss/parser.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/scss/rx.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/scss/static_parser.rb +7 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector/abstract_sequence.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector/comma_sequence.rb +13 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector/pseudo.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector/sequence.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector/simple.rb +1 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/selector/simple_sequence.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/shared.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/source/map.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/source/position.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/source/range.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/stack.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/supports.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/at_root_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/charset_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/comment_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/content_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/css_import_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/debug_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/directive_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/each_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/error_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/extend_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/for_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/function_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/if_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/import_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/keyframe_rule_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/media_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/mixin_def_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/mixin_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/node.rb +2 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/prop_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/return_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/root_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/rule_node.rb +13 -4
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/supports_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/trace_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/variable_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/base.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/check_nesting.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/convert.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/cssize.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/extend.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/perform.rb +3 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/set_options.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/visitors/to_css.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/warn_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/tree/while_node.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util/cross_platform_random.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util/multibyte_string_scanner.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util/normalized_map.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util/ordered_hash.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util/subset_map.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/util/test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/lib/sass/version.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/rails/init.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass-spec.yml +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/cache_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/callbacks_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/compiler_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/conversion_test.rb +3 -3
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/css2sass_test.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/css_variable_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/data/hsl-rgb.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/encoding_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/engine_test.rb +56 -50
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/exec_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/extend_test.rb +14 -8
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/fixtures/test_staleness_check_across_importers.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/functions_test.rb +5 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/importer_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/logger_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/mock_importer.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/more_results/more1.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/more_results/more1_with_line_comments.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/more_results/more_import.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/more_templates/_more_partial.sass +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/more_templates/more1.sass +23 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/more_templates/more_import.sass +2 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/plugin_test.rb +3 -3
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/alt.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/basic.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/cached_import_option.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/compact.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/complex.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/compressed.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/expanded.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/filename_fn.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/if.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/import.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/import_charset.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/import_charset_1_8.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/import_charset_ibm866.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/import_content.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/line_numbers.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/mixins.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/multiline.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/nested.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/options.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/parent_ref.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/script.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/scss_import.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/scss_importee.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/subdir/subdir.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/units.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/warn.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/results/warn_imported.css +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/script_conversion_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/script_test.rb +38 -29
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/scss/css_test.rb +2 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/scss/rx_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/scss/scss_test.rb +25 -10
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/scss/test_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/source_map_test.rb +13 -13
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/superselector_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_cached_import_option_partial.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_double_import_loop2.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_filename_fn_import.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_imported_charset_ibm866.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_imported_charset_utf8.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_imported_content.sass +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/_same_name_different_partiality.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/alt.sass +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/basic.sass +23 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/bork1.sass +2 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/bork2.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/bork3.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/bork4.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/bork5.sass +1 -1
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/cached_import_option.scss +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/compact.sass +17 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/complex.sass +305 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/compressed.sass +15 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/double_import_loop1.sass +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/expanded.sass +17 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/filename_fn.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/if.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/import.sass +2 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/import_charset.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/import_charset_1_8.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/import_charset_ibm866.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/import_content.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/importee.less +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/importee.sass +3 -3
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/line_numbers.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/mixin_bork.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/mixins.sass +22 -22
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/multiline.sass +4 -4
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/nested.sass +25 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/nested_bork1.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/nested_bork2.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/nested_bork3.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/nested_bork4.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/nested_import.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/nested_mixin_bork.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/options.sass +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/parent_ref.sass +25 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/same_name_different_ext.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/same_name_different_ext.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/same_name_different_partiality.scss +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/script.sass +101 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/scss_import.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/scss_importee.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/single_import_loop.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/subdir/import_up1.scss +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/subdir/import_up2.scss +0 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/subdir/subdir.sass +3 -3
- data/bundle/ruby/2.3.0/gems/sass-3.4.25/test/sass/templates/units.sass +11 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/warn.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/templates/warn_imported.sass +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/test_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/util/multibyte_string_scanner_test.rb +10 -2
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/util/normalized_map_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/util/subset_map_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/util_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/sass/value_helpers_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/test/test_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/CHANGELOG.md +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/CONTRIBUTING.md +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/Gemfile +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/Guardfile +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/LICENSE +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/README.md +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/Vagrantfile +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/adapter.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/adapters/bsd.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/adapters/darwin.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/adapters/linux.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/adapters/polling.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/adapters/windows.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/directory_record.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/listener.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/turnstile.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/lib/listen/version.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/listen.gemspec +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/adapter_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/directory_record_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/listener_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen/turnstile_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/listen_spec.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/spec_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/support/adapter_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/support/directory_record_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/support/fixtures_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/support/listeners_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sass-3.4.24 → sass-3.4.25}/vendor/listen/spec/support/platform_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/History.txt +49 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/Manifest.txt +1 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/README.txt +36 -7
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/Rakefile +4 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/lib/composite_sexp_processor.rb +4 -4
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/lib/pt_testcase.rb +21 -25
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.10.0/lib/sexp.rb +1414 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/lib/sexp_processor.rb +127 -65
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.10.0/lib/strict_sexp.rb +126 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/lib/unique.rb +7 -1
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/test/test_composite_sexp_processor.rb +9 -12
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/test/test_environment.rb +2 -2
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.10.0/test/test_sexp.rb +1630 -0
- data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/test/test_sexp_processor.rb +65 -52
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/CHANGELOG.md +10 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/COPYING +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/Gemfile +3 -5
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/HACKING +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/README.md +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/Rakefile +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/bin/tilt +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/docs/TEMPLATES.md +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/docs/common.css +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt.rb +2 -2
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/babel.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/builder.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/commonmarker.rb +1 -1
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/csv.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/dummy.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/erubi.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/erubis.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/haml.rb +86 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/less.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/livescript.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/mapping.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/pandoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/redcarpet.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/rst-pandoc.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/sass.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/sigil.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/string.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/template.rb +1 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/typescript.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/lib/tilt/yajl.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/man/index.txt +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/man/tilt.1.ronn +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/markaby/locals.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/markaby/markaby.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/markaby/markaby_other_static.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/markaby/render_twice.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/markaby/scope.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/markaby/yielding.mab +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/mytemplate.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/test_helper.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_asciidoctor_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_babeltemplate.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_blueclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_buildertemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_cache_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_coffeescripttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_commonmarkertemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_compilesite_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_creoletemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_csv_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_erbtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_erubistemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_erubitemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_etannitemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_hamltemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_kramdown_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_lesstemplate_test.less +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_lesstemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_liquidtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_livescripttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_mapping_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_markaby_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_markdown_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_marukutemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_metadata_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_nokogiritemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_pandoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_prawntemplate.prawn +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_prawntemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_radiustemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_rdiscounttemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_rdoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_redcarpettemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_redclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_rstpandoctemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_sasstemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_sigil_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_stringtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_template_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_typescript_test.rb +4 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_wikiclothtemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/test/tilt_yajltemplate_test.rb +0 -0
- data/bundle/ruby/2.3.0/gems/{tilt-2.0.7 → tilt-2.0.8}/tilt.gemspec +2 -2
- data/lib/brakeman.rb +8 -0
- data/lib/brakeman/commandline.rb +179 -0
- data/lib/brakeman/options.rb +17 -13
- data/lib/brakeman/processors/alias_processor.rb +11 -1
- data/lib/brakeman/processors/output_processor.rb +15 -16
- data/lib/brakeman/processors/template_alias_processor.rb +3 -1
- data/lib/brakeman/version.rb +1 -1
- data/lib/ruby_parser/bm_sexp.rb +2 -2
- metadata +467 -464
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/VERSION +0 -1
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/VERSION_DATE +0 -1
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/more_templates/more1.sass +0 -23
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/_partial.sass +0 -2
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/basic.sass +0 -23
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/bork1.sass +0 -2
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/compact.sass +0 -17
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/complex.sass +0 -305
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/compressed.sass +0 -15
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/expanded.sass +0 -17
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/nested.sass +0 -25
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/parent_ref.sass +0 -25
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/script.sass +0 -101
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
- data/bundle/ruby/2.3.0/gems/sass-3.4.24/test/sass/templates/units.sass +0 -11
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.9.0/lib/sexp.rb +0 -371
- data/bundle/ruby/2.3.0/gems/sexp_processor-4.9.0/test/test_sexp.rb +0 -432
- data/bundle/ruby/2.3.0/gems/tilt-2.0.7/lib/tilt/haml.rb +0 -58
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "sexp_processor"
|
2
2
|
|
3
3
|
##
|
4
4
|
# Implements the Composite pattern on SexpProcessor. Need we say more?
|
@@ -24,7 +24,7 @@ class CompositeSexpProcessor < SexpProcessor
|
|
24
24
|
##
|
25
25
|
# Add a +processor+ to the list of processors to run.
|
26
26
|
|
27
|
-
def <<
|
27
|
+
def << processor
|
28
28
|
raise ArgumentError, "Can only add sexp processors" unless
|
29
29
|
SexpProcessor === processor || processor.respond_to?(:process)
|
30
30
|
@processors << processor
|
@@ -34,14 +34,14 @@ class CompositeSexpProcessor < SexpProcessor
|
|
34
34
|
# Run +exp+ through all of the processors, returning the final
|
35
35
|
# result.
|
36
36
|
|
37
|
-
def process
|
37
|
+
def process exp
|
38
38
|
@processors.each do |processor|
|
39
39
|
exp = processor.process(exp)
|
40
40
|
end
|
41
41
|
exp
|
42
42
|
end
|
43
43
|
|
44
|
-
def on_error_in
|
44
|
+
def on_error_in node_type, &block
|
45
45
|
@processors.each do |processor|
|
46
46
|
processor.on_error_in(node_type, &block)
|
47
47
|
end
|
data/bundle/ruby/2.3.0/gems/{sexp_processor-4.9.0 → sexp_processor-4.10.0}/lib/pt_testcase.rb
RENAMED
@@ -1,9 +1,10 @@
|
|
1
1
|
# encoding: US-ASCII
|
2
2
|
|
3
3
|
$TESTING = true
|
4
|
+
# :stopdoc:
|
4
5
|
|
5
|
-
require
|
6
|
-
require
|
6
|
+
require "minitest/test"
|
7
|
+
require "sexp_processor" # for deep_clone
|
7
8
|
|
8
9
|
# key:
|
9
10
|
# wwtt = what were they thinking?
|
@@ -12,7 +13,7 @@ class Examples
|
|
12
13
|
attr_reader :reader
|
13
14
|
attr_writer :writer
|
14
15
|
|
15
|
-
def a_method
|
16
|
+
def a_method x; x+1; end
|
16
17
|
alias an_alias a_method
|
17
18
|
|
18
19
|
define_method(:bmethod_noargs) do
|
@@ -136,9 +137,9 @@ class ParseTreeTestCase < Minitest::Test
|
|
136
137
|
extra_input = []
|
137
138
|
|
138
139
|
_, expected, extra_expected = *expected if
|
139
|
-
Array === expected and expected.
|
140
|
+
Array === expected and expected.sexp_type == :defx
|
140
141
|
_, input, extra_input = *input if
|
141
|
-
Array === input and input.
|
142
|
+
Array === input and input.sexp_type == :defx
|
142
143
|
|
143
144
|
# OMG... I can't believe I have to do this this way. these
|
144
145
|
# hooks are here instead of refactoring this define_method
|
@@ -167,7 +168,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
167
168
|
install_missing_reporter
|
168
169
|
clone_same
|
169
170
|
|
170
|
-
output_name = klass.name.to_s.sub(/^Test/,
|
171
|
+
output_name = klass.name.to_s.sub(/^Test/, "")
|
171
172
|
|
172
173
|
input_name = self.previous(output_name)
|
173
174
|
|
@@ -202,7 +203,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
202
203
|
end
|
203
204
|
end
|
204
205
|
|
205
|
-
def self.previous
|
206
|
+
def self.previous key, extra=0 # FIX: remove R2C code
|
206
207
|
idx = @@testcase_order.index(key)
|
207
208
|
|
208
209
|
raise "Unknown class #{key} in @@testcase_order" if idx.nil?
|
@@ -307,7 +308,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
307
308
|
"Ruby2Ruby" => "10")
|
308
309
|
|
309
310
|
add_18tests("str_question_literal",
|
310
|
-
"Ruby" =>
|
311
|
+
"Ruby" => "?a",
|
311
312
|
"ParseTree" => s(:lit, 97),
|
312
313
|
"Ruby2Ruby" => "97")
|
313
314
|
|
@@ -595,7 +596,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
595
596
|
"ParseTree" => s(:str, "\n"))
|
596
597
|
|
597
598
|
add_19tests("str_question_literal",
|
598
|
-
"Ruby" =>
|
599
|
+
"Ruby" => "?a",
|
599
600
|
"ParseTree" => s(:str, "a"))
|
600
601
|
|
601
602
|
add_19tests("unless_post_not",
|
@@ -748,13 +749,6 @@ class ParseTreeTestCase < Minitest::Test
|
|
748
749
|
s(:lit, 42), s(:lit, 24))),
|
749
750
|
"Ruby2Ruby" => "a = []\na[42] = 24\n")
|
750
751
|
|
751
|
-
add_tests("attrset",
|
752
|
-
"Ruby" => [Examples, :writer=],
|
753
|
-
"ParseTree" => s(:defn, :writer=,
|
754
|
-
s(:args, :arg),
|
755
|
-
s(:attrset, :@writer)),
|
756
|
-
"Ruby2Ruby" => "attr_writer :writer")
|
757
|
-
|
758
752
|
add_tests("back_ref",
|
759
753
|
"Ruby" => "[$&, $`, $', $+]",
|
760
754
|
"ParseTree" => s(:array,
|
@@ -1534,15 +1528,15 @@ class ParseTreeTestCase < Minitest::Test
|
|
1534
1528
|
|
1535
1529
|
add_tests("dregx_interp",
|
1536
1530
|
"Ruby" => "/#\{@rakefile}/",
|
1537
|
-
"ParseTree" => s(:dregx,
|
1531
|
+
"ParseTree" => s(:dregx, "", s(:evstr, s(:ivar, :@rakefile))))
|
1538
1532
|
|
1539
1533
|
add_tests("dregx_interp_empty",
|
1540
1534
|
"Ruby" => "/a#\{}b/",
|
1541
|
-
"ParseTree" => s(:dregx,
|
1535
|
+
"ParseTree" => s(:dregx, "a", s(:evstr), s(:str, "b")))
|
1542
1536
|
|
1543
1537
|
add_tests("dregx_n",
|
1544
1538
|
"Ruby" => '/#{1}/n',
|
1545
|
-
"ParseTree" => s(:dregx,
|
1539
|
+
"ParseTree" => s(:dregx, "",
|
1546
1540
|
s(:evstr, s(:lit, 1)), /x/n.options))
|
1547
1541
|
|
1548
1542
|
add_tests("dregx_once",
|
@@ -1554,7 +1548,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
1554
1548
|
|
1555
1549
|
add_tests("dregx_once_n_interp",
|
1556
1550
|
"Ruby" => "/#\{IAC}#\{SB}/no",
|
1557
|
-
"ParseTree" => s(:dregx_once,
|
1551
|
+
"ParseTree" => s(:dregx_once, "",
|
1558
1552
|
s(:evstr, s(:const, :IAC)),
|
1559
1553
|
s(:evstr, s(:const, :SB)), /x/n.options))
|
1560
1554
|
|
@@ -1624,7 +1618,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
1624
1618
|
add_tests("dstr_heredoc_windoze_sucks",
|
1625
1619
|
"Ruby" => "<<-EOF\r\ndef test_#\{action}_valid_feed\r\n EOF\r\n",
|
1626
1620
|
"ParseTree" => s(:dstr,
|
1627
|
-
|
1621
|
+
"def test_",
|
1628
1622
|
s(:evstr, s(:call, nil, :action)),
|
1629
1623
|
s(:str, "_valid_feed\n")),
|
1630
1624
|
"Ruby2Ruby" => "\"def test_#\{action}_valid_feed\\n\"")
|
@@ -1681,7 +1675,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
1681
1675
|
"Ruby" => "t = 5\n`touch #\{t}`\n",
|
1682
1676
|
"ParseTree" => s(:block,
|
1683
1677
|
s(:lasgn, :t, s(:lit, 5)),
|
1684
|
-
s(:dxstr,
|
1678
|
+
s(:dxstr, "touch ", s(:evstr, s(:lvar, :t)))))
|
1685
1679
|
|
1686
1680
|
add_tests("ensure",
|
1687
1681
|
"Ruby" => "begin\n (1 + 1)\nrescue SyntaxError => e1\n 2\nrescue Exception => e2\n 3\nelse\n 4\nensure\n 5\nend",
|
@@ -2164,7 +2158,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
2164
2158
|
"ParseTree" => s(:lit, /x/))
|
2165
2159
|
|
2166
2160
|
add_tests("lit_regexp_i_wwtt",
|
2167
|
-
"Ruby" =>
|
2161
|
+
"Ruby" => "str.split(//i)",
|
2168
2162
|
"ParseTree" => s(:call,
|
2169
2163
|
s(:call, nil, :str),
|
2170
2164
|
:split,
|
@@ -2369,7 +2363,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
2369
2363
|
s(:call,
|
2370
2364
|
s(:call, nil, :d),
|
2371
2365
|
:e,
|
2372
|
-
s(:str,
|
2366
|
+
s(:str, "f")))))
|
2373
2367
|
|
2374
2368
|
add_tests("match",
|
2375
2369
|
"Ruby" => "1 if /x/",
|
@@ -3083,7 +3077,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
3083
3077
|
|
3084
3078
|
add_tests("xstr",
|
3085
3079
|
"Ruby" => "`touch 5`",
|
3086
|
-
"ParseTree" => s(:xstr,
|
3080
|
+
"ParseTree" => s(:xstr, "touch 5"))
|
3087
3081
|
|
3088
3082
|
add_tests("yield_0",
|
3089
3083
|
"Ruby" => "yield",
|
@@ -3125,3 +3119,5 @@ class ParseTreeTestCase < Minitest::Test
|
|
3125
3119
|
# end
|
3126
3120
|
|
3127
3121
|
end
|
3122
|
+
|
3123
|
+
# :startdoc:
|
@@ -0,0 +1,1414 @@
|
|
1
|
+
$TESTING ||= false # unless defined $TESTING
|
2
|
+
|
3
|
+
##
|
4
|
+
# Sexps are the basic storage mechanism of SexpProcessor. Sexps have
|
5
|
+
# a +type+ (to be renamed +node_type+) which is the first element of
|
6
|
+
# the Sexp. The type is used by SexpProcessor to determine whom to
|
7
|
+
# dispatch the Sexp to for processing.
|
8
|
+
|
9
|
+
class Sexp < Array # ZenTest FULL
|
10
|
+
##
|
11
|
+
# A setter for the line this sexp was found on. Usually set by ruby_parser.
|
12
|
+
|
13
|
+
attr_writer :line
|
14
|
+
|
15
|
+
##
|
16
|
+
# Accessors for the file. Usually set by ruby_parser.
|
17
|
+
|
18
|
+
attr_accessor :file
|
19
|
+
|
20
|
+
##
|
21
|
+
# Optional comments above/aside this sexp. Usually set by ruby_parser.
|
22
|
+
|
23
|
+
attr_accessor :comments
|
24
|
+
|
25
|
+
@@array_types = [ :array, :args ] # TODO: remove
|
26
|
+
|
27
|
+
##
|
28
|
+
# Create a new Sexp containing +args+.
|
29
|
+
|
30
|
+
def initialize *args
|
31
|
+
super(args)
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# Creates a new Sexp from Array +a+.
|
36
|
+
|
37
|
+
def self.from_array a
|
38
|
+
ary = Array === a ? a : [a]
|
39
|
+
|
40
|
+
self.new(*ary.map { |x|
|
41
|
+
case x
|
42
|
+
when Sexp
|
43
|
+
x
|
44
|
+
when Array
|
45
|
+
self.from_array(x)
|
46
|
+
else
|
47
|
+
x
|
48
|
+
end
|
49
|
+
})
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# Creates a new sexp with the new contents of +body+, but with the
|
54
|
+
# same +file+, +line+, and +comment+ as self.
|
55
|
+
|
56
|
+
def new(*body)
|
57
|
+
r = self.class.new(*body) # ensures a sexp from map
|
58
|
+
r.file = self.file if self.file
|
59
|
+
r.line = self.line if self.line
|
60
|
+
r.comments = self.comments if self.comments
|
61
|
+
r
|
62
|
+
end
|
63
|
+
|
64
|
+
def map &blk # :nodoc:
|
65
|
+
self.new(*super(&blk)) # ensures a sexp from map
|
66
|
+
end
|
67
|
+
|
68
|
+
def == obj # :nodoc:
|
69
|
+
obj.class == self.class and super # only because of a bug in ruby
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# Returns true if the node_type is +array+ or +args+.
|
74
|
+
#
|
75
|
+
# REFACTOR: to TypedSexp - we only care when we have units.
|
76
|
+
|
77
|
+
def array_type?
|
78
|
+
warn "DEPRECATED: please file an issue if you actually use this. from #{caller.first}"
|
79
|
+
type = self.sexp_type
|
80
|
+
@@array_types.include? type
|
81
|
+
end
|
82
|
+
|
83
|
+
def compact # :nodoc:
|
84
|
+
self.delete_if(&:nil?)
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Recursively enumerates the sexp yielding to +block+ for every element.
|
89
|
+
|
90
|
+
def deep_each &block
|
91
|
+
return enum_for(:deep_each) unless block_given?
|
92
|
+
|
93
|
+
self.each_sexp do |sexp|
|
94
|
+
block[sexp]
|
95
|
+
sexp.deep_each(&block)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
##
|
100
|
+
# Return the maximum depth of the sexp. One-based.
|
101
|
+
|
102
|
+
def depth
|
103
|
+
1 + (each_sexp.map(&:depth).max || 0)
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Enumeratates the sexp yielding to +b+ when the node_type == +t+.
|
108
|
+
|
109
|
+
def each_of_type t, &b
|
110
|
+
return enum_for(:each_of_type) unless block_given?
|
111
|
+
|
112
|
+
each_sexp do | sexp |
|
113
|
+
sexp.each_of_type(t, &b)
|
114
|
+
yield sexp if sexp.sexp_type == t
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Recursively enumerates all sub-sexps skipping non-Sexp elements.
|
120
|
+
|
121
|
+
def each_sexp
|
122
|
+
return enum_for(:each_sexp) unless block_given?
|
123
|
+
|
124
|
+
self.each do |sexp|
|
125
|
+
next unless Sexp === sexp
|
126
|
+
|
127
|
+
yield sexp
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Replaces all elements whose node_type is +from+ with +to+. Used
|
133
|
+
# only for the most trivial of rewrites.
|
134
|
+
|
135
|
+
def find_and_replace_all from, to
|
136
|
+
each_with_index do | elem, index |
|
137
|
+
if Sexp === elem then
|
138
|
+
elem.find_and_replace_all(from, to)
|
139
|
+
elsif elem == from
|
140
|
+
self[index] = to
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# Replaces all Sexps matching +pattern+ with Sexp +repl+.
|
147
|
+
|
148
|
+
def gsub pattern, repl
|
149
|
+
return repl if pattern == self
|
150
|
+
|
151
|
+
new = self.map { |subset|
|
152
|
+
case subset
|
153
|
+
when Sexp then
|
154
|
+
if Matcher === pattern && pattern.satisfy?(subset) then # TODO: make === be satisfy? maybe?
|
155
|
+
repl.dup rescue repl
|
156
|
+
else
|
157
|
+
subset.gsub pattern, repl
|
158
|
+
end
|
159
|
+
else
|
160
|
+
subset
|
161
|
+
end
|
162
|
+
}
|
163
|
+
|
164
|
+
Sexp.from_array new
|
165
|
+
end
|
166
|
+
|
167
|
+
def inspect # :nodoc:
|
168
|
+
sexp_str = self.map(&:inspect).join ", "
|
169
|
+
if ENV["VERBOSE"] && line then
|
170
|
+
"s(#{sexp_str}).line(#{line})"
|
171
|
+
else
|
172
|
+
"s(#{sexp_str})"
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def find_node name, delete = false # :nodoc:
|
177
|
+
matches = find_nodes name
|
178
|
+
|
179
|
+
case matches.size
|
180
|
+
when 0 then
|
181
|
+
nil
|
182
|
+
when 1 then
|
183
|
+
match = matches.first
|
184
|
+
delete match if delete
|
185
|
+
match
|
186
|
+
else
|
187
|
+
raise NoMethodError, "multiple nodes for #{name} were found in #{inspect}"
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# Find every node with type +name+.
|
193
|
+
|
194
|
+
def find_nodes name
|
195
|
+
each_sexp.find_all { |sexp| sexp.sexp_type == name }
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# If passed a line number, sets the line and returns self. Otherwise
|
200
|
+
# returns the line number. This allows you to do message cascades
|
201
|
+
# and still get the sexp back.
|
202
|
+
|
203
|
+
def line n = nil
|
204
|
+
if n then
|
205
|
+
@line = n
|
206
|
+
self
|
207
|
+
else
|
208
|
+
@line ||= nil
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# Returns the maximum line number of the children of self.
|
214
|
+
|
215
|
+
def line_max
|
216
|
+
@line_max ||= self.deep_each.map(&:line).max
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Returns the size of the sexp, flattened.
|
221
|
+
|
222
|
+
def mass
|
223
|
+
@mass ||= inject(1) { |t, s| Sexp === s ? t + s.mass : t }
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# Returns the node named +node+, deleting it if +delete+ is true.
|
228
|
+
|
229
|
+
def method_missing meth, delete = false
|
230
|
+
r = find_node meth, delete
|
231
|
+
if ENV["DEBUG"] then
|
232
|
+
if r.nil? then
|
233
|
+
warn "%p.method_missing(%p) => nil from %s" % [self, meth, caller.first]
|
234
|
+
elsif ENV["VERBOSE"]
|
235
|
+
warn "%p.method_missing(%p) from %s" % [self, meth, caller.first]
|
236
|
+
end
|
237
|
+
end
|
238
|
+
r
|
239
|
+
end
|
240
|
+
|
241
|
+
def respond_to? msg, private = false # :nodoc:
|
242
|
+
# why do I need this? Because ruby 2.0 is broken. That's why.
|
243
|
+
super
|
244
|
+
end
|
245
|
+
|
246
|
+
def pretty_print q # :nodoc:
|
247
|
+
nnd = ")"
|
248
|
+
nnd << ".line(#{line})" if line && ENV["VERBOSE"]
|
249
|
+
|
250
|
+
q.group(1, "s(", nnd) do
|
251
|
+
q.seplist(self) {|v| q.pp v }
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
##
|
256
|
+
# Returns the node type of the Sexp.
|
257
|
+
|
258
|
+
def sexp_type
|
259
|
+
first
|
260
|
+
end
|
261
|
+
|
262
|
+
##
|
263
|
+
# Sets the node type of the Sexp.
|
264
|
+
|
265
|
+
def sexp_type= v
|
266
|
+
self[0] = v
|
267
|
+
end
|
268
|
+
|
269
|
+
##
|
270
|
+
# Returns the Sexp body (starting at +from+, defaulting to 1), ie
|
271
|
+
# the values without the node type.
|
272
|
+
|
273
|
+
def sexp_body from = 1
|
274
|
+
self.new(*self[from..-1])
|
275
|
+
end
|
276
|
+
|
277
|
+
##
|
278
|
+
# Returns the Sexp body, ie the values without the node type.
|
279
|
+
|
280
|
+
def sexp_body= v
|
281
|
+
self[1..-1] = v
|
282
|
+
end
|
283
|
+
|
284
|
+
alias :head :sexp_type
|
285
|
+
alias :rest :sexp_body
|
286
|
+
|
287
|
+
##
|
288
|
+
# If run with debug, Sexp will raise if you shift on an empty
|
289
|
+
# Sexp. Helps with debugging.
|
290
|
+
|
291
|
+
def shift
|
292
|
+
raise "I'm empty" if self.empty?
|
293
|
+
super
|
294
|
+
end if ($DEBUG or $TESTING)
|
295
|
+
|
296
|
+
##
|
297
|
+
# Returns the bare bones structure of the sexp.
|
298
|
+
# s(:a, :b, s(:c, :d), :e) => s(:a, s(:c))
|
299
|
+
|
300
|
+
def structure
|
301
|
+
if Array === self.sexp_type then
|
302
|
+
warn "NOTE: form s(s(:subsexp)).structure is deprecated. Removing in 5.0"
|
303
|
+
s(:bogus, *self).structure # TODO: remove >= 4.2.0
|
304
|
+
else
|
305
|
+
s(self.sexp_type, *each_sexp.map(&:structure))
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
##
|
310
|
+
# Replaces the Sexp matching +pattern+ with +repl+.
|
311
|
+
|
312
|
+
def sub pattern, repl
|
313
|
+
return repl.dup if pattern == self
|
314
|
+
return repl.dup if Matcher === pattern && pattern.satisfy?(self)
|
315
|
+
|
316
|
+
done = false
|
317
|
+
|
318
|
+
new = self.map do |subset|
|
319
|
+
if done then
|
320
|
+
subset
|
321
|
+
else
|
322
|
+
case subset
|
323
|
+
when Sexp then
|
324
|
+
if pattern == subset then
|
325
|
+
done = true
|
326
|
+
repl.dup rescue repl
|
327
|
+
elsif Matcher === pattern && pattern.satisfy?(subset) then
|
328
|
+
done = true
|
329
|
+
repl.dup rescue repl
|
330
|
+
else
|
331
|
+
subset.sub pattern, repl
|
332
|
+
end
|
333
|
+
else
|
334
|
+
subset
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
Sexp.from_array new
|
340
|
+
end
|
341
|
+
|
342
|
+
def to_a # :nodoc:
|
343
|
+
self.map { |o| Sexp === o ? o.to_a : o }
|
344
|
+
end
|
345
|
+
|
346
|
+
alias to_s inspect # :nodoc:
|
347
|
+
end
|
348
|
+
|
349
|
+
##
|
350
|
+
# This is a very important shortcut to make using Sexps much more awesome.
|
351
|
+
#
|
352
|
+
# In its normal form +s(...)+, creates a Sexp instance. If passed a
|
353
|
+
# block, it creates a Sexp::Matcher using the factory methods on Sexp.
|
354
|
+
#
|
355
|
+
# See Matcher and other factory class methods on Sexp.
|
356
|
+
|
357
|
+
def s *args, &blk
|
358
|
+
return Sexp.class_eval(&blk) if blk
|
359
|
+
Sexp.new(*args)
|
360
|
+
end
|
361
|
+
|
362
|
+
class Sexp #:nodoc:
|
363
|
+
##
|
364
|
+
# Verifies that +pattern+ is a Matcher and then dispatches to its
|
365
|
+
# #=~ method.
|
366
|
+
#
|
367
|
+
# See Matcher.=~
|
368
|
+
|
369
|
+
def =~ pattern
|
370
|
+
raise ArgumentError, "Not a pattern: %p" % [pattern] unless Matcher === pattern
|
371
|
+
pattern =~ self
|
372
|
+
end
|
373
|
+
|
374
|
+
##
|
375
|
+
# Verifies that +pattern+ is a Matcher and then dispatches to its
|
376
|
+
# #satisfy? method.
|
377
|
+
#
|
378
|
+
# TODO: rename match?
|
379
|
+
|
380
|
+
def satisfy? pattern
|
381
|
+
raise ArgumentError, "Not a pattern: %p" % [pattern] unless Matcher === pattern
|
382
|
+
pattern.satisfy? self
|
383
|
+
end
|
384
|
+
|
385
|
+
##
|
386
|
+
# Verifies that +pattern+ is a Matcher and then dispatches to its #/
|
387
|
+
# method.
|
388
|
+
#
|
389
|
+
# TODO: rename grep? match_all ? find_all ?
|
390
|
+
|
391
|
+
def / pattern
|
392
|
+
raise ArgumentError, "Not a pattern: %p" % [pattern] unless Matcher === pattern
|
393
|
+
pattern / self
|
394
|
+
end
|
395
|
+
|
396
|
+
##
|
397
|
+
# Recursively searches for the +pattern+ yielding the matches.
|
398
|
+
|
399
|
+
def search_each pattern, &block # TODO: rename to grep?
|
400
|
+
raise ArgumentError, "Needs a pattern" unless pattern.kind_of? Matcher
|
401
|
+
|
402
|
+
return enum_for(:search_each, pattern) unless block_given?
|
403
|
+
|
404
|
+
if pattern.satisfy? self then
|
405
|
+
yield self
|
406
|
+
end
|
407
|
+
|
408
|
+
self.each_sexp do |subset|
|
409
|
+
subset.search_each pattern, &block
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
##
|
414
|
+
# Recursively searches for the +pattern+ yielding each match, and
|
415
|
+
# replacing it with the result of the block.
|
416
|
+
#
|
417
|
+
|
418
|
+
def replace_sexp pattern, &block # TODO: rename to gsub?
|
419
|
+
raise ArgumentError, "Needs a pattern" unless pattern.kind_of? Matcher
|
420
|
+
|
421
|
+
return yield self if pattern.satisfy? self
|
422
|
+
|
423
|
+
# TODO: Needs #new_from(*new_body) to copy file/line/comment
|
424
|
+
self.class.new(*self.map { |subset|
|
425
|
+
case subset
|
426
|
+
when Sexp then
|
427
|
+
subset.replace_sexp pattern, &block
|
428
|
+
else
|
429
|
+
subset
|
430
|
+
end
|
431
|
+
})
|
432
|
+
end
|
433
|
+
|
434
|
+
##
|
435
|
+
# Matches an S-Expression.
|
436
|
+
#
|
437
|
+
# See Matcher for examples.
|
438
|
+
|
439
|
+
def self.s *args
|
440
|
+
Matcher.new(*args)
|
441
|
+
end
|
442
|
+
|
443
|
+
##
|
444
|
+
# Matches any single item.
|
445
|
+
#
|
446
|
+
# See Wild for examples.
|
447
|
+
|
448
|
+
def self._
|
449
|
+
Wild.new
|
450
|
+
end
|
451
|
+
|
452
|
+
# TODO: reorder factory methods and classes to match
|
453
|
+
|
454
|
+
##
|
455
|
+
# Matches all remaining input.
|
456
|
+
#
|
457
|
+
# See Remaining for examples.
|
458
|
+
|
459
|
+
def self.___
|
460
|
+
Remaining.new
|
461
|
+
end
|
462
|
+
|
463
|
+
##
|
464
|
+
# Matches an expression or any expression that includes the child.
|
465
|
+
#
|
466
|
+
# See Include for examples.
|
467
|
+
|
468
|
+
def self.include child # TODO: rename, name is generic ruby
|
469
|
+
Include.new(child)
|
470
|
+
end
|
471
|
+
|
472
|
+
##
|
473
|
+
# Matches any atom.
|
474
|
+
#
|
475
|
+
# See Atom for examples.
|
476
|
+
|
477
|
+
def self.atom
|
478
|
+
Atom.new
|
479
|
+
end
|
480
|
+
|
481
|
+
##
|
482
|
+
# Matches when any of the sub-expressions match.
|
483
|
+
#
|
484
|
+
# This is also available via Matcher#|.
|
485
|
+
#
|
486
|
+
# See Any for examples.
|
487
|
+
|
488
|
+
def self.any *args
|
489
|
+
Any.new(*args)
|
490
|
+
end
|
491
|
+
|
492
|
+
##
|
493
|
+
# Matches only when all sub-expressions match.
|
494
|
+
#
|
495
|
+
# This is also available via Matcher#&.
|
496
|
+
#
|
497
|
+
# See All for examples.
|
498
|
+
|
499
|
+
def self.all *args
|
500
|
+
All.new(*args)
|
501
|
+
end
|
502
|
+
|
503
|
+
##
|
504
|
+
# Matches when sub-expression does not match.
|
505
|
+
#
|
506
|
+
# This is also available via Matcher#-@.
|
507
|
+
#
|
508
|
+
# See Not for examples.
|
509
|
+
|
510
|
+
def self.not? arg
|
511
|
+
Not.new arg
|
512
|
+
end
|
513
|
+
|
514
|
+
# TODO: add Sibling factory method?
|
515
|
+
|
516
|
+
##
|
517
|
+
# Matches anything that has a child matching the sub-expression.
|
518
|
+
#
|
519
|
+
# See Child for examples.
|
520
|
+
|
521
|
+
def self.child child
|
522
|
+
Child.new child
|
523
|
+
end
|
524
|
+
|
525
|
+
##
|
526
|
+
# Matches anything having the same sexp_type, which is the first
|
527
|
+
# value in a Sexp.
|
528
|
+
#
|
529
|
+
# See Type for examples.
|
530
|
+
|
531
|
+
def self.t name
|
532
|
+
Type.new name
|
533
|
+
end
|
534
|
+
|
535
|
+
##
|
536
|
+
# Matches any atom who's string representation matches the patterns
|
537
|
+
# passed in.
|
538
|
+
#
|
539
|
+
# See Pattern for examples.
|
540
|
+
|
541
|
+
def self.m *values
|
542
|
+
res = values.map { |value|
|
543
|
+
case value
|
544
|
+
when Regexp then
|
545
|
+
value
|
546
|
+
else
|
547
|
+
re = Regexp.escape value.to_s
|
548
|
+
Regexp.new "\\A%s\\Z" % re
|
549
|
+
end
|
550
|
+
}
|
551
|
+
Pattern.new Regexp.union(*res)
|
552
|
+
end
|
553
|
+
|
554
|
+
##
|
555
|
+
# Defines a family of objects that can be used to match sexps to
|
556
|
+
# certain types of patterns, much like regexps can be used on
|
557
|
+
# strings. Generally you won't use this class directly.
|
558
|
+
#
|
559
|
+
# You would normally create a matcher using the top-level #s method,
|
560
|
+
# but with a block, calling into the Sexp factory methods. For example:
|
561
|
+
#
|
562
|
+
# s{ s(:class, m(/^Test/), _, ___) }
|
563
|
+
#
|
564
|
+
# This creates a matcher for classes whose names start with "Test".
|
565
|
+
# It uses Sexp.m to create a Sexp::Matcher::Pattern matcher, Sexp._
|
566
|
+
# to create a Sexp::Matcher::Wild matcher, and Sexp.___ to create a
|
567
|
+
# Sexp::Matcher::Remaining matcher. It works like this:
|
568
|
+
#
|
569
|
+
# s{ # start to create a pattern
|
570
|
+
# s( # create a sexp matcher
|
571
|
+
# :class. # for class nodes
|
572
|
+
# m(/^Test/), # matching name slots that start with "Test"
|
573
|
+
# _, # any superclass value
|
574
|
+
# ___ # and whatever is in the class
|
575
|
+
# )
|
576
|
+
# }
|
577
|
+
#
|
578
|
+
# Then you can use that with #=~, #/, Sexp#replace_sexp, and others.
|
579
|
+
#
|
580
|
+
# For more examples, see the various Sexp class methods, the examples,
|
581
|
+
# and the tests supplied with Sexp.
|
582
|
+
#
|
583
|
+
# * For pattern creation, see factory methods: Sexp::_, Sexp::___, etc.
|
584
|
+
# * For matching returning truthy/falsey results, see Sexp#=~.
|
585
|
+
# * See Sexp#=~ for matching returning truthy/falsey results.
|
586
|
+
# * For case expressions, see Matcher#===.
|
587
|
+
# * For getting all subtree matches, see Sexp#/.
|
588
|
+
#
|
589
|
+
# If rdoc didn't suck, these would all be links.
|
590
|
+
|
591
|
+
class Matcher < Sexp
|
592
|
+
##
|
593
|
+
# Should #=~ match sub-trees?
|
594
|
+
|
595
|
+
def self.match_subs?
|
596
|
+
@@match_subs
|
597
|
+
end
|
598
|
+
|
599
|
+
##
|
600
|
+
# Setter for +match_subs?+.
|
601
|
+
|
602
|
+
def self.match_subs= o
|
603
|
+
@@match_subs = o
|
604
|
+
end
|
605
|
+
|
606
|
+
self.match_subs = true
|
607
|
+
|
608
|
+
##
|
609
|
+
# Does this matcher actually match +o+? Returns falsey if +o+ is
|
610
|
+
# not a Sexp or if any sub-tree of +o+ is not satisfied by or
|
611
|
+
# equal to its corresponding sub-matcher.
|
612
|
+
#
|
613
|
+
#--
|
614
|
+
# TODO: push this up to Sexp and make this the workhorse
|
615
|
+
# TODO: do the same with ===/satisfy?
|
616
|
+
|
617
|
+
def satisfy? o
|
618
|
+
return unless o.kind_of?(Sexp) &&
|
619
|
+
(length == o.length || Matcher === last && last.greedy?)
|
620
|
+
|
621
|
+
each_with_index.all? { |child, i|
|
622
|
+
sexp = o.at i
|
623
|
+
if Sexp === child then # TODO: when will this NOT be a matcher?
|
624
|
+
sexp = o.sexp_body i if child.respond_to?(:greedy?) && child.greedy?
|
625
|
+
child.satisfy? sexp
|
626
|
+
else
|
627
|
+
child == sexp
|
628
|
+
end
|
629
|
+
}
|
630
|
+
end
|
631
|
+
|
632
|
+
##
|
633
|
+
# Tree equivalent to String#=~, returns true if +self+ matches
|
634
|
+
# +sexp+ as a whole or in a sub-tree (if +match_subs?+).
|
635
|
+
#
|
636
|
+
# TODO: maybe this should NOT be aliased to === ?
|
637
|
+
#
|
638
|
+
# TODO: example
|
639
|
+
|
640
|
+
def =~ sexp
|
641
|
+
raise ArgumentError, "Can't both be matchers: %p" % [sexp] if Matcher === sexp
|
642
|
+
|
643
|
+
self.satisfy?(sexp) ||
|
644
|
+
(self.class.match_subs? && sexp.each_sexp.any? { |sub| self =~ sub })
|
645
|
+
end
|
646
|
+
|
647
|
+
alias === =~ # TODO?: alias === satisfy?
|
648
|
+
|
649
|
+
##
|
650
|
+
# Searches through +sexp+ for all sub-trees that match this
|
651
|
+
# matcher and returns a MatchCollection for each match.
|
652
|
+
#
|
653
|
+
# TODO: redirect?
|
654
|
+
# Example:
|
655
|
+
# Q{ s(:b) } / s(:a, s(:b)) => [s(:b)]
|
656
|
+
|
657
|
+
def / sexp
|
658
|
+
raise ArgumentError, "can't both be matchers" if Matcher === sexp
|
659
|
+
|
660
|
+
# TODO: move search_each into matcher?
|
661
|
+
MatchCollection.new sexp.search_each(self).to_a
|
662
|
+
end
|
663
|
+
|
664
|
+
##
|
665
|
+
# Combines the Matcher with another Matcher, the resulting one will
|
666
|
+
# be satisfied if either Matcher would be satisfied.
|
667
|
+
#
|
668
|
+
# TODO: redirect
|
669
|
+
# Example:
|
670
|
+
# s(:a) | s(:b)
|
671
|
+
|
672
|
+
def | other
|
673
|
+
Any.new self, other
|
674
|
+
end
|
675
|
+
|
676
|
+
##
|
677
|
+
# Combines the Matcher with another Matcher, the resulting one will
|
678
|
+
# be satisfied only if both Matchers would be satisfied.
|
679
|
+
#
|
680
|
+
# TODO: redirect
|
681
|
+
# Example:
|
682
|
+
# t(:a) & include(:b)
|
683
|
+
|
684
|
+
def & other
|
685
|
+
All.new self, other
|
686
|
+
end
|
687
|
+
|
688
|
+
##
|
689
|
+
# Returns a Matcher that matches whenever this Matcher would not have matched
|
690
|
+
#
|
691
|
+
# Example:
|
692
|
+
# -s(:a)
|
693
|
+
|
694
|
+
def -@
|
695
|
+
Not.new self
|
696
|
+
end
|
697
|
+
|
698
|
+
##
|
699
|
+
# Returns a Matcher that matches if this has a sibling +o+
|
700
|
+
#
|
701
|
+
# Example:
|
702
|
+
# s(:a) >> s(:b)
|
703
|
+
|
704
|
+
def >> other
|
705
|
+
Sibling.new self, other
|
706
|
+
end
|
707
|
+
|
708
|
+
##
|
709
|
+
# Is this matcher greedy? Defaults to false.
|
710
|
+
|
711
|
+
def greedy?
|
712
|
+
false
|
713
|
+
end
|
714
|
+
|
715
|
+
def inspect # :nodoc:
|
716
|
+
s = super
|
717
|
+
s[0] = "q"
|
718
|
+
s
|
719
|
+
end
|
720
|
+
|
721
|
+
def pretty_print q # :nodoc:
|
722
|
+
q.group 1, "q(", ")" do
|
723
|
+
q.seplist self do |v|
|
724
|
+
q.pp v
|
725
|
+
end
|
726
|
+
end
|
727
|
+
end
|
728
|
+
|
729
|
+
##
|
730
|
+
# Parse a lispy string representation of a matcher into a Matcher.
|
731
|
+
# See +Parser+.
|
732
|
+
|
733
|
+
def self.parse s
|
734
|
+
Parser.new(s).parse
|
735
|
+
end
|
736
|
+
|
737
|
+
##
|
738
|
+
# Converts from a lispy string to Sexp matchers in a safe manner.
|
739
|
+
#
|
740
|
+
# "(a 42 _ (c) [t x] ___)" => s{ s(:a, 42, _, s(:c), t(:x), ___) }
|
741
|
+
|
742
|
+
class Parser
|
743
|
+
|
744
|
+
##
|
745
|
+
# The stream of tokens to parse. See #lex.
|
746
|
+
|
747
|
+
attr_accessor :tokens
|
748
|
+
|
749
|
+
##
|
750
|
+
# Create a new Parser instance on +s+
|
751
|
+
|
752
|
+
def initialize s
|
753
|
+
self.tokens = []
|
754
|
+
lex s
|
755
|
+
end
|
756
|
+
|
757
|
+
##
|
758
|
+
# Converts +s+ into a stream of tokens and adds them to +tokens+.
|
759
|
+
|
760
|
+
def lex s
|
761
|
+
tokens.concat s.scan(%r%[()\[\]]|\"[^"]*\"|/[^/]*/|[\w-]+%)
|
762
|
+
end
|
763
|
+
|
764
|
+
##
|
765
|
+
# Returns the next token and removes it from the stream or raises if empty.
|
766
|
+
|
767
|
+
def next_token
|
768
|
+
raise SyntaxError, "unbalanced input" if tokens.empty?
|
769
|
+
tokens.shift
|
770
|
+
end
|
771
|
+
|
772
|
+
##
|
773
|
+
# Returns the next token without removing it from the stream.
|
774
|
+
|
775
|
+
def peek_token
|
776
|
+
tokens.first
|
777
|
+
end
|
778
|
+
|
779
|
+
##
|
780
|
+
# Parses tokens and returns a +Matcher+ instance.
|
781
|
+
|
782
|
+
def parse
|
783
|
+
result = parse_sexp until tokens.empty?
|
784
|
+
result
|
785
|
+
end
|
786
|
+
|
787
|
+
##
|
788
|
+
# Parses a string into a sexp matcher:
|
789
|
+
#
|
790
|
+
# SEXP : "(" SEXP:args* ")" => Sexp.q(*args)
|
791
|
+
# | "[" CMD:cmd sexp:args* "]" => Sexp.cmd(*args)
|
792
|
+
# | "nil" => nil
|
793
|
+
# | /\d+/:n => n.to_i
|
794
|
+
# | "___" => Sexp.___
|
795
|
+
# | "_" => Sexp._
|
796
|
+
# | /^\/(.*)\/$/:re => Regexp.new re[0]
|
797
|
+
# | /^"(.*)"$/:s => String.new s[0]
|
798
|
+
# | NAME:name => name.to_sym
|
799
|
+
# NAME : /\w+/
|
800
|
+
# CMD : "t" | "m" | "atom"
|
801
|
+
|
802
|
+
def parse_sexp
|
803
|
+
token = next_token
|
804
|
+
|
805
|
+
case token
|
806
|
+
when "(" then
|
807
|
+
parse_list
|
808
|
+
when "[" then
|
809
|
+
parse_cmd
|
810
|
+
when "nil" then
|
811
|
+
nil
|
812
|
+
when /^\d+$/ then
|
813
|
+
token.to_i
|
814
|
+
when "___" then
|
815
|
+
Sexp.___
|
816
|
+
when "_" then
|
817
|
+
Sexp._
|
818
|
+
when %r%^/(.*)/$% then
|
819
|
+
re = $1
|
820
|
+
raise SyntaxError, "Not allowed: /%p/" % [re] unless
|
821
|
+
re =~ /\A([\w()|.*+^$]+)\z/
|
822
|
+
Regexp.new re
|
823
|
+
when /^"(.*)"$/ then
|
824
|
+
$1
|
825
|
+
when /^\w+$/ then
|
826
|
+
token.to_sym
|
827
|
+
else
|
828
|
+
raise SyntaxError, "unhandled token: %p" % [token]
|
829
|
+
end
|
830
|
+
end
|
831
|
+
|
832
|
+
##
|
833
|
+
# Parses a balanced list of expressions and returns the
|
834
|
+
# equivalent matcher.
|
835
|
+
|
836
|
+
def parse_list
|
837
|
+
result = []
|
838
|
+
|
839
|
+
result << parse_sexp while peek_token && peek_token != ")"
|
840
|
+
next_token # pop off ")"
|
841
|
+
|
842
|
+
Sexp.s(*result)
|
843
|
+
end
|
844
|
+
|
845
|
+
##
|
846
|
+
# A collection of allowed commands to convert into matchers.
|
847
|
+
|
848
|
+
ALLOWED = [:t, :m, :atom].freeze
|
849
|
+
|
850
|
+
##
|
851
|
+
# Parses a balanced command. A command is denoted by square
|
852
|
+
# brackets and must conform to a whitelisted set of allowed
|
853
|
+
# commands (see +ALLOWED+).
|
854
|
+
|
855
|
+
def parse_cmd
|
856
|
+
args = []
|
857
|
+
args << parse_sexp while peek_token && peek_token != "]"
|
858
|
+
next_token # pop off "]"
|
859
|
+
|
860
|
+
cmd = args.shift
|
861
|
+
args = Sexp.s(*args)
|
862
|
+
|
863
|
+
raise SyntaxError, "bad cmd: %p" % [cmd] unless ALLOWED.include? cmd
|
864
|
+
|
865
|
+
result = Sexp.send cmd, *args
|
866
|
+
|
867
|
+
result
|
868
|
+
end
|
869
|
+
end # class Parser
|
870
|
+
end # class Matcher
|
871
|
+
|
872
|
+
##
|
873
|
+
# Matches any single item.
|
874
|
+
#
|
875
|
+
# examples:
|
876
|
+
#
|
877
|
+
# s(:a) / s{ _ } #=> [s(:a)]
|
878
|
+
# s(:a, s(s(:b))) / s{ s(_) } #=> [s(s(:b))]
|
879
|
+
|
880
|
+
class Wild < Matcher
|
881
|
+
##
|
882
|
+
# Matches any single element.
|
883
|
+
|
884
|
+
def satisfy? o
|
885
|
+
true
|
886
|
+
end
|
887
|
+
|
888
|
+
def inspect # :nodoc:
|
889
|
+
"_"
|
890
|
+
end
|
891
|
+
|
892
|
+
def pretty_print q # :nodoc:
|
893
|
+
q.text "_"
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
##
|
898
|
+
# Matches all remaining input. If remaining comes before any other
|
899
|
+
# matchers, they will be ignored.
|
900
|
+
#
|
901
|
+
# examples:
|
902
|
+
#
|
903
|
+
# s(:a) / s{ s(:a, ___ ) } #=> [s(:a)]
|
904
|
+
# s(:a, :b, :c) / s{ s(:a, ___ ) } #=> [s(:a, :b, :c)]
|
905
|
+
|
906
|
+
class Remaining < Matcher
|
907
|
+
##
|
908
|
+
# Always satisfied once this is reached. Think of it as a var arg.
|
909
|
+
|
910
|
+
def satisfy? o
|
911
|
+
true
|
912
|
+
end
|
913
|
+
|
914
|
+
def greedy?
|
915
|
+
true
|
916
|
+
end
|
917
|
+
|
918
|
+
def inspect # :nodoc:
|
919
|
+
"___"
|
920
|
+
end
|
921
|
+
|
922
|
+
def pretty_print q # :nodoc:
|
923
|
+
q.text "___"
|
924
|
+
end
|
925
|
+
end
|
926
|
+
|
927
|
+
##
|
928
|
+
# Matches when any of the sub-expressions match.
|
929
|
+
#
|
930
|
+
# This is also available via Matcher#|.
|
931
|
+
#
|
932
|
+
# examples:
|
933
|
+
#
|
934
|
+
# s(:a) / s{ any(s(:a), s(:b)) } #=> [s(:a)]
|
935
|
+
# s(:a) / s{ s(:a) | s(:b) } #=> [s(:a)] # same thing via |
|
936
|
+
# s(:a) / s{ any(s(:b), s(:c)) } #=> []
|
937
|
+
|
938
|
+
class Any < Matcher
|
939
|
+
##
|
940
|
+
# The collection of sub-matchers to match against.
|
941
|
+
|
942
|
+
attr_reader :options
|
943
|
+
|
944
|
+
##
|
945
|
+
# Create an Any matcher which will match any of the +options+.
|
946
|
+
|
947
|
+
def initialize *options
|
948
|
+
@options = options
|
949
|
+
end
|
950
|
+
|
951
|
+
##
|
952
|
+
# Satisfied when any sub expressions match +o+
|
953
|
+
|
954
|
+
def satisfy? o
|
955
|
+
options.any? { |exp|
|
956
|
+
Sexp === exp && exp.satisfy?(o) || exp == o
|
957
|
+
}
|
958
|
+
end
|
959
|
+
|
960
|
+
def == o # :nodoc:
|
961
|
+
super && self.options == o.options
|
962
|
+
end
|
963
|
+
|
964
|
+
def inspect # :nodoc:
|
965
|
+
options.map(&:inspect).join(" | ")
|
966
|
+
end
|
967
|
+
|
968
|
+
def pretty_print q # :nodoc:
|
969
|
+
q.group 1, "any(", ")" do
|
970
|
+
q.seplist options do |v|
|
971
|
+
q.pp v
|
972
|
+
end
|
973
|
+
end
|
974
|
+
end
|
975
|
+
end
|
976
|
+
|
977
|
+
##
|
978
|
+
# Matches only when all sub-expressions match.
|
979
|
+
#
|
980
|
+
# This is also available via Matcher#&.
|
981
|
+
#
|
982
|
+
# examples:
|
983
|
+
#
|
984
|
+
# s(:a) / s{ all(s(:a), s(:b)) } #=> []
|
985
|
+
# s(:a, :b) / s{ t(:a) & include(:b)) } #=> [s(:a, :b)]
|
986
|
+
|
987
|
+
class All < Matcher
|
988
|
+
##
|
989
|
+
# The collection of sub-matchers to match against.
|
990
|
+
|
991
|
+
attr_reader :options
|
992
|
+
|
993
|
+
##
|
994
|
+
# Create an All matcher which will match all of the +options+.
|
995
|
+
|
996
|
+
def initialize *options
|
997
|
+
@options = options
|
998
|
+
end
|
999
|
+
|
1000
|
+
##
|
1001
|
+
# Satisfied when all sub expressions match +o+
|
1002
|
+
|
1003
|
+
def satisfy? o
|
1004
|
+
options.all? { |exp|
|
1005
|
+
exp.kind_of?(Sexp) ? exp.satisfy?(o) : exp == o
|
1006
|
+
}
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
def == o # :nodoc:
|
1010
|
+
super && self.options == o.options
|
1011
|
+
end
|
1012
|
+
|
1013
|
+
def inspect # :nodoc:
|
1014
|
+
options.map(&:inspect).join(" & ")
|
1015
|
+
end
|
1016
|
+
|
1017
|
+
def pretty_print q # :nodoc:
|
1018
|
+
q.group 1, "all(", ")" do
|
1019
|
+
q.seplist options do |v|
|
1020
|
+
q.pp v
|
1021
|
+
end
|
1022
|
+
end
|
1023
|
+
end
|
1024
|
+
end
|
1025
|
+
|
1026
|
+
##
|
1027
|
+
# Matches when sub-expression does not match.
|
1028
|
+
#
|
1029
|
+
# This is also available via Matcher#-@.
|
1030
|
+
#
|
1031
|
+
# examples:
|
1032
|
+
#
|
1033
|
+
# s(:a) / s{ not?(s(:b)) } #=> [s(:a)]
|
1034
|
+
# s(:a) / s{ -s(:b) } #=> [s(:a)]
|
1035
|
+
# s(:a) / s{ s(not? :a) } #=> []
|
1036
|
+
|
1037
|
+
class Not < Matcher
|
1038
|
+
|
1039
|
+
##
|
1040
|
+
# The value to negate in the match.
|
1041
|
+
|
1042
|
+
attr_reader :value
|
1043
|
+
|
1044
|
+
##
|
1045
|
+
# Creates a Matcher which will match any Sexp that does not match the +value+
|
1046
|
+
|
1047
|
+
def initialize value
|
1048
|
+
@value = value
|
1049
|
+
end
|
1050
|
+
|
1051
|
+
def == o # :nodoc:
|
1052
|
+
super && self.value == o.value
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
##
|
1056
|
+
# Satisfied if a +o+ does not match the +value+
|
1057
|
+
|
1058
|
+
def satisfy? o
|
1059
|
+
!(value.kind_of?(Sexp) ? value.satisfy?(o) : value == o)
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
def inspect # :nodoc:
|
1063
|
+
"not?(%p)" % [value]
|
1064
|
+
end
|
1065
|
+
|
1066
|
+
def pretty_print q # :nodoc:
|
1067
|
+
q.group 1, "not?(", ")" do
|
1068
|
+
q.pp value
|
1069
|
+
end
|
1070
|
+
end
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
##
|
1074
|
+
# Matches anything that has a child matching the sub-expression
|
1075
|
+
#
|
1076
|
+
# example:
|
1077
|
+
#
|
1078
|
+
# s(s(s(s(s(:a))))) / s{ child(s(:a)) } #=> [s(s(s(s(s(:a))))),
|
1079
|
+
# s(s(s(s(:a)))),
|
1080
|
+
# s(s(s(:a))),
|
1081
|
+
# s(s(:a)),
|
1082
|
+
# s(:a)]
|
1083
|
+
|
1084
|
+
class Child < Matcher
|
1085
|
+
##
|
1086
|
+
# The child to match.
|
1087
|
+
|
1088
|
+
attr_reader :child
|
1089
|
+
|
1090
|
+
##
|
1091
|
+
# Create a Child matcher which will match anything having a
|
1092
|
+
# descendant matching +child+.
|
1093
|
+
|
1094
|
+
def initialize child
|
1095
|
+
@child = child
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
##
|
1099
|
+
# Satisfied if matches +child+ or +o+ has a descendant matching
|
1100
|
+
# +child+.
|
1101
|
+
|
1102
|
+
def satisfy? o
|
1103
|
+
if child.satisfy? o
|
1104
|
+
true
|
1105
|
+
elsif o.kind_of? Sexp
|
1106
|
+
o.search_each(child).any?
|
1107
|
+
end
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
def == o # :nodoc:
|
1111
|
+
super && self.child == o.child
|
1112
|
+
end
|
1113
|
+
|
1114
|
+
def inspect # :nodoc:
|
1115
|
+
"child(%p)" % [child]
|
1116
|
+
end
|
1117
|
+
|
1118
|
+
def pretty_print q # :nodoc:
|
1119
|
+
q.group 1, "child(", ")" do
|
1120
|
+
q.pp child
|
1121
|
+
end
|
1122
|
+
end
|
1123
|
+
end
|
1124
|
+
|
1125
|
+
##
|
1126
|
+
# Matches any atom (non-Sexp).
|
1127
|
+
#
|
1128
|
+
# examples:
|
1129
|
+
#
|
1130
|
+
# s(:a) / s{ s(atom) } #=> [s(:a)]
|
1131
|
+
# s(:a, s(:b)) / s{ s(atom) } #=> [s(:b)]
|
1132
|
+
|
1133
|
+
class Atom < Matcher
|
1134
|
+
##
|
1135
|
+
# Satisfied when +o+ is an atom.
|
1136
|
+
|
1137
|
+
def satisfy? o
|
1138
|
+
!(o.kind_of? Sexp)
|
1139
|
+
end
|
1140
|
+
|
1141
|
+
def inspect #:nodoc:
|
1142
|
+
"atom"
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
def pretty_print q # :nodoc:
|
1146
|
+
q.text "atom"
|
1147
|
+
end
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
##
|
1151
|
+
# Matches any atom who's string representation matches the patterns
|
1152
|
+
# passed in.
|
1153
|
+
#
|
1154
|
+
# examples:
|
1155
|
+
#
|
1156
|
+
# s(:a) / s{ m('a') } #=> [s(:a)]
|
1157
|
+
# s(:a) / s{ m(/\w/,/\d/) } #=> [s(:a)]
|
1158
|
+
# s(:tests, s(s(:test_a), s(:test_b))) / s{ m(/test_\w/) } #=> [s(:test_a),
|
1159
|
+
#
|
1160
|
+
# TODO: maybe don't require non-sexps? This does respond to =~ now.
|
1161
|
+
|
1162
|
+
class Pattern < Matcher
|
1163
|
+
|
1164
|
+
##
|
1165
|
+
# The regexp to match for the pattern.
|
1166
|
+
|
1167
|
+
attr_reader :pattern
|
1168
|
+
|
1169
|
+
def == o # :nodoc:
|
1170
|
+
super && self.pattern == o.pattern
|
1171
|
+
end
|
1172
|
+
|
1173
|
+
##
|
1174
|
+
# Create a Patten matcher which will match any atom that either
|
1175
|
+
# matches the input +pattern+.
|
1176
|
+
|
1177
|
+
def initialize pattern
|
1178
|
+
@pattern = pattern
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
##
|
1182
|
+
# Satisfied if +o+ is an atom, and +o+ matches +pattern+
|
1183
|
+
|
1184
|
+
def satisfy? o
|
1185
|
+
!o.kind_of?(Sexp) && o.to_s =~ pattern # TODO: question to_s
|
1186
|
+
end
|
1187
|
+
|
1188
|
+
def inspect # :nodoc:
|
1189
|
+
"m(%p)" % pattern
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
def pretty_print q # :nodoc:
|
1193
|
+
q.group 1, "m(", ")" do
|
1194
|
+
q.pp pattern
|
1195
|
+
end
|
1196
|
+
end
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
##
|
1200
|
+
# Matches anything having the same sexp_type, which is the first
|
1201
|
+
# value in a Sexp.
|
1202
|
+
#
|
1203
|
+
# examples:
|
1204
|
+
#
|
1205
|
+
# s(:a, :b) / s{ t(:a) } #=> [s(:a, :b)]
|
1206
|
+
# s(:a, :b) / s{ t(:b) } #=> []
|
1207
|
+
# s(:a, s(:b, :c)) / s{ t(:b) } #=> [s(:b, :c)]
|
1208
|
+
|
1209
|
+
class Type < Matcher
|
1210
|
+
attr_reader :sexp_type
|
1211
|
+
|
1212
|
+
##
|
1213
|
+
# Creates a Matcher which will match any Sexp who's type is +type+, where a type is
|
1214
|
+
# the first element in the Sexp.
|
1215
|
+
|
1216
|
+
def initialize type
|
1217
|
+
@sexp_type = type
|
1218
|
+
end
|
1219
|
+
|
1220
|
+
def == o # :nodoc:
|
1221
|
+
super && self.sexp_type == o.sexp_type
|
1222
|
+
end
|
1223
|
+
|
1224
|
+
##
|
1225
|
+
# Satisfied if the sexp_type of +o+ is +type+.
|
1226
|
+
|
1227
|
+
def satisfy? o
|
1228
|
+
o.kind_of?(Sexp) && o.sexp_type == sexp_type
|
1229
|
+
end
|
1230
|
+
|
1231
|
+
def inspect # :nodoc:
|
1232
|
+
"t(%p)" % sexp_type
|
1233
|
+
end
|
1234
|
+
|
1235
|
+
def pretty_print q # :nodoc:
|
1236
|
+
q.group 1, "t(", ")" do
|
1237
|
+
q.pp sexp_type
|
1238
|
+
end
|
1239
|
+
end
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
##
|
1243
|
+
# Matches an expression or any expression that includes the child.
|
1244
|
+
#
|
1245
|
+
# examples:
|
1246
|
+
#
|
1247
|
+
# s(:a, :b) / s{ include(:b) } #=> [s(:a, :b)]
|
1248
|
+
# s(s(s(:a))) / s{ include(:a) } #=> [s(:a)]
|
1249
|
+
|
1250
|
+
class Include < Matcher
|
1251
|
+
##
|
1252
|
+
# The value that should be included in the match.
|
1253
|
+
|
1254
|
+
attr_reader :value
|
1255
|
+
|
1256
|
+
##
|
1257
|
+
# Creates a Matcher which will match any Sexp that contains the
|
1258
|
+
# +value+.
|
1259
|
+
|
1260
|
+
def initialize value
|
1261
|
+
@value = value
|
1262
|
+
end
|
1263
|
+
|
1264
|
+
##
|
1265
|
+
# Satisfied if a +o+ is a Sexp and one of +o+'s elements matches
|
1266
|
+
# value
|
1267
|
+
|
1268
|
+
def satisfy? o
|
1269
|
+
Sexp === o && o.any? { |c|
|
1270
|
+
# TODO: switch to respond_to??
|
1271
|
+
Sexp === value ? value.satisfy?(c) : value == c
|
1272
|
+
}
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
def == o # :nodoc:
|
1276
|
+
super && self.value == o.value
|
1277
|
+
end
|
1278
|
+
|
1279
|
+
def inspect # :nodoc:
|
1280
|
+
"include(%p)" % [value]
|
1281
|
+
end
|
1282
|
+
|
1283
|
+
def pretty_print q # :nodoc:
|
1284
|
+
q.group 1, "include(", ")" do
|
1285
|
+
q.pp value
|
1286
|
+
end
|
1287
|
+
end
|
1288
|
+
end
|
1289
|
+
|
1290
|
+
##
|
1291
|
+
# See Matcher for sibling relations: <,<<,>>,>
|
1292
|
+
|
1293
|
+
class Sibling < Matcher
|
1294
|
+
|
1295
|
+
##
|
1296
|
+
# The LHS of the matcher.
|
1297
|
+
|
1298
|
+
attr_reader :subject
|
1299
|
+
|
1300
|
+
##
|
1301
|
+
# The RHS of the matcher.
|
1302
|
+
|
1303
|
+
attr_reader :sibling
|
1304
|
+
|
1305
|
+
##
|
1306
|
+
# An optional distance requirement for the matcher.
|
1307
|
+
|
1308
|
+
attr_reader :distance
|
1309
|
+
|
1310
|
+
##
|
1311
|
+
# Creates a Matcher which will match any pair of Sexps that are siblings.
|
1312
|
+
# Defaults to matching the immediate following sibling.
|
1313
|
+
|
1314
|
+
def initialize subject, sibling, distance = nil
|
1315
|
+
@subject = subject
|
1316
|
+
@sibling = sibling
|
1317
|
+
@distance = distance
|
1318
|
+
end
|
1319
|
+
|
1320
|
+
##
|
1321
|
+
# Satisfied if o contains +subject+ followed by +sibling+
|
1322
|
+
|
1323
|
+
def satisfy? o
|
1324
|
+
# Future optimizations:
|
1325
|
+
# * Shortcut matching sibling
|
1326
|
+
subject_matches = index_matches(subject, o)
|
1327
|
+
return nil if subject_matches.empty?
|
1328
|
+
|
1329
|
+
sibling_matches = index_matches(sibling, o)
|
1330
|
+
return nil if sibling_matches.empty?
|
1331
|
+
|
1332
|
+
subject_matches.any? { |i1, _data_1|
|
1333
|
+
sibling_matches.any? { |i2, _data_2|
|
1334
|
+
distance ? (i2-i1 == distance) : i2 > i1
|
1335
|
+
}
|
1336
|
+
}
|
1337
|
+
end
|
1338
|
+
|
1339
|
+
def == o # :nodoc:
|
1340
|
+
super &&
|
1341
|
+
self.subject == o.subject &&
|
1342
|
+
self.sibling == o.sibling &&
|
1343
|
+
self.distance == o.distance
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
def inspect # :nodoc:
|
1347
|
+
"%p >> %p" % [subject, sibling]
|
1348
|
+
end
|
1349
|
+
|
1350
|
+
def pretty_print q # :nodoc:
|
1351
|
+
if distance then
|
1352
|
+
q.group 1, "sibling(", ")" do
|
1353
|
+
q.seplist [subject, sibling, distance] do |v|
|
1354
|
+
q.pp v
|
1355
|
+
end
|
1356
|
+
end
|
1357
|
+
else
|
1358
|
+
q.group 1 do
|
1359
|
+
q.pp subject
|
1360
|
+
q.text " >> "
|
1361
|
+
q.pp sibling
|
1362
|
+
end
|
1363
|
+
end
|
1364
|
+
end
|
1365
|
+
|
1366
|
+
private
|
1367
|
+
|
1368
|
+
def index_matches pattern, o
|
1369
|
+
indexes = []
|
1370
|
+
return indexes unless o.kind_of? Sexp
|
1371
|
+
|
1372
|
+
o.each_with_index do |e, i|
|
1373
|
+
data = {}
|
1374
|
+
if pattern.kind_of?(Sexp) ? pattern.satisfy?(e) : pattern == o[i]
|
1375
|
+
indexes << [i, data]
|
1376
|
+
end
|
1377
|
+
end
|
1378
|
+
|
1379
|
+
indexes
|
1380
|
+
end
|
1381
|
+
end # class Sibling
|
1382
|
+
|
1383
|
+
##
|
1384
|
+
# Wraps the results of a Sexp query. MatchCollection defines
|
1385
|
+
# MatchCollection#/ so that you can chain queries.
|
1386
|
+
#
|
1387
|
+
# For instance:
|
1388
|
+
# res = s(:a, s(:b)) / s{ s(:a,_) } / s{ s(:b) }
|
1389
|
+
|
1390
|
+
class MatchCollection < Array
|
1391
|
+
##
|
1392
|
+
# See Traverse#search
|
1393
|
+
|
1394
|
+
def / pattern
|
1395
|
+
inject(self.class.new) { |result, match|
|
1396
|
+
result.concat match / pattern
|
1397
|
+
}
|
1398
|
+
end
|
1399
|
+
|
1400
|
+
def inspect # :nodoc:
|
1401
|
+
"MatchCollection.new(%s)" % self.to_a.inspect[1..-2]
|
1402
|
+
end
|
1403
|
+
|
1404
|
+
alias :to_s :inspect # :nodoc:
|
1405
|
+
|
1406
|
+
def pretty_print q # :nodoc:
|
1407
|
+
q.group 1, "MatchCollection.new(", ")" do
|
1408
|
+
q.seplist(self) {|v| q.pp v }
|
1409
|
+
end
|
1410
|
+
end
|
1411
|
+
end # class MatchCollection
|
1412
|
+
end
|
1413
|
+
|
1414
|
+
require "strict_sexp" if ENV["STRICT_SEXP"].to_i > 0
|