exercism-analysis 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (579) hide show
  1. checksums.yaml +7 -0
  2. data/exercism-analysis.gemspec +30 -0
  3. data/lib/exercism-analysis.rb +38 -0
  4. data/lib/exercism-analysis/adapters/adapter.rb +23 -0
  5. data/lib/exercism-analysis/adapters/clojure.rb +13 -0
  6. data/lib/exercism-analysis/adapters/go.rb +19 -0
  7. data/lib/exercism-analysis/adapters/javascript.rb +13 -0
  8. data/lib/exercism-analysis/adapters/python.rb +13 -0
  9. data/lib/exercism-analysis/adapters/ruby.rb +19 -0
  10. data/lib/exercism-analysis/analysis.rb +18 -0
  11. data/lib/exercism-analysis/analyzers/analyzer.rb +54 -0
  12. data/lib/exercism-analysis/analyzers/clojure/kibit.rb +25 -0
  13. data/lib/exercism-analysis/analyzers/go/golint.rb +23 -0
  14. data/lib/exercism-analysis/analyzers/javascript/jslint.rb +24 -0
  15. data/lib/exercism-analysis/analyzers/python/pylint.rb +24 -0
  16. data/lib/exercism-analysis/analyzers/ruby/control_flow.rb +21 -0
  17. data/lib/exercism-analysis/analyzers/ruby/enumerable_condition.rb +21 -0
  18. data/lib/exercism-analysis/analyzers/ruby/for_loop.rb +29 -0
  19. data/lib/exercism-analysis/analyzers/ruby/indentation.rb +21 -0
  20. data/lib/exercism-analysis/analyzers/ruby/iter_mutation.rb +37 -0
  21. data/lib/exercism-analysis/analyzers/ruby/output.rb +20 -0
  22. data/lib/exercism-analysis/analyzers/ruby/range.rb +28 -0
  23. data/lib/exercism-analysis/analyzers/ruby/roodi.rb +19 -0
  24. data/lib/exercism-analysis/analyzers/ruby/send.rb +25 -0
  25. data/lib/exercism-analysis/analyzers/ruby/shebang.rb +23 -0
  26. data/lib/exercism-analysis/analyzers/ruby/tab.rb +38 -0
  27. data/lib/exercism-analysis/processors/call_processor.rb +39 -0
  28. data/lib/exercism-analysis/processors/control_flow_processor.rb +27 -0
  29. data/lib/exercism-analysis/processors/enumerable_condition_processor.rb +31 -0
  30. data/lib/exercism-analysis/processors/for_loop_processor.rb +21 -0
  31. data/lib/exercism-analysis/processors/indentation_processor.rb +69 -0
  32. data/lib/exercism-analysis/processors/iter_mutation_processor.rb +50 -0
  33. data/lib/exercism-analysis/processors/processor.rb +34 -0
  34. data/lib/exercism-analysis/processors/range_processor.rb +23 -0
  35. data/lib/exercism-analysis/processors/send_processor.rb +23 -0
  36. data/lib/exercism-analysis/templates/each_to_map.rb +29 -0
  37. data/lib/exercism-analysis/templates/each_to_select.rb +31 -0
  38. data/lib/exercism-analysis/templates/range_exclusive.rb +19 -0
  39. data/lib/exercism-analysis/templates/template.rb +29 -0
  40. data/vendor/clojure/kibit-runner/LICENSE +214 -0
  41. data/vendor/clojure/kibit-runner/project.clj +10 -0
  42. data/vendor/clojure/kibit-runner/src/kibit_runner/core.clj +17 -0
  43. data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT-standalone.jar +0 -0
  44. data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT.jar +0 -0
  45. data/vendor/clojure/kibit-runner/target/stale/extract-native.dependencies +1 -0
  46. data/vendor/go/src/github.com/golang/lint/LICENSE +27 -0
  47. data/vendor/go/src/github.com/golang/lint/README +59 -0
  48. data/vendor/go/src/github.com/golang/lint/golint/golint.go +67 -0
  49. data/vendor/go/src/github.com/golang/lint/lint.go +1061 -0
  50. data/vendor/go/src/runner/golint_runner.go +23 -0
  51. data/vendor/javascript/jshint_runner.js +6 -0
  52. data/vendor/javascript/node_modules/jshint/README.md +47 -0
  53. data/vendor/javascript/node_modules/jshint/bin/apply +6 -0
  54. data/vendor/javascript/node_modules/jshint/bin/build +36 -0
  55. data/vendor/javascript/node_modules/jshint/bin/changelog +36 -0
  56. data/vendor/javascript/node_modules/jshint/bin/jshint +3 -0
  57. data/vendor/javascript/node_modules/jshint/bin/land +34 -0
  58. data/vendor/javascript/node_modules/jshint/data/ascii-identifier-data.js +22 -0
  59. data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-part-only.js +1570 -0
  60. data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-start.js +48477 -0
  61. data/vendor/javascript/node_modules/jshint/dist/jshint-rhino.js +60642 -0
  62. data/vendor/javascript/node_modules/jshint/dist/jshint.js +60525 -0
  63. data/vendor/javascript/node_modules/jshint/node_modules/cli/README.md +196 -0
  64. data/vendor/javascript/node_modules/jshint/node_modules/cli/cli.js +1139 -0
  65. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/cat.js +17 -0
  66. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/command.js +16 -0
  67. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/echo.js +54 -0
  68. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/glob.js +6 -0
  69. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/long_desc.js +20 -0
  70. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/progress.js +11 -0
  71. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/sort.js +18 -0
  72. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/spinner.js +9 -0
  73. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.coffee +27 -0
  74. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.js +25 -0
  75. data/vendor/javascript/node_modules/jshint/node_modules/cli/index.js +1 -0
  76. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +27 -0
  77. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +250 -0
  78. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +9 -0
  79. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +9 -0
  80. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +728 -0
  81. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  82. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +42 -0
  83. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  84. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  85. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +51 -0
  86. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +25 -0
  87. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +58 -0
  88. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +176 -0
  89. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +63 -0
  90. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +351 -0
  91. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +55 -0
  92. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +19 -0
  93. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +118 -0
  94. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js +10 -0
  95. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +113 -0
  96. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +73 -0
  97. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js +36 -0
  98. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +39 -0
  99. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +46 -0
  100. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +32 -0
  101. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +11 -0
  102. data/vendor/javascript/node_modules/jshint/node_modules/cli/package.json +70 -0
  103. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/LICENCE +19 -0
  104. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/README.md +33 -0
  105. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/index.js +86 -0
  106. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/LICENCE +19 -0
  107. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/README.md +45 -0
  108. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/index.js +5 -0
  109. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/package.json +89 -0
  110. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/seed.js +16 -0
  111. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/index.js +28 -0
  112. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/static/index.html +10 -0
  113. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/package.json +88 -0
  114. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/index.js +67 -0
  115. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/index.html +12 -0
  116. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +53 -0
  117. data/vendor/javascript/node_modules/jshint/node_modules/exit/Gruntfile.js +48 -0
  118. data/vendor/javascript/node_modules/jshint/node_modules/exit/LICENSE-MIT +22 -0
  119. data/vendor/javascript/node_modules/jshint/node_modules/exit/README.md +75 -0
  120. data/vendor/javascript/node_modules/jshint/node_modules/exit/lib/exit.js +41 -0
  121. data/vendor/javascript/node_modules/jshint/node_modules/exit/package.json +69 -0
  122. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/exit_test.js +121 -0
  123. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stderr.txt +10 -0
  124. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout-stderr.txt +20 -0
  125. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout.txt +10 -0
  126. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stderr.txt +100 -0
  127. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout-stderr.txt +200 -0
  128. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout.txt +100 -0
  129. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stderr.txt +1000 -0
  130. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +2000 -0
  131. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout.txt +1000 -0
  132. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/create-files.sh +8 -0
  133. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log-broken.js +23 -0
  134. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log.js +25 -0
  135. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/LICENSE +18 -0
  136. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/README.md +83 -0
  137. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/CollectingHandler.js +55 -0
  138. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/FeedHandler.js +95 -0
  139. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Parser.js +337 -0
  140. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/ProxyHandler.js +27 -0
  141. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Stream.js +35 -0
  142. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Tokenizer.js +891 -0
  143. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/WritableStream.js +21 -0
  144. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/index.js +68 -0
  145. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/LICENSE +11 -0
  146. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/index.js +14 -0
  147. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/package.json +40 -0
  148. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/readme.md +1 -0
  149. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/LICENSE +11 -0
  150. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/index.js +211 -0
  151. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/package.json +68 -0
  152. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/readme.md +102 -0
  153. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/01-basic.json +57 -0
  154. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
  155. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
  156. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
  157. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
  158. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
  159. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
  160. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
  161. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
  162. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
  163. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
  164. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/12-text_only.json +11 -0
  165. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
  166. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
  167. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
  168. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
  169. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
  170. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
  171. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
  172. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
  173. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
  174. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
  175. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/23-dom-lvl1.json +121 -0
  176. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/tests.js +58 -0
  177. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/LICENSE +11 -0
  178. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/index.js +14 -0
  179. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +141 -0
  180. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +87 -0
  181. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +77 -0
  182. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +94 -0
  183. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +93 -0
  184. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +24 -0
  185. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/package.json +71 -0
  186. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/readme.md +1 -0
  187. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/fixture.js +6 -0
  188. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/helpers.js +89 -0
  189. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/legacy.js +119 -0
  190. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/utils.js +9 -0
  191. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/LICENSE +11 -0
  192. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/index.js +31 -0
  193. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode.js +72 -0
  194. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +26 -0
  195. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/encode.js +48 -0
  196. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/decode.json +1 -0
  197. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/entities.json +1 -0
  198. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/legacy.json +1 -0
  199. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/xml.json +1 -0
  200. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/package.json +79 -0
  201. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/readme.md +31 -0
  202. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/mocha.opts +2 -0
  203. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/test.js +150 -0
  204. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/LICENSE +18 -0
  205. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/README.md +15 -0
  206. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/duplex.js +1 -0
  207. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/float.patch +923 -0
  208. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
  209. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
  210. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_readable.js +944 -0
  211. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_transform.js +209 -0
  212. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_writable.js +472 -0
  213. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/README.md +3 -0
  214. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/float.patch +604 -0
  215. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +107 -0
  216. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json +53 -0
  217. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/util.js +106 -0
  218. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/LICENSE +16 -0
  219. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/README.md +42 -0
  220. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits.js +1 -0
  221. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +23 -0
  222. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json +51 -0
  223. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/test.js +25 -0
  224. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/README.md +54 -0
  225. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/build/build.js +209 -0
  226. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
  227. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/index.js +3 -0
  228. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json +54 -0
  229. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/LICENSE +20 -0
  230. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/README.md +7 -0
  231. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/index.js +200 -0
  232. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json +53 -0
  233. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/package.json +68 -0
  234. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/passthrough.js +1 -0
  235. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/readable.js +7 -0
  236. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/transform.js +1 -0
  237. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/writable.js +1 -0
  238. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/package.json +90 -0
  239. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/01-events.js +9 -0
  240. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/02-stream.js +23 -0
  241. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/03-feed.js +19 -0
  242. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Atom_Example.xml +25 -0
  243. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Attributes.html +16 -0
  244. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Basic.html +1 -0
  245. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RDF_Example.xml +63 -0
  246. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RSS_Example.xml +48 -0
  247. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/01-simple.json +44 -0
  248. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/02-template.json +63 -0
  249. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/03-lowercase_tags.json +46 -0
  250. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/04-cdata.json +50 -0
  251. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/05-cdata-special.json +35 -0
  252. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/06-leading-lt.json +16 -0
  253. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/07-self-closing.json +67 -0
  254. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/08-implicit-close-tags.json +59 -0
  255. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/09-attributes.json +68 -0
  256. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/10-crazy-attrib.json +52 -0
  257. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json +54 -0
  258. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/12-long-comment-end.json +20 -0
  259. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/13-long-cdata-end.json +22 -0
  260. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/14-implicit-open-tags.json +27 -0
  261. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/15-lt-whitespace.json +16 -0
  262. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/16-double_attribs.json +45 -0
  263. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/17-numeric_entities.json +16 -0
  264. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/18-legacy_entities.json +16 -0
  265. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/19-named_entities.json +16 -0
  266. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/20-xml_entities.json +16 -0
  267. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/21-entity_in_attribute.json +38 -0
  268. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/22-double_brackets.json +41 -0
  269. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/23-legacy_entity_fail.json +16 -0
  270. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/24-special_special.json +133 -0
  271. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/25-empty_tag_name.json +13 -0
  272. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/26-not-quite-closed.json +35 -0
  273. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/27-entities_in_attributes.json +62 -0
  274. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/28-cdata_in_html.json +9 -0
  275. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/29-comment_edge-cases.json +18 -0
  276. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/30-cdata_edge-cases.json +22 -0
  277. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/01-rss.js +34 -0
  278. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/02-atom.js +18 -0
  279. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/03-rdf.js +20 -0
  280. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/01-basic.json +83 -0
  281. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/02-RSS.json +1093 -0
  282. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/03-Atom.json +644 -0
  283. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/04-RDF.json +1399 -0
  284. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/05-Attributes.json +354 -0
  285. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/api.js +63 -0
  286. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js +83 -0
  287. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/LICENSE +23 -0
  288. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/README.md +218 -0
  289. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/minimatch.js +1061 -0
  290. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  291. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  292. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  293. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  294. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +50 -0
  295. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  296. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  297. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  298. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  299. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  300. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  301. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +58 -0
  302. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  303. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  304. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/package.json +57 -0
  305. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/basic.js +399 -0
  306. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +33 -0
  307. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/caching.js +14 -0
  308. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/defaults.js +274 -0
  309. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  310. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/LICENSE +26 -0
  311. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/README.md +569 -0
  312. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/bin/shjs +51 -0
  313. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/global.js +3 -0
  314. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/make.js +47 -0
  315. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/package.json +61 -0
  316. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/generate-docs.js +21 -0
  317. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +50 -0
  318. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/shell.js +157 -0
  319. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cat.js +43 -0
  320. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cd.js +19 -0
  321. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/chmod.js +208 -0
  322. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/common.js +203 -0
  323. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cp.js +201 -0
  324. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/dirs.js +191 -0
  325. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/echo.js +20 -0
  326. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/error.js +10 -0
  327. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/exec.js +181 -0
  328. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/find.js +51 -0
  329. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/grep.js +52 -0
  330. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ln.js +53 -0
  331. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ls.js +126 -0
  332. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mkdir.js +68 -0
  333. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mv.js +80 -0
  334. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/popd.js +1 -0
  335. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pushd.js +1 -0
  336. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pwd.js +11 -0
  337. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/rm.js +145 -0
  338. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/sed.js +43 -0
  339. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/tempdir.js +56 -0
  340. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/test.js +85 -0
  341. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/to.js +29 -0
  342. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/toEnd.js +29 -0
  343. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/which.js +83 -0
  344. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/cli.js +41 -0
  345. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/package.json +76 -0
  346. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/readme.md +74 -0
  347. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/strip-json-comments.js +64 -0
  348. data/vendor/javascript/node_modules/jshint/node_modules/underscore/LICENSE +23 -0
  349. data/vendor/javascript/node_modules/jshint/node_modules/underscore/README.md +22 -0
  350. data/vendor/javascript/node_modules/jshint/node_modules/underscore/package.json +66 -0
  351. data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore-min.js +6 -0
  352. data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore.js +1343 -0
  353. data/vendor/javascript/node_modules/jshint/package.json +80 -0
  354. data/vendor/javascript/node_modules/jshint/src/cli.js +731 -0
  355. data/vendor/javascript/node_modules/jshint/src/jshint.js +5023 -0
  356. data/vendor/javascript/node_modules/jshint/src/lex.js +1650 -0
  357. data/vendor/javascript/node_modules/jshint/src/messages.js +223 -0
  358. data/vendor/javascript/node_modules/jshint/src/platforms/rhino.js +115 -0
  359. data/vendor/javascript/node_modules/jshint/src/reg.js +38 -0
  360. data/vendor/javascript/node_modules/jshint/src/reporters/checkstyle.js +81 -0
  361. data/vendor/javascript/node_modules/jshint/src/reporters/default.js +34 -0
  362. data/vendor/javascript/node_modules/jshint/src/reporters/jslint_xml.js +57 -0
  363. data/vendor/javascript/node_modules/jshint/src/reporters/non_error.js +52 -0
  364. data/vendor/javascript/node_modules/jshint/src/state.js +28 -0
  365. data/vendor/javascript/node_modules/jshint/src/style.js +143 -0
  366. data/vendor/javascript/node_modules/jshint/src/vars.js +658 -0
  367. data/vendor/python/astroid/COPYING +339 -0
  368. data/vendor/python/astroid/COPYING.LESSER +510 -0
  369. data/vendor/python/astroid/ChangeLog +574 -0
  370. data/vendor/python/astroid/MANIFEST.in +9 -0
  371. data/vendor/python/astroid/README +56 -0
  372. data/vendor/python/astroid/README.Python3 +26 -0
  373. data/vendor/python/astroid/__init__.py +118 -0
  374. data/vendor/python/astroid/__init__.pyc +0 -0
  375. data/vendor/python/astroid/__pkginfo__.py +48 -0
  376. data/vendor/python/astroid/__pkginfo__.pyc +0 -0
  377. data/vendor/python/astroid/announce.txt +23 -0
  378. data/vendor/python/astroid/as_string.py +496 -0
  379. data/vendor/python/astroid/as_string.pyc +0 -0
  380. data/vendor/python/astroid/bases.py +618 -0
  381. data/vendor/python/astroid/bases.pyc +0 -0
  382. data/vendor/python/astroid/brain/py2gi.py +159 -0
  383. data/vendor/python/astroid/brain/py2gi.pyc +0 -0
  384. data/vendor/python/astroid/brain/py2mechanize.py +20 -0
  385. data/vendor/python/astroid/brain/py2mechanize.pyc +0 -0
  386. data/vendor/python/astroid/brain/py2qt4.py +25 -0
  387. data/vendor/python/astroid/brain/py2qt4.pyc +0 -0
  388. data/vendor/python/astroid/brain/py2stdlib.py +252 -0
  389. data/vendor/python/astroid/brain/py2stdlib.pyc +0 -0
  390. data/vendor/python/astroid/builder.py +238 -0
  391. data/vendor/python/astroid/builder.pyc +0 -0
  392. data/vendor/python/astroid/exceptions.py +51 -0
  393. data/vendor/python/astroid/exceptions.pyc +0 -0
  394. data/vendor/python/astroid/inference.py +393 -0
  395. data/vendor/python/astroid/inference.pyc +0 -0
  396. data/vendor/python/astroid/inspector.py +275 -0
  397. data/vendor/python/astroid/manager.py +336 -0
  398. data/vendor/python/astroid/manager.pyc +0 -0
  399. data/vendor/python/astroid/mixins.py +122 -0
  400. data/vendor/python/astroid/mixins.pyc +0 -0
  401. data/vendor/python/astroid/node_classes.py +928 -0
  402. data/vendor/python/astroid/node_classes.pyc +0 -0
  403. data/vendor/python/astroid/nodes.py +73 -0
  404. data/vendor/python/astroid/nodes.pyc +0 -0
  405. data/vendor/python/astroid/protocols.py +322 -0
  406. data/vendor/python/astroid/protocols.pyc +0 -0
  407. data/vendor/python/astroid/raw_building.py +361 -0
  408. data/vendor/python/astroid/raw_building.pyc +0 -0
  409. data/vendor/python/astroid/rebuilder.py +954 -0
  410. data/vendor/python/astroid/rebuilder.pyc +0 -0
  411. data/vendor/python/astroid/scoped_nodes.py +1118 -0
  412. data/vendor/python/astroid/scoped_nodes.pyc +0 -0
  413. data/vendor/python/astroid/setup.py +184 -0
  414. data/vendor/python/astroid/tox.ini +10 -0
  415. data/vendor/python/astroid/utils.py +236 -0
  416. data/vendor/python/astroid/utils.pyc +0 -0
  417. data/vendor/python/logilab/__init__.py +0 -0
  418. data/vendor/python/logilab/__init__.pyc +0 -0
  419. data/vendor/python/logilab/common/COPYING +339 -0
  420. data/vendor/python/logilab/common/COPYING.LESSER +510 -0
  421. data/vendor/python/logilab/common/ChangeLog +1517 -0
  422. data/vendor/python/logilab/common/MANIFEST.in +13 -0
  423. data/vendor/python/logilab/common/README +185 -0
  424. data/vendor/python/logilab/common/README.Python3 +29 -0
  425. data/vendor/python/logilab/common/__init__.py +171 -0
  426. data/vendor/python/logilab/common/__init__.pyc +0 -0
  427. data/vendor/python/logilab/common/__pkginfo__.py +53 -0
  428. data/vendor/python/logilab/common/__pkginfo__.pyc +0 -0
  429. data/vendor/python/logilab/common/announce.txt +25 -0
  430. data/vendor/python/logilab/common/bin/pytest +7 -0
  431. data/vendor/python/logilab/common/bin/pytest.bat +17 -0
  432. data/vendor/python/logilab/common/cache.py +114 -0
  433. data/vendor/python/logilab/common/changelog.py +236 -0
  434. data/vendor/python/logilab/common/changelog.pyc +0 -0
  435. data/vendor/python/logilab/common/clcommands.py +332 -0
  436. data/vendor/python/logilab/common/cli.py +208 -0
  437. data/vendor/python/logilab/common/compat.py +243 -0
  438. data/vendor/python/logilab/common/compat.pyc +0 -0
  439. data/vendor/python/logilab/common/configuration.py +1094 -0
  440. data/vendor/python/logilab/common/configuration.pyc +0 -0
  441. data/vendor/python/logilab/common/contexts.py +5 -0
  442. data/vendor/python/logilab/common/corbautils.py +117 -0
  443. data/vendor/python/logilab/common/daemon.py +100 -0
  444. data/vendor/python/logilab/common/date.py +333 -0
  445. data/vendor/python/logilab/common/dbf.py +229 -0
  446. data/vendor/python/logilab/common/debugger.py +210 -0
  447. data/vendor/python/logilab/common/decorators.py +281 -0
  448. data/vendor/python/logilab/common/decorators.pyc +0 -0
  449. data/vendor/python/logilab/common/deprecation.py +188 -0
  450. data/vendor/python/logilab/common/deprecation.pyc +0 -0
  451. data/vendor/python/logilab/common/fileutils.py +402 -0
  452. data/vendor/python/logilab/common/graph.py +276 -0
  453. data/vendor/python/logilab/common/graph.pyc +0 -0
  454. data/vendor/python/logilab/common/hg.py +130 -0
  455. data/vendor/python/logilab/common/interface.py +71 -0
  456. data/vendor/python/logilab/common/interface.pyc +0 -0
  457. data/vendor/python/logilab/common/logging_ext.py +193 -0
  458. data/vendor/python/logilab/common/modutils.py +695 -0
  459. data/vendor/python/logilab/common/modutils.pyc +0 -0
  460. data/vendor/python/logilab/common/optik_ext.py +391 -0
  461. data/vendor/python/logilab/common/optik_ext.pyc +0 -0
  462. data/vendor/python/logilab/common/optparser.py +90 -0
  463. data/vendor/python/logilab/common/proc.py +277 -0
  464. data/vendor/python/logilab/common/pyro_ext.py +180 -0
  465. data/vendor/python/logilab/common/pytest.py +1177 -0
  466. data/vendor/python/logilab/common/python-logilab-common.spec +184 -0
  467. data/vendor/python/logilab/common/registry.py +1113 -0
  468. data/vendor/python/logilab/common/setup.cfg +3 -0
  469. data/vendor/python/logilab/common/setup.py +189 -0
  470. data/vendor/python/logilab/common/shellutils.py +455 -0
  471. data/vendor/python/logilab/common/sphinx_ext.py +87 -0
  472. data/vendor/python/logilab/common/sphinxutils.py +122 -0
  473. data/vendor/python/logilab/common/table.py +925 -0
  474. data/vendor/python/logilab/common/tasksqueue.py +100 -0
  475. data/vendor/python/logilab/common/textutils.py +534 -0
  476. data/vendor/python/logilab/common/textutils.pyc +0 -0
  477. data/vendor/python/logilab/common/tree.py +369 -0
  478. data/vendor/python/logilab/common/tree.pyc +0 -0
  479. data/vendor/python/logilab/common/umessage.py +190 -0
  480. data/vendor/python/logilab/common/ureports/__init__.py +174 -0
  481. data/vendor/python/logilab/common/ureports/__init__.pyc +0 -0
  482. data/vendor/python/logilab/common/ureports/docbook_writer.py +139 -0
  483. data/vendor/python/logilab/common/ureports/html_writer.py +131 -0
  484. data/vendor/python/logilab/common/ureports/html_writer.pyc +0 -0
  485. data/vendor/python/logilab/common/ureports/nodes.py +201 -0
  486. data/vendor/python/logilab/common/ureports/nodes.pyc +0 -0
  487. data/vendor/python/logilab/common/ureports/text_writer.py +140 -0
  488. data/vendor/python/logilab/common/ureports/text_writer.pyc +0 -0
  489. data/vendor/python/logilab/common/urllib2ext.py +87 -0
  490. data/vendor/python/logilab/common/vcgutils.py +216 -0
  491. data/vendor/python/logilab/common/visitor.py +107 -0
  492. data/vendor/python/logilab/common/visitor.pyc +0 -0
  493. data/vendor/python/logilab/common/xmlrpcutils.py +131 -0
  494. data/vendor/python/logilab/common/xmlutils.py +61 -0
  495. data/vendor/python/pylint/CONTRIBUTORS.txt +38 -0
  496. data/vendor/python/pylint/COPYING +340 -0
  497. data/vendor/python/pylint/ChangeLog +1437 -0
  498. data/vendor/python/pylint/DEPENDS +3 -0
  499. data/vendor/python/pylint/MANIFEST.in +14 -0
  500. data/vendor/python/pylint/README +50 -0
  501. data/vendor/python/pylint/README.Python3 +37 -0
  502. data/vendor/python/pylint/__init__.py +44 -0
  503. data/vendor/python/pylint/__init__.pyc +0 -0
  504. data/vendor/python/pylint/__main__.py +3 -0
  505. data/vendor/python/pylint/__pkginfo__.py +74 -0
  506. data/vendor/python/pylint/__pkginfo__.pyc +0 -0
  507. data/vendor/python/pylint/bin/epylint +3 -0
  508. data/vendor/python/pylint/bin/epylint.bat +5 -0
  509. data/vendor/python/pylint/bin/pylint +3 -0
  510. data/vendor/python/pylint/bin/pylint-gui +3 -0
  511. data/vendor/python/pylint/bin/pylint-gui.bat +5 -0
  512. data/vendor/python/pylint/bin/pylint.bat +5 -0
  513. data/vendor/python/pylint/bin/pyreverse +3 -0
  514. data/vendor/python/pylint/bin/pyreverse.bat +5 -0
  515. data/vendor/python/pylint/bin/symilar +3 -0
  516. data/vendor/python/pylint/bin/symilar.bat +5 -0
  517. data/vendor/python/pylint/checkers/__init__.py +145 -0
  518. data/vendor/python/pylint/checkers/__init__.pyc +0 -0
  519. data/vendor/python/pylint/checkers/base.py +1141 -0
  520. data/vendor/python/pylint/checkers/base.pyc +0 -0
  521. data/vendor/python/pylint/checkers/classes.py +792 -0
  522. data/vendor/python/pylint/checkers/classes.pyc +0 -0
  523. data/vendor/python/pylint/checkers/design_analysis.py +367 -0
  524. data/vendor/python/pylint/checkers/design_analysis.pyc +0 -0
  525. data/vendor/python/pylint/checkers/exceptions.py +306 -0
  526. data/vendor/python/pylint/checkers/exceptions.pyc +0 -0
  527. data/vendor/python/pylint/checkers/format.py +943 -0
  528. data/vendor/python/pylint/checkers/format.pyc +0 -0
  529. data/vendor/python/pylint/checkers/imports.py +394 -0
  530. data/vendor/python/pylint/checkers/imports.pyc +0 -0
  531. data/vendor/python/pylint/checkers/logging.py +213 -0
  532. data/vendor/python/pylint/checkers/logging.pyc +0 -0
  533. data/vendor/python/pylint/checkers/misc.py +90 -0
  534. data/vendor/python/pylint/checkers/misc.pyc +0 -0
  535. data/vendor/python/pylint/checkers/newstyle.py +151 -0
  536. data/vendor/python/pylint/checkers/newstyle.pyc +0 -0
  537. data/vendor/python/pylint/checkers/raw_metrics.py +129 -0
  538. data/vendor/python/pylint/checkers/raw_metrics.pyc +0 -0
  539. data/vendor/python/pylint/checkers/similar.py +365 -0
  540. data/vendor/python/pylint/checkers/similar.pyc +0 -0
  541. data/vendor/python/pylint/checkers/stdlib.py +69 -0
  542. data/vendor/python/pylint/checkers/stdlib.pyc +0 -0
  543. data/vendor/python/pylint/checkers/strings.py +304 -0
  544. data/vendor/python/pylint/checkers/strings.pyc +0 -0
  545. data/vendor/python/pylint/checkers/typecheck.py +451 -0
  546. data/vendor/python/pylint/checkers/typecheck.pyc +0 -0
  547. data/vendor/python/pylint/checkers/utils.py +416 -0
  548. data/vendor/python/pylint/checkers/utils.pyc +0 -0
  549. data/vendor/python/pylint/checkers/variables.py +741 -0
  550. data/vendor/python/pylint/checkers/variables.pyc +0 -0
  551. data/vendor/python/pylint/config.py +156 -0
  552. data/vendor/python/pylint/config.pyc +0 -0
  553. data/vendor/python/pylint/epylint.py +175 -0
  554. data/vendor/python/pylint/gui.py +508 -0
  555. data/vendor/python/pylint/interfaces.py +72 -0
  556. data/vendor/python/pylint/interfaces.pyc +0 -0
  557. data/vendor/python/pylint/lint.py +1106 -0
  558. data/vendor/python/pylint/lint.pyc +0 -0
  559. data/vendor/python/pylint/pyreverse/__init__.py +5 -0
  560. data/vendor/python/pylint/pyreverse/diadefslib.py +233 -0
  561. data/vendor/python/pylint/pyreverse/diagrams.py +247 -0
  562. data/vendor/python/pylint/pyreverse/main.py +124 -0
  563. data/vendor/python/pylint/pyreverse/utils.py +131 -0
  564. data/vendor/python/pylint/pyreverse/writer.py +199 -0
  565. data/vendor/python/pylint/reporters/__init__.py +138 -0
  566. data/vendor/python/pylint/reporters/__init__.pyc +0 -0
  567. data/vendor/python/pylint/reporters/guireporter.py +28 -0
  568. data/vendor/python/pylint/reporters/guireporter.pyc +0 -0
  569. data/vendor/python/pylint/reporters/html.py +70 -0
  570. data/vendor/python/pylint/reporters/html.pyc +0 -0
  571. data/vendor/python/pylint/reporters/text.py +143 -0
  572. data/vendor/python/pylint/reporters/text.pyc +0 -0
  573. data/vendor/python/pylint/setup.cfg +3 -0
  574. data/vendor/python/pylint/setup.py +203 -0
  575. data/vendor/python/pylint/tox.ini +10 -0
  576. data/vendor/python/pylint/utils.py +744 -0
  577. data/vendor/python/pylint/utils.pyc +0 -0
  578. data/vendor/python/pylint_runner.py +22 -0
  579. metadata +675 -0
@@ -0,0 +1,27 @@
1
+ module.exports = ProxyHandler;
2
+
3
+ function ProxyHandler(cbs){
4
+ this._cbs = cbs || {};
5
+ }
6
+
7
+ var EVENTS = require("./").EVENTS;
8
+ Object.keys(EVENTS).forEach(function(name){
9
+ if(EVENTS[name] === 0){
10
+ name = "on" + name;
11
+ ProxyHandler.prototype[name] = function(){
12
+ if(this._cbs[name]) this._cbs[name]();
13
+ };
14
+ } else if(EVENTS[name] === 1){
15
+ name = "on" + name;
16
+ ProxyHandler.prototype[name] = function(a){
17
+ if(this._cbs[name]) this._cbs[name](a);
18
+ };
19
+ } else if(EVENTS[name] === 2){
20
+ name = "on" + name;
21
+ ProxyHandler.prototype[name] = function(a, b){
22
+ if(this._cbs[name]) this._cbs[name](a, b);
23
+ };
24
+ } else {
25
+ throw Error("wrong number of arguments");
26
+ }
27
+ });
@@ -0,0 +1,35 @@
1
+ module.exports = Stream;
2
+
3
+ var Parser = require("./WritableStream.js");
4
+
5
+ function Stream(options){
6
+ Parser.call(this, new Cbs(this), options);
7
+ }
8
+
9
+ require("util").inherits(Stream, Parser);
10
+
11
+ Stream.prototype.readable = true;
12
+
13
+ function Cbs(scope){
14
+ this.scope = scope;
15
+ }
16
+
17
+ var EVENTS = require("../").EVENTS;
18
+
19
+ Object.keys(EVENTS).forEach(function(name){
20
+ if(EVENTS[name] === 0){
21
+ Cbs.prototype["on" + name] = function(){
22
+ this.scope.emit(name);
23
+ };
24
+ } else if(EVENTS[name] === 1){
25
+ Cbs.prototype["on" + name] = function(a){
26
+ this.scope.emit(name, a);
27
+ };
28
+ } else if(EVENTS[name] === 2){
29
+ Cbs.prototype["on" + name] = function(a, b){
30
+ this.scope.emit(name, a, b);
31
+ };
32
+ } else {
33
+ throw Error("wrong number of arguments!");
34
+ }
35
+ });
@@ -0,0 +1,891 @@
1
+ module.exports = Tokenizer;
2
+
3
+ var decodeCodePoint = require("entities/lib/decode_codepoint.js"),
4
+ entityMap = require("entities/maps/entities.json"),
5
+ legacyMap = require("entities/maps/legacy.json"),
6
+ xmlMap = require("entities/maps/xml.json"),
7
+
8
+ i = 0,
9
+
10
+ TEXT = i++,
11
+ BEFORE_TAG_NAME = i++, //after <
12
+ IN_TAG_NAME = i++,
13
+ IN_SELF_CLOSING_TAG = i++,
14
+ BEFORE_CLOSING_TAG_NAME = i++,
15
+ IN_CLOSING_TAG_NAME = i++,
16
+ AFTER_CLOSING_TAG_NAME = i++,
17
+
18
+ //attributes
19
+ BEFORE_ATTRIBUTE_NAME = i++,
20
+ IN_ATTRIBUTE_NAME = i++,
21
+ AFTER_ATTRIBUTE_NAME = i++,
22
+ BEFORE_ATTRIBUTE_VALUE = i++,
23
+ IN_ATTRIBUTE_VALUE_DQ = i++, // "
24
+ IN_ATTRIBUTE_VALUE_SQ = i++, // '
25
+ IN_ATTRIBUTE_VALUE_NQ = i++,
26
+
27
+ //declarations
28
+ BEFORE_DECLARATION = i++, // !
29
+ IN_DECLARATION = i++,
30
+
31
+ //processing instructions
32
+ IN_PROCESSING_INSTRUCTION = i++, // ?
33
+
34
+ //comments
35
+ BEFORE_COMMENT = i++,
36
+ IN_COMMENT = i++,
37
+ AFTER_COMMENT_1 = i++,
38
+ AFTER_COMMENT_2 = i++,
39
+
40
+ //cdata
41
+ BEFORE_CDATA_1 = i++, // [
42
+ BEFORE_CDATA_2 = i++, // C
43
+ BEFORE_CDATA_3 = i++, // D
44
+ BEFORE_CDATA_4 = i++, // A
45
+ BEFORE_CDATA_5 = i++, // T
46
+ BEFORE_CDATA_6 = i++, // A
47
+ IN_CDATA = i++, // [
48
+ AFTER_CDATA_1 = i++, // ]
49
+ AFTER_CDATA_2 = i++, // ]
50
+
51
+ //special tags
52
+ BEFORE_SPECIAL = i++, //S
53
+ BEFORE_SPECIAL_END = i++, //S
54
+
55
+ BEFORE_SCRIPT_1 = i++, //C
56
+ BEFORE_SCRIPT_2 = i++, //R
57
+ BEFORE_SCRIPT_3 = i++, //I
58
+ BEFORE_SCRIPT_4 = i++, //P
59
+ BEFORE_SCRIPT_5 = i++, //T
60
+ AFTER_SCRIPT_1 = i++, //C
61
+ AFTER_SCRIPT_2 = i++, //R
62
+ AFTER_SCRIPT_3 = i++, //I
63
+ AFTER_SCRIPT_4 = i++, //P
64
+ AFTER_SCRIPT_5 = i++, //T
65
+
66
+ BEFORE_STYLE_1 = i++, //T
67
+ BEFORE_STYLE_2 = i++, //Y
68
+ BEFORE_STYLE_3 = i++, //L
69
+ BEFORE_STYLE_4 = i++, //E
70
+ AFTER_STYLE_1 = i++, //T
71
+ AFTER_STYLE_2 = i++, //Y
72
+ AFTER_STYLE_3 = i++, //L
73
+ AFTER_STYLE_4 = i++, //E
74
+
75
+ BEFORE_ENTITY = i++, //&
76
+ BEFORE_NUMERIC_ENTITY = i++, //#
77
+ IN_NAMED_ENTITY = i++,
78
+ IN_NUMERIC_ENTITY = i++,
79
+ IN_HEX_ENTITY = i++, //X
80
+
81
+ j = 0,
82
+
83
+ SPECIAL_NONE = j++,
84
+ SPECIAL_SCRIPT = j++,
85
+ SPECIAL_STYLE = j++;
86
+
87
+ function whitespace(c){
88
+ return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r";
89
+ }
90
+
91
+ function characterState(char, SUCCESS){
92
+ return function(c){
93
+ if(c === char) this._state = SUCCESS;
94
+ };
95
+ }
96
+
97
+ function ifElseState(upper, SUCCESS, FAILURE){
98
+ var lower = upper.toLowerCase();
99
+
100
+ if(upper === lower){
101
+ return function(c){
102
+ if(c === lower){
103
+ this._state = SUCCESS;
104
+ } else {
105
+ this._state = FAILURE;
106
+ this._index--;
107
+ }
108
+ };
109
+ } else {
110
+ return function(c){
111
+ if(c === lower || c === upper){
112
+ this._state = SUCCESS;
113
+ } else {
114
+ this._state = FAILURE;
115
+ this._index--;
116
+ }
117
+ };
118
+ }
119
+ }
120
+
121
+ function consumeSpecialNameChar(upper, NEXT_STATE){
122
+ var lower = upper.toLowerCase();
123
+
124
+ return function(c){
125
+ if(c === lower || c === upper){
126
+ this._state = NEXT_STATE;
127
+ } else {
128
+ this._state = IN_TAG_NAME;
129
+ this._index--; //consume the token again
130
+ }
131
+ };
132
+ }
133
+
134
+ function Tokenizer(options, cbs){
135
+ this._state = TEXT;
136
+ this._buffer = "";
137
+ this._sectionStart = 0;
138
+ this._index = 0;
139
+ this._baseState = TEXT;
140
+ this._special = SPECIAL_NONE;
141
+ this._cbs = cbs;
142
+ this._running = true;
143
+ this._ended = false;
144
+ this._xmlMode = !!(options && options.xmlMode);
145
+ this._decodeEntities = !!(options && options.decodeEntities);
146
+ }
147
+
148
+ Tokenizer.prototype._stateText = function(c){
149
+ if(c === "<"){
150
+ if(this._index > this._sectionStart){
151
+ this._cbs.ontext(this._getSection());
152
+ }
153
+ this._state = BEFORE_TAG_NAME;
154
+ this._sectionStart = this._index;
155
+ } else if(this._decodeEntities && this._special === SPECIAL_NONE && c === "&"){
156
+ if(this._index > this._sectionStart){
157
+ this._cbs.ontext(this._getSection());
158
+ }
159
+ this._baseState = TEXT;
160
+ this._state = BEFORE_ENTITY;
161
+ this._sectionStart = this._index;
162
+ }
163
+ };
164
+
165
+ Tokenizer.prototype._stateBeforeTagName = function(c){
166
+ if(c === "/"){
167
+ this._state = BEFORE_CLOSING_TAG_NAME;
168
+ } else if(c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) {
169
+ this._state = TEXT;
170
+ } else if(c === "!"){
171
+ this._state = BEFORE_DECLARATION;
172
+ this._sectionStart = this._index + 1;
173
+ } else if(c === "?"){
174
+ this._state = IN_PROCESSING_INSTRUCTION;
175
+ this._sectionStart = this._index + 1;
176
+ } else if(c === "<"){
177
+ this._cbs.ontext(this._getSection());
178
+ this._sectionStart = this._index;
179
+ } else {
180
+ this._state = (!this._xmlMode && (c === "s" || c === "S")) ?
181
+ BEFORE_SPECIAL : IN_TAG_NAME;
182
+ this._sectionStart = this._index;
183
+ }
184
+ };
185
+
186
+ Tokenizer.prototype._stateInTagName = function(c){
187
+ if(c === "/" || c === ">" || whitespace(c)){
188
+ this._emitToken("onopentagname");
189
+ this._state = BEFORE_ATTRIBUTE_NAME;
190
+ this._index--;
191
+ }
192
+ };
193
+
194
+ Tokenizer.prototype._stateBeforeCloseingTagName = function(c){
195
+ if(whitespace(c));
196
+ else if(c === ">"){
197
+ this._state = TEXT;
198
+ } else if(this._special !== SPECIAL_NONE){
199
+ if(c === "s" || c === "S"){
200
+ this._state = BEFORE_SPECIAL_END;
201
+ } else {
202
+ this._state = TEXT;
203
+ this._index--;
204
+ }
205
+ } else {
206
+ this._state = IN_CLOSING_TAG_NAME;
207
+ this._sectionStart = this._index;
208
+ }
209
+ };
210
+
211
+ Tokenizer.prototype._stateInCloseingTagName = function(c){
212
+ if(c === ">" || whitespace(c)){
213
+ this._emitToken("onclosetag");
214
+ this._state = AFTER_CLOSING_TAG_NAME;
215
+ this._index--;
216
+ }
217
+ };
218
+
219
+ Tokenizer.prototype._stateAfterCloseingTagName = function(c){
220
+ //skip everything until ">"
221
+ if(c === ">"){
222
+ this._state = TEXT;
223
+ this._sectionStart = this._index + 1;
224
+ }
225
+ };
226
+
227
+ Tokenizer.prototype._stateBeforeAttributeName = function(c){
228
+ if(c === ">"){
229
+ this._cbs.onopentagend();
230
+ this._state = TEXT;
231
+ this._sectionStart = this._index + 1;
232
+ } else if(c === "/"){
233
+ this._state = IN_SELF_CLOSING_TAG;
234
+ } else if(!whitespace(c)){
235
+ this._state = IN_ATTRIBUTE_NAME;
236
+ this._sectionStart = this._index;
237
+ }
238
+ };
239
+
240
+ Tokenizer.prototype._stateInSelfClosingTag = function(c){
241
+ if(c === ">"){
242
+ this._cbs.onselfclosingtag();
243
+ this._state = TEXT;
244
+ this._sectionStart = this._index + 1;
245
+ } else if(!whitespace(c)){
246
+ this._state = BEFORE_ATTRIBUTE_NAME;
247
+ this._index--;
248
+ }
249
+ };
250
+
251
+ Tokenizer.prototype._stateInAttributeName = function(c){
252
+ if(c === "=" || c === "/" || c === ">" || whitespace(c)){
253
+ this._cbs.onattribname(this._getSection());
254
+ this._sectionStart = -1;
255
+ this._state = AFTER_ATTRIBUTE_NAME;
256
+ this._index--;
257
+ }
258
+ };
259
+
260
+ Tokenizer.prototype._stateAfterAttributeName = function(c){
261
+ if(c === "="){
262
+ this._state = BEFORE_ATTRIBUTE_VALUE;
263
+ } else if(c === "/" || c === ">"){
264
+ this._cbs.onattribend();
265
+ this._state = BEFORE_ATTRIBUTE_NAME;
266
+ this._index--;
267
+ } else if(!whitespace(c)){
268
+ this._cbs.onattribend();
269
+ this._state = IN_ATTRIBUTE_NAME;
270
+ this._sectionStart = this._index;
271
+ }
272
+ };
273
+
274
+ Tokenizer.prototype._stateBeforeAttributeValue = function(c){
275
+ if(c === "\""){
276
+ this._state = IN_ATTRIBUTE_VALUE_DQ;
277
+ this._sectionStart = this._index + 1;
278
+ } else if(c === "'"){
279
+ this._state = IN_ATTRIBUTE_VALUE_SQ;
280
+ this._sectionStart = this._index + 1;
281
+ } else if(!whitespace(c)){
282
+ this._state = IN_ATTRIBUTE_VALUE_NQ;
283
+ this._sectionStart = this._index;
284
+ this._index--; //reconsume token
285
+ }
286
+ };
287
+
288
+ Tokenizer.prototype._stateInAttributeValueDoubleQuotes = function(c){
289
+ if(c === "\""){
290
+ this._emitToken("onattribdata");
291
+ this._cbs.onattribend();
292
+ this._state = BEFORE_ATTRIBUTE_NAME;
293
+ } else if(this._decodeEntities && c === "&"){
294
+ this._emitToken("onattribdata");
295
+ this._baseState = this._state;
296
+ this._state = BEFORE_ENTITY;
297
+ this._sectionStart = this._index;
298
+ }
299
+ };
300
+
301
+ Tokenizer.prototype._stateInAttributeValueSingleQuotes = function(c){
302
+ if(c === "'"){
303
+ this._emitToken("onattribdata");
304
+ this._cbs.onattribend();
305
+ this._state = BEFORE_ATTRIBUTE_NAME;
306
+ } else if(this._decodeEntities && c === "&"){
307
+ this._emitToken("onattribdata");
308
+ this._baseState = this._state;
309
+ this._state = BEFORE_ENTITY;
310
+ this._sectionStart = this._index;
311
+ }
312
+ };
313
+
314
+ Tokenizer.prototype._stateInAttributeValueNoQuotes = function(c){
315
+ if(whitespace(c) || c === ">"){
316
+ this._emitToken("onattribdata");
317
+ this._cbs.onattribend();
318
+ this._state = BEFORE_ATTRIBUTE_NAME;
319
+ this._index--;
320
+ } else if(this._decodeEntities && c === "&"){
321
+ this._emitToken("onattribdata");
322
+ this._baseState = this._state;
323
+ this._state = BEFORE_ENTITY;
324
+ this._sectionStart = this._index;
325
+ }
326
+ };
327
+
328
+ Tokenizer.prototype._stateBeforeDeclaration = function(c){
329
+ this._state = c === "[" ? BEFORE_CDATA_1 :
330
+ c === "-" ? BEFORE_COMMENT :
331
+ IN_DECLARATION;
332
+ };
333
+
334
+ Tokenizer.prototype._stateInDeclaration = function(c){
335
+ if(c === ">"){
336
+ this._cbs.ondeclaration(this._getSection());
337
+ this._state = TEXT;
338
+ this._sectionStart = this._index + 1;
339
+ }
340
+ };
341
+
342
+ Tokenizer.prototype._stateInProcessingInstruction = function(c){
343
+ if(c === ">"){
344
+ this._cbs.onprocessinginstruction(this._getSection());
345
+ this._state = TEXT;
346
+ this._sectionStart = this._index + 1;
347
+ }
348
+ };
349
+
350
+ Tokenizer.prototype._stateBeforeComment = function(c){
351
+ if(c === "-"){
352
+ this._state = IN_COMMENT;
353
+ this._sectionStart = this._index + 1;
354
+ } else {
355
+ this._state = IN_DECLARATION;
356
+ }
357
+ };
358
+
359
+ Tokenizer.prototype._stateInComment = function(c){
360
+ if(c === "-") this._state = AFTER_COMMENT_1;
361
+ };
362
+
363
+ Tokenizer.prototype._stateAfterComment1 = characterState("-", AFTER_COMMENT_2);
364
+
365
+ Tokenizer.prototype._stateAfterComment2 = function(c){
366
+ if(c === ">"){
367
+ //remove 2 trailing chars
368
+ this._cbs.oncomment(this._buffer.substring(this._sectionStart, this._index - 2));
369
+ this._state = TEXT;
370
+ this._sectionStart = this._index + 1;
371
+ } else if(c !== "-"){
372
+ this._state = IN_COMMENT;
373
+ }
374
+ // else: stay in AFTER_COMMENT_2 (`--->`)
375
+ };
376
+
377
+ Tokenizer.prototype._stateBeforeCdata1 = ifElseState("C", BEFORE_CDATA_2, IN_DECLARATION);
378
+ Tokenizer.prototype._stateBeforeCdata2 = ifElseState("D", BEFORE_CDATA_3, IN_DECLARATION);
379
+ Tokenizer.prototype._stateBeforeCdata3 = ifElseState("A", BEFORE_CDATA_4, IN_DECLARATION);
380
+ Tokenizer.prototype._stateBeforeCdata4 = ifElseState("T", BEFORE_CDATA_5, IN_DECLARATION);
381
+ Tokenizer.prototype._stateBeforeCdata5 = ifElseState("A", BEFORE_CDATA_6, IN_DECLARATION);
382
+
383
+ Tokenizer.prototype._stateBeforeCdata6 = function(c){
384
+ if(c === "["){
385
+ this._state = IN_CDATA;
386
+ this._sectionStart = this._index + 1;
387
+ } else {
388
+ this._state = IN_DECLARATION;
389
+ this._index--;
390
+ }
391
+ };
392
+
393
+ Tokenizer.prototype._stateInCdata = function(c){
394
+ if(c === "]") this._state = AFTER_CDATA_1;
395
+ };
396
+
397
+ Tokenizer.prototype._stateAfterCdata1 = characterState("]", AFTER_CDATA_2);
398
+
399
+ Tokenizer.prototype._stateAfterCdata2 = function(c){
400
+ if(c === ">"){
401
+ //remove 2 trailing chars
402
+ this._cbs.oncdata(this._buffer.substring(this._sectionStart, this._index - 2));
403
+ this._state = TEXT;
404
+ this._sectionStart = this._index + 1;
405
+ } else if (c !== "]") {
406
+ this._state = IN_CDATA;
407
+ }
408
+ //else: stay in AFTER_CDATA_2 (`]]]>`)
409
+ };
410
+
411
+ Tokenizer.prototype._stateBeforeSpecial = function(c){
412
+ if(c === "c" || c === "C"){
413
+ this._state = BEFORE_SCRIPT_1;
414
+ } else if(c === "t" || c === "T"){
415
+ this._state = BEFORE_STYLE_1;
416
+ } else {
417
+ this._state = IN_TAG_NAME;
418
+ this._index--; //consume the token again
419
+ }
420
+ };
421
+
422
+ Tokenizer.prototype._stateBeforeSpecialEnd = function(c){
423
+ if(this._special === SPECIAL_SCRIPT && (c === "c" || c === "C")){
424
+ this._state = AFTER_SCRIPT_1;
425
+ } else if(this._special === SPECIAL_STYLE && (c === "t" || c === "T")){
426
+ this._state = AFTER_STYLE_1;
427
+ }
428
+ else this._state = TEXT;
429
+ };
430
+
431
+ Tokenizer.prototype._stateBeforeScript1 = consumeSpecialNameChar("R", BEFORE_SCRIPT_2);
432
+ Tokenizer.prototype._stateBeforeScript2 = consumeSpecialNameChar("I", BEFORE_SCRIPT_3);
433
+ Tokenizer.prototype._stateBeforeScript3 = consumeSpecialNameChar("P", BEFORE_SCRIPT_4);
434
+ Tokenizer.prototype._stateBeforeScript4 = consumeSpecialNameChar("T", BEFORE_SCRIPT_5);
435
+
436
+ Tokenizer.prototype._stateBeforeScript5 = function(c){
437
+ if(c === "/" || c === ">" || whitespace(c)){
438
+ this._special = SPECIAL_SCRIPT;
439
+ }
440
+ this._state = IN_TAG_NAME;
441
+ this._index--; //consume the token again
442
+ };
443
+
444
+ Tokenizer.prototype._stateAfterScript1 = ifElseState("R", AFTER_SCRIPT_2, TEXT);
445
+ Tokenizer.prototype._stateAfterScript2 = ifElseState("I", AFTER_SCRIPT_3, TEXT);
446
+ Tokenizer.prototype._stateAfterScript3 = ifElseState("P", AFTER_SCRIPT_4, TEXT);
447
+ Tokenizer.prototype._stateAfterScript4 = ifElseState("T", AFTER_SCRIPT_5, TEXT);
448
+
449
+ Tokenizer.prototype._stateAfterScript5 = function(c){
450
+ if(c === ">" || whitespace(c)){
451
+ this._special = SPECIAL_NONE;
452
+ this._state = IN_CLOSING_TAG_NAME;
453
+ this._sectionStart = this._index - 6;
454
+ this._index--; //reconsume the token
455
+ }
456
+ else this._state = TEXT;
457
+ };
458
+
459
+ Tokenizer.prototype._stateBeforeStyle1 = consumeSpecialNameChar("Y", BEFORE_STYLE_2);
460
+ Tokenizer.prototype._stateBeforeStyle2 = consumeSpecialNameChar("L", BEFORE_STYLE_3);
461
+ Tokenizer.prototype._stateBeforeStyle3 = consumeSpecialNameChar("E", BEFORE_STYLE_4);
462
+
463
+ Tokenizer.prototype._stateBeforeStyle4 = function(c){
464
+ if(c === "/" || c === ">" || whitespace(c)){
465
+ this._special = SPECIAL_STYLE;
466
+ }
467
+ this._state = IN_TAG_NAME;
468
+ this._index--; //consume the token again
469
+ };
470
+
471
+ Tokenizer.prototype._stateAfterStyle1 = ifElseState("Y", AFTER_STYLE_2, TEXT);
472
+ Tokenizer.prototype._stateAfterStyle2 = ifElseState("L", AFTER_STYLE_3, TEXT);
473
+ Tokenizer.prototype._stateAfterStyle3 = ifElseState("E", AFTER_STYLE_4, TEXT);
474
+
475
+ Tokenizer.prototype._stateAfterStyle4 = function(c){
476
+ if(c === ">" || whitespace(c)){
477
+ this._special = SPECIAL_NONE;
478
+ this._state = IN_CLOSING_TAG_NAME;
479
+ this._sectionStart = this._index - 5;
480
+ this._index--; //reconsume the token
481
+ }
482
+ else this._state = TEXT;
483
+ };
484
+
485
+ Tokenizer.prototype._stateBeforeEntity = ifElseState("#", BEFORE_NUMERIC_ENTITY, IN_NAMED_ENTITY);
486
+ Tokenizer.prototype._stateBeforeNumericEntity = ifElseState("X", IN_HEX_ENTITY, IN_NUMERIC_ENTITY);
487
+
488
+ //for entities terminated with a semicolon
489
+ Tokenizer.prototype._parseNamedEntityStrict = function(){
490
+ //offset = 1
491
+ if(this._sectionStart + 1 < this._index){
492
+ var entity = this._buffer.substring(this._sectionStart + 1, this._index),
493
+ map = this._xmlMode ? xmlMap : entityMap;
494
+
495
+ if(map.hasOwnProperty(entity)){
496
+ this._emitPartial(map[entity]);
497
+ this._sectionStart = this._index + 1;
498
+ }
499
+ }
500
+ };
501
+
502
+
503
+ //parses legacy entities (without trailing semicolon)
504
+ Tokenizer.prototype._parseLegacyEntity = function(){
505
+ var start = this._sectionStart + 1,
506
+ limit = this._index - start;
507
+
508
+ if(limit > 6) limit = 6; //the max length of legacy entities is 6
509
+
510
+ while(limit >= 2){ //the min length of legacy entities is 2
511
+ var entity = this._buffer.substr(start, limit);
512
+
513
+ if(legacyMap.hasOwnProperty(entity)){
514
+ this._emitPartial(legacyMap[entity]);
515
+ this._sectionStart += limit + 1;
516
+ return;
517
+ } else {
518
+ limit--;
519
+ }
520
+ }
521
+ };
522
+
523
+ Tokenizer.prototype._stateInNamedEntity = function(c){
524
+ if(c === ";"){
525
+ this._parseNamedEntityStrict();
526
+ if(this._sectionStart + 1 < this._index && !this._xmlMode){
527
+ this._parseLegacyEntity();
528
+ }
529
+ this._state = this._baseState;
530
+ } else if((c < "a" || c > "z") && (c < "A" || c > "Z") && (c < "0" || c > "9")){
531
+ if(this._xmlMode);
532
+ else if(this._sectionStart + 1 === this._index);
533
+ else if(this._baseState !== TEXT){
534
+ if(c !== "="){
535
+ this._parseNamedEntityStrict();
536
+ }
537
+ } else {
538
+ this._parseLegacyEntity();
539
+ }
540
+
541
+ this._state = this._baseState;
542
+ this._index--;
543
+ }
544
+ };
545
+
546
+ Tokenizer.prototype._decodeNumericEntity = function(offset, base){
547
+ var sectionStart = this._sectionStart + offset;
548
+
549
+ if(sectionStart !== this._index){
550
+ //parse entity
551
+ var entity = this._buffer.substring(sectionStart, this._index);
552
+ var parsed = parseInt(entity, base);
553
+
554
+ this._emitPartial(decodeCodePoint(parsed));
555
+ this._sectionStart = this._index;
556
+ } else {
557
+ this._sectionStart--;
558
+ }
559
+
560
+ this._state = this._baseState;
561
+ };
562
+
563
+ Tokenizer.prototype._stateInNumericEntity = function(c){
564
+ if(c === ";"){
565
+ this._decodeNumericEntity(2, 10);
566
+ this._sectionStart++;
567
+ } else if(c < "0" || c > "9"){
568
+ if(!this._xmlMode){
569
+ this._decodeNumericEntity(2, 10);
570
+ } else {
571
+ this._state = this._baseState;
572
+ }
573
+ this._index--;
574
+ }
575
+ };
576
+
577
+ Tokenizer.prototype._stateInHexEntity = function(c){
578
+ if(c === ";"){
579
+ this._decodeNumericEntity(3, 16);
580
+ this._sectionStart++;
581
+ } else if((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")){
582
+ if(!this._xmlMode){
583
+ this._decodeNumericEntity(3, 16);
584
+ } else {
585
+ this._state = this._baseState;
586
+ }
587
+ this._index--;
588
+ }
589
+ };
590
+
591
+ Tokenizer.prototype._cleanup = function () {
592
+ if(this._sectionStart < 0){
593
+ this._buffer = "";
594
+ this._index = 0;
595
+ } else if(this._running){
596
+ if(this._state === TEXT){
597
+ if(this._sectionStart !== this._index){
598
+ this._cbs.ontext(this._buffer.substr(this._sectionStart));
599
+ }
600
+ this._buffer = "";
601
+ this._index = 0;
602
+ } else if(this._sectionStart === this._index){
603
+ //the section just started
604
+ this._buffer = "";
605
+ this._index = 0;
606
+ } else {
607
+ //remove everything unnecessary
608
+ this._buffer = this._buffer.substr(this._sectionStart);
609
+ this._index -= this._sectionStart;
610
+ }
611
+
612
+ this._sectionStart = 0;
613
+ }
614
+ };
615
+
616
+ //TODO make events conditional
617
+ Tokenizer.prototype.write = function(chunk){
618
+ if(this._ended) this._cbs.onerror(Error(".write() after done!"));
619
+
620
+ this._buffer += chunk;
621
+ this._parse();
622
+ };
623
+
624
+ Tokenizer.prototype._parse = function(){
625
+ while(this._index < this._buffer.length && this._running){
626
+ var c = this._buffer.charAt(this._index);
627
+ if(this._state === TEXT) {
628
+ this._stateText(c);
629
+ } else if(this._state === BEFORE_TAG_NAME){
630
+ this._stateBeforeTagName(c);
631
+ } else if(this._state === IN_TAG_NAME) {
632
+ this._stateInTagName(c);
633
+ } else if(this._state === BEFORE_CLOSING_TAG_NAME){
634
+ this._stateBeforeCloseingTagName(c);
635
+ } else if(this._state === IN_CLOSING_TAG_NAME){
636
+ this._stateInCloseingTagName(c);
637
+ } else if(this._state === AFTER_CLOSING_TAG_NAME){
638
+ this._stateAfterCloseingTagName(c);
639
+ } else if(this._state === IN_SELF_CLOSING_TAG){
640
+ this._stateInSelfClosingTag(c);
641
+ }
642
+
643
+ /*
644
+ * attributes
645
+ */
646
+ else if(this._state === BEFORE_ATTRIBUTE_NAME){
647
+ this._stateBeforeAttributeName(c);
648
+ } else if(this._state === IN_ATTRIBUTE_NAME){
649
+ this._stateInAttributeName(c);
650
+ } else if(this._state === AFTER_ATTRIBUTE_NAME){
651
+ this._stateAfterAttributeName(c);
652
+ } else if(this._state === BEFORE_ATTRIBUTE_VALUE){
653
+ this._stateBeforeAttributeValue(c);
654
+ } else if(this._state === IN_ATTRIBUTE_VALUE_DQ){
655
+ this._stateInAttributeValueDoubleQuotes(c);
656
+ } else if(this._state === IN_ATTRIBUTE_VALUE_SQ){
657
+ this._stateInAttributeValueSingleQuotes(c);
658
+ } else if(this._state === IN_ATTRIBUTE_VALUE_NQ){
659
+ this._stateInAttributeValueNoQuotes(c);
660
+ }
661
+
662
+ /*
663
+ * declarations
664
+ */
665
+ else if(this._state === BEFORE_DECLARATION){
666
+ this._stateBeforeDeclaration(c);
667
+ } else if(this._state === IN_DECLARATION){
668
+ this._stateInDeclaration(c);
669
+ }
670
+
671
+ /*
672
+ * processing instructions
673
+ */
674
+ else if(this._state === IN_PROCESSING_INSTRUCTION){
675
+ this._stateInProcessingInstruction(c);
676
+ }
677
+
678
+ /*
679
+ * comments
680
+ */
681
+ else if(this._state === BEFORE_COMMENT){
682
+ this._stateBeforeComment(c);
683
+ } else if(this._state === IN_COMMENT){
684
+ this._stateInComment(c);
685
+ } else if(this._state === AFTER_COMMENT_1){
686
+ this._stateAfterComment1(c);
687
+ } else if(this._state === AFTER_COMMENT_2){
688
+ this._stateAfterComment2(c);
689
+ }
690
+
691
+ /*
692
+ * cdata
693
+ */
694
+ else if(this._state === BEFORE_CDATA_1){
695
+ this._stateBeforeCdata1(c);
696
+ } else if(this._state === BEFORE_CDATA_2){
697
+ this._stateBeforeCdata2(c);
698
+ } else if(this._state === BEFORE_CDATA_3){
699
+ this._stateBeforeCdata3(c);
700
+ } else if(this._state === BEFORE_CDATA_4){
701
+ this._stateBeforeCdata4(c);
702
+ } else if(this._state === BEFORE_CDATA_5){
703
+ this._stateBeforeCdata5(c);
704
+ } else if(this._state === BEFORE_CDATA_6){
705
+ this._stateBeforeCdata6(c);
706
+ } else if(this._state === IN_CDATA){
707
+ this._stateInCdata(c);
708
+ } else if(this._state === AFTER_CDATA_1){
709
+ this._stateAfterCdata1(c);
710
+ } else if(this._state === AFTER_CDATA_2){
711
+ this._stateAfterCdata2(c);
712
+ }
713
+
714
+ /*
715
+ * special tags
716
+ */
717
+ else if(this._state === BEFORE_SPECIAL){
718
+ this._stateBeforeSpecial(c);
719
+ } else if(this._state === BEFORE_SPECIAL_END){
720
+ this._stateBeforeSpecialEnd(c);
721
+ }
722
+
723
+ /*
724
+ * script
725
+ */
726
+ else if(this._state === BEFORE_SCRIPT_1){
727
+ this._stateBeforeScript1(c);
728
+ } else if(this._state === BEFORE_SCRIPT_2){
729
+ this._stateBeforeScript2(c);
730
+ } else if(this._state === BEFORE_SCRIPT_3){
731
+ this._stateBeforeScript3(c);
732
+ } else if(this._state === BEFORE_SCRIPT_4){
733
+ this._stateBeforeScript4(c);
734
+ } else if(this._state === BEFORE_SCRIPT_5){
735
+ this._stateBeforeScript5(c);
736
+ }
737
+
738
+ else if(this._state === AFTER_SCRIPT_1){
739
+ this._stateAfterScript1(c);
740
+ } else if(this._state === AFTER_SCRIPT_2){
741
+ this._stateAfterScript2(c);
742
+ } else if(this._state === AFTER_SCRIPT_3){
743
+ this._stateAfterScript3(c);
744
+ } else if(this._state === AFTER_SCRIPT_4){
745
+ this._stateAfterScript4(c);
746
+ } else if(this._state === AFTER_SCRIPT_5){
747
+ this._stateAfterScript5(c);
748
+ }
749
+
750
+ /*
751
+ * style
752
+ */
753
+ else if(this._state === BEFORE_STYLE_1){
754
+ this._stateBeforeStyle1(c);
755
+ } else if(this._state === BEFORE_STYLE_2){
756
+ this._stateBeforeStyle2(c);
757
+ } else if(this._state === BEFORE_STYLE_3){
758
+ this._stateBeforeStyle3(c);
759
+ } else if(this._state === BEFORE_STYLE_4){
760
+ this._stateBeforeStyle4(c);
761
+ }
762
+
763
+ else if(this._state === AFTER_STYLE_1){
764
+ this._stateAfterStyle1(c);
765
+ } else if(this._state === AFTER_STYLE_2){
766
+ this._stateAfterStyle2(c);
767
+ } else if(this._state === AFTER_STYLE_3){
768
+ this._stateAfterStyle3(c);
769
+ } else if(this._state === AFTER_STYLE_4){
770
+ this._stateAfterStyle4(c);
771
+ }
772
+
773
+ /*
774
+ * entities
775
+ */
776
+ else if(this._state === BEFORE_ENTITY){
777
+ this._stateBeforeEntity(c);
778
+ } else if(this._state === BEFORE_NUMERIC_ENTITY){
779
+ this._stateBeforeNumericEntity(c);
780
+ } else if(this._state === IN_NAMED_ENTITY){
781
+ this._stateInNamedEntity(c);
782
+ } else if(this._state === IN_NUMERIC_ENTITY){
783
+ this._stateInNumericEntity(c);
784
+ } else if(this._state === IN_HEX_ENTITY){
785
+ this._stateInHexEntity(c);
786
+ }
787
+
788
+ else {
789
+ this._cbs.onerror(Error("unknown _state"), this._state);
790
+ }
791
+
792
+ this._index++;
793
+ }
794
+
795
+ this._cleanup();
796
+ };
797
+
798
+ Tokenizer.prototype.pause = function(){
799
+ this._running = false;
800
+ };
801
+ Tokenizer.prototype.resume = function(){
802
+ this._running = true;
803
+
804
+ if(this._index < this._buffer.length){
805
+ this._parse();
806
+ }
807
+ if(this._ended){
808
+ this._finish();
809
+ }
810
+ };
811
+
812
+ Tokenizer.prototype.end = function(chunk){
813
+ if(this._ended) this._cbs.onerror(Error(".end() after done!"));
814
+ if(chunk) this.write(chunk);
815
+
816
+ this._ended = true;
817
+
818
+ if(this._running) this._finish();
819
+ };
820
+
821
+ Tokenizer.prototype._finish = function(){
822
+ //if there is remaining data, emit it in a reasonable way
823
+ if(this._sectionStart < this._index){
824
+ this._handleTrailingData();
825
+ }
826
+
827
+ this._cbs.onend();
828
+ };
829
+
830
+ Tokenizer.prototype._handleTrailingData = function(){
831
+ var data = this._buffer.substr(this._sectionStart);
832
+
833
+ if(this._state === IN_CDATA || this._state === AFTER_CDATA_1 || this._state === AFTER_CDATA_2){
834
+ this._cbs.oncdata(data);
835
+ } else if(this._state === IN_COMMENT || this._state === AFTER_COMMENT_1 || this._state === AFTER_COMMENT_2){
836
+ this._cbs.oncomment(data);
837
+ } else if(this._state === IN_NAMED_ENTITY && !this._xmlMode){
838
+ this._parseLegacyEntity();
839
+ if(this._sectionStart < this._index){
840
+ this._state = this._baseState;
841
+ this._handleTrailingData();
842
+ }
843
+ } else if(this._state === IN_NUMERIC_ENTITY && !this._xmlMode){
844
+ this._decodeNumericEntity(2, 10);
845
+ if(this._sectionStart < this._index){
846
+ this._state = this._baseState;
847
+ this._handleTrailingData();
848
+ }
849
+ } else if(this._state === IN_HEX_ENTITY && !this._xmlMode){
850
+ this._decodeNumericEntity(3, 16);
851
+ if(this._sectionStart < this._index){
852
+ this._state = this._baseState;
853
+ this._handleTrailingData();
854
+ }
855
+ } else if(
856
+ this._state !== IN_TAG_NAME &&
857
+ this._state !== BEFORE_ATTRIBUTE_NAME &&
858
+ this._state !== BEFORE_ATTRIBUTE_VALUE &&
859
+ this._state !== AFTER_ATTRIBUTE_NAME &&
860
+ this._state !== IN_ATTRIBUTE_NAME &&
861
+ this._state !== IN_ATTRIBUTE_VALUE_SQ &&
862
+ this._state !== IN_ATTRIBUTE_VALUE_DQ &&
863
+ this._state !== IN_ATTRIBUTE_VALUE_NQ &&
864
+ this._state !== IN_CLOSING_TAG_NAME
865
+ ){
866
+ this._cbs.ontext(data);
867
+ }
868
+ //else, ignore remaining data
869
+ //TODO add a way to remove current tag
870
+ };
871
+
872
+ Tokenizer.prototype.reset = function(){
873
+ Tokenizer.call(this, {xmlMode: this._xmlMode, decodeEntities: this._decodeEntities}, this._cbs);
874
+ };
875
+
876
+ Tokenizer.prototype._getSection = function(){
877
+ return this._buffer.substring(this._sectionStart, this._index);
878
+ };
879
+
880
+ Tokenizer.prototype._emitToken = function(name){
881
+ this._cbs[name](this._getSection());
882
+ this._sectionStart = -1;
883
+ };
884
+
885
+ Tokenizer.prototype._emitPartial = function(value){
886
+ if(this._baseState !== TEXT){
887
+ this._cbs.onattribdata(value); //TODO implement the new event
888
+ } else {
889
+ this._cbs.ontext(value);
890
+ }
891
+ };