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
@@ -0,0 +1,179 @@
1
+ # encoding: UTF-8
2
+ #
3
+ # lexical scanner definition for ruby
4
+
5
+ class RubyParser::Legacy::RubyLexer
6
+
7
+ macro
8
+
9
+ IDENT /^#{IDENT_CHAR}+/o
10
+
11
+ ESC /\\((?>[0-7]{1,3}|x[0-9a-fA-F]{1,2}|M-[^\\]|(C-|c)[^\\]|u[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}|[^0-7xMCc]))/
12
+ SIMPLE_STRING /((#{ESC}|\#(#{ESC}|[^\{\#\@\$\"\\])|[^\"\\\#])*)/o
13
+ SSTRING /((\\.|[^\'])*)/
14
+
15
+ INT_DEC /[+]?(?:(?:[1-9][\d_]*|0)(?!\.\d)(ri|r|i)?\b|0d[0-9_]+)(ri|r|i)?/i
16
+ INT_HEX /[+]?0x[a-f0-9_]+(ri|r|i)?/i
17
+ INT_BIN /[+]?0b[01_]+(ri|r|i)?/i
18
+ INT_OCT /[+]?0o?[0-7_]+(ri|r|i)?|0o(ri|r|i)?/i
19
+ FLOAT /[+]?\d[\d_]*\.[\d_]+(e[+-]?[\d_]+)?(?:(ri|r|i)\b)?|[+]?[\d_]+e[+-]?[\d_]+(?:(ri|r|i)\b)?/i
20
+ INT_DEC2 /[+]?\d[0-9_]*(?![e])((ri|r|i)\b)?/i
21
+
22
+ NUM_BAD /[+]?0[xbd]\b/i
23
+ INT_OCT_BAD /[+]?0o?[0-7_]*[89]/i
24
+ FLOAT_BAD /[+]?\d[\d_]*_(e|\.)/i
25
+
26
+ start
27
+
28
+ return process_string if lex_strterm
29
+
30
+ self.cmd_state = self.command_start
31
+ self.command_start = false
32
+ self.space_seen = false # TODO: rename token_seen?
33
+ self.last_state = lex_state
34
+
35
+ rule
36
+
37
+ # [:state] pattern [actions]
38
+
39
+ # \s - \n + \v
40
+ /[\ \t\r\f\v]/ { self.space_seen = true; next }
41
+
42
+ /\n|\#/ process_newline_or_comment
43
+
44
+ /[\]\)\}]/ process_brace_close
45
+
46
+ : /\!/
47
+ | in_arg_state? /\!\@/ { result :expr_arg, :tUBANG, "!@" }
48
+ | /\![=~]?/ { result :arg_state, TOKENS[text], text }
49
+
50
+ : /\./
51
+ | /\.\.\.?/ { result :expr_beg, TOKENS[text], text }
52
+ | /\.\d/ { rb_compile_error "no .<digit> floating literal anymore put 0 before dot" }
53
+ | /\./ { self.lex_state = :expr_beg; result :expr_dot, :tDOT, "." }
54
+
55
+ /\(/ process_paren
56
+
57
+ # TODO: :expr_beg|:expr_label
58
+ /\,/ { result :expr_beg, TOKENS[text], text }
59
+
60
+ : /=/
61
+ | /\=\=\=|\=\=|\=~|\=>|\=(?!begin\b)/ { result arg_state, TOKENS[text], text }
62
+ | bol? /\=begin(?=\s)/ process_begin
63
+ | /\=(?=begin\b)/ { result arg_state, TOKENS[text], text }
64
+
65
+ ruby22_label? /\"#{SIMPLE_STRING}\":/o process_label
66
+ /\"(#{SIMPLE_STRING})\"/o { result :expr_end, :tSTRING, text[1..-2].gsub(ESC) { unescape $1 } }
67
+ /\"/ { string STR_DQUOTE; result nil, :tSTRING_BEG, text }
68
+
69
+ /\@\@?\d/ { rb_compile_error "`#{text}` is not allowed as a variable name" }
70
+ /\@\@?#{IDENT_CHAR}+/o process_ivar
71
+
72
+ : /:/
73
+ | not_end? /:([a-zA-Z_]#{IDENT_CHAR}*(?:[?]|[!](?!=)|=(?==>)|=(?![=>]))?)/o process_symbol
74
+ | not_end? /\:\"(#{SIMPLE_STRING})\"/o process_symbol
75
+ | not_end? /\:\'(#{SSTRING})\'/o process_symbol
76
+ | /\:\:/ process_colon2
77
+ | /\:/ process_colon1
78
+
79
+ /->/ { result :expr_endfn, :tLAMBDA, nil }
80
+
81
+ /[+-]/ process_plus_minus
82
+
83
+ : /[+\d]/
84
+ | /#{NUM_BAD}/o { rb_compile_error "Invalid numeric format" }
85
+ | /#{INT_DEC}/o { int_with_base 10 }
86
+ | /#{INT_HEX}/o { int_with_base 16 }
87
+ | /#{INT_BIN}/o { int_with_base 2 }
88
+ | /#{INT_OCT_BAD}/o { rb_compile_error "Illegal octal digit." }
89
+ | /#{INT_OCT}/o { int_with_base 8 }
90
+ | /#{FLOAT_BAD}/o { rb_compile_error "Trailing '_' in number." }
91
+ | /#{FLOAT}/o process_float
92
+ | /#{INT_DEC2}/o { int_with_base 10 }
93
+ | /[0-9]/ { rb_compile_error "Bad number format" }
94
+
95
+ /\[/ process_square_bracket
96
+
97
+ was_label? /\'#{SSTRING}\':?/o process_label_or_string
98
+
99
+ : /\|/
100
+ | /\|\|\=/ { result :expr_beg, :tOP_ASGN, "||" }
101
+ | /\|\|/ { result :expr_beg, :tOROP, "||" }
102
+ | /\|\=/ { result :expr_beg, :tOP_ASGN, "|" }
103
+ | /\|/ { result :arg_state, :tPIPE, "|" }
104
+
105
+ /\{/ process_brace_open
106
+
107
+ : /\*/
108
+ | /\*\*=/ { result :expr_beg, :tOP_ASGN, "**" }
109
+ | /\*\*/ { result(:arg_state, space_vs_beginning(:tDSTAR, :tDSTAR, :tPOW), "**") }
110
+ | /\*\=/ { result(:expr_beg, :tOP_ASGN, "*") }
111
+ | /\*/ { result(:arg_state, space_vs_beginning(:tSTAR, :tSTAR, :tSTAR2), "*") }
112
+
113
+ # TODO: fix result+process_lchevron to set command_start = true
114
+ : /</
115
+ | /\<\=\>/ { result :arg_state, :tCMP, "<=>" }
116
+ | /\<\=/ { result :arg_state, :tLEQ, "<=" }
117
+ | /\<\<\=/ { result :expr_beg, :tOP_ASGN, "<<" }
118
+ | /\<\</ process_lchevron
119
+ | /\</ { result :arg_state, :tLT, "<" }
120
+
121
+ : />/
122
+ | /\>\=/ { result :arg_state, :tGEQ, ">=" }
123
+ | /\>\>=/ { result :expr_beg, :tOP_ASGN, ">>" }
124
+ | /\>\>/ { result :arg_state, :tRSHFT, ">>" }
125
+ | /\>/ { result :arg_state, :tGT, ">" }
126
+
127
+ : /\`/
128
+ | expr_fname? /\`/ { result(:expr_end, :tBACK_REF2, "`") }
129
+ | expr_dot? /\`/ { result((cmd_state ? :expr_cmdarg : :expr_arg), :tBACK_REF2, "`") }
130
+ | /\`/ { string STR_XQUOTE, '`'; result(nil, :tXSTRING_BEG, "`") }
131
+
132
+ /\?/ process_questionmark
133
+
134
+ : /&/
135
+ | /\&\&\=/ { result(:expr_beg, :tOP_ASGN, "&&") }
136
+ | /\&\&/ { result(:expr_beg, :tANDOP, "&&") }
137
+ | /\&\=/ { result(:expr_beg, :tOP_ASGN, "&" ) }
138
+ | /\&\./ { result(:expr_dot, :tLONELY, "&.") }
139
+ | /\&/ process_amper
140
+
141
+ /\// process_slash
142
+
143
+ : /\^/
144
+ | /\^=/ { result(:expr_beg, :tOP_ASGN, "^") }
145
+ | /\^/ { result(:arg_state, :tCARET, "^") }
146
+
147
+ /\;/ { self.command_start = true; result(:expr_beg, :tSEMI, ";") }
148
+
149
+ : /~/
150
+ | in_arg_state? /\~@/ { result(:arg_state, :tTILDE, "~") }
151
+ | /\~/ { result(:arg_state, :tTILDE, "~") }
152
+
153
+ : /\\/
154
+ | /\\\r?\n/ { self.lineno += 1; self.space_seen = true; next }
155
+ | /\\/ { rb_compile_error "bare backslash only allowed before newline" }
156
+
157
+ /\%/ process_percent
158
+
159
+ : /\$/
160
+ | /\$_\w+/ process_gvar
161
+ | /\$_/ process_gvar
162
+ | /\$[~*$?!@\/\\;,.=:<>\"]|\$-\w?/ process_gvar
163
+ | in_fname? /\$([\&\`\'\+])/ process_gvar
164
+ | /\$([\&\`\'\+])/ process_backref
165
+ | in_fname? /\$([1-9]\d*)/ process_gvar
166
+ | /\$([1-9]\d*)/ process_nthref
167
+ | /\$0/ process_gvar
168
+ | /\$\W|\$\z/ process_gvar_oddity
169
+ | /\$\w+/ process_gvar
170
+
171
+ /\_/ process_underscore
172
+
173
+ /#{IDENT}/o process_token
174
+
175
+ /\004|\032|\000|\Z/ { [RubyLexer::EOF, RubyLexer::EOF] }
176
+
177
+ /./ { rb_compile_error "Invalid char #{text.inspect} in expression" }
178
+
179
+ end
@@ -0,0 +1,323 @@
1
+ # encoding: UTF-8
2
+ #--
3
+ # This file is automatically generated. Do not modify it.
4
+ # Generated by: oedipus_lex version 2.5.0.
5
+ # Source: lib/ruby_parser/legacy/ruby_lexer.rex
6
+ #++
7
+
8
+ #
9
+ # lexical scanner definition for ruby
10
+
11
+ class RubyParser::Legacy::RubyLexer
12
+ require 'strscan'
13
+
14
+ IDENT = /^#{IDENT_CHAR}+/o
15
+ ESC = /\\((?>[0-7]{1,3}|x[0-9a-fA-F]{1,2}|M-[^\\]|(C-|c)[^\\]|u[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}|[^0-7xMCc]))/
16
+ SIMPLE_STRING = /((#{ESC}|\#(#{ESC}|[^\{\#\@\$\"\\])|[^\"\\\#])*)/o
17
+ SSTRING = /((\\.|[^\'])*)/
18
+ INT_DEC = /[+]?(?:(?:[1-9][\d_]*|0)(?!\.\d)(ri|r|i)?\b|0d[0-9_]+)(ri|r|i)?/i
19
+ INT_HEX = /[+]?0x[a-f0-9_]+(ri|r|i)?/i
20
+ INT_BIN = /[+]?0b[01_]+(ri|r|i)?/i
21
+ INT_OCT = /[+]?0o?[0-7_]+(ri|r|i)?|0o(ri|r|i)?/i
22
+ FLOAT = /[+]?\d[\d_]*\.[\d_]+(e[+-]?[\d_]+)?(?:(ri|r|i)\b)?|[+]?[\d_]+e[+-]?[\d_]+(?:(ri|r|i)\b)?/i
23
+ INT_DEC2 = /[+]?\d[0-9_]*(?![e])((ri|r|i)\b)?/i
24
+ NUM_BAD = /[+]?0[xbd]\b/i
25
+ INT_OCT_BAD = /[+]?0o?[0-7_]*[89]/i
26
+ FLOAT_BAD = /[+]?\d[\d_]*_(e|\.)/i
27
+
28
+ class LexerError < StandardError ; end
29
+ class ScanError < LexerError ; end
30
+
31
+ attr_accessor :filename
32
+ attr_accessor :ss
33
+ attr_accessor :state
34
+
35
+ alias :match :ss
36
+
37
+ def matches
38
+ m = (1..9).map { |i| ss[i] }
39
+ m.pop until m[-1] or m.empty?
40
+ m
41
+ end
42
+
43
+ def action
44
+ yield
45
+ end
46
+
47
+ def scanner_class
48
+ StringScanner
49
+ end unless instance_methods(false).map(&:to_s).include?("scanner_class")
50
+
51
+ def parse str
52
+ self.ss = scanner_class.new str
53
+ self.state ||= nil
54
+
55
+ do_parse
56
+ end
57
+
58
+ def parse_file path
59
+ self.filename = path
60
+ open path do |f|
61
+ parse f.read
62
+ end
63
+ end
64
+
65
+ def location
66
+ [
67
+ (filename || "<input>"),
68
+ ].compact.join(":")
69
+ end
70
+
71
+ def next_token
72
+ return process_string if lex_strterm
73
+ self.cmd_state = self.command_start
74
+ self.command_start = false
75
+ self.space_seen = false # TODO: rename token_seen?
76
+ self.last_state = lex_state
77
+
78
+ token = nil
79
+
80
+ until ss.eos? or token do
81
+ token =
82
+ case state
83
+ when nil then
84
+ case
85
+ when ss.skip(/[\ \t\r\f\v]/) then
86
+ action { self.space_seen = true; next }
87
+ when text = ss.scan(/\n|\#/) then
88
+ process_newline_or_comment text
89
+ when text = ss.scan(/[\]\)\}]/) then
90
+ process_brace_close text
91
+ when ss.match?(/\!/) then
92
+ case
93
+ when in_arg_state? && (ss.skip(/\!\@/)) then
94
+ action { result :expr_arg, :tUBANG, "!@" }
95
+ when text = ss.scan(/\![=~]?/) then
96
+ action { result :arg_state, TOKENS[text], text }
97
+ end # group /\!/
98
+ when ss.match?(/\./) then
99
+ case
100
+ when text = ss.scan(/\.\.\.?/) then
101
+ action { result :expr_beg, TOKENS[text], text }
102
+ when ss.skip(/\.\d/) then
103
+ action { rb_compile_error "no .<digit> floating literal anymore put 0 before dot" }
104
+ when ss.skip(/\./) then
105
+ action { self.lex_state = :expr_beg; result :expr_dot, :tDOT, "." }
106
+ end # group /\./
107
+ when text = ss.scan(/\(/) then
108
+ process_paren text
109
+ when text = ss.scan(/\,/) then
110
+ action { result :expr_beg, TOKENS[text], text }
111
+ when ss.match?(/=/) then
112
+ case
113
+ when text = ss.scan(/\=\=\=|\=\=|\=~|\=>|\=(?!begin\b)/) then
114
+ action { result arg_state, TOKENS[text], text }
115
+ when bol? && (text = ss.scan(/\=begin(?=\s)/)) then
116
+ process_begin text
117
+ when text = ss.scan(/\=(?=begin\b)/) then
118
+ action { result arg_state, TOKENS[text], text }
119
+ end # group /=/
120
+ when ruby22_label? && (text = ss.scan(/\"#{SIMPLE_STRING}\":/o)) then
121
+ process_label text
122
+ when text = ss.scan(/\"(#{SIMPLE_STRING})\"/o) then
123
+ action { result :expr_end, :tSTRING, text[1..-2].gsub(ESC) { unescape $1 } }
124
+ when text = ss.scan(/\"/) then
125
+ action { string STR_DQUOTE; result nil, :tSTRING_BEG, text }
126
+ when text = ss.scan(/\@\@?\d/) then
127
+ action { rb_compile_error "`#{text}` is not allowed as a variable name" }
128
+ when text = ss.scan(/\@\@?#{IDENT_CHAR}+/o) then
129
+ process_ivar text
130
+ when ss.match?(/:/) then
131
+ case
132
+ when not_end? && (text = ss.scan(/:([a-zA-Z_]#{IDENT_CHAR}*(?:[?]|[!](?!=)|=(?==>)|=(?![=>]))?)/o)) then
133
+ process_symbol text
134
+ when not_end? && (text = ss.scan(/\:\"(#{SIMPLE_STRING})\"/o)) then
135
+ process_symbol text
136
+ when not_end? && (text = ss.scan(/\:\'(#{SSTRING})\'/o)) then
137
+ process_symbol text
138
+ when text = ss.scan(/\:\:/) then
139
+ process_colon2 text
140
+ when text = ss.scan(/\:/) then
141
+ process_colon1 text
142
+ end # group /:/
143
+ when ss.skip(/->/) then
144
+ action { result :expr_endfn, :tLAMBDA, nil }
145
+ when text = ss.scan(/[+-]/) then
146
+ process_plus_minus text
147
+ when ss.match?(/[+\d]/) then
148
+ case
149
+ when ss.skip(/#{NUM_BAD}/o) then
150
+ action { rb_compile_error "Invalid numeric format" }
151
+ when ss.skip(/#{INT_DEC}/o) then
152
+ action { int_with_base 10 }
153
+ when ss.skip(/#{INT_HEX}/o) then
154
+ action { int_with_base 16 }
155
+ when ss.skip(/#{INT_BIN}/o) then
156
+ action { int_with_base 2 }
157
+ when ss.skip(/#{INT_OCT_BAD}/o) then
158
+ action { rb_compile_error "Illegal octal digit." }
159
+ when ss.skip(/#{INT_OCT}/o) then
160
+ action { int_with_base 8 }
161
+ when ss.skip(/#{FLOAT_BAD}/o) then
162
+ action { rb_compile_error "Trailing '_' in number." }
163
+ when text = ss.scan(/#{FLOAT}/o) then
164
+ process_float text
165
+ when ss.skip(/#{INT_DEC2}/o) then
166
+ action { int_with_base 10 }
167
+ when ss.skip(/[0-9]/) then
168
+ action { rb_compile_error "Bad number format" }
169
+ end # group /[+\d]/
170
+ when text = ss.scan(/\[/) then
171
+ process_square_bracket text
172
+ when was_label? && (text = ss.scan(/\'#{SSTRING}\':?/o)) then
173
+ process_label_or_string text
174
+ when ss.match?(/\|/) then
175
+ case
176
+ when ss.skip(/\|\|\=/) then
177
+ action { result :expr_beg, :tOP_ASGN, "||" }
178
+ when ss.skip(/\|\|/) then
179
+ action { result :expr_beg, :tOROP, "||" }
180
+ when ss.skip(/\|\=/) then
181
+ action { result :expr_beg, :tOP_ASGN, "|" }
182
+ when ss.skip(/\|/) then
183
+ action { result :arg_state, :tPIPE, "|" }
184
+ end # group /\|/
185
+ when text = ss.scan(/\{/) then
186
+ process_brace_open text
187
+ when ss.match?(/\*/) then
188
+ case
189
+ when ss.skip(/\*\*=/) then
190
+ action { result :expr_beg, :tOP_ASGN, "**" }
191
+ when ss.skip(/\*\*/) then
192
+ action { result(:arg_state, space_vs_beginning(:tDSTAR, :tDSTAR, :tPOW), "**") }
193
+ when ss.skip(/\*\=/) then
194
+ action { result(:expr_beg, :tOP_ASGN, "*") }
195
+ when ss.skip(/\*/) then
196
+ action { result(:arg_state, space_vs_beginning(:tSTAR, :tSTAR, :tSTAR2), "*") }
197
+ end # group /\*/
198
+ when ss.match?(/</) then
199
+ case
200
+ when ss.skip(/\<\=\>/) then
201
+ action { result :arg_state, :tCMP, "<=>" }
202
+ when ss.skip(/\<\=/) then
203
+ action { result :arg_state, :tLEQ, "<=" }
204
+ when ss.skip(/\<\<\=/) then
205
+ action { result :expr_beg, :tOP_ASGN, "<<" }
206
+ when text = ss.scan(/\<\</) then
207
+ process_lchevron text
208
+ when ss.skip(/\</) then
209
+ action { result :arg_state, :tLT, "<" }
210
+ end # group /</
211
+ when ss.match?(/>/) then
212
+ case
213
+ when ss.skip(/\>\=/) then
214
+ action { result :arg_state, :tGEQ, ">=" }
215
+ when ss.skip(/\>\>=/) then
216
+ action { result :expr_beg, :tOP_ASGN, ">>" }
217
+ when ss.skip(/\>\>/) then
218
+ action { result :arg_state, :tRSHFT, ">>" }
219
+ when ss.skip(/\>/) then
220
+ action { result :arg_state, :tGT, ">" }
221
+ end # group />/
222
+ when ss.match?(/\`/) then
223
+ case
224
+ when expr_fname? && (ss.skip(/\`/)) then
225
+ action { result(:expr_end, :tBACK_REF2, "`") }
226
+ when expr_dot? && (ss.skip(/\`/)) then
227
+ action { result((cmd_state ? :expr_cmdarg : :expr_arg), :tBACK_REF2, "`") }
228
+ when ss.skip(/\`/) then
229
+ action { string STR_XQUOTE, '`'; result(nil, :tXSTRING_BEG, "`") }
230
+ end # group /\`/
231
+ when text = ss.scan(/\?/) then
232
+ process_questionmark text
233
+ when ss.match?(/&/) then
234
+ case
235
+ when ss.skip(/\&\&\=/) then
236
+ action { result(:expr_beg, :tOP_ASGN, "&&") }
237
+ when ss.skip(/\&\&/) then
238
+ action { result(:expr_beg, :tANDOP, "&&") }
239
+ when ss.skip(/\&\=/) then
240
+ action { result(:expr_beg, :tOP_ASGN, "&" ) }
241
+ when ss.skip(/\&\./) then
242
+ action { result(:expr_dot, :tLONELY, "&.") }
243
+ when text = ss.scan(/\&/) then
244
+ process_amper text
245
+ end # group /&/
246
+ when text = ss.scan(/\//) then
247
+ process_slash text
248
+ when ss.match?(/\^/) then
249
+ case
250
+ when ss.skip(/\^=/) then
251
+ action { result(:expr_beg, :tOP_ASGN, "^") }
252
+ when ss.skip(/\^/) then
253
+ action { result(:arg_state, :tCARET, "^") }
254
+ end # group /\^/
255
+ when ss.skip(/\;/) then
256
+ action { self.command_start = true; result(:expr_beg, :tSEMI, ";") }
257
+ when ss.match?(/~/) then
258
+ case
259
+ when in_arg_state? && (ss.skip(/\~@/)) then
260
+ action { result(:arg_state, :tTILDE, "~") }
261
+ when ss.skip(/\~/) then
262
+ action { result(:arg_state, :tTILDE, "~") }
263
+ end # group /~/
264
+ when ss.match?(/\\/) then
265
+ case
266
+ when ss.skip(/\\\r?\n/) then
267
+ action { self.lineno += 1; self.space_seen = true; next }
268
+ when ss.skip(/\\/) then
269
+ action { rb_compile_error "bare backslash only allowed before newline" }
270
+ end # group /\\/
271
+ when text = ss.scan(/\%/) then
272
+ process_percent text
273
+ when ss.match?(/\$/) then
274
+ case
275
+ when text = ss.scan(/\$_\w+/) then
276
+ process_gvar text
277
+ when text = ss.scan(/\$_/) then
278
+ process_gvar text
279
+ when text = ss.scan(/\$[~*$?!@\/\\;,.=:<>\"]|\$-\w?/) then
280
+ process_gvar text
281
+ when in_fname? && (text = ss.scan(/\$([\&\`\'\+])/)) then
282
+ process_gvar text
283
+ when text = ss.scan(/\$([\&\`\'\+])/) then
284
+ process_backref text
285
+ when in_fname? && (text = ss.scan(/\$([1-9]\d*)/)) then
286
+ process_gvar text
287
+ when text = ss.scan(/\$([1-9]\d*)/) then
288
+ process_nthref text
289
+ when text = ss.scan(/\$0/) then
290
+ process_gvar text
291
+ when text = ss.scan(/\$\W|\$\z/) then
292
+ process_gvar_oddity text
293
+ when text = ss.scan(/\$\w+/) then
294
+ process_gvar text
295
+ end # group /\$/
296
+ when text = ss.scan(/\_/) then
297
+ process_underscore text
298
+ when text = ss.scan(/#{IDENT}/o) then
299
+ process_token text
300
+ when ss.skip(/\004|\032|\000|\Z/) then
301
+ action { [RubyLexer::EOF, RubyLexer::EOF] }
302
+ when text = ss.scan(/./) then
303
+ action { rb_compile_error "Invalid char #{text.inspect} in expression" }
304
+ else
305
+ text = ss.string[ss.pos .. -1]
306
+ raise ScanError, "can not match (#{state.inspect}) at #{location}: '#{text}'"
307
+ end
308
+ else
309
+ raise ScanError, "undefined state at #{location}: '#{state}'"
310
+ end # token = case state
311
+
312
+ next unless token # allow functions to trigger redo w/ nil
313
+ end # while
314
+
315
+ raise LexerError, "bad lexical result at #{location}: #{token.inspect}" unless
316
+ token.nil? || (Array === token && token.size >= 2)
317
+
318
+ # auto-switch state
319
+ self.state = token.last if token && token.first == :state
320
+
321
+ token
322
+ end # def next_token
323
+ end # class