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,954 @@
1
+ # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2
+ # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3
+ #
4
+ # This file is part of astroid.
5
+ #
6
+ # astroid is free software: you can redistribute it and/or modify it
7
+ # under the terms of the GNU Lesser General Public License as published by the
8
+ # Free Software Foundation, either version 2.1 of the License, or (at your
9
+ # option) any later version.
10
+ #
11
+ # astroid is distributed in the hope that it will be useful, but
12
+ # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14
+ # for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License along
17
+ # with astroid. If not, see <http://www.gnu.org/licenses/>.
18
+ """this module contains utilities for rebuilding a _ast tree in
19
+ order to get a single Astroid representation
20
+ """
21
+
22
+ import sys
23
+ from warnings import warn
24
+ from _ast import (Expr as Discard, Str, Name, Attribute,
25
+ # binary operators
26
+ Add, Div, FloorDiv, Mod, Mult, Pow, Sub, BitAnd, BitOr, BitXor,
27
+ LShift, RShift,
28
+ # logical operators
29
+ And, Or,
30
+ # unary operators
31
+ UAdd, USub, Not, Invert,
32
+ # comparison operators
33
+ Eq, Gt, GtE, In, Is, IsNot, Lt, LtE, NotEq, NotIn,
34
+ )
35
+
36
+ from astroid import nodes as new
37
+
38
+
39
+ _BIN_OP_CLASSES = {Add: '+',
40
+ BitAnd: '&',
41
+ BitOr: '|',
42
+ BitXor: '^',
43
+ Div: '/',
44
+ FloorDiv: '//',
45
+ Mod: '%',
46
+ Mult: '*',
47
+ Pow: '**',
48
+ Sub: '-',
49
+ LShift: '<<',
50
+ RShift: '>>'}
51
+
52
+ _BOOL_OP_CLASSES = {And: 'and',
53
+ Or: 'or'}
54
+
55
+ _UNARY_OP_CLASSES = {UAdd: '+',
56
+ USub: '-',
57
+ Not: 'not',
58
+ Invert: '~'}
59
+
60
+ _CMP_OP_CLASSES = {Eq: '==',
61
+ Gt: '>',
62
+ GtE: '>=',
63
+ In: 'in',
64
+ Is: 'is',
65
+ IsNot: 'is not',
66
+ Lt: '<',
67
+ LtE: '<=',
68
+ NotEq: '!=',
69
+ NotIn: 'not in'}
70
+
71
+ CONST_NAME_TRANSFORMS = {'None': None,
72
+ 'True': True,
73
+ 'False': False}
74
+
75
+ REDIRECT = {'arguments': 'Arguments',
76
+ 'Attribute': 'Getattr',
77
+ 'comprehension': 'Comprehension',
78
+ 'Call': 'CallFunc',
79
+ 'ClassDef': 'Class',
80
+ "ListCompFor": 'Comprehension',
81
+ "GenExprFor": 'Comprehension',
82
+ 'excepthandler': 'ExceptHandler',
83
+ 'Expr': 'Discard',
84
+ 'FunctionDef': 'Function',
85
+ 'GeneratorExp': 'GenExpr',
86
+ 'ImportFrom': 'From',
87
+ 'keyword': 'Keyword',
88
+ 'Repr': 'Backquote',
89
+ }
90
+ PY3K = sys.version_info >= (3, 0)
91
+ PY34 = sys.version_info >= (3, 4)
92
+
93
+ def _init_set_doc(node, newnode):
94
+ newnode.doc = None
95
+ try:
96
+ if isinstance(node.body[0], Discard) and isinstance(node.body[0].value, Str):
97
+ newnode.tolineno = node.body[0].lineno
98
+ newnode.doc = node.body[0].value.s
99
+ node.body = node.body[1:]
100
+
101
+ except IndexError:
102
+ pass # ast built from scratch
103
+
104
+ def _lineno_parent(oldnode, newnode, parent):
105
+ newnode.parent = parent
106
+ if hasattr(oldnode, 'lineno'):
107
+ newnode.lineno = oldnode.lineno
108
+ if hasattr(oldnode, 'col_offset'):
109
+ newnode.col_offset = oldnode.col_offset
110
+
111
+ def _set_infos(oldnode, newnode, parent):
112
+ newnode.parent = parent
113
+ if hasattr(oldnode, 'lineno'):
114
+ newnode.lineno = oldnode.lineno
115
+ if hasattr(oldnode, 'col_offset'):
116
+ newnode.col_offset = oldnode.col_offset
117
+ newnode.set_line_info(newnode.last_child()) # set_line_info accepts None
118
+
119
+ def _infer_metaclass(node):
120
+ if isinstance(node, Name):
121
+ return node.id
122
+ elif isinstance(node, Attribute):
123
+ return node.attr
124
+
125
+ def _create_yield_node(node, parent, rebuilder, factory):
126
+ newnode = factory()
127
+ _lineno_parent(node, newnode, parent)
128
+ if node.value is not None:
129
+ newnode.value = rebuilder.visit(node.value, newnode)
130
+ newnode.set_line_info(newnode.last_child())
131
+ return newnode
132
+
133
+
134
+ class TreeRebuilder(object):
135
+ """Rebuilds the _ast tree to become an Astroid tree"""
136
+
137
+ def __init__(self, manager):
138
+ self._manager = manager
139
+ self.asscontext = None
140
+ self._metaclass = ['']
141
+ self._global_names = []
142
+ self._from_nodes = []
143
+ self._delayed_assattr = []
144
+ self._visit_meths = {}
145
+ self._transform = manager.transform
146
+
147
+ def visit_module(self, node, modname, package):
148
+ """visit a Module node by returning a fresh instance of it"""
149
+ newnode = new.Module(modname, None)
150
+ newnode.package = package
151
+ _lineno_parent(node, newnode, parent=None)
152
+ _init_set_doc(node, newnode)
153
+ newnode.body = [self.visit(child, newnode) for child in node.body]
154
+ newnode.set_line_info(newnode.last_child())
155
+ return self._transform(newnode)
156
+
157
+ def visit(self, node, parent):
158
+ cls = node.__class__
159
+ if cls in self._visit_meths:
160
+ visit_method = self._visit_meths[cls]
161
+ else:
162
+ cls_name = cls.__name__
163
+ visit_name = 'visit_' + REDIRECT.get(cls_name, cls_name).lower()
164
+ visit_method = getattr(self, visit_name)
165
+ self._visit_meths[cls] = visit_method
166
+ return self._transform(visit_method(node, parent))
167
+
168
+ def _save_assignment(self, node, name=None):
169
+ """save assignement situation since node.parent is not available yet"""
170
+ if self._global_names and node.name in self._global_names[-1]:
171
+ node.root().set_local(node.name, node)
172
+ else:
173
+ node.parent.set_local(node.name, node)
174
+
175
+
176
+ def visit_arguments(self, node, parent):
177
+ """visit a Arguments node by returning a fresh instance of it"""
178
+ newnode = new.Arguments()
179
+ _lineno_parent(node, newnode, parent)
180
+ self.asscontext = "Ass"
181
+ newnode.args = [self.visit(child, newnode) for child in node.args]
182
+ self.asscontext = None
183
+ newnode.defaults = [self.visit(child, newnode) for child in node.defaults]
184
+ newnode.kwonlyargs = []
185
+ newnode.kw_defaults = []
186
+ vararg, kwarg = node.vararg, node.kwarg
187
+ # change added in 82732 (7c5c678e4164), vararg and kwarg
188
+ # are instances of `_ast.arg`, not strings
189
+ if vararg and PY34:
190
+ vararg = vararg.arg
191
+ if kwarg and PY34:
192
+ kwarg = kwarg.arg
193
+ newnode.vararg = vararg
194
+ newnode.kwarg = kwarg
195
+ # save argument names in locals:
196
+ if vararg:
197
+ newnode.parent.set_local(vararg, newnode)
198
+ if kwarg:
199
+ newnode.parent.set_local(kwarg, newnode)
200
+ newnode.set_line_info(newnode.last_child())
201
+ return newnode
202
+
203
+ def visit_assattr(self, node, parent):
204
+ """visit a AssAttr node by returning a fresh instance of it"""
205
+ assc, self.asscontext = self.asscontext, None
206
+ newnode = new.AssAttr()
207
+ _lineno_parent(node, newnode, parent)
208
+ newnode.expr = self.visit(node.expr, newnode)
209
+ self.asscontext = assc
210
+ self._delayed_assattr.append(newnode)
211
+ newnode.set_line_info(newnode.last_child())
212
+ return newnode
213
+
214
+ def visit_assert(self, node, parent):
215
+ """visit a Assert node by returning a fresh instance of it"""
216
+ newnode = new.Assert()
217
+ _lineno_parent(node, newnode, parent)
218
+ newnode.test = self.visit(node.test, newnode)
219
+ if node.msg is not None:
220
+ newnode.fail = self.visit(node.msg, newnode)
221
+ newnode.set_line_info(newnode.last_child())
222
+ return newnode
223
+
224
+ def visit_assign(self, node, parent):
225
+ """visit a Assign node by returning a fresh instance of it"""
226
+ newnode = new.Assign()
227
+ _lineno_parent(node, newnode, parent)
228
+ self.asscontext = "Ass"
229
+ newnode.targets = [self.visit(child, newnode) for child in node.targets]
230
+ self.asscontext = None
231
+ newnode.value = self.visit(node.value, newnode)
232
+ # set some function or metaclass infos XXX explain ?
233
+ klass = newnode.parent.frame()
234
+ if (isinstance(klass, new.Class)
235
+ and isinstance(newnode.value, new.CallFunc)
236
+ and isinstance(newnode.value.func, new.Name)):
237
+ func_name = newnode.value.func.name
238
+ for ass_node in newnode.targets:
239
+ try:
240
+ meth = klass[ass_node.name]
241
+ if isinstance(meth, new.Function):
242
+ if func_name in ('classmethod', 'staticmethod'):
243
+ meth.type = func_name
244
+ elif func_name == 'classproperty': # see lgc.decorators
245
+ meth.type = 'classmethod'
246
+ meth.extra_decorators.append(newnode.value)
247
+ except (AttributeError, KeyError):
248
+ continue
249
+ elif getattr(newnode.targets[0], 'name', None) == '__metaclass__':
250
+ # XXX check more...
251
+ self._metaclass[-1] = _infer_metaclass(node.value)
252
+ newnode.set_line_info(newnode.last_child())
253
+ return newnode
254
+
255
+ def visit_assname(self, node, parent, node_name=None):
256
+ '''visit a node and return a AssName node'''
257
+ newnode = new.AssName()
258
+ _set_infos(node, newnode, parent)
259
+ newnode.name = node_name
260
+ self._save_assignment(newnode)
261
+ return newnode
262
+
263
+ def visit_augassign(self, node, parent):
264
+ """visit a AugAssign node by returning a fresh instance of it"""
265
+ newnode = new.AugAssign()
266
+ _lineno_parent(node, newnode, parent)
267
+ newnode.op = _BIN_OP_CLASSES[node.op.__class__] + "="
268
+ self.asscontext = "Ass"
269
+ newnode.target = self.visit(node.target, newnode)
270
+ self.asscontext = None
271
+ newnode.value = self.visit(node.value, newnode)
272
+ newnode.set_line_info(newnode.last_child())
273
+ return newnode
274
+
275
+ def visit_backquote(self, node, parent):
276
+ """visit a Backquote node by returning a fresh instance of it"""
277
+ newnode = new.Backquote()
278
+ _lineno_parent(node, newnode, parent)
279
+ newnode.value = self.visit(node.value, newnode)
280
+ newnode.set_line_info(newnode.last_child())
281
+ return newnode
282
+
283
+ def visit_binop(self, node, parent):
284
+ """visit a BinOp node by returning a fresh instance of it"""
285
+ newnode = new.BinOp()
286
+ _lineno_parent(node, newnode, parent)
287
+ newnode.left = self.visit(node.left, newnode)
288
+ newnode.right = self.visit(node.right, newnode)
289
+ newnode.op = _BIN_OP_CLASSES[node.op.__class__]
290
+ newnode.set_line_info(newnode.last_child())
291
+ return newnode
292
+
293
+ def visit_boolop(self, node, parent):
294
+ """visit a BoolOp node by returning a fresh instance of it"""
295
+ newnode = new.BoolOp()
296
+ _lineno_parent(node, newnode, parent)
297
+ newnode.values = [self.visit(child, newnode) for child in node.values]
298
+ newnode.op = _BOOL_OP_CLASSES[node.op.__class__]
299
+ newnode.set_line_info(newnode.last_child())
300
+ return newnode
301
+
302
+ def visit_break(self, node, parent):
303
+ """visit a Break node by returning a fresh instance of it"""
304
+ newnode = new.Break()
305
+ _set_infos(node, newnode, parent)
306
+ return newnode
307
+
308
+ def visit_callfunc(self, node, parent):
309
+ """visit a CallFunc node by returning a fresh instance of it"""
310
+ newnode = new.CallFunc()
311
+ _lineno_parent(node, newnode, parent)
312
+ newnode.func = self.visit(node.func, newnode)
313
+ newnode.args = [self.visit(child, newnode) for child in node.args]
314
+ if node.starargs is not None:
315
+ newnode.starargs = self.visit(node.starargs, newnode)
316
+ if node.kwargs is not None:
317
+ newnode.kwargs = self.visit(node.kwargs, newnode)
318
+ newnode.args.extend(self.visit(child, newnode) for child in node.keywords)
319
+ newnode.set_line_info(newnode.last_child())
320
+ return newnode
321
+
322
+ def visit_class(self, node, parent):
323
+ """visit a Class node to become astroid"""
324
+ self._metaclass.append(self._metaclass[-1])
325
+ newnode = new.Class(node.name, None)
326
+ _lineno_parent(node, newnode, parent)
327
+ _init_set_doc(node, newnode)
328
+ newnode.bases = [self.visit(child, newnode) for child in node.bases]
329
+ newnode.body = [self.visit(child, newnode) for child in node.body]
330
+ if 'decorator_list' in node._fields and node.decorator_list:# py >= 2.6
331
+ newnode.decorators = self.visit_decorators(node, newnode)
332
+ newnode.set_line_info(newnode.last_child())
333
+ metaclass = self._metaclass.pop()
334
+ if PY3K:
335
+ newnode._newstyle = True
336
+ else:
337
+ if not newnode.bases:
338
+ # no base classes, detect new / style old style according to
339
+ # current scope
340
+ newnode._newstyle = metaclass in ('type', 'ABCMeta')
341
+ newnode.parent.frame().set_local(newnode.name, newnode)
342
+ return newnode
343
+
344
+ def visit_const(self, node, parent):
345
+ """visit a Const node by returning a fresh instance of it"""
346
+ newnode = new.Const(node.value)
347
+ _set_infos(node, newnode, parent)
348
+ return newnode
349
+
350
+ def visit_continue(self, node, parent):
351
+ """visit a Continue node by returning a fresh instance of it"""
352
+ newnode = new.Continue()
353
+ _set_infos(node, newnode, parent)
354
+ return newnode
355
+
356
+ def visit_compare(self, node, parent):
357
+ """visit a Compare node by returning a fresh instance of it"""
358
+ newnode = new.Compare()
359
+ _lineno_parent(node, newnode, parent)
360
+ newnode.left = self.visit(node.left, newnode)
361
+ newnode.ops = [(_CMP_OP_CLASSES[op.__class__], self.visit(expr, newnode))
362
+ for (op, expr) in zip(node.ops, node.comparators)]
363
+ newnode.set_line_info(newnode.last_child())
364
+ return newnode
365
+
366
+ def visit_comprehension(self, node, parent):
367
+ """visit a Comprehension node by returning a fresh instance of it"""
368
+ newnode = new.Comprehension()
369
+ _lineno_parent(node, newnode, parent)
370
+ self.asscontext = "Ass"
371
+ newnode.target = self.visit(node.target, newnode)
372
+ self.asscontext = None
373
+ newnode.iter = self.visit(node.iter, newnode)
374
+ newnode.ifs = [self.visit(child, newnode) for child in node.ifs]
375
+ newnode.set_line_info(newnode.last_child())
376
+ return newnode
377
+
378
+ def visit_decorators(self, node, parent):
379
+ """visit a Decorators node by returning a fresh instance of it"""
380
+ # /!\ node is actually a _ast.Function node while
381
+ # parent is a astroid.nodes.Function node
382
+ newnode = new.Decorators()
383
+ _lineno_parent(node, newnode, parent)
384
+ if 'decorators' in node._fields: # py < 2.6, i.e. 2.5
385
+ decorators = node.decorators
386
+ else:
387
+ decorators= node.decorator_list
388
+ newnode.nodes = [self.visit(child, newnode) for child in decorators]
389
+ newnode.set_line_info(newnode.last_child())
390
+ return newnode
391
+
392
+ def visit_delete(self, node, parent):
393
+ """visit a Delete node by returning a fresh instance of it"""
394
+ newnode = new.Delete()
395
+ _lineno_parent(node, newnode, parent)
396
+ self.asscontext = "Del"
397
+ newnode.targets = [self.visit(child, newnode) for child in node.targets]
398
+ self.asscontext = None
399
+ newnode.set_line_info(newnode.last_child())
400
+ return newnode
401
+
402
+ def visit_dict(self, node, parent):
403
+ """visit a Dict node by returning a fresh instance of it"""
404
+ newnode = new.Dict()
405
+ _lineno_parent(node, newnode, parent)
406
+ newnode.items = [(self.visit(key, newnode), self.visit(value, newnode))
407
+ for key, value in zip(node.keys, node.values)]
408
+ newnode.set_line_info(newnode.last_child())
409
+ return newnode
410
+
411
+ def visit_dictcomp(self, node, parent):
412
+ """visit a DictComp node by returning a fresh instance of it"""
413
+ newnode = new.DictComp()
414
+ _lineno_parent(node, newnode, parent)
415
+ newnode.key = self.visit(node.key, newnode)
416
+ newnode.value = self.visit(node.value, newnode)
417
+ newnode.generators = [self.visit(child, newnode)
418
+ for child in node.generators]
419
+ newnode.set_line_info(newnode.last_child())
420
+ return newnode
421
+
422
+ def visit_discard(self, node, parent):
423
+ """visit a Discard node by returning a fresh instance of it"""
424
+ newnode = new.Discard()
425
+ _lineno_parent(node, newnode, parent)
426
+ newnode.value = self.visit(node.value, newnode)
427
+ newnode.set_line_info(newnode.last_child())
428
+ return newnode
429
+
430
+ def visit_ellipsis(self, node, parent):
431
+ """visit an Ellipsis node by returning a fresh instance of it"""
432
+ newnode = new.Ellipsis()
433
+ _set_infos(node, newnode, parent)
434
+ return newnode
435
+
436
+ def visit_emptynode(self, node, parent):
437
+ """visit an EmptyNode node by returning a fresh instance of it"""
438
+ newnode = new.EmptyNode()
439
+ _set_infos(node, newnode, parent)
440
+ return newnode
441
+
442
+ def visit_excepthandler(self, node, parent):
443
+ """visit an ExceptHandler node by returning a fresh instance of it"""
444
+ newnode = new.ExceptHandler()
445
+ _lineno_parent(node, newnode, parent)
446
+ if node.type is not None:
447
+ newnode.type = self.visit(node.type, newnode)
448
+ if node.name is not None:
449
+ # /!\ node.name can be a tuple
450
+ self.asscontext = "Ass"
451
+ newnode.name = self.visit(node.name, newnode)
452
+ self.asscontext = None
453
+ newnode.body = [self.visit(child, newnode) for child in node.body]
454
+ newnode.set_line_info(newnode.last_child())
455
+ return newnode
456
+
457
+ def visit_exec(self, node, parent):
458
+ """visit an Exec node by returning a fresh instance of it"""
459
+ newnode = new.Exec()
460
+ _lineno_parent(node, newnode, parent)
461
+ newnode.expr = self.visit(node.body, newnode)
462
+ if node.globals is not None:
463
+ newnode.globals = self.visit(node.globals, newnode)
464
+ if node.locals is not None:
465
+ newnode.locals = self.visit(node.locals, newnode)
466
+ newnode.set_line_info(newnode.last_child())
467
+ return newnode
468
+
469
+ def visit_extslice(self, node, parent):
470
+ """visit an ExtSlice node by returning a fresh instance of it"""
471
+ newnode = new.ExtSlice()
472
+ _lineno_parent(node, newnode, parent)
473
+ newnode.dims = [self.visit(dim, newnode) for dim in node.dims]
474
+ newnode.set_line_info(newnode.last_child())
475
+ return newnode
476
+
477
+ def visit_for(self, node, parent):
478
+ """visit a For node by returning a fresh instance of it"""
479
+ newnode = new.For()
480
+ _lineno_parent(node, newnode, parent)
481
+ self.asscontext = "Ass"
482
+ newnode.target = self.visit(node.target, newnode)
483
+ self.asscontext = None
484
+ newnode.iter = self.visit(node.iter, newnode)
485
+ newnode.body = [self.visit(child, newnode) for child in node.body]
486
+ newnode.orelse = [self.visit(child, newnode) for child in node.orelse]
487
+ newnode.set_line_info(newnode.last_child())
488
+ return newnode
489
+
490
+ def visit_from(self, node, parent):
491
+ """visit a From node by returning a fresh instance of it"""
492
+ names = [(alias.name, alias.asname) for alias in node.names]
493
+ newnode = new.From(node.module or '', names, node.level or None)
494
+ _set_infos(node, newnode, parent)
495
+ # store From names to add them to locals after building
496
+ self._from_nodes.append(newnode)
497
+ return newnode
498
+
499
+ def visit_function(self, node, parent):
500
+ """visit an Function node to become astroid"""
501
+ self._global_names.append({})
502
+ newnode = new.Function(node.name, None)
503
+ _lineno_parent(node, newnode, parent)
504
+ _init_set_doc(node, newnode)
505
+ newnode.args = self.visit(node.args, newnode)
506
+ newnode.body = [self.visit(child, newnode) for child in node.body]
507
+ if 'decorators' in node._fields: # py < 2.6
508
+ attr = 'decorators'
509
+ else:
510
+ attr = 'decorator_list'
511
+ decorators = getattr(node, attr)
512
+ if decorators:
513
+ newnode.decorators = self.visit_decorators(node, newnode)
514
+ newnode.set_line_info(newnode.last_child())
515
+ self._global_names.pop()
516
+ frame = newnode.parent.frame()
517
+ if isinstance(frame, new.Class):
518
+ if newnode.name == '__new__':
519
+ newnode._type = 'classmethod'
520
+ else:
521
+ newnode._type = 'method'
522
+ if newnode.decorators is not None:
523
+ for decorator_expr in newnode.decorators.nodes:
524
+ if isinstance(decorator_expr, new.Name):
525
+ if decorator_expr.name in ('classmethod', 'staticmethod'):
526
+ newnode._type = decorator_expr.name
527
+ elif decorator_expr.name == 'classproperty':
528
+ newnode._type = 'classmethod'
529
+ frame.set_local(newnode.name, newnode)
530
+ return newnode
531
+
532
+ def visit_genexpr(self, node, parent):
533
+ """visit a GenExpr node by returning a fresh instance of it"""
534
+ newnode = new.GenExpr()
535
+ _lineno_parent(node, newnode, parent)
536
+ newnode.elt = self.visit(node.elt, newnode)
537
+ newnode.generators = [self.visit(child, newnode) for child in node.generators]
538
+ newnode.set_line_info(newnode.last_child())
539
+ return newnode
540
+
541
+ def visit_getattr(self, node, parent):
542
+ """visit a Getattr node by returning a fresh instance of it"""
543
+ if self.asscontext == "Del":
544
+ # FIXME : maybe we should reintroduce and visit_delattr ?
545
+ # for instance, deactivating asscontext
546
+ newnode = new.DelAttr()
547
+ elif self.asscontext == "Ass":
548
+ # FIXME : maybe we should call visit_assattr ?
549
+ newnode = new.AssAttr()
550
+ self._delayed_assattr.append(newnode)
551
+ else:
552
+ newnode = new.Getattr()
553
+ _lineno_parent(node, newnode, parent)
554
+ asscontext, self.asscontext = self.asscontext, None
555
+ newnode.expr = self.visit(node.value, newnode)
556
+ self.asscontext = asscontext
557
+ newnode.attrname = node.attr
558
+ newnode.set_line_info(newnode.last_child())
559
+ return newnode
560
+
561
+ def visit_global(self, node, parent):
562
+ """visit an Global node to become astroid"""
563
+ newnode = new.Global(node.names)
564
+ _set_infos(node, newnode, parent)
565
+ if self._global_names: # global at the module level, no effect
566
+ for name in node.names:
567
+ self._global_names[-1].setdefault(name, []).append(newnode)
568
+ return newnode
569
+
570
+ def visit_if(self, node, parent):
571
+ """visit a If node by returning a fresh instance of it"""
572
+ newnode = new.If()
573
+ _lineno_parent(node, newnode, parent)
574
+ newnode.test = self.visit(node.test, newnode)
575
+ newnode.body = [self.visit(child, newnode) for child in node.body]
576
+ newnode.orelse = [self.visit(child, newnode) for child in node.orelse]
577
+ newnode.set_line_info(newnode.last_child())
578
+ return newnode
579
+
580
+ def visit_ifexp(self, node, parent):
581
+ """visit a IfExp node by returning a fresh instance of it"""
582
+ newnode = new.IfExp()
583
+ _lineno_parent(node, newnode, parent)
584
+ newnode.test = self.visit(node.test, newnode)
585
+ newnode.body = self.visit(node.body, newnode)
586
+ newnode.orelse = self.visit(node.orelse, newnode)
587
+ newnode.set_line_info(newnode.last_child())
588
+ return newnode
589
+
590
+ def visit_import(self, node, parent):
591
+ """visit a Import node by returning a fresh instance of it"""
592
+ newnode = new.Import()
593
+ _set_infos(node, newnode, parent)
594
+ newnode.names = [(alias.name, alias.asname) for alias in node.names]
595
+ # save import names in parent's locals:
596
+ for (name, asname) in newnode.names:
597
+ name = asname or name
598
+ newnode.parent.set_local(name.split('.')[0], newnode)
599
+ return newnode
600
+
601
+ def visit_index(self, node, parent):
602
+ """visit a Index node by returning a fresh instance of it"""
603
+ newnode = new.Index()
604
+ _lineno_parent(node, newnode, parent)
605
+ newnode.value = self.visit(node.value, newnode)
606
+ newnode.set_line_info(newnode.last_child())
607
+ return newnode
608
+
609
+ def visit_keyword(self, node, parent):
610
+ """visit a Keyword node by returning a fresh instance of it"""
611
+ newnode = new.Keyword()
612
+ _lineno_parent(node, newnode, parent)
613
+ newnode.arg = node.arg
614
+ newnode.value = self.visit(node.value, newnode)
615
+ newnode.set_line_info(newnode.last_child())
616
+ return newnode
617
+
618
+ def visit_lambda(self, node, parent):
619
+ """visit a Lambda node by returning a fresh instance of it"""
620
+ newnode = new.Lambda()
621
+ _lineno_parent(node, newnode, parent)
622
+ newnode.args = self.visit(node.args, newnode)
623
+ newnode.body = self.visit(node.body, newnode)
624
+ newnode.set_line_info(newnode.last_child())
625
+ return newnode
626
+
627
+ def visit_list(self, node, parent):
628
+ """visit a List node by returning a fresh instance of it"""
629
+ newnode = new.List()
630
+ _lineno_parent(node, newnode, parent)
631
+ newnode.elts = [self.visit(child, newnode) for child in node.elts]
632
+ newnode.set_line_info(newnode.last_child())
633
+ return newnode
634
+
635
+ def visit_listcomp(self, node, parent):
636
+ """visit a ListComp node by returning a fresh instance of it"""
637
+ newnode = new.ListComp()
638
+ _lineno_parent(node, newnode, parent)
639
+ newnode.elt = self.visit(node.elt, newnode)
640
+ newnode.generators = [self.visit(child, newnode)
641
+ for child in node.generators]
642
+ newnode.set_line_info(newnode.last_child())
643
+ return newnode
644
+
645
+ def visit_name(self, node, parent):
646
+ """visit a Name node by returning a fresh instance of it"""
647
+ # True and False can be assigned to something in py2x, so we have to
648
+ # check first the asscontext
649
+ if self.asscontext == "Del":
650
+ newnode = new.DelName()
651
+ elif self.asscontext is not None: # Ass
652
+ assert self.asscontext == "Ass"
653
+ newnode = new.AssName()
654
+ elif node.id in CONST_NAME_TRANSFORMS:
655
+ newnode = new.Const(CONST_NAME_TRANSFORMS[node.id])
656
+ _set_infos(node, newnode, parent)
657
+ return newnode
658
+ else:
659
+ newnode = new.Name()
660
+ _lineno_parent(node, newnode, parent)
661
+ newnode.name = node.id
662
+ # XXX REMOVE me :
663
+ if self.asscontext in ('Del', 'Ass'): # 'Aug' ??
664
+ self._save_assignment(newnode)
665
+ newnode.set_line_info(newnode.last_child())
666
+ return newnode
667
+
668
+ def visit_bytes(self, node, parent):
669
+ """visit a Bytes node by returning a fresh instance of Const"""
670
+ newnode = new.Const(node.s)
671
+ _set_infos(node, newnode, parent)
672
+ return newnode
673
+
674
+ def visit_num(self, node, parent):
675
+ """visit a Num node by returning a fresh instance of Const"""
676
+ newnode = new.Const(node.n)
677
+ _set_infos(node, newnode, parent)
678
+ return newnode
679
+
680
+ def visit_pass(self, node, parent):
681
+ """visit a Pass node by returning a fresh instance of it"""
682
+ newnode = new.Pass()
683
+ _set_infos(node, newnode, parent)
684
+ return newnode
685
+
686
+ def visit_str(self, node, parent):
687
+ """visit a Str node by returning a fresh instance of Const"""
688
+ newnode = new.Const(node.s)
689
+ _set_infos(node, newnode, parent)
690
+ return newnode
691
+
692
+ def visit_print(self, node, parent):
693
+ """visit a Print node by returning a fresh instance of it"""
694
+ newnode = new.Print()
695
+ _lineno_parent(node, newnode, parent)
696
+ newnode.nl = node.nl
697
+ if node.dest is not None:
698
+ newnode.dest = self.visit(node.dest, newnode)
699
+ newnode.values = [self.visit(child, newnode) for child in node.values]
700
+ newnode.set_line_info(newnode.last_child())
701
+ return newnode
702
+
703
+ def visit_raise(self, node, parent):
704
+ """visit a Raise node by returning a fresh instance of it"""
705
+ newnode = new.Raise()
706
+ _lineno_parent(node, newnode, parent)
707
+ if node.type is not None:
708
+ newnode.exc = self.visit(node.type, newnode)
709
+ if node.inst is not None:
710
+ newnode.inst = self.visit(node.inst, newnode)
711
+ if node.tback is not None:
712
+ newnode.tback = self.visit(node.tback, newnode)
713
+ newnode.set_line_info(newnode.last_child())
714
+ return newnode
715
+
716
+ def visit_return(self, node, parent):
717
+ """visit a Return node by returning a fresh instance of it"""
718
+ newnode = new.Return()
719
+ _lineno_parent(node, newnode, parent)
720
+ if node.value is not None:
721
+ newnode.value = self.visit(node.value, newnode)
722
+ newnode.set_line_info(newnode.last_child())
723
+ return newnode
724
+
725
+ def visit_set(self, node, parent):
726
+ """visit a Set node by returning a fresh instance of it"""
727
+ newnode = new.Set()
728
+ _lineno_parent(node, newnode, parent)
729
+ newnode.elts = [self.visit(child, newnode) for child in node.elts]
730
+ newnode.set_line_info(newnode.last_child())
731
+ return newnode
732
+
733
+ def visit_setcomp(self, node, parent):
734
+ """visit a SetComp node by returning a fresh instance of it"""
735
+ newnode = new.SetComp()
736
+ _lineno_parent(node, newnode, parent)
737
+ newnode.elt = self.visit(node.elt, newnode)
738
+ newnode.generators = [self.visit(child, newnode)
739
+ for child in node.generators]
740
+ newnode.set_line_info(newnode.last_child())
741
+ return newnode
742
+
743
+ def visit_slice(self, node, parent):
744
+ """visit a Slice node by returning a fresh instance of it"""
745
+ newnode = new.Slice()
746
+ _lineno_parent(node, newnode, parent)
747
+ if node.lower is not None:
748
+ newnode.lower = self.visit(node.lower, newnode)
749
+ if node.upper is not None:
750
+ newnode.upper = self.visit(node.upper, newnode)
751
+ if node.step is not None:
752
+ newnode.step = self.visit(node.step, newnode)
753
+ newnode.set_line_info(newnode.last_child())
754
+ return newnode
755
+
756
+ def visit_subscript(self, node, parent):
757
+ """visit a Subscript node by returning a fresh instance of it"""
758
+ newnode = new.Subscript()
759
+ _lineno_parent(node, newnode, parent)
760
+ subcontext, self.asscontext = self.asscontext, None
761
+ newnode.value = self.visit(node.value, newnode)
762
+ newnode.slice = self.visit(node.slice, newnode)
763
+ self.asscontext = subcontext
764
+ newnode.set_line_info(newnode.last_child())
765
+ return newnode
766
+
767
+ def visit_tryexcept(self, node, parent):
768
+ """visit a TryExcept node by returning a fresh instance of it"""
769
+ newnode = new.TryExcept()
770
+ _lineno_parent(node, newnode, parent)
771
+ newnode.body = [self.visit(child, newnode) for child in node.body]
772
+ newnode.handlers = [self.visit(child, newnode) for child in node.handlers]
773
+ newnode.orelse = [self.visit(child, newnode) for child in node.orelse]
774
+ newnode.set_line_info(newnode.last_child())
775
+ return newnode
776
+
777
+ def visit_tryfinally(self, node, parent):
778
+ """visit a TryFinally node by returning a fresh instance of it"""
779
+ newnode = new.TryFinally()
780
+ _lineno_parent(node, newnode, parent)
781
+ newnode.body = [self.visit(child, newnode) for child in node.body]
782
+ newnode.finalbody = [self.visit(n, newnode) for n in node.finalbody]
783
+ newnode.set_line_info(newnode.last_child())
784
+ return newnode
785
+
786
+ def visit_tuple(self, node, parent):
787
+ """visit a Tuple node by returning a fresh instance of it"""
788
+ newnode = new.Tuple()
789
+ _lineno_parent(node, newnode, parent)
790
+ newnode.elts = [self.visit(child, newnode) for child in node.elts]
791
+ newnode.set_line_info(newnode.last_child())
792
+ return newnode
793
+
794
+ def visit_unaryop(self, node, parent):
795
+ """visit a UnaryOp node by returning a fresh instance of it"""
796
+ newnode = new.UnaryOp()
797
+ _lineno_parent(node, newnode, parent)
798
+ newnode.operand = self.visit(node.operand, newnode)
799
+ newnode.op = _UNARY_OP_CLASSES[node.op.__class__]
800
+ newnode.set_line_info(newnode.last_child())
801
+ return newnode
802
+
803
+ def visit_while(self, node, parent):
804
+ """visit a While node by returning a fresh instance of it"""
805
+ newnode = new.While()
806
+ _lineno_parent(node, newnode, parent)
807
+ newnode.test = self.visit(node.test, newnode)
808
+ newnode.body = [self.visit(child, newnode) for child in node.body]
809
+ newnode.orelse = [self.visit(child, newnode) for child in node.orelse]
810
+ newnode.set_line_info(newnode.last_child())
811
+ return newnode
812
+
813
+ def visit_with(self, node, parent):
814
+ newnode = new.With()
815
+ _lineno_parent(node, newnode, parent)
816
+ expr = self.visit(node.context_expr, newnode)
817
+ self.asscontext = "Ass"
818
+ if node.optional_vars is not None:
819
+ vars = self.visit(node.optional_vars, newnode)
820
+ else:
821
+ vars = None
822
+ self.asscontext = None
823
+ newnode.items = [(expr, vars)]
824
+ newnode.body = [self.visit(child, newnode) for child in node.body]
825
+ newnode.set_line_info(newnode.last_child())
826
+ return newnode
827
+
828
+ def visit_yield(self, node, parent):
829
+ """visit a Yield node by returning a fresh instance of it"""
830
+ return _create_yield_node(node, parent, self, new.Yield)
831
+
832
+ class TreeRebuilder3k(TreeRebuilder):
833
+ """extend and overwrite TreeRebuilder for python3k"""
834
+
835
+ def visit_arg(self, node, parent):
836
+ """visit a arg node by returning a fresh AssName instance"""
837
+ # the <arg> node is coming from py>=3.0, but we use AssName in py2.x
838
+ # XXX or we should instead introduce a Arg node in astroid ?
839
+ return self.visit_assname(node, parent, node.arg)
840
+
841
+ def visit_nameconstant(self, node, parent):
842
+ # in Python 3.4 we have NameConstant for True / False / None
843
+ newnode = new.Const(node.value)
844
+ _set_infos(node, newnode, parent)
845
+ return newnode
846
+
847
+ def visit_arguments(self, node, parent):
848
+ newnode = super(TreeRebuilder3k, self).visit_arguments(node, parent)
849
+ self.asscontext = "Ass"
850
+ newnode.kwonlyargs = [self.visit(child, newnode) for child in node.kwonlyargs]
851
+ self.asscontext = None
852
+ newnode.kw_defaults = [self.visit(child, newnode) if child else None for child in node.kw_defaults]
853
+ return newnode
854
+
855
+ def visit_excepthandler(self, node, parent):
856
+ """visit an ExceptHandler node by returning a fresh instance of it"""
857
+ newnode = new.ExceptHandler()
858
+ _lineno_parent(node, newnode, parent)
859
+ if node.type is not None:
860
+ newnode.type = self.visit(node.type, newnode)
861
+ if node.name is not None:
862
+ newnode.name = self.visit_assname(node, newnode, node.name)
863
+ newnode.body = [self.visit(child, newnode) for child in node.body]
864
+ newnode.set_line_info(newnode.last_child())
865
+ return newnode
866
+
867
+ def visit_nonlocal(self, node, parent):
868
+ """visit a Nonlocal node and return a new instance of it"""
869
+ newnode = new.Nonlocal(node.names)
870
+ _set_infos(node, newnode, parent)
871
+ return newnode
872
+
873
+ def visit_raise(self, node, parent):
874
+ """visit a Raise node by returning a fresh instance of it"""
875
+ newnode = new.Raise()
876
+ _lineno_parent(node, newnode, parent)
877
+ # no traceback; anyway it is not used in Pylint
878
+ if node.exc is not None:
879
+ newnode.exc = self.visit(node.exc, newnode)
880
+ if node.cause is not None:
881
+ newnode.cause = self.visit(node.cause, newnode)
882
+ newnode.set_line_info(newnode.last_child())
883
+ return newnode
884
+
885
+ def visit_starred(self, node, parent):
886
+ """visit a Starred node and return a new instance of it"""
887
+ newnode = new.Starred()
888
+ _lineno_parent(node, newnode, parent)
889
+ newnode.value = self.visit(node.value, newnode)
890
+ newnode.set_line_info(newnode.last_child())
891
+ return newnode
892
+
893
+ def visit_try(self, node, parent):
894
+ # python 3.3 introduce a new Try node replacing TryFinally/TryExcept nodes
895
+ if node.finalbody:
896
+ newnode = new.TryFinally()
897
+ _lineno_parent(node, newnode, parent)
898
+ newnode.finalbody = [self.visit(n, newnode) for n in node.finalbody]
899
+ if node.handlers:
900
+ excnode = new.TryExcept()
901
+ _lineno_parent(node, excnode, newnode)
902
+ excnode.body = [self.visit(child, excnode) for child in node.body]
903
+ excnode.handlers = [self.visit(child, excnode) for child in node.handlers]
904
+ excnode.orelse = [self.visit(child, excnode) for child in node.orelse]
905
+ excnode.set_line_info(excnode.last_child())
906
+ newnode.body = [excnode]
907
+ else:
908
+ newnode.body = [self.visit(child, newnode) for child in node.body]
909
+ elif node.handlers:
910
+ newnode = new.TryExcept()
911
+ _lineno_parent(node, newnode, parent)
912
+ newnode.body = [self.visit(child, newnode) for child in node.body]
913
+ newnode.handlers = [self.visit(child, newnode) for child in node.handlers]
914
+ newnode.orelse = [self.visit(child, newnode) for child in node.orelse]
915
+ newnode.set_line_info(newnode.last_child())
916
+ return newnode
917
+
918
+ def visit_with(self, node, parent):
919
+ if 'items' not in node._fields:
920
+ # python < 3.3
921
+ return super(TreeRebuilder3k, self).visit_with(node, parent)
922
+
923
+ newnode = new.With()
924
+ _lineno_parent(node, newnode, parent)
925
+ def visit_child(child):
926
+ expr = self.visit(child.context_expr, newnode)
927
+ self.asscontext = 'Ass'
928
+ if child.optional_vars:
929
+ var = self.visit(child.optional_vars, newnode)
930
+ else:
931
+ var = None
932
+ self.asscontext = None
933
+ return expr, var
934
+ newnode.items = [visit_child(child)
935
+ for child in node.items]
936
+ newnode.body = [self.visit(child, newnode) for child in node.body]
937
+ newnode.set_line_info(newnode.last_child())
938
+ return newnode
939
+
940
+ def visit_yieldfrom(self, node, parent):
941
+ return _create_yield_node(node, parent, self, new.YieldFrom)
942
+
943
+ def visit_class(self, node, parent):
944
+ newnode = super(TreeRebuilder3k, self).visit_class(node, parent)
945
+ for keyword in node.keywords:
946
+ if keyword.arg == 'metaclass':
947
+ newnode._metaclass = self.visit(keyword, newnode).value
948
+ break
949
+ return newnode
950
+
951
+ if sys.version_info >= (3, 0):
952
+ TreeRebuilder = TreeRebuilder3k
953
+
954
+