brakeman 4.4.0 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of brakeman might be problematic. Click here for more details.

Files changed (362) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +17 -0
  3. data/bundle/load.rb +7 -8
  4. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/History.rdoc +8 -0
  5. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/Manifest.txt +0 -0
  6. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/README.rdoc +0 -0
  7. data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/lib/ruby2ruby.rb +34 -36
  8. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/History.rdoc +47 -0
  9. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/Manifest.txt +5 -4
  10. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/README.rdoc +0 -0
  11. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/compare/normalize.rb +29 -2
  12. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/debugging.md +18 -0
  13. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_extensions.rb +0 -7
  14. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_stringscanner.rb +0 -0
  15. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby20_parser.rb +6874 -0
  16. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby20_parser.y +284 -201
  17. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby21_parser.rb +6952 -0
  18. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby21_parser.y +281 -197
  19. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby22_parser.rb +6983 -0
  20. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib/ruby_parser.yy → ruby_parser-3.13.0/lib/ruby22_parser.y} +280 -306
  21. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby23_parser.rb +6982 -0
  22. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby23_parser.y +282 -203
  23. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby24_parser.rb +6982 -0
  24. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby24_parser.y +282 -203
  25. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby25_parser.rb +6981 -0
  26. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby25_parser.y +282 -203
  27. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.rb +6999 -0
  28. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.y +2469 -0
  29. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rb +116 -118
  30. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex +10 -8
  31. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex.rb +8 -8
  32. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_parser.rb +5 -7
  33. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser.yy +2571 -0
  34. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser_extras.rb +1360 -0
  35. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/munge.rb +216 -0
  36. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/ripper.rb +23 -0
  37. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +6 -0
  38. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +19 -0
  39. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +54 -0
  40. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +5 -0
  41. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.rb +7 -6
  42. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.y +5 -4
  43. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.rb +7 -6
  44. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.y +5 -4
  45. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +1412 -0
  46. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +179 -0
  47. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +323 -0
  48. data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +30 -0
  49. data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby_parser_extras.rb +43 -33
  50. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/CHANGES.md +5 -0
  51. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/Gemfile +0 -0
  52. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/LICENSE.txt +0 -0
  53. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/README.md +0 -0
  54. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/bundle_install_all_ruby_versions.sh +0 -0
  55. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml.rb +0 -0
  56. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/deep.rb +0 -0
  57. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/libyaml_checker.rb +0 -0
  58. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/load.rb +0 -0
  59. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/date.rb +2 -0
  60. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/hexadecimal.rb +0 -0
  61. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/sexagesimal.rb +0 -0
  62. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_handler.rb +0 -0
  63. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_resolver.rb +0 -0
  64. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/resolver.rb +0 -0
  65. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
  66. data/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +39 -0
  67. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_hack.rb +0 -0
  68. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
  69. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_resolver.rb +0 -0
  70. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform.rb +0 -0
  71. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_boolean.rb +0 -0
  72. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_date.rb +0 -0
  73. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_float.rb +0 -0
  74. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_integer.rb +0 -0
  75. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_nil.rb +0 -0
  76. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_symbol.rb +0 -0
  77. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/transformation_map.rb +0 -0
  78. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/version.rb +1 -1
  79. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/run_specs_all_ruby_versions.sh +0 -0
  80. data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/safe_yaml.gemspec +0 -0
  81. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/History.rdoc +8 -0
  82. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/Manifest.txt +0 -0
  83. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/README.rdoc +0 -0
  84. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/composite_sexp_processor.rb +0 -0
  85. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/pt_testcase.rb +2 -2
  86. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp.rb +4 -4
  87. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp_processor.rb +1 -1
  88. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/strict_sexp.rb +3 -3
  89. data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/unique.rb +0 -0
  90. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/CHANGES +6 -0
  91. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/EXPRESSIONS.md +1 -1
  92. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/Gemfile +0 -0
  93. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/LICENSE +0 -0
  94. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/README.md +1 -1
  95. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple.rb +0 -0
  96. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/engine.rb +0 -0
  97. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/engine.rb +0 -0
  98. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/parser.rb +0 -0
  99. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/template.rb +0 -0
  100. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/trimming.rb +0 -0
  101. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/exceptions.rb +0 -0
  102. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filter.rb +0 -0
  103. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/code_merger.rb +0 -0
  104. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/control_flow.rb +0 -0
  105. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/dynamic_inliner.rb +0 -0
  106. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/encoding.rb +0 -0
  107. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/eraser.rb +0 -0
  108. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/escapable.rb +0 -0
  109. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/multi_flattener.rb +0 -0
  110. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/remove_bom.rb +0 -0
  111. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_analyzer.rb +0 -0
  112. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_merger.rb +0 -0
  113. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/string_splitter.rb +0 -0
  114. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/validator.rb +0 -0
  115. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generator.rb +0 -0
  116. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array.rb +0 -0
  117. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array_buffer.rb +0 -0
  118. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/erb.rb +0 -0
  119. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/rails_output_buffer.rb +0 -0
  120. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/string_buffer.rb +0 -0
  121. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/grammar.rb +0 -0
  122. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_merger.rb +0 -0
  123. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_remover.rb +0 -0
  124. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_sorter.rb +0 -0
  125. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/dispatcher.rb +0 -0
  126. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/fast.rb +0 -0
  127. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/filter.rb +0 -0
  128. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/pretty.rb +0 -0
  129. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/safe.rb +0 -0
  130. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/map.rb +0 -0
  131. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/dispatcher.rb +2 -1
  132. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/engine_dsl.rb +0 -0
  133. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/grammar_dsl.rb +0 -0
  134. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/options.rb +0 -0
  135. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/template.rb +0 -0
  136. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/parser.rb +0 -0
  137. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/static_analyzer.rb +0 -0
  138. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates.rb +0 -0
  139. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/rails.rb +2 -2
  140. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/tilt.rb +0 -0
  141. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/utils.rb +0 -0
  142. data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +3 -0
  143. data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/temple.gemspec +0 -0
  144. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/CHANGELOG.md +4 -0
  145. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/MIT-LICENSE.txt +1 -1
  146. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/README.md +10 -10
  147. data/bundle/ruby/2.5.0/gems/unicode-display_width-1.5.0/data/display_width.marshal.gz +0 -0
  148. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width.rb +0 -0
  149. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/constants.rb +2 -2
  150. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/index.rb +0 -0
  151. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
  152. data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/string_ext.rb +0 -0
  153. data/lib/brakeman/checks/base_check.rb +16 -0
  154. data/lib/brakeman/checks/check_content_tag.rb +12 -0
  155. data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -6
  156. data/lib/brakeman/checks/check_evaluation.rb +0 -1
  157. data/lib/brakeman/checks/check_execute.rb +18 -0
  158. data/lib/brakeman/checks/check_send.rb +0 -1
  159. data/lib/brakeman/checks/check_session_manipulation.rb +0 -1
  160. data/lib/brakeman/checks/check_sql.rb +12 -3
  161. data/lib/brakeman/file_parser.rb +8 -4
  162. data/lib/brakeman/parsers/haml_embedded.rb +44 -0
  163. data/lib/brakeman/parsers/slim_embedded.rb +44 -0
  164. data/lib/brakeman/parsers/template_parser.rb +2 -4
  165. data/lib/brakeman/processors/alias_processor.rb +23 -1
  166. data/lib/brakeman/processors/lib/call_conversion_helper.rb +4 -0
  167. data/lib/brakeman/processors/slim_template_processor.rb +16 -0
  168. data/lib/brakeman/processors/template_alias_processor.rb +2 -2
  169. data/lib/brakeman/scanner.rb +11 -10
  170. data/lib/brakeman/tracker.rb +5 -1
  171. data/lib/brakeman/tracker/config.rb +32 -7
  172. data/lib/brakeman/util.rb +17 -0
  173. data/lib/brakeman/version.rb +1 -1
  174. metadata +157 -320
  175. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby20_parser.rb +0 -6687
  176. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby21_parser.rb +0 -6767
  177. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.rb +0 -6803
  178. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.y +0 -2376
  179. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby23_parser.rb +0 -6818
  180. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby24_parser.rb +0 -6818
  181. data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby25_parser.rb +0 -6818
  182. data/bundle/ruby/2.5.0/gems/sass-3.4.25/CODE_OF_CONDUCT.md +0 -10
  183. data/bundle/ruby/2.5.0/gems/sass-3.4.25/CONTRIBUTING.md +0 -148
  184. data/bundle/ruby/2.5.0/gems/sass-3.4.25/MIT-LICENSE +0 -20
  185. data/bundle/ruby/2.5.0/gems/sass-3.4.25/README.md +0 -227
  186. data/bundle/ruby/2.5.0/gems/sass-3.4.25/REVISION +0 -1
  187. data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION +0 -1
  188. data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_DATE +0 -1
  189. data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_NAME +0 -1
  190. data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/sass-spec-ref.sh +0 -32
  191. data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/update_watch.rb +0 -13
  192. data/bundle/ruby/2.5.0/gems/sass-3.4.25/init.rb +0 -18
  193. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass.rb +0 -109
  194. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores.rb +0 -15
  195. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/base.rb +0 -88
  196. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/chain.rb +0 -34
  197. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/filesystem.rb +0 -60
  198. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/memory.rb +0 -46
  199. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/null.rb +0 -25
  200. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/callbacks.rb +0 -67
  201. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/css.rb +0 -408
  202. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/deprecation.rb +0 -55
  203. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/engine.rb +0 -1226
  204. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/environment.rb +0 -215
  205. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/error.rb +0 -198
  206. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec.rb +0 -9
  207. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/base.rb +0 -199
  208. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_convert.rb +0 -283
  209. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb +0 -440
  210. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/features.rb +0 -47
  211. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers.rb +0 -23
  212. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/base.rb +0 -182
  213. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/deprecated_path.rb +0 -51
  214. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/filesystem.rb +0 -219
  215. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger.rb +0 -17
  216. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/base.rb +0 -36
  217. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/delayed.rb +0 -50
  218. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/log_level.rb +0 -45
  219. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/media.rb +0 -210
  220. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin.rb +0 -134
  221. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb +0 -582
  222. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/configuration.rb +0 -134
  223. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/generic.rb +0 -15
  224. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/merb.rb +0 -48
  225. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rack.rb +0 -60
  226. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rails.rb +0 -47
  227. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/staleness_checker.rb +0 -199
  228. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/railtie.rb +0 -10
  229. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/repl.rb +0 -57
  230. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/root.rb +0 -7
  231. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script.rb +0 -66
  232. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_lexer.rb +0 -33
  233. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_parser.rb +0 -33
  234. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_variable_warning.rb +0 -52
  235. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/functions.rb +0 -2693
  236. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/lexer.rb +0 -464
  237. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/parser.rb +0 -832
  238. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree.rb +0 -16
  239. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/funcall.rb +0 -313
  240. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/interpolation.rb +0 -223
  241. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/list_literal.rb +0 -104
  242. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/literal.rb +0 -49
  243. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/map_literal.rb +0 -64
  244. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/node.rb +0 -127
  245. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/operation.rb +0 -156
  246. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/selector.rb +0 -26
  247. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/string_interpolation.rb +0 -125
  248. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/unary_operation.rb +0 -69
  249. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/variable.rb +0 -57
  250. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value.rb +0 -11
  251. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/arg_list.rb +0 -36
  252. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/base.rb +0 -241
  253. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/bool.rb +0 -35
  254. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/color.rb +0 -698
  255. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/helpers.rb +0 -272
  256. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/list.rb +0 -113
  257. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/map.rb +0 -70
  258. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/null.rb +0 -44
  259. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/number.rb +0 -563
  260. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/string.rb +0 -138
  261. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss.rb +0 -14
  262. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/css_parser.rb +0 -56
  263. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/parser.rb +0 -1254
  264. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/rx.rb +0 -140
  265. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/static_parser.rb +0 -373
  266. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector.rb +0 -323
  267. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/abstract_sequence.rb +0 -111
  268. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/comma_sequence.rb +0 -191
  269. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/pseudo.rb +0 -266
  270. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb +0 -636
  271. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple.rb +0 -117
  272. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple_sequence.rb +0 -344
  273. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/shared.rb +0 -76
  274. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/map.rb +0 -213
  275. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/position.rb +0 -39
  276. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/range.rb +0 -41
  277. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/stack.rb +0 -120
  278. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/supports.rb +0 -225
  279. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/at_root_node.rb +0 -83
  280. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/charset_node.rb +0 -22
  281. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/comment_node.rb +0 -82
  282. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/content_node.rb +0 -9
  283. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/css_import_node.rb +0 -68
  284. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/debug_node.rb +0 -18
  285. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/directive_node.rb +0 -59
  286. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/each_node.rb +0 -24
  287. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/error_node.rb +0 -18
  288. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/extend_node.rb +0 -43
  289. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/for_node.rb +0 -36
  290. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/function_node.rb +0 -44
  291. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/if_node.rb +0 -52
  292. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/import_node.rb +0 -75
  293. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/keyframe_rule_node.rb +0 -15
  294. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/media_node.rb +0 -48
  295. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_def_node.rb +0 -38
  296. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_node.rb +0 -52
  297. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/node.rb +0 -240
  298. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/prop_node.rb +0 -170
  299. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/return_node.rb +0 -19
  300. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/root_node.rb +0 -44
  301. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/rule_node.rb +0 -155
  302. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/supports_node.rb +0 -38
  303. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/trace_node.rb +0 -33
  304. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/variable_node.rb +0 -36
  305. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb +0 -72
  306. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/check_nesting.rb +0 -173
  307. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/convert.rb +0 -351
  308. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/cssize.rb +0 -373
  309. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/deep_copy.rb +0 -107
  310. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/extend.rb +0 -70
  311. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb +0 -564
  312. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/set_options.rb +0 -139
  313. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/to_css.rb +0 -409
  314. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/warn_node.rb +0 -18
  315. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/while_node.rb +0 -18
  316. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util.rb +0 -1375
  317. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/cross_platform_random.rb +0 -19
  318. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/multibyte_string_scanner.rb +0 -155
  319. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/normalized_map.rb +0 -129
  320. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/ordered_hash.rb +0 -192
  321. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/subset_map.rb +0 -109
  322. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/test.rb +0 -9
  323. data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/version.rb +0 -124
  324. data/bundle/ruby/2.5.0/gems/sass-3.4.25/rails/init.rb +0 -1
  325. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CHANGELOG.md +0 -1
  326. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CONTRIBUTING.md +0 -38
  327. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Gemfile +0 -20
  328. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Guardfile +0 -8
  329. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/LICENSE +0 -20
  330. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/README.md +0 -349
  331. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Rakefile +0 -5
  332. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Vagrantfile +0 -96
  333. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb +0 -54
  334. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapter.rb +0 -327
  335. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
  336. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
  337. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/linux.rb +0 -81
  338. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/polling.rb +0 -58
  339. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/windows.rb +0 -91
  340. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/directory_record.rb +0 -406
  341. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/listener.rb +0 -323
  342. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/turnstile.rb +0 -32
  343. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/version.rb +0 -3
  344. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/listen.gemspec +0 -28
  345. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapter_spec.rb +0 -149
  346. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
  347. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
  348. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
  349. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
  350. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
  351. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
  352. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/listener_spec.rb +0 -258
  353. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
  354. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen_spec.rb +0 -67
  355. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/spec_helper.rb +0 -25
  356. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/adapter_helper.rb +0 -666
  357. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/directory_record_helper.rb +0 -57
  358. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/fixtures_helper.rb +0 -29
  359. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/listeners_helper.rb +0 -179
  360. data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/platform_helper.rb +0 -15
  361. data/bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/version.rb +0 -3
  362. data/bundle/ruby/2.5.0/gems/unicode-display_width-1.4.1/data/display_width.marshal.gz +0 -0
@@ -1,107 +0,0 @@
1
- # A visitor for copying the full structure of a Sass tree.
2
- class Sass::Tree::Visitors::DeepCopy < Sass::Tree::Visitors::Base
3
- protected
4
-
5
- def visit(node)
6
- super(node.dup)
7
- end
8
-
9
- def visit_children(parent)
10
- parent.children = parent.children.map {|c| visit(c)}
11
- parent
12
- end
13
-
14
- def visit_debug(node)
15
- node.expr = node.expr.deep_copy
16
- yield
17
- end
18
-
19
- def visit_error(node)
20
- node.expr = node.expr.deep_copy
21
- yield
22
- end
23
-
24
- def visit_each(node)
25
- node.list = node.list.deep_copy
26
- yield
27
- end
28
-
29
- def visit_extend(node)
30
- node.selector = node.selector.map {|c| c.is_a?(Sass::Script::Tree::Node) ? c.deep_copy : c}
31
- yield
32
- end
33
-
34
- def visit_for(node)
35
- node.from = node.from.deep_copy
36
- node.to = node.to.deep_copy
37
- yield
38
- end
39
-
40
- def visit_function(node)
41
- node.args = node.args.map {|k, v| [k.deep_copy, v && v.deep_copy]}
42
- yield
43
- end
44
-
45
- def visit_if(node)
46
- node.expr = node.expr.deep_copy if node.expr
47
- node.else = visit(node.else) if node.else
48
- yield
49
- end
50
-
51
- def visit_mixindef(node)
52
- node.args = node.args.map {|k, v| [k.deep_copy, v && v.deep_copy]}
53
- yield
54
- end
55
-
56
- def visit_mixin(node)
57
- node.args = node.args.map {|a| a.deep_copy}
58
- node.keywords = Sass::Util::NormalizedMap.new(Hash[node.keywords.map {|k, v| [k, v.deep_copy]}])
59
- yield
60
- end
61
-
62
- def visit_prop(node)
63
- node.name = node.name.map {|c| c.is_a?(Sass::Script::Tree::Node) ? c.deep_copy : c}
64
- node.value = node.value.deep_copy
65
- yield
66
- end
67
-
68
- def visit_return(node)
69
- node.expr = node.expr.deep_copy
70
- yield
71
- end
72
-
73
- def visit_rule(node)
74
- node.rule = node.rule.map {|c| c.is_a?(Sass::Script::Tree::Node) ? c.deep_copy : c}
75
- yield
76
- end
77
-
78
- def visit_variable(node)
79
- node.expr = node.expr.deep_copy
80
- yield
81
- end
82
-
83
- def visit_warn(node)
84
- node.expr = node.expr.deep_copy
85
- yield
86
- end
87
-
88
- def visit_while(node)
89
- node.expr = node.expr.deep_copy
90
- yield
91
- end
92
-
93
- def visit_directive(node)
94
- node.value = node.value.map {|c| c.is_a?(Sass::Script::Tree::Node) ? c.deep_copy : c}
95
- yield
96
- end
97
-
98
- def visit_media(node)
99
- node.query = node.query.map {|c| c.is_a?(Sass::Script::Tree::Node) ? c.deep_copy : c}
100
- yield
101
- end
102
-
103
- def visit_supports(node)
104
- node.condition = node.condition.deep_copy
105
- yield
106
- end
107
- end
@@ -1,70 +0,0 @@
1
- # A visitor for performing selector inheritance on a static CSS tree.
2
- #
3
- # Destructively modifies the tree.
4
- class Sass::Tree::Visitors::Extend < Sass::Tree::Visitors::Base
5
- # Performs the given extensions on the static CSS tree based in `root`, then
6
- # validates that all extends matched some selector.
7
- #
8
- # @param root [Tree::Node] The root node of the tree to visit.
9
- # @param extends [Sass::Util::SubsetMap{Selector::Simple =>
10
- # Sass::Tree::Visitors::Cssize::Extend}]
11
- # The extensions to perform on this tree.
12
- # @return [Object] The return value of \{#visit} for the root node.
13
- def self.visit(root, extends)
14
- return if extends.empty?
15
- new(extends).send(:visit, root)
16
- check_extends_fired! extends
17
- end
18
-
19
- protected
20
-
21
- def initialize(extends)
22
- @parent_directives = []
23
- @extends = extends
24
- end
25
-
26
- # If an exception is raised, this adds proper metadata to the backtrace.
27
- def visit(node)
28
- super(node)
29
- rescue Sass::SyntaxError => e
30
- e.modify_backtrace(:filename => node.filename, :line => node.line)
31
- raise e
32
- end
33
-
34
- # Keeps track of the current parent directives.
35
- def visit_children(parent)
36
- @parent_directives.push parent if parent.is_a?(Sass::Tree::DirectiveNode)
37
- super
38
- ensure
39
- @parent_directives.pop if parent.is_a?(Sass::Tree::DirectiveNode)
40
- end
41
-
42
- # Applies the extend to a single rule's selector.
43
- def visit_rule(node)
44
- node.resolved_rules = node.resolved_rules.do_extend(@extends, @parent_directives)
45
- end
46
-
47
- class << self
48
- private
49
-
50
- def check_extends_fired!(extends)
51
- extends.each_value do |ex|
52
- next if ex.result == :succeeded || ex.node.optional?
53
- message = "\"#{ex.extender}\" failed to @extend \"#{ex.target.join}\"."
54
- reason =
55
- if ex.result == :not_found
56
- "The selector \"#{ex.target.join}\" was not found."
57
- else
58
- "No selectors matching \"#{ex.target.join}\" could be unified with \"#{ex.extender}\"."
59
- end
60
-
61
- # TODO(nweiz): this should use the Sass stack trace of the extend node.
62
- raise Sass::SyntaxError.new(<<MESSAGE, :filename => ex.node.filename, :line => ex.node.line)
63
- #{message}
64
- #{reason}
65
- Use "@extend #{ex.target.join} !optional" if the extend should be able to fail.
66
- MESSAGE
67
- end
68
- end
69
- end
70
- end
@@ -1,564 +0,0 @@
1
- # A visitor for converting a dynamic Sass tree into a static Sass tree.
2
- class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
3
- @@function_name_deprecation = Sass::Deprecation.new
4
-
5
- class << self
6
- # @param root [Tree::Node] The root node of the tree to visit.
7
- # @param environment [Sass::Environment] The lexical environment.
8
- # @return [Tree::Node] The resulting tree of static nodes.
9
- def visit(root, environment = nil)
10
- new(environment).send(:visit, root)
11
- end
12
-
13
- # @api private
14
- # @comment
15
- # rubocop:disable MethodLength
16
- def perform_arguments(callable, args, splat, environment)
17
- desc = "#{callable.type.capitalize} #{callable.name}"
18
- downcase_desc = "#{callable.type} #{callable.name}"
19
-
20
- # All keywords are contained in splat.keywords for consistency,
21
- # even if there were no splats passed in.
22
- old_keywords_accessed = splat.keywords_accessed
23
- keywords = splat.keywords
24
- splat.keywords_accessed = old_keywords_accessed
25
-
26
- begin
27
- unless keywords.empty?
28
- unknown_args = Sass::Util.array_minus(keywords.keys,
29
- callable.args.map {|var| var.first.underscored_name})
30
- if callable.splat && unknown_args.include?(callable.splat.underscored_name)
31
- raise Sass::SyntaxError.new("Argument $#{callable.splat.name} of #{downcase_desc} " +
32
- "cannot be used as a named argument.")
33
- elsif unknown_args.any?
34
- description = unknown_args.length > 1 ? 'the following arguments:' : 'an argument named'
35
- raise Sass::SyntaxError.new("#{desc} doesn't have #{description} " +
36
- "#{unknown_args.map {|name| "$#{name}"}.join ', '}.")
37
- end
38
- end
39
- rescue Sass::SyntaxError => keyword_exception
40
- end
41
-
42
- # If there's no splat, raise the keyword exception immediately. The actual
43
- # raising happens in the ensure clause at the end of this function.
44
- return if keyword_exception && !callable.splat
45
-
46
- splat_sep = :comma
47
- if splat
48
- args += splat.to_a
49
- splat_sep = splat.separator
50
- end
51
-
52
- if args.size > callable.args.size && !callable.splat
53
- extra_args_because_of_splat = splat && args.size - splat.to_a.size <= callable.args.size
54
-
55
- takes = callable.args.size
56
- passed = args.size
57
- message = "#{desc} takes #{takes} argument#{'s' unless takes == 1} " +
58
- "but #{passed} #{passed == 1 ? 'was' : 'were'} passed."
59
- raise Sass::SyntaxError.new(message) unless extra_args_because_of_splat
60
- # TODO: when the deprecation period is over, make this an error.
61
- Sass::Util.sass_warn("WARNING: #{message}\n" +
62
- environment.stack.to_s.gsub(/^/m, " " * 8) + "\n" +
63
- "This will be an error in future versions of Sass.")
64
- end
65
-
66
- env = Sass::Environment.new(callable.environment)
67
- callable.args.zip(args[0...callable.args.length]) do |(var, default), value|
68
- if value && keywords.has_key?(var.name)
69
- raise Sass::SyntaxError.new("#{desc} was passed argument $#{var.name} " +
70
- "both by position and by name.")
71
- end
72
-
73
- value ||= keywords.delete(var.name)
74
- value ||= default && default.perform(env)
75
- raise Sass::SyntaxError.new("#{desc} is missing argument #{var.inspect}.") unless value
76
- env.set_local_var(var.name, value)
77
- end
78
-
79
- if callable.splat
80
- rest = args[callable.args.length..-1] || []
81
- arg_list = Sass::Script::Value::ArgList.new(rest, keywords, splat_sep)
82
- arg_list.options = env.options
83
- env.set_local_var(callable.splat.name, arg_list)
84
- end
85
-
86
- yield env
87
- rescue StandardError => e
88
- ensure
89
- # If there's a keyword exception, we don't want to throw it immediately,
90
- # because the invalid keywords may be part of a glob argument that should be
91
- # passed on to another function. So we only raise it if we reach the end of
92
- # this function *and* the keywords attached to the argument list glob object
93
- # haven't been accessed.
94
- #
95
- # The keyword exception takes precedence over any Sass errors, but not over
96
- # non-Sass exceptions.
97
- if keyword_exception &&
98
- !(arg_list && arg_list.keywords_accessed) &&
99
- (e.nil? || e.is_a?(Sass::SyntaxError))
100
- raise keyword_exception
101
- elsif e
102
- raise e
103
- end
104
- end
105
-
106
- # @api private
107
- # @return [Sass::Script::Value::ArgList]
108
- def perform_splat(splat, performed_keywords, kwarg_splat, environment)
109
- args, kwargs, separator = [], nil, :comma
110
-
111
- if splat
112
- splat = splat.perform(environment)
113
- separator = splat.separator || separator
114
- if splat.is_a?(Sass::Script::Value::ArgList)
115
- args = splat.to_a
116
- kwargs = splat.keywords
117
- elsif splat.is_a?(Sass::Script::Value::Map)
118
- kwargs = arg_hash(splat)
119
- else
120
- args = splat.to_a
121
- end
122
- end
123
- kwargs ||= Sass::Util::NormalizedMap.new
124
- kwargs.update(performed_keywords)
125
-
126
- if kwarg_splat
127
- kwarg_splat = kwarg_splat.perform(environment)
128
- unless kwarg_splat.is_a?(Sass::Script::Value::Map)
129
- raise Sass::SyntaxError.new("Variable keyword arguments must be a map " +
130
- "(was #{kwarg_splat.inspect}).")
131
- end
132
- kwargs.update(arg_hash(kwarg_splat))
133
- end
134
-
135
- Sass::Script::Value::ArgList.new(args, kwargs, separator)
136
- end
137
-
138
- private
139
-
140
- def arg_hash(map)
141
- Sass::Util.map_keys(map.to_h) do |key|
142
- next key.value if key.is_a?(Sass::Script::Value::String)
143
- raise Sass::SyntaxError.new("Variable keyword argument map must have string keys.\n" +
144
- "#{key.inspect} is not a string in #{map.inspect}.")
145
- end
146
- end
147
- end
148
- # @comment
149
- # rubocop:enable MethodLength
150
-
151
- protected
152
-
153
- def initialize(env)
154
- @environment = env
155
- @in_keyframes = false
156
- @at_root_without_rule = false
157
- end
158
-
159
- # If an exception is raised, this adds proper metadata to the backtrace.
160
- def visit(node)
161
- return super(node.dup) unless @environment
162
- @environment.stack.with_base(node.filename, node.line) {super(node.dup)}
163
- rescue Sass::SyntaxError => e
164
- e.modify_backtrace(:filename => node.filename, :line => node.line)
165
- raise e
166
- end
167
-
168
- # Keeps track of the current environment.
169
- def visit_children(parent)
170
- with_environment Sass::Environment.new(@environment, parent.options) do
171
- parent.children = super.flatten
172
- parent
173
- end
174
- end
175
-
176
- # Runs a block of code with the current environment replaced with the given one.
177
- #
178
- # @param env [Sass::Environment] The new environment for the duration of the block.
179
- # @yield A block in which the environment is set to `env`.
180
- # @return [Object] The return value of the block.
181
- def with_environment(env)
182
- old_env, @environment = @environment, env
183
- yield
184
- ensure
185
- @environment = old_env
186
- end
187
-
188
- # Sets the options on the environment if this is the top-level root.
189
- def visit_root(node)
190
- yield
191
- rescue Sass::SyntaxError => e
192
- e.sass_template ||= node.template
193
- raise e
194
- end
195
-
196
- # Removes this node from the tree if it's a silent comment.
197
- def visit_comment(node)
198
- return [] if node.invisible?
199
- node.resolved_value = run_interp_no_strip(node.value)
200
- node.resolved_value.gsub!(/\\([\\#])/, '\1')
201
- node
202
- end
203
-
204
- # Prints the expression to STDERR.
205
- def visit_debug(node)
206
- res = node.expr.perform(@environment)
207
- if res.is_a?(Sass::Script::Value::String)
208
- res = res.value
209
- else
210
- res = res.to_sass
211
- end
212
- if node.filename
213
- Sass::Util.sass_warn "#{node.filename}:#{node.line} DEBUG: #{res}"
214
- else
215
- Sass::Util.sass_warn "Line #{node.line} DEBUG: #{res}"
216
- end
217
- []
218
- end
219
-
220
- # Throws the expression as an error.
221
- def visit_error(node)
222
- res = node.expr.perform(@environment)
223
- if res.is_a?(Sass::Script::Value::String)
224
- res = res.value
225
- else
226
- res = res.to_sass
227
- end
228
- raise Sass::SyntaxError.new(res)
229
- end
230
-
231
- # Runs the child nodes once for each value in the list.
232
- def visit_each(node)
233
- list = node.list.perform(@environment)
234
-
235
- with_environment Sass::SemiGlobalEnvironment.new(@environment) do
236
- list.to_a.map do |value|
237
- if node.vars.length == 1
238
- @environment.set_local_var(node.vars.first, value)
239
- else
240
- node.vars.zip(value.to_a) do |(var, sub_value)|
241
- @environment.set_local_var(var, sub_value || Sass::Script::Value::Null.new)
242
- end
243
- end
244
- node.children.map {|c| visit(c)}
245
- end.flatten
246
- end
247
- end
248
-
249
- # Runs SassScript interpolation in the selector,
250
- # and then parses the result into a {Sass::Selector::CommaSequence}.
251
- def visit_extend(node)
252
- parser = Sass::SCSS::StaticParser.new(run_interp(node.selector),
253
- node.filename, node.options[:importer], node.line)
254
- node.resolved_selector = parser.parse_selector
255
- node
256
- end
257
-
258
- # Runs the child nodes once for each time through the loop, varying the variable each time.
259
- def visit_for(node)
260
- from = node.from.perform(@environment)
261
- to = node.to.perform(@environment)
262
- from.assert_int!
263
- to.assert_int!
264
-
265
- to = to.coerce(from.numerator_units, from.denominator_units)
266
- direction = from.to_i > to.to_i ? -1 : 1
267
- range = Range.new(direction * from.to_i, direction * to.to_i, node.exclusive)
268
-
269
- with_environment Sass::SemiGlobalEnvironment.new(@environment) do
270
- range.map do |i|
271
- @environment.set_local_var(node.var,
272
- Sass::Script::Value::Number.new(direction * i,
273
- from.numerator_units, from.denominator_units))
274
- node.children.map {|c| visit(c)}
275
- end.flatten
276
- end
277
- end
278
-
279
- # Loads the function into the environment.
280
- def visit_function(node)
281
- env = Sass::Environment.new(@environment, node.options)
282
-
283
- if node.normalized_name == 'calc' || node.normalized_name == 'element' ||
284
- node.name == 'expression' || node.name == 'url'
285
- @@function_name_deprecation.warn(node.filename, node.line, <<WARNING)
286
- Naming a function "#{node.name}" is disallowed and will be an error in future versions of Sass.
287
- This name conflicts with an existing CSS function with special parse rules.
288
- WARNING
289
- end
290
-
291
- @environment.set_local_function(node.name,
292
- Sass::Callable.new(node.name, node.args, node.splat, env,
293
- node.children, false, "function"))
294
- []
295
- end
296
-
297
- # Runs the child nodes if the conditional expression is true;
298
- # otherwise, tries the else nodes.
299
- def visit_if(node)
300
- if node.expr.nil? || node.expr.perform(@environment).to_bool
301
- with_environment Sass::SemiGlobalEnvironment.new(@environment) do
302
- node.children.map {|c| visit(c)}
303
- end.flatten
304
- elsif node.else
305
- visit(node.else)
306
- else
307
- []
308
- end
309
- end
310
-
311
- # Returns a static DirectiveNode if this is importing a CSS file,
312
- # or parses and includes the imported Sass file.
313
- def visit_import(node)
314
- if (path = node.css_import?)
315
- resolved_node = Sass::Tree::CssImportNode.resolved("url(#{path})")
316
- resolved_node.options = node.options
317
- resolved_node.source_range = node.source_range
318
- return resolved_node
319
- end
320
- file = node.imported_file
321
- if @environment.stack.frames.any? {|f| f.is_import? && f.filename == file.options[:filename]}
322
- handle_import_loop!(node)
323
- end
324
-
325
- begin
326
- @environment.stack.with_import(node.filename, node.line) do
327
- root = file.to_tree
328
- Sass::Tree::Visitors::CheckNesting.visit(root)
329
- node.children = root.children.map {|c| visit(c)}.flatten
330
- node
331
- end
332
- rescue Sass::SyntaxError => e
333
- e.modify_backtrace(:filename => node.imported_file.options[:filename])
334
- e.add_backtrace(:filename => node.filename, :line => node.line)
335
- raise e
336
- end
337
- end
338
-
339
- # Loads a mixin into the environment.
340
- def visit_mixindef(node)
341
- env = Sass::Environment.new(@environment, node.options)
342
- @environment.set_local_mixin(node.name,
343
- Sass::Callable.new(node.name, node.args, node.splat, env,
344
- node.children, node.has_content, "mixin"))
345
- []
346
- end
347
-
348
- # Runs a mixin.
349
- def visit_mixin(node)
350
- @environment.stack.with_mixin(node.filename, node.line, node.name) do
351
- mixin = @environment.mixin(node.name)
352
- raise Sass::SyntaxError.new("Undefined mixin '#{node.name}'.") unless mixin
353
-
354
- if node.children.any? && !mixin.has_content
355
- raise Sass::SyntaxError.new(%(Mixin "#{node.name}" does not accept a content block.))
356
- end
357
-
358
- args = node.args.map {|a| a.perform(@environment)}
359
- keywords = Sass::Util.map_vals(node.keywords) {|v| v.perform(@environment)}
360
- splat = self.class.perform_splat(node.splat, keywords, node.kwarg_splat, @environment)
361
-
362
- self.class.perform_arguments(mixin, args, splat, @environment) do |env|
363
- env.caller = Sass::Environment.new(@environment)
364
- env.content = [node.children, @environment] if node.has_children
365
-
366
- trace_node = Sass::Tree::TraceNode.from_node(node.name, node)
367
- with_environment(env) {trace_node.children = mixin.tree.map {|c| visit(c)}.flatten}
368
- trace_node
369
- end
370
- end
371
- rescue Sass::SyntaxError => e
372
- e.modify_backtrace(:mixin => node.name, :line => node.line)
373
- e.add_backtrace(:line => node.line)
374
- raise e
375
- end
376
-
377
- def visit_content(node)
378
- content, content_env = @environment.content
379
- return [] unless content
380
- @environment.stack.with_mixin(node.filename, node.line, '@content') do
381
- trace_node = Sass::Tree::TraceNode.from_node('@content', node)
382
- content_env = Sass::Environment.new(content_env)
383
- content_env.caller = Sass::Environment.new(@environment)
384
- with_environment(content_env) do
385
- trace_node.children = content.map {|c| visit(c.dup)}.flatten
386
- end
387
- trace_node
388
- end
389
- rescue Sass::SyntaxError => e
390
- e.modify_backtrace(:mixin => '@content', :line => node.line)
391
- e.add_backtrace(:line => node.line)
392
- raise e
393
- end
394
-
395
- # Runs any SassScript that may be embedded in a property.
396
- def visit_prop(node)
397
- node.resolved_name = run_interp(node.name)
398
- val = node.value.perform(@environment)
399
- node.resolved_value = val.to_s
400
- node.value_source_range = val.source_range if val.source_range
401
- yield
402
- end
403
-
404
- # Returns the value of the expression.
405
- def visit_return(node)
406
- throw :_sass_return, node.expr.perform(@environment)
407
- end
408
-
409
- # Runs SassScript interpolation in the selector,
410
- # and then parses the result into a {Sass::Selector::CommaSequence}.
411
- def visit_rule(node)
412
- old_at_root_without_rule = @at_root_without_rule
413
- parser = Sass::SCSS::StaticParser.new(run_interp(node.rule),
414
- node.filename, node.options[:importer], node.line)
415
- if @in_keyframes
416
- keyframe_rule_node = Sass::Tree::KeyframeRuleNode.new(parser.parse_keyframes_selector)
417
- keyframe_rule_node.options = node.options
418
- keyframe_rule_node.line = node.line
419
- keyframe_rule_node.filename = node.filename
420
- keyframe_rule_node.source_range = node.source_range
421
- keyframe_rule_node.has_children = node.has_children
422
- with_environment Sass::Environment.new(@environment, node.options) do
423
- keyframe_rule_node.children = node.children.map {|c| visit(c)}.flatten
424
- end
425
- keyframe_rule_node
426
- else
427
- @at_root_without_rule = false
428
- node.parsed_rules ||= parser.parse_selector
429
- node.resolved_rules = node.parsed_rules.resolve_parent_refs(
430
- @environment.selector, !old_at_root_without_rule)
431
- node.stack_trace = @environment.stack.to_s if node.options[:trace_selectors]
432
- with_environment Sass::Environment.new(@environment, node.options) do
433
- @environment.selector = node.resolved_rules
434
- node.children = node.children.map {|c| visit(c)}.flatten
435
- end
436
- node
437
- end
438
- ensure
439
- @at_root_without_rule = old_at_root_without_rule
440
- end
441
-
442
- # Sets a variable that indicates that the first level of rule nodes
443
- # shouldn't include the parent selector by default.
444
- def visit_atroot(node)
445
- if node.query
446
- parser = Sass::SCSS::StaticParser.new(run_interp(node.query),
447
- node.filename, node.options[:importer], node.line)
448
- node.resolved_type, node.resolved_value = parser.parse_static_at_root_query
449
- else
450
- node.resolved_type, node.resolved_value = :without, ['rule']
451
- end
452
-
453
- old_at_root_without_rule = @at_root_without_rule
454
- old_in_keyframes = @in_keyframes
455
- @at_root_without_rule = true if node.exclude?('rule')
456
- @in_keyframes = false if node.exclude?('keyframes')
457
- yield
458
- ensure
459
- @in_keyframes = old_in_keyframes
460
- @at_root_without_rule = old_at_root_without_rule
461
- end
462
-
463
- # Loads the new variable value into the environment.
464
- def visit_variable(node)
465
- env = @environment
466
- env = env.global_env if node.global
467
- if node.guarded
468
- var = env.var(node.name)
469
- return [] if var && !var.null?
470
- end
471
-
472
- val = node.expr.perform(@environment)
473
- if node.expr.source_range
474
- val.source_range = node.expr.source_range
475
- else
476
- val.source_range = node.source_range
477
- end
478
- env.set_var(node.name, val)
479
- []
480
- end
481
-
482
- # Prints the expression to STDERR with a stylesheet trace.
483
- def visit_warn(node)
484
- res = node.expr.perform(@environment)
485
- res = res.value if res.is_a?(Sass::Script::Value::String)
486
- msg = "WARNING: #{res}\n "
487
- msg << @environment.stack.to_s.gsub("\n", "\n ") << "\n"
488
- Sass::Util.sass_warn msg
489
- []
490
- end
491
-
492
- # Runs the child nodes until the continuation expression becomes false.
493
- def visit_while(node)
494
- children = []
495
- with_environment Sass::SemiGlobalEnvironment.new(@environment) do
496
- children += node.children.map {|c| visit(c)} while node.expr.perform(@environment).to_bool
497
- end
498
- children.flatten
499
- end
500
-
501
- def visit_directive(node)
502
- node.resolved_value = run_interp(node.value)
503
- old_in_keyframes, @in_keyframes = @in_keyframes, node.normalized_name == "@keyframes"
504
- with_environment Sass::Environment.new(@environment) do
505
- node.children = node.children.map {|c| visit(c)}.flatten
506
- node
507
- end
508
- ensure
509
- @in_keyframes = old_in_keyframes
510
- end
511
-
512
- def visit_media(node)
513
- parser = Sass::SCSS::StaticParser.new(run_interp(node.query),
514
- node.filename, node.options[:importer], node.line)
515
- node.resolved_query ||= parser.parse_media_query_list
516
- yield
517
- end
518
-
519
- def visit_supports(node)
520
- node.condition = node.condition.deep_copy
521
- node.condition.perform(@environment)
522
- yield
523
- end
524
-
525
- def visit_cssimport(node)
526
- node.resolved_uri = run_interp([node.uri])
527
- if node.query && !node.query.empty?
528
- parser = Sass::SCSS::StaticParser.new(run_interp(node.query),
529
- node.filename, node.options[:importer], node.line)
530
- node.resolved_query ||= parser.parse_media_query_list
531
- end
532
- if node.supports_condition
533
- node.supports_condition.perform(@environment)
534
- end
535
- yield
536
- end
537
-
538
- private
539
-
540
- def run_interp_no_strip(text)
541
- text.map do |r|
542
- next r if r.is_a?(String)
543
- r.perform(@environment).to_s(:quote => :none)
544
- end.join
545
- end
546
-
547
- def run_interp(text)
548
- run_interp_no_strip(text).strip
549
- end
550
-
551
- def handle_import_loop!(node)
552
- msg = "An @import loop has been found:"
553
- files = @environment.stack.frames.select {|f| f.is_import?}.map {|f| f.filename}.compact
554
- if node.filename == node.imported_file.options[:filename]
555
- raise Sass::SyntaxError.new("#{msg} #{node.filename} imports itself")
556
- end
557
-
558
- files << node.filename << node.imported_file.options[:filename]
559
- msg << "\n" << Sass::Util.enum_cons(files, 2).map do |m1, m2|
560
- " #{m1} imports #{m2}"
561
- end.join("\n")
562
- raise Sass::SyntaxError.new(msg)
563
- end
564
- end