tree-sitter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1857) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +36 -0
  4. data/Rakefile +49 -0
  5. data/ext/tree-sitter/extconf.rb +34 -0
  6. data/ext/tree-sitter/tree-sitter.c +114 -0
  7. data/ext/tree-sitter/tree-sitter.h +15 -0
  8. data/ext/tree-sitter/tree-sitter/Makefile +360 -0
  9. data/ext/tree-sitter/tree-sitter/README.md +224 -0
  10. data/ext/tree-sitter/tree-sitter/compiler.target.mk +238 -0
  11. data/ext/tree-sitter/tree-sitter/doc/grammar-schema.json +249 -0
  12. data/ext/tree-sitter/tree-sitter/externals/bandit/CMakeLists.txt +57 -0
  13. data/ext/tree-sitter/tree-sitter/externals/bandit/LICENSE.md +21 -0
  14. data/ext/tree-sitter/tree-sitter/externals/bandit/README.md +64 -0
  15. data/ext/tree-sitter/tree-sitter/externals/bandit/appveyor.yml +12 -0
  16. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/adapters/adapter.h +12 -0
  17. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/adapters/adapters.h +16 -0
  18. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/adapters/snowhouse.h +22 -0
  19. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_exception.h +51 -0
  20. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeCloseTo.h +55 -0
  21. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeEmpty.h +32 -0
  22. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeFalsy.h +39 -0
  23. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeGTE.h +45 -0
  24. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeGreaterThan.h +39 -0
  25. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeLTE.h +45 -0
  26. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeLessThan.h +39 -0
  27. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeNull.h +29 -0
  28. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/BeTruthy.h +35 -0
  29. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/Contain.h +58 -0
  30. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/Equal.h +90 -0
  31. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/MatchProxy.h +43 -0
  32. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/Matcher.h +74 -0
  33. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/MatcherException.h +16 -0
  34. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/ThrowException.h +60 -0
  35. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/ValueProxy.h +26 -0
  36. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/matchers.h +19 -0
  37. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/matchers/must.h +36 -0
  38. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/CMakeLists.txt +49 -0
  39. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/LICENSE_1_0.txt +23 -0
  40. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/README.md +419 -0
  41. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/cross_compile.sh +50 -0
  42. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/basic_assertions.cpp +228 -0
  43. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/boolean_operators.cpp +48 -0
  44. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/container_spec.cpp +85 -0
  45. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/custom_matchers_test.cpp +69 -0
  46. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/exceptions_tests.cpp +97 -0
  47. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/expression_error_handling.cpp +28 -0
  48. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/main.cpp +43 -0
  49. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/map_tests.cpp +38 -0
  50. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/operator_tests.cpp +137 -0
  51. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/sequence_container_tests.cpp +192 -0
  52. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/string_line_tests.cpp +179 -0
  53. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/string_tests.cpp +65 -0
  54. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/stringize_tests.cpp +111 -0
  55. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/example/tests.h +16 -0
  56. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assert.h +126 -0
  57. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertionexception.h +58 -0
  58. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertmacro.h +22 -0
  59. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/constraints.h +23 -0
  60. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/containsconstraint.h +80 -0
  61. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/endswithconstraint.h +53 -0
  62. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalsconstraint.h +83 -0
  63. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalscontainerconstraint.h +80 -0
  64. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalswithdeltaconstraint.h +51 -0
  65. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h +46 -0
  66. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression.h +38 -0
  67. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression_fwd.h +15 -0
  68. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/notexpression.h +44 -0
  69. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/orexpression.h +46 -0
  70. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/fulfillsconstraint.h +51 -0
  71. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/haslengthconstraint.h +60 -0
  72. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanconstraint.h +55 -0
  73. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanorequaltoconstraint.h +55 -0
  74. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanconstraint.h +54 -0
  75. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanorequaltoconstraint.h +55 -0
  76. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/startswithconstraint.h +52 -0
  77. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/exceptions.h +120 -0
  78. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintadapter.h +39 -0
  79. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintlist.h +91 -0
  80. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/expressionbuilder.h +357 -0
  81. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/fluent.h +38 -0
  82. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/andoperator.h +54 -0
  83. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/alloperator.h +35 -0
  84. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atleastoperator.h +41 -0
  85. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atmostoperator.h +39 -0
  86. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionconstraintevaluator.h +113 -0
  87. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionoperator.h +24 -0
  88. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/exactlyoperator.h +39 -0
  89. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/noneoperator.h +33 -0
  90. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/constraintoperator.h +70 -0
  91. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/invalidexpressionexception.h +28 -0
  92. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/notoperator.h +53 -0
  93. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/oroperator.h +55 -0
  94. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/snowhouse.h +33 -0
  95. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringize.h +104 -0
  96. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringizers.h +60 -0
  97. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/bandit.h +44 -0
  98. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/context.h +97 -0
  99. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/external/optionparser.h +2825 -0
  100. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/failure_formatters/default_failure_formatter.h +30 -0
  101. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/failure_formatters/failure_formatter.h +13 -0
  102. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/failure_formatters/failure_formatters.h +16 -0
  103. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/failure_formatters/visual_studio_failure_formatter.h +36 -0
  104. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/grammar.h +185 -0
  105. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/listener.h +27 -0
  106. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/options.h +117 -0
  107. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/registration/registrar.h +25 -0
  108. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/registration/registration.h +7 -0
  109. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/registration/spec_registry.h +17 -0
  110. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/colorizer.h +141 -0
  111. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/dots_reporter.h +76 -0
  112. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/info_reporter.h +319 -0
  113. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/progress_reporter.h +116 -0
  114. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/reporters.h +53 -0
  115. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/single_line_reporter.h +86 -0
  116. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/spec_reporter.h +126 -0
  117. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/test_run_summary.h +90 -0
  118. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/reporters/xunit_reporter.h +109 -0
  119. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/run_policies/always_run_policy.h +16 -0
  120. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/run_policies/bandit_run_policy.h +168 -0
  121. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/run_policies/never_run_policy.h +14 -0
  122. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/run_policies/run_policies.h +9 -0
  123. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/run_policies/run_policy.h +66 -0
  124. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/runner.h +103 -0
  125. data/ext/tree-sitter/tree-sitter/externals/bandit/bandit/test_run_error.h +12 -0
  126. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/CMake/cotire.cmake +3695 -0
  127. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/CMakeLists.txt +11 -0
  128. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/HISTORY.md +281 -0
  129. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/MANUAL.md +780 -0
  130. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/OpenCV-2.3.1.patch +299 -0
  131. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/README.md +24 -0
  132. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/bullet-2.80-rev2531.patch +389 -0
  133. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/clang-3.0.src.patch +35 -0
  134. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/clang-3.1.src.patch +35 -0
  135. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/clang-3.3.src.patch +46 -0
  136. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/clang-3.4.src.patch +48 -0
  137. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/clang-3.5.src.patch +39 -0
  138. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/clapack-3.2.1-CMAKE.patch +93 -0
  139. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/cmake-2.8.7.patch +218 -0
  140. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/cminpack-1.1.4.patch +18 -0
  141. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/fsedit-qt5.patch +74 -0
  142. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/fseditor-1.0.patch +68 -0
  143. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/hdf5-1.8.8.patch +118 -0
  144. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/libpng-1.5.9.patch +38 -0
  145. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/llvm-3.0.src.patch +69 -0
  146. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/llvm-3.1.src.patch +69 -0
  147. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/llvm-3.3.src.patch +128 -0
  148. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/llvm-3.4.src.patch +100 -0
  149. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/llvm-3.5.src.patch +99 -0
  150. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/yaml-cpp.patch +37 -0
  151. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/Patches/zlib-1.2.6.patch +23 -0
  152. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/README.md +137 -0
  153. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/license +22 -0
  154. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/src/CMakeLists.txt +33 -0
  155. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/src/example.cpp +24 -0
  156. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/src/example.h +10 -0
  157. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/src/log.cpp +17 -0
  158. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/src/log.h +10 -0
  159. data/ext/tree-sitter/tree-sitter/externals/bandit/cmake/cotire/src/main.cpp +12 -0
  160. data/ext/tree-sitter/tree-sitter/externals/bandit/cross_compile.sh +43 -0
  161. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/before_each_after_each.spec.cpp +78 -0
  162. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/context.spec.cpp +44 -0
  163. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/describe.spec.cpp +117 -0
  164. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/failure_formatters/default_formatter.spec.cpp +21 -0
  165. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/failure_formatters/visual_studio_failure_formatter.spec.cpp +22 -0
  166. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/fakes/fake_context.h +69 -0
  167. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/fakes/fake_reporter.h +78 -0
  168. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/fakes/fakes.h +8 -0
  169. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/fakes/logging_fake.h +32 -0
  170. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/fuzzbox.spec.cpp +77 -0
  171. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/it.spec.cpp +355 -0
  172. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/main.cpp +6 -0
  173. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_close_to.cpp +112 -0
  174. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_empty.cpp +89 -0
  175. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_falsy.cpp +85 -0
  176. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_greater_than.cpp +105 -0
  177. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_gte.cpp +120 -0
  178. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_less_than.cpp +105 -0
  179. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_lte.cpp +119 -0
  180. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_null.cpp +43 -0
  181. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/be_truthy.cpp +85 -0
  182. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/contain.cpp +156 -0
  183. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/equal.cpp +218 -0
  184. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/matchers/throw_exception.cpp +105 -0
  185. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/options.spec.cpp +134 -0
  186. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/reporters/colorizer.spec.cpp +45 -0
  187. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/reporters/dots_reporter.spec.cpp +206 -0
  188. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/reporters/info_reporter.spec.cpp +377 -0
  189. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/reporters/single_line_reporter.spec.cpp +201 -0
  190. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/reporters/xunit_reporter.spec.cpp +161 -0
  191. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/run.spec.cpp +77 -0
  192. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/run_policies/bandit_run_policy.spec.cpp +247 -0
  193. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/specs.h +10 -0
  194. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/synopsis.spec.cpp +54 -0
  195. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/util/argv_helper.h +62 -0
  196. data/ext/tree-sitter/tree-sitter/externals/bandit/specs/util/util.h +6 -0
  197. data/ext/tree-sitter/tree-sitter/externals/gyp/AUTHORS +11 -0
  198. data/ext/tree-sitter/tree-sitter/externals/gyp/DEPS +24 -0
  199. data/ext/tree-sitter/tree-sitter/externals/gyp/LICENSE +27 -0
  200. data/ext/tree-sitter/tree-sitter/externals/gyp/OWNERS +1 -0
  201. data/ext/tree-sitter/tree-sitter/externals/gyp/PRESUBMIT.py +120 -0
  202. data/ext/tree-sitter/tree-sitter/externals/gyp/buildbot/buildbot_run.py +190 -0
  203. data/ext/tree-sitter/tree-sitter/externals/gyp/codereview.settings +10 -0
  204. data/ext/tree-sitter/tree-sitter/externals/gyp/data/win/large-pdb-shim.cc +12 -0
  205. data/ext/tree-sitter/tree-sitter/externals/gyp/gyp +8 -0
  206. data/ext/tree-sitter/tree-sitter/externals/gyp/gyp.bat +5 -0
  207. data/ext/tree-sitter/tree-sitter/externals/gyp/gyp_main.py +18 -0
  208. data/ext/tree-sitter/tree-sitter/externals/gyp/gyptest.py +274 -0
  209. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSNew.py +340 -0
  210. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSProject.py +208 -0
  211. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSSettings.py +1076 -0
  212. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSSettings_test.py +1483 -0
  213. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  214. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  215. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSUtil.py +267 -0
  216. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/MSVSVersion.py +409 -0
  217. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/__init__.py +537 -0
  218. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/__init__.pyc +0 -0
  219. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/common.py +521 -0
  220. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/common.pyc +0 -0
  221. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/common_test.py +72 -0
  222. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/easy_xml.py +157 -0
  223. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/easy_xml_test.py +103 -0
  224. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/flock_tool.py +49 -0
  225. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/__init__.py +0 -0
  226. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/__init__.pyc +0 -0
  227. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/android.py +1072 -0
  228. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/cmake.py +1143 -0
  229. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/dump_dependency_json.py +81 -0
  230. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/eclipse.py +335 -0
  231. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/gypd.py +87 -0
  232. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/gypsh.py +56 -0
  233. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/make.py +2181 -0
  234. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/make.pyc +0 -0
  235. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/msvs.py +3342 -0
  236. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/msvs_test.py +37 -0
  237. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/ninja.py +2160 -0
  238. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/ninja_test.py +44 -0
  239. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/xcode.py +1224 -0
  240. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/xcode.pyc +0 -0
  241. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  242. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/input.py +2809 -0
  243. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/input.pyc +0 -0
  244. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/input_test.py +90 -0
  245. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/mac_tool.py +510 -0
  246. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/msvs_emulation.py +972 -0
  247. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/ninja_syntax.py +160 -0
  248. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/ordered_dict.py +289 -0
  249. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/win_tool.py +292 -0
  250. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/xcode_emulation.py +1499 -0
  251. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
  252. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/xcodeproj_file.py +2889 -0
  253. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
  254. data/ext/tree-sitter/tree-sitter/externals/gyp/pylib/gyp/xml_fix.py +69 -0
  255. data/ext/tree-sitter/tree-sitter/externals/gyp/pylintrc +307 -0
  256. data/ext/tree-sitter/tree-sitter/externals/gyp/samples/samples +81 -0
  257. data/ext/tree-sitter/tree-sitter/externals/gyp/samples/samples.bat +5 -0
  258. data/ext/tree-sitter/tree-sitter/externals/gyp/setup.py +19 -0
  259. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-bare/gyptest-bare.py +23 -0
  260. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-bare/src/bare.gyp +25 -0
  261. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-bare/src/bare.py +11 -0
  262. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/gyptest-all.py +72 -0
  263. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/src/actions.gyp +226 -0
  264. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/src/copy.py +9 -0
  265. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/src/filter.py +12 -0
  266. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/src/foo.c +11 -0
  267. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/src/input.txt +1 -0
  268. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-multiple/src/main.c +22 -0
  269. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-none/gyptest-none.py +23 -0
  270. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-none/src/fake_cross.py +12 -0
  271. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-none/src/foo.cc +1 -0
  272. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-none/src/none_with_source_files.gyp +35 -0
  273. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-subdir/gyptest-action.py +26 -0
  274. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-subdir/src/make-file.py +11 -0
  275. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-subdir/src/none.gyp +31 -0
  276. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-subdir/src/subdir/make-subdir-file.py +11 -0
  277. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions-subdir/src/subdir/subdir.gyp +28 -0
  278. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/generated-header/action.py +11 -0
  279. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/generated-header/main.cc +7 -0
  280. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/generated-header/test.gyp +34 -0
  281. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/gyptest-all.py +102 -0
  282. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/gyptest-default.py +69 -0
  283. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/gyptest-errors.py +24 -0
  284. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/gyptest-generated-header.py +38 -0
  285. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/action_missing_name.gyp +24 -0
  286. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/actions.gyp +114 -0
  287. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/confirm-dep-files.py +21 -0
  288. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir1/counter.py +44 -0
  289. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir1/executable.gyp +74 -0
  290. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir1/make-prog1.py +20 -0
  291. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir1/make-prog2.py +20 -0
  292. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir1/program.c +12 -0
  293. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir2/make-file.py +11 -0
  294. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir2/none.gyp +33 -0
  295. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir3/generate_main.py +21 -0
  296. data/ext/tree-sitter/tree-sitter/externals/gyp/test/actions/src/subdir3/null_input.gyp +29 -0
  297. data/ext/tree-sitter/tree-sitter/externals/gyp/test/additional-targets/gyptest-additional.py +56 -0
  298. data/ext/tree-sitter/tree-sitter/externals/gyp/test/additional-targets/src/all.gyp +13 -0
  299. data/ext/tree-sitter/tree-sitter/externals/gyp/test/additional-targets/src/dir1/actions.gyp +56 -0
  300. data/ext/tree-sitter/tree-sitter/externals/gyp/test/additional-targets/src/dir1/emit.py +11 -0
  301. data/ext/tree-sitter/tree-sitter/externals/gyp/test/additional-targets/src/dir1/lib1.c +6 -0
  302. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/gyptest-assembly.py +31 -0
  303. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/gyptest-override.py +24 -0
  304. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/as.bat +4 -0
  305. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/assembly.gyp +62 -0
  306. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/lib1.S +15 -0
  307. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/lib1.c +3 -0
  308. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/override.gyp +34 -0
  309. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/override_asm.asm +8 -0
  310. data/ext/tree-sitter/tree-sitter/externals/gyp/test/assembly/src/program.c +12 -0
  311. data/ext/tree-sitter/tree-sitter/externals/gyp/test/build-option/gyptest-build.py +22 -0
  312. data/ext/tree-sitter/tree-sitter/externals/gyp/test/build-option/hello.c +13 -0
  313. data/ext/tree-sitter/tree-sitter/externals/gyp/test/build-option/hello.gyp +15 -0
  314. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/gyptest-all.py +85 -0
  315. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/gyptest-default.py +85 -0
  316. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/builddir.gypi +18 -0
  317. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/func1.c +6 -0
  318. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/func2.c +6 -0
  319. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/func3.c +6 -0
  320. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/func4.c +6 -0
  321. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/func5.c +6 -0
  322. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/prog1.c +10 -0
  323. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/prog1.gyp +30 -0
  324. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/prog2.c +10 -0
  325. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/prog2.gyp +19 -0
  326. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/subdir3/prog3.c +10 -0
  327. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp +19 -0
  328. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c +10 -0
  329. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp +19 -0
  330. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c +10 -0
  331. data/ext/tree-sitter/tree-sitter/externals/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp +19 -0
  332. data/ext/tree-sitter/tree-sitter/externals/gyp/test/cflags/cflags.c +15 -0
  333. data/ext/tree-sitter/tree-sitter/externals/gyp/test/cflags/cflags.gyp +23 -0
  334. data/ext/tree-sitter/tree-sitter/externals/gyp/test/cflags/gyptest-cflags.py +104 -0
  335. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compilable/gyptest-headers.py +29 -0
  336. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compilable/src/headers.gyp +26 -0
  337. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compilable/src/lib1.cpp +7 -0
  338. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compilable/src/lib1.hpp +6 -0
  339. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compilable/src/program.cpp +9 -0
  340. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/compiler-global-settings.gyp.in +34 -0
  341. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/compiler-host.gyp +17 -0
  342. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/compiler.gyp +16 -0
  343. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/cxxtest.cc +7 -0
  344. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/gyptest-compiler-env.py +112 -0
  345. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/gyptest-compiler-global-settings.py +73 -0
  346. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/my_cc.py +6 -0
  347. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/my_cxx.py +6 -0
  348. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/my_ld.py +6 -0
  349. data/ext/tree-sitter/tree-sitter/externals/gyp/test/compiler-override/test.c +7 -0
  350. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/basics/configurations.c +15 -0
  351. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/basics/configurations.gyp +32 -0
  352. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/basics/gyptest-configurations.py +29 -0
  353. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/inheritance/configurations.c +21 -0
  354. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/inheritance/configurations.gyp +40 -0
  355. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/inheritance/gyptest-inheritance.py +33 -0
  356. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/actions.gyp +18 -0
  357. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/all_dependent_settings.gyp +18 -0
  358. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/configurations.gyp +18 -0
  359. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/dependencies.gyp +18 -0
  360. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/direct_dependent_settings.gyp +18 -0
  361. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/gyptest-configurations.py +36 -0
  362. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/libraries.gyp +18 -0
  363. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/link_settings.gyp +18 -0
  364. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/sources.gyp +18 -0
  365. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/standalone_static_library.gyp +17 -0
  366. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/target_name.gyp +18 -0
  367. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/invalid/type.gyp +18 -0
  368. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/target_platform/configurations.gyp +58 -0
  369. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/target_platform/front.c +8 -0
  370. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/target_platform/gyptest-target_platform.py +40 -0
  371. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/target_platform/left.c +3 -0
  372. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/target_platform/right.c +3 -0
  373. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/x64/configurations.c +12 -0
  374. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/x64/configurations.gyp +38 -0
  375. data/ext/tree-sitter/tree-sitter/externals/gyp/test/configurations/x64/gyptest-x86.py +31 -0
  376. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/gyptest-all.py +40 -0
  377. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/gyptest-attribs.py +41 -0
  378. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/gyptest-default.py +40 -0
  379. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/gyptest-samedir.py +28 -0
  380. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/gyptest-slash.py +38 -0
  381. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/gyptest-updir.py +24 -0
  382. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/copies-attribs.gyp +20 -0
  383. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/copies-samedir.gyp +37 -0
  384. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/copies-slash.gyp +36 -0
  385. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/copies-updir.gyp +21 -0
  386. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/copies.gyp +70 -0
  387. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/directory/file3 +1 -0
  388. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/directory/file4 +1 -0
  389. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/directory/subdir/file5 +1 -0
  390. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/executable-file.sh +3 -0
  391. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/file1 +1 -0
  392. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/file2 +1 -0
  393. data/ext/tree-sitter/tree-sitter/externals/gyp/test/copies/src/parentdir/subdir/file6 +1 -0
  394. data/ext/tree-sitter/tree-sitter/externals/gyp/test/custom-generator/gyptest-custom-generator.py +18 -0
  395. data/ext/tree-sitter/tree-sitter/externals/gyp/test/custom-generator/mygenerator.py +14 -0
  396. data/ext/tree-sitter/tree-sitter/externals/gyp/test/custom-generator/test.gyp +15 -0
  397. data/ext/tree-sitter/tree-sitter/externals/gyp/test/cxxflags/cxxflags.cc +15 -0
  398. data/ext/tree-sitter/tree-sitter/externals/gyp/test/cxxflags/cxxflags.gyp +16 -0
  399. data/ext/tree-sitter/tree-sitter/externals/gyp/test/cxxflags/gyptest-cxxflags.py +65 -0
  400. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines-escaping/defines-escaping.c +11 -0
  401. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines-escaping/defines-escaping.gyp +19 -0
  402. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines-escaping/gyptest-defines-escaping.py +184 -0
  403. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/defines-env.gyp +22 -0
  404. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/defines.c +23 -0
  405. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/defines.gyp +38 -0
  406. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/gyptest-define-override.py +43 -0
  407. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/gyptest-defines-env-regyp.py +51 -0
  408. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/gyptest-defines-env.py +85 -0
  409. data/ext/tree-sitter/tree-sitter/externals/gyp/test/defines/gyptest-defines.py +39 -0
  410. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/a.c +9 -0
  411. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/b/b.c +3 -0
  412. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/b/b.gyp +22 -0
  413. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/b/b3.c +9 -0
  414. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/c/c.c +4 -0
  415. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/c/c.gyp +22 -0
  416. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/c/d.c +3 -0
  417. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/double_dependency.gyp +23 -0
  418. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/double_dependent.gyp +12 -0
  419. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/extra_targets.gyp +18 -0
  420. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/gyptest-double-dependency.py +19 -0
  421. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/gyptest-extra-targets.py +21 -0
  422. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/gyptest-lib-only.py +39 -0
  423. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/gyptest-none-traversal.py +25 -0
  424. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/gyptest-sharedlib-linksettings.py +21 -0
  425. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/lib_only.gyp +16 -0
  426. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/main.c +14 -0
  427. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/none_traversal.gyp +46 -0
  428. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/sharedlib-linksettings/program.c +25 -0
  429. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/sharedlib-linksettings/sharedlib.c +16 -0
  430. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/sharedlib-linksettings/staticlib.c +24 -0
  431. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependencies/sharedlib-linksettings/test.gyp +37 -0
  432. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependency-copy/gyptest-copy.py +26 -0
  433. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependency-copy/src/copies.gyp +25 -0
  434. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependency-copy/src/file1.c +7 -0
  435. data/ext/tree-sitter/tree-sitter/externals/gyp/test/dependency-copy/src/file2.c +7 -0
  436. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/duplicate_basenames.gyp +13 -0
  437. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/duplicate_node.gyp +12 -0
  438. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/duplicate_rule.gyp +22 -0
  439. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/duplicate_targets.gyp +14 -0
  440. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/gyptest-errors.py +47 -0
  441. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/missing_dep.gyp +15 -0
  442. data/ext/tree-sitter/tree-sitter/externals/gyp/test/errors/missing_targets.gyp +8 -0
  443. data/ext/tree-sitter/tree-sitter/externals/gyp/test/escaping/colon/test.gyp +21 -0
  444. data/ext/tree-sitter/tree-sitter/externals/gyp/test/escaping/gyptest-colon.py +43 -0
  445. data/ext/tree-sitter/tree-sitter/externals/gyp/test/exclusion/exclusion.gyp +23 -0
  446. data/ext/tree-sitter/tree-sitter/externals/gyp/test/exclusion/gyptest-exclusion.py +22 -0
  447. data/ext/tree-sitter/tree-sitter/externals/gyp/test/exclusion/hello.c +15 -0
  448. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/gyptest-cross.py +31 -0
  449. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/bogus1.cc +1 -0
  450. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/bogus2.c +1 -0
  451. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/cross.gyp +83 -0
  452. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/cross_compile.gypi +23 -0
  453. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/fake_cross.py +18 -0
  454. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/program.cc +16 -0
  455. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/test1.cc +1 -0
  456. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/test2.c +1 -0
  457. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/test3.cc +1 -0
  458. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/test4.c +1 -0
  459. data/ext/tree-sitter/tree-sitter/externals/gyp/test/external-cross-compile/src/tochar.py +13 -0
  460. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/actions.gyp +16 -0
  461. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/build/README.txt +4 -0
  462. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir1/actions-out/README.txt +4 -0
  463. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir1/build/README.txt +4 -0
  464. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir1/executable.gyp +44 -0
  465. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir1/make-prog1.py +20 -0
  466. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir1/make-prog2.py +20 -0
  467. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir1/program.c +12 -0
  468. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir2/actions-out/README.txt +4 -0
  469. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir2/build/README.txt +4 -0
  470. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir2/make-file.py +11 -0
  471. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/actions/subdir2/none.gyp +31 -0
  472. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/build/README.txt +4 -0
  473. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/copies-out/README.txt +4 -0
  474. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/copies.gyp +50 -0
  475. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/file1 +1 -0
  476. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/file2 +1 -0
  477. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/subdir/build/README.txt +4 -0
  478. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/subdir/copies-out/README.txt +4 -0
  479. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/subdir/file3 +1 -0
  480. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/subdir/file4 +1 -0
  481. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/copies/subdir/subdir.gyp +32 -0
  482. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-actions.py +58 -0
  483. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-copies.py +59 -0
  484. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-depth.py +58 -0
  485. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-mac-bundle.py +28 -0
  486. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-relocate.py +60 -0
  487. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-rules.py +59 -0
  488. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-subdir2-deep.py +37 -0
  489. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-symlink.py +43 -0
  490. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/gyptest-top-all.py +54 -0
  491. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/mac-bundle/Info.plist +32 -0
  492. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/mac-bundle/app.order +1 -0
  493. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/mac-bundle/header.h +1 -0
  494. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/mac-bundle/main.c +1 -0
  495. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/mac-bundle/resource.sb +1 -0
  496. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/mac-bundle/test.gyp +25 -0
  497. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/build/README.txt +4 -0
  498. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/copy-file.py +12 -0
  499. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/rules.gyp +16 -0
  500. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/build/README.txt +4 -0
  501. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/define3.in0 +1 -0
  502. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/define4.in0 +1 -0
  503. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/executable.gyp +59 -0
  504. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/function1.in1 +6 -0
  505. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/function2.in1 +6 -0
  506. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir1/program.c +18 -0
  507. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/build/README.txt +4 -0
  508. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/file1.in0 +1 -0
  509. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/file2.in0 +1 -0
  510. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/file3.in1 +1 -0
  511. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/file4.in1 +1 -0
  512. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/none.gyp +49 -0
  513. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/rules/subdir2/rules-out/README.txt +4 -0
  514. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/build/README.txt +4 -0
  515. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/inc.h +1 -0
  516. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/inc1/include1.h +1 -0
  517. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/prog1.c +18 -0
  518. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/prog1.gyp +28 -0
  519. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/build/README.txt +4 -0
  520. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/deeper/build/README.txt +4 -0
  521. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/deeper/deeper.c +7 -0
  522. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp +18 -0
  523. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/deeper/deeper.h +1 -0
  524. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/inc2/include2.h +1 -0
  525. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/prog2.c +18 -0
  526. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir2/prog2.gyp +28 -0
  527. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir3/build/README.txt +4 -0
  528. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir3/inc3/include3.h +1 -0
  529. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir3/prog3.c +18 -0
  530. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/subdir3/prog3.gyp +25 -0
  531. data/ext/tree-sitter/tree-sitter/externals/gyp/test/generator-output/src/symroot.gypi +16 -0
  532. data/ext/tree-sitter/tree-sitter/externals/gyp/test/gyp-defines/defines.gyp +26 -0
  533. data/ext/tree-sitter/tree-sitter/externals/gyp/test/gyp-defines/echo.py +11 -0
  534. data/ext/tree-sitter/tree-sitter/externals/gyp/test/gyp-defines/gyptest-multiple-values.py +40 -0
  535. data/ext/tree-sitter/tree-sitter/externals/gyp/test/gyp-defines/gyptest-regyp.py +40 -0
  536. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py +37 -0
  537. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py +36 -0
  538. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/a.c +9 -0
  539. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/a.h +12 -0
  540. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/b.c +9 -0
  541. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/b.h +12 -0
  542. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/c.c +10 -0
  543. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/c.h +10 -0
  544. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/d.c +9 -0
  545. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/emit.py +11 -0
  546. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hard_dependency/src/hard_dependency.gyp +78 -0
  547. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/gyptest-all.py +24 -0
  548. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/gyptest-default.py +24 -0
  549. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/gyptest-disable-regyp.py +32 -0
  550. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/gyptest-regyp-output.py +36 -0
  551. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/gyptest-regyp.py +32 -0
  552. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/gyptest-target.py +24 -0
  553. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/hello.c +11 -0
  554. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/hello.gyp +15 -0
  555. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/hello2.c +11 -0
  556. data/ext/tree-sitter/tree-sitter/externals/gyp/test/hello/hello2.gyp +15 -0
  557. data/ext/tree-sitter/tree-sitter/externals/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py +31 -0
  558. data/ext/tree-sitter/tree-sitter/externals/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py +33 -0
  559. data/ext/tree-sitter/tree-sitter/externals/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py +44 -0
  560. data/ext/tree-sitter/tree-sitter/externals/gyp/test/home_dot_gyp/gyptest-home-includes.py +30 -0
  561. data/ext/tree-sitter/tree-sitter/externals/gyp/test/home_dot_gyp/src/all.gyp +22 -0
  562. data/ext/tree-sitter/tree-sitter/externals/gyp/test/home_dot_gyp/src/printfoo.c +7 -0
  563. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/gyptest-all.py +43 -0
  564. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/gyptest-default.py +43 -0
  565. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/inc.h +1 -0
  566. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/inc1/include1.h +1 -0
  567. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/includes.c +19 -0
  568. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/includes.gyp +27 -0
  569. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/shadow1/shadow.h +1 -0
  570. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/shadow2/shadow.h +1 -0
  571. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/subdir/inc.h +1 -0
  572. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/subdir/inc2/include2.h +1 -0
  573. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/subdir/subdir_includes.c +14 -0
  574. data/ext/tree-sitter/tree-sitter/externals/gyp/test/include_dirs/src/subdir/subdir_includes.gyp +20 -0
  575. data/ext/tree-sitter/tree-sitter/externals/gyp/test/intermediate_dir/gyptest-intermediate-dir.py +42 -0
  576. data/ext/tree-sitter/tree-sitter/externals/gyp/test/intermediate_dir/src/script.py +24 -0
  577. data/ext/tree-sitter/tree-sitter/externals/gyp/test/intermediate_dir/src/shared_infile.txt +1 -0
  578. data/ext/tree-sitter/tree-sitter/externals/gyp/test/intermediate_dir/src/test.gyp +42 -0
  579. data/ext/tree-sitter/tree-sitter/externals/gyp/test/intermediate_dir/src/test2.gyp +42 -0
  580. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  581. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  582. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
  583. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/English.lproj/Main_iPhone.storyboard +27 -0
  584. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/TestApp-Info.plist +32 -0
  585. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/check_no_signature.py +13 -0
  586. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/main.m +13 -0
  587. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/only-compile-in-32-bits.m +7 -0
  588. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/TestApp/only-compile-in-64-bits.m +7 -0
  589. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/test-archs.gyp +110 -0
  590. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/test-device.gyp +79 -0
  591. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/app-bundle/test.gyp +45 -0
  592. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/deployment-target/check-version-min.c +33 -0
  593. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/deployment-target/deployment-target.gyp +58 -0
  594. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/gyptest-app-ios.py +46 -0
  595. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/gyptest-archs.py +106 -0
  596. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/gyptest-deployment-target.py +23 -0
  597. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ios/gyptest-per-config-settings.py +147 -0
  598. data/ext/tree-sitter/tree-sitter/externals/gyp/test/lib/README.txt +17 -0
  599. data/ext/tree-sitter/tree-sitter/externals/gyp/test/lib/TestCmd.py +1597 -0
  600. data/ext/tree-sitter/tree-sitter/externals/gyp/test/lib/TestCommon.py +570 -0
  601. data/ext/tree-sitter/tree-sitter/externals/gyp/test/lib/TestGyp.py +1117 -0
  602. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/gyptest-shared-obj-install-path.py +42 -0
  603. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/gyptest-shared.py +84 -0
  604. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/gyptest-static.py +84 -0
  605. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/lib1.c +10 -0
  606. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/lib1_moveable.c +10 -0
  607. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/lib2.c +10 -0
  608. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/lib2_moveable.c +10 -0
  609. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/library.gyp +58 -0
  610. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/program.c +15 -0
  611. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library/src/shared_dependency.gyp +33 -0
  612. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/gyptest-library-dirs.py +50 -0
  613. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/subdir/README.txt +1 -0
  614. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/subdir/hello.cc +11 -0
  615. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/subdir/mylib.cc +9 -0
  616. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/subdir/mylib.h +12 -0
  617. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/subdir/test-win.gyp +60 -0
  618. data/ext/tree-sitter/tree-sitter/externals/gyp/test/library_dirs/subdir/test.gyp +68 -0
  619. data/ext/tree-sitter/tree-sitter/externals/gyp/test/link-objects/base.c +6 -0
  620. data/ext/tree-sitter/tree-sitter/externals/gyp/test/link-objects/extra.c +5 -0
  621. data/ext/tree-sitter/tree-sitter/externals/gyp/test/link-objects/gyptest-all.py +28 -0
  622. data/ext/tree-sitter/tree-sitter/externals/gyp/test/link-objects/link-objects.gyp +24 -0
  623. data/ext/tree-sitter/tree-sitter/externals/gyp/test/linux/gyptest-implicit-rpath.py +48 -0
  624. data/ext/tree-sitter/tree-sitter/externals/gyp/test/linux/implicit-rpath/file.c +1 -0
  625. data/ext/tree-sitter/tree-sitter/externals/gyp/test/linux/implicit-rpath/main.c +1 -0
  626. data/ext/tree-sitter/tree-sitter/externals/gyp/test/linux/implicit-rpath/test.gyp +47 -0
  627. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/action-envvars/action/action.gyp +34 -0
  628. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/action-envvars/action/action.sh +8 -0
  629. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  630. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  631. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
  632. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16be.strings +0 -0
  633. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16le.strings +0 -0
  634. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/TestApp-Info.plist +34 -0
  635. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.h +13 -0
  636. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.m +15 -0
  637. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/TestApp/main.m +10 -0
  638. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/empty.c +0 -0
  639. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/test-error.gyp +31 -0
  640. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/app-bundle/test.gyp +41 -0
  641. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/empty_main.cc +1 -0
  642. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/file.mm +1 -0
  643. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/header.h +1 -0
  644. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/my_file.cc +4 -0
  645. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/my_main_file.cc +9 -0
  646. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/test-archs-multiarch.gyp +72 -0
  647. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/test-archs-x86_64.gyp +27 -0
  648. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/archs/test-no-archs.gyp +21 -0
  649. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/bundle-resources/change.sh +3 -0
  650. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/bundle-resources/executable-file.sh +3 -0
  651. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/bundle-resources/secret.txt +1 -0
  652. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/bundle-resources/test.gyp +59 -0
  653. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/ccfile.cc +7 -0
  654. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/ccfile_withcflags.cc +7 -0
  655. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/cfile.c +7 -0
  656. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/cppfile.cpp +7 -0
  657. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/cppfile_withcflags.cpp +7 -0
  658. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/cxxfile.cxx +7 -0
  659. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/cxxfile_withcflags.cxx +7 -0
  660. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/mfile.m +7 -0
  661. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/mmfile.mm +7 -0
  662. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/mmfile_withcflags.mm +7 -0
  663. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/cflags/test.gyp +132 -0
  664. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/clang-cxx-language-standard/c++11.cc +8 -0
  665. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/clang-cxx-language-standard/c++98.cc +24 -0
  666. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/clang-cxx-language-standard/clang-cxx-language-standard.gyp +30 -0
  667. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/clang-cxx-library/clang-cxx-library.gyp +32 -0
  668. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/clang-cxx-library/libc++.cc +11 -0
  669. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/clang-cxx-library/libstdc++.cc +11 -0
  670. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/copy-dylib/empty.c +1 -0
  671. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/copy-dylib/test.gyp +31 -0
  672. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/debuginfo/file.c +6 -0
  673. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/debuginfo/test.gyp +82 -0
  674. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings +1 -0
  675. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/depend-on-bundle/Info.plist +28 -0
  676. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/depend-on-bundle/bundle.c +1 -0
  677. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/depend-on-bundle/executable.c +4 -0
  678. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/depend-on-bundle/test.gyp +28 -0
  679. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/deployment-target/check-version-min.c +33 -0
  680. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/deployment-target/deployment-target.gyp +28 -0
  681. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework-dirs/calculate.c +15 -0
  682. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework-dirs/framework-dirs.gyp +21 -0
  683. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework-headers/myframework.h +8 -0
  684. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework-headers/myframework.m +8 -0
  685. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework-headers/test.gyp +44 -0
  686. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings +2 -0
  687. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/TestFramework/Info.plist +28 -0
  688. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/TestFramework/ObjCVector.h +28 -0
  689. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/TestFramework/ObjCVector.mm +63 -0
  690. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h +9 -0
  691. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch +7 -0
  692. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/empty.c +0 -0
  693. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/framework/framework.gyp +71 -0
  694. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/global-settings/src/dir1/dir1.gyp +11 -0
  695. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/global-settings/src/dir2/dir2.gyp +22 -0
  696. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/global-settings/src/dir2/file.txt +1 -0
  697. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-action-envvars.py +30 -0
  698. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-app-error.py +43 -0
  699. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-app.py +119 -0
  700. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-archs.py +89 -0
  701. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-bundle-resources.py +58 -0
  702. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-cflags.py +20 -0
  703. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-clang-cxx-language-standard.py +25 -0
  704. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-clang-cxx-library.py +29 -0
  705. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-copies.py +49 -0
  706. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-copy-dylib.py +25 -0
  707. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-debuginfo.py +36 -0
  708. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-depend-on-bundle.py +40 -0
  709. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-deployment-target.py +23 -0
  710. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-framework-dirs.py +23 -0
  711. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-framework-headers.py +38 -0
  712. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-framework.py +74 -0
  713. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-global-settings.py +26 -0
  714. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-infoplist-process.py +51 -0
  715. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-installname.py +79 -0
  716. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-ldflags-passed-to-libtool.py +31 -0
  717. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-ldflags.py +68 -0
  718. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-libraries.py +22 -0
  719. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-loadable-module.py +48 -0
  720. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-missing-cfbundlesignature.py +29 -0
  721. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-non-strs-flattened-to-env.py +33 -0
  722. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-objc-arc.py +26 -0
  723. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-objc-gc.py +45 -0
  724. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-postbuild-copy-bundle.py +75 -0
  725. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-postbuild-defaults.py +29 -0
  726. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-postbuild-fail.py +67 -0
  727. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-postbuild-multiple-configurations.py +26 -0
  728. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-postbuild-static-library.py +28 -0
  729. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-postbuild.py +53 -0
  730. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-prefixheader.py +19 -0
  731. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-rebuild.py +41 -0
  732. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-rpath.py +49 -0
  733. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-sdkroot.py +50 -0
  734. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-sourceless-module.py +72 -0
  735. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-strip-default.py +95 -0
  736. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-strip.py +53 -0
  737. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-type-envvars.py +24 -0
  738. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-unicode-settings.py +20 -0
  739. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-xcode-env-order.py +94 -0
  740. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-xcode-gcc-clang.py +40 -0
  741. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-xcode-gcc.py +56 -0
  742. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/gyptest-xctest.py +38 -0
  743. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/infoplist-process/Info.plist +36 -0
  744. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/infoplist-process/main.c +7 -0
  745. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/infoplist-process/test1.gyp +25 -0
  746. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/infoplist-process/test2.gyp +25 -0
  747. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/infoplist-process/test3.gyp +25 -0
  748. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/installname/Info.plist +28 -0
  749. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/installname/file.c +1 -0
  750. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/installname/main.c +1 -0
  751. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/installname/test.gyp +93 -0
  752. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/ldflags-libtool/file.c +1 -0
  753. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/ldflags-libtool/test.gyp +17 -0
  754. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/ldflags/subdirectory/Info.plist +8 -0
  755. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/ldflags/subdirectory/file.c +2 -0
  756. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/ldflags/subdirectory/symbol_list.def +1 -0
  757. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/ldflags/subdirectory/test.gyp +66 -0
  758. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/libraries/subdir/README.txt +1 -0
  759. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/libraries/subdir/hello.cc +10 -0
  760. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/libraries/subdir/mylib.c +7 -0
  761. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/libraries/subdir/test.gyp +65 -0
  762. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/loadable-module/Info.plist +26 -0
  763. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/loadable-module/module.c +11 -0
  764. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/loadable-module/test.gyp +18 -0
  765. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/missing-cfbundlesignature/Info.plist +10 -0
  766. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/missing-cfbundlesignature/Other-Info.plist +12 -0
  767. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/missing-cfbundlesignature/Third-Info.plist +12 -0
  768. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/missing-cfbundlesignature/file.c +1 -0
  769. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/missing-cfbundlesignature/test.gyp +34 -0
  770. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/non-strs-flattened-to-env/Info.plist +15 -0
  771. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/non-strs-flattened-to-env/main.c +7 -0
  772. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/non-strs-flattened-to-env/test.gyp +27 -0
  773. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/c-file.c +6 -0
  774. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/cc-file.cc +5 -0
  775. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/m-file-no-arc.m +5 -0
  776. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/m-file.m +5 -0
  777. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/mm-file-no-arc.mm +5 -0
  778. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/mm-file.mm +5 -0
  779. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-arc/test.gyp +45 -0
  780. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-gc/c-file.c +1 -0
  781. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-gc/cc-file.cc +1 -0
  782. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-gc/main.m +6 -0
  783. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-gc/needs-gc-mm.mm +1 -0
  784. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-gc/needs-gc.m +1 -0
  785. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/objc-gc/test.gyp +102 -0
  786. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/Framework-Info.plist +30 -0
  787. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/TestApp-Info.plist +32 -0
  788. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/copied.txt +1 -0
  789. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/empty.c +0 -0
  790. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/main.c +4 -0
  791. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh +9 -0
  792. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/resource_file.sb +1 -0
  793. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-copy-bundle/test.gyp +49 -0
  794. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-defaults/Info.plist +13 -0
  795. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-defaults/main.c +7 -0
  796. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-defaults/postbuild-defaults.sh +15 -0
  797. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-defaults/test.gyp +26 -0
  798. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-fail/file.c +6 -0
  799. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-fail/postbuild-fail.sh +6 -0
  800. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-fail/test.gyp +38 -0
  801. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-fail/touch-dynamic.sh +7 -0
  802. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-fail/touch-static.sh +7 -0
  803. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-multiple-configurations/main.c +4 -0
  804. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh +7 -0
  805. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-multiple-configurations/test.gyp +26 -0
  806. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-static-library/empty.c +4 -0
  807. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh +7 -0
  808. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuild-static-library/test.gyp +34 -0
  809. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/copy.sh +3 -0
  810. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/file.c +4 -0
  811. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/file_g.c +4 -0
  812. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/file_h.c +4 -0
  813. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh +23 -0
  814. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/script/static_library_postbuild.sh +23 -0
  815. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/subdirectory/copied_file.txt +1 -0
  816. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp +53 -0
  817. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/postbuilds/test.gyp +93 -0
  818. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/prefixheader/file.c +1 -0
  819. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/prefixheader/file.cc +1 -0
  820. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/prefixheader/file.m +1 -0
  821. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/prefixheader/file.mm +1 -0
  822. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/prefixheader/header.h +1 -0
  823. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/prefixheader/test.gyp +82 -0
  824. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rebuild/TestApp-Info.plist +32 -0
  825. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rebuild/delay-touch.sh +6 -0
  826. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rebuild/empty.c +0 -0
  827. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rebuild/main.c +1 -0
  828. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rebuild/test.gyp +56 -0
  829. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rpath/file.c +1 -0
  830. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rpath/main.c +1 -0
  831. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/rpath/test.gyp +48 -0
  832. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sdkroot/file.cc +5 -0
  833. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sdkroot/test.gyp +35 -0
  834. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sdkroot/test_shorthand.sh +20 -0
  835. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sourceless-module/empty.c +1 -0
  836. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sourceless-module/empty.txt +2 -0
  837. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sourceless-module/fun.c +1 -0
  838. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/sourceless-module/test.gyp +96 -0
  839. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/file.c +22 -0
  840. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/main.c +25 -0
  841. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/strip.saves +5 -0
  842. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/subdirectory/nested_file.c +1 -0
  843. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/subdirectory/nested_strip.saves +5 -0
  844. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/subdirectory/subdirectory.gyp +38 -0
  845. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh +5 -0
  846. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/test-defaults.gyp +51 -0
  847. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/strip/test.gyp +119 -0
  848. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/file.c +6 -0
  849. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test.gyp +100 -0
  850. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_bundle_executable.sh +21 -0
  851. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_bundle_loadable_module.sh +22 -0
  852. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_bundle_shared_library.sh +23 -0
  853. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_nonbundle_executable.sh +22 -0
  854. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_nonbundle_loadable_module.sh +21 -0
  855. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_nonbundle_none.sh +22 -0
  856. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_nonbundle_shared_library.sh +21 -0
  857. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/type_envvars/test_nonbundle_static_library.sh +21 -0
  858. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/unicode-settings/file.cc +2 -0
  859. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/unicode-settings/test.gyp +23 -0
  860. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/unicode-settings/test_bundle_display_name.sh +7 -0
  861. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-env-order/Info.plist +56 -0
  862. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-env-order/file.ext1 +0 -0
  863. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-env-order/file.ext2 +0 -0
  864. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-env-order/file.ext3 +0 -0
  865. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-env-order/main.c +7 -0
  866. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-env-order/test.gyp +121 -0
  867. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/aliasing.cc +13 -0
  868. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/test-clang.gyp +42 -0
  869. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/test.gyp +60 -0
  870. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/valid_c.c +8 -0
  871. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/valid_cc.cc +8 -0
  872. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/valid_m.m +8 -0
  873. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/valid_mm.mm +8 -0
  874. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc +15 -0
  875. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c +8 -0
  876. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xctest/MyClass.h +8 -0
  877. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xctest/MyClass.m +8 -0
  878. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xctest/TestCase.m +16 -0
  879. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xctest/resource.txt +1 -0
  880. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xctest/test.gyp +47 -0
  881. data/ext/tree-sitter/tree-sitter/externals/gyp/test/mac/xctest/test.xcodeproj/xcshareddata/xcschemes/classes.xcscheme +69 -0
  882. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/dependencies.gyp +15 -0
  883. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/gyptest-dependencies.py +26 -0
  884. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/gyptest-noload.py +57 -0
  885. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/main.cc +12 -0
  886. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/main.h +0 -0
  887. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/noload/all.gyp +18 -0
  888. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/noload/lib/shared.c +3 -0
  889. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/noload/lib/shared.gyp +16 -0
  890. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/noload/lib/shared.h +1 -0
  891. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make/noload/main.c +9 -0
  892. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py +46 -0
  893. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make_global_settings/basics/make_global_settings.gyp +17 -0
  894. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py +46 -0
  895. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make_global_settings/env-wrapper/wrapper.gyp +17 -0
  896. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py +47 -0
  897. data/ext/tree-sitter/tree-sitter/externals/gyp/test/make_global_settings/wrapper/wrapper.gyp +21 -0
  898. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/file0 +0 -0
  899. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/file1 +0 -0
  900. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/file2 +0 -0
  901. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/file3 +0 -0
  902. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/file4 +0 -0
  903. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/gyptest-many-actions-unsorted.py +34 -0
  904. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/gyptest-many-actions.py +20 -0
  905. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/many-actions-unsorted.gyp +154 -0
  906. data/ext/tree-sitter/tree-sitter/externals/gyp/test/many-actions/many-actions.gyp +1817 -0
  907. data/ext/tree-sitter/tree-sitter/externals/gyp/test/module/gyptest-default.py +29 -0
  908. data/ext/tree-sitter/tree-sitter/externals/gyp/test/module/src/lib1.c +10 -0
  909. data/ext/tree-sitter/tree-sitter/externals/gyp/test/module/src/lib2.c +10 -0
  910. data/ext/tree-sitter/tree-sitter/externals/gyp/test/module/src/module.gyp +53 -0
  911. data/ext/tree-sitter/tree-sitter/externals/gyp/test/module/src/program.c +111 -0
  912. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/buildevents/buildevents.gyp +14 -0
  913. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py +24 -0
  914. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py +29 -0
  915. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/buildevents/main.cc +5 -0
  916. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/config_attrs/gyptest-config_attrs.py +31 -0
  917. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/config_attrs/hello.c +11 -0
  918. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/config_attrs/hello.gyp +21 -0
  919. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/express/base/base.gyp +22 -0
  920. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/express/express.gyp +19 -0
  921. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/express/gyptest-express.py +29 -0
  922. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/external.gyp +68 -0
  923. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/external_builder.py +9 -0
  924. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/gyptest-all.py +59 -0
  925. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/hello.cpp +10 -0
  926. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/hello.z +6 -0
  927. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/msbuild_action.py +9 -0
  928. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/external_builder/msbuild_rule.py +11 -0
  929. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/filters/filters.gyp +47 -0
  930. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/filters/gyptest-filters-2008.py +68 -0
  931. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/filters/gyptest-filters-2010.py +57 -0
  932. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/list_excluded/gyptest-all.py +51 -0
  933. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/list_excluded/hello.cpp +10 -0
  934. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/list_excluded/hello_exclude.gyp +19 -0
  935. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/list_excluded/hello_mac.cpp +10 -0
  936. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/missing_sources/gyptest-missing.py +43 -0
  937. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/missing_sources/hello_missing.gyp +15 -0
  938. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/props/AppName.props +14 -0
  939. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/props/AppName.vsprops +11 -0
  940. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/props/gyptest-props.py +22 -0
  941. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/props/hello.c +11 -0
  942. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/props/hello.gyp +22 -0
  943. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/shared_output/common.gypi +17 -0
  944. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/shared_output/gyptest-shared_output.py +41 -0
  945. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/shared_output/hello.c +12 -0
  946. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/shared_output/hello.gyp +21 -0
  947. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/shared_output/there/there.c +12 -0
  948. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/shared_output/there/there.gyp +16 -0
  949. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/uldi2010/gyptest-all.py +20 -0
  950. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/uldi2010/hello.c +13 -0
  951. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/uldi2010/hello.gyp +26 -0
  952. data/ext/tree-sitter/tree-sitter/externals/gyp/test/msvs/uldi2010/hello2.c +10 -0
  953. data/ext/tree-sitter/tree-sitter/externals/gyp/test/multiple-targets/gyptest-all.py +33 -0
  954. data/ext/tree-sitter/tree-sitter/externals/gyp/test/multiple-targets/gyptest-default.py +33 -0
  955. data/ext/tree-sitter/tree-sitter/externals/gyp/test/multiple-targets/src/common.c +7 -0
  956. data/ext/tree-sitter/tree-sitter/externals/gyp/test/multiple-targets/src/multiple.gyp +24 -0
  957. data/ext/tree-sitter/tree-sitter/externals/gyp/test/multiple-targets/src/prog1.c +10 -0
  958. data/ext/tree-sitter/tree-sitter/externals/gyp/test/multiple-targets/src/prog2.c +10 -0
  959. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py +53 -0
  960. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/a.c +10 -0
  961. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/a.h +13 -0
  962. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/action_dependencies.gyp +88 -0
  963. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/b.c +18 -0
  964. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/b.h +13 -0
  965. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/c.c +10 -0
  966. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/c.h +13 -0
  967. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/src/emit.py +11 -0
  968. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/chained-dependency/chained-dependency.gyp +53 -0
  969. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/chained-dependency/chained.c +5 -0
  970. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py +26 -0
  971. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py +42 -0
  972. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/normalize-paths-win/hello.cc +7 -0
  973. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/normalize-paths-win/normalize-paths.gyp +56 -0
  974. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/s-needs-no-depfiles/empty.s +1 -0
  975. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py +42 -0
  976. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/s-needs-no-depfiles/s-needs-no-depfiles.gyp +13 -0
  977. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py +41 -0
  978. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/solibs_avoid_relinking/main.cc +5 -0
  979. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/solibs_avoid_relinking/solib.cc +8 -0
  980. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/solibs_avoid_relinking/solibs_avoid_relinking.gyp +38 -0
  981. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/use-custom-environment-files/gyptest-use-custom-environment-files.py +28 -0
  982. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc +7 -0
  983. data/ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.gyp +15 -0
  984. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-cpp/gyptest-no-cpp.py +50 -0
  985. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-cpp/src/call-f-main.c +2 -0
  986. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-cpp/src/empty-main.c +1 -0
  987. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-cpp/src/f.cc +3 -0
  988. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-cpp/src/test.gyp +25 -0
  989. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-output/gyptest-no-output.py +21 -0
  990. data/ext/tree-sitter/tree-sitter/externals/gyp/test/no-output/src/nooutput.gyp +17 -0
  991. data/ext/tree-sitter/tree-sitter/externals/gyp/test/product/gyptest-product.py +44 -0
  992. data/ext/tree-sitter/tree-sitter/externals/gyp/test/product/hello.c +15 -0
  993. data/ext/tree-sitter/tree-sitter/externals/gyp/test/product/product.gyp +128 -0
  994. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/gyptest-prune-targets.py +64 -0
  995. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/lib1.cc +6 -0
  996. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/lib2.cc +6 -0
  997. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/lib3.cc +6 -0
  998. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/lib_indirect.cc +6 -0
  999. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/program.cc +7 -0
  1000. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/test1.gyp +26 -0
  1001. data/ext/tree-sitter/tree-sitter/externals/gyp/test/prune_targets/test2.gyp +30 -0
  1002. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/foo/a/a.cc +9 -0
  1003. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/foo/a/a.gyp +13 -0
  1004. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/foo/a/c/c.cc +9 -0
  1005. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/foo/a/c/c.gyp +12 -0
  1006. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/foo/b/b.cc +9 -0
  1007. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/foo/b/b.gyp +9 -0
  1008. data/ext/tree-sitter/tree-sitter/externals/gyp/test/relative/gyptest-default.py +25 -0
  1009. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rename/filecase/file.c +1 -0
  1010. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rename/filecase/test-casesensitive.gyp +15 -0
  1011. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rename/filecase/test.gyp +14 -0
  1012. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rename/gyptest-filecase.py +35 -0
  1013. data/ext/tree-sitter/tree-sitter/externals/gyp/test/restat/gyptest-restat.py +31 -0
  1014. data/ext/tree-sitter/tree-sitter/externals/gyp/test/restat/src/create_intermediate.py +17 -0
  1015. data/ext/tree-sitter/tree-sitter/externals/gyp/test/restat/src/restat.gyp +50 -0
  1016. data/ext/tree-sitter/tree-sitter/externals/gyp/test/restat/src/touch.py +16 -0
  1017. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/gyptest-dirname.py +36 -0
  1018. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/actions.gyp +15 -0
  1019. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/copy-file.py +11 -0
  1020. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/a/b/c.gencc +11 -0
  1021. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/a/b/c.printvars +1 -0
  1022. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc +11 -0
  1023. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars +1 -0
  1024. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp +92 -0
  1025. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/main.cc +12 -0
  1026. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-dirname/src/subdir/printvars.py +14 -0
  1027. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/gyptest-all.py +70 -0
  1028. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/gyptest-default.py +91 -0
  1029. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/src/main.c +12 -0
  1030. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/src/make-sources.py +19 -0
  1031. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/src/prog1.in +7 -0
  1032. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/src/prog2.in +7 -0
  1033. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-rebuild/src/same_target.gyp +31 -0
  1034. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-use-built-dependencies/gyptest-use-built-dependencies.py +22 -0
  1035. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-use-built-dependencies/src/main.cc +17 -0
  1036. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-use-built-dependencies/src/use-built-dependencies-rule.gyp +42 -0
  1037. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/gyptest-rules-variables.py +26 -0
  1038. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/input_ext.c +9 -0
  1039. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/input_name/test.c +9 -0
  1040. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/input_path/subdir/test.c +9 -0
  1041. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/subdir/input_dirname.c +9 -0
  1042. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/subdir/test.c +18 -0
  1043. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/test.input_root.c +9 -0
  1044. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules-variables/src/variables.gyp +40 -0
  1045. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/gyptest-all.py +69 -0
  1046. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/gyptest-default.py +55 -0
  1047. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/gyptest-input-root.py +26 -0
  1048. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/gyptest-special-variables.py +18 -0
  1049. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/actions.gyp +22 -0
  1050. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/an_asm.S +6 -0
  1051. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/as.bat +7 -0
  1052. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/copy-file.py +11 -0
  1053. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/external/external.gyp +66 -0
  1054. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/external/file1.in +1 -0
  1055. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/external/file2.in +1 -0
  1056. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/input-root.gyp +24 -0
  1057. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/noaction/file1.in +1 -0
  1058. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp +37 -0
  1059. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/rule.py +17 -0
  1060. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/somefile.ext +0 -0
  1061. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/special-variables.gyp +35 -0
  1062. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir1/executable.gyp +37 -0
  1063. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir1/function1.in +6 -0
  1064. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir1/function2.in +6 -0
  1065. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir1/program.c +12 -0
  1066. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir2/file1.in +1 -0
  1067. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir2/file2.in +1 -0
  1068. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir2/never_used.gyp +31 -0
  1069. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir2/no_action.gyp +38 -0
  1070. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir2/no_inputs.gyp +32 -0
  1071. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir2/none.gyp +33 -0
  1072. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir3/executable2.gyp +37 -0
  1073. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir3/function3.in +6 -0
  1074. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir3/program.c +10 -0
  1075. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir4/asm-function.assem +10 -0
  1076. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir4/build-asm.gyp +49 -0
  1077. data/ext/tree-sitter/tree-sitter/externals/gyp/test/rules/src/subdir4/program.c +19 -0
  1078. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/gyptest-all.py +38 -0
  1079. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/gyptest-default.py +38 -0
  1080. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/gyptest-library.py +20 -0
  1081. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/library/one/sub.gyp +11 -0
  1082. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/library/test.gyp +15 -0
  1083. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/library/two/sub.gyp +11 -0
  1084. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/src/all.gyp +16 -0
  1085. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/src/subdir1/executable.gyp +15 -0
  1086. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/src/subdir1/main1.cc +6 -0
  1087. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/src/subdir2/executable.gyp +15 -0
  1088. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-gyp-name/src/subdir2/main2.cc +6 -0
  1089. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-rule-output-file-name/gyptest-all.py +23 -0
  1090. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-rule-output-file-name/src/subdir1/subdir1.gyp +30 -0
  1091. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-rule-output-file-name/src/subdir2/subdir2.gyp +30 -0
  1092. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-rule-output-file-name/src/subdirs.gyp +16 -0
  1093. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-rule-output-file-name/src/touch.py +11 -0
  1094. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/gyptest-all.py +34 -0
  1095. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/gyptest-default.py +34 -0
  1096. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/gyptest-fail-shared.py +18 -0
  1097. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/gyptest-fail-static.py +18 -0
  1098. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/gyptest-pass-executable.py +33 -0
  1099. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/all.gyp +30 -0
  1100. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/double-executable.gyp +21 -0
  1101. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/double-shared.gyp +21 -0
  1102. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/double-static.gyp +21 -0
  1103. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/func.c +6 -0
  1104. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/prog1.c +16 -0
  1105. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/prog2.c +16 -0
  1106. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/prog3.c +18 -0
  1107. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/subdir1/func.c +6 -0
  1108. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-source-file-name/src/subdir2/func.c +6 -0
  1109. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name-different-directory/gyptest-all.py +36 -0
  1110. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp +66 -0
  1111. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp +66 -0
  1112. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name-different-directory/src/subdirs.gyp +16 -0
  1113. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name-different-directory/src/touch.py +11 -0
  1114. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name/gyptest-same-target-name.py +18 -0
  1115. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name/src/all.gyp +16 -0
  1116. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name/src/executable1.gyp +15 -0
  1117. data/ext/tree-sitter/tree-sitter/externals/gyp/test/same-target-name/src/executable2.gyp +15 -0
  1118. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sanitize-rule-names/blah.S +0 -0
  1119. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py +17 -0
  1120. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sanitize-rule-names/hello.cc +7 -0
  1121. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp +27 -0
  1122. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sanitize-rule-names/script.py +10 -0
  1123. data/ext/tree-sitter/tree-sitter/externals/gyp/test/self-dependency/common.gypi +13 -0
  1124. data/ext/tree-sitter/tree-sitter/externals/gyp/test/self-dependency/dep.gyp +23 -0
  1125. data/ext/tree-sitter/tree-sitter/externals/gyp/test/self-dependency/gyptest-self-dependency.py +19 -0
  1126. data/ext/tree-sitter/tree-sitter/externals/gyp/test/self-dependency/self_dependency.gyp +15 -0
  1127. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/gyptest-all.py +39 -0
  1128. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/gyptest-relocate.py +41 -0
  1129. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/src/build/all.gyp +16 -0
  1130. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/src/prog1/prog1.c +7 -0
  1131. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/src/prog1/prog1.gyp +15 -0
  1132. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/src/prog2/prog2.c +7 -0
  1133. data/ext/tree-sitter/tree-sitter/externals/gyp/test/sibling/src/prog2/prog2.gyp +15 -0
  1134. data/ext/tree-sitter/tree-sitter/externals/gyp/test/small/gyptest-small.py +55 -0
  1135. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone-static-library/gyptest-standalone-static-library.py +52 -0
  1136. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone-static-library/invalid.gyp +16 -0
  1137. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone-static-library/mylib.c +7 -0
  1138. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone-static-library/mylib.gyp +26 -0
  1139. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone-static-library/prog.c +7 -0
  1140. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone/gyptest-standalone.py +33 -0
  1141. data/ext/tree-sitter/tree-sitter/externals/gyp/test/standalone/standalone.gyp +12 -0
  1142. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-SYMROOT-all.py +36 -0
  1143. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-SYMROOT-default.py +37 -0
  1144. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-subdir-all.py +35 -0
  1145. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-subdir-default.py +35 -0
  1146. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-subdir2-deep.py +25 -0
  1147. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-top-all.py +43 -0
  1148. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/gyptest-top-default.py +43 -0
  1149. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/prog1.c +7 -0
  1150. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/prog1.gyp +21 -0
  1151. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/subdir/prog2.c +7 -0
  1152. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/subdir/prog2.gyp +18 -0
  1153. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/subdir/subdir2/prog3.c +7 -0
  1154. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/subdir/subdir2/prog3.gyp +18 -0
  1155. data/ext/tree-sitter/tree-sitter/externals/gyp/test/subdirectory/src/symroot.gypi +16 -0
  1156. data/ext/tree-sitter/tree-sitter/externals/gyp/test/target/gyptest-target.py +37 -0
  1157. data/ext/tree-sitter/tree-sitter/externals/gyp/test/target/hello.c +7 -0
  1158. data/ext/tree-sitter/tree-sitter/externals/gyp/test/target/target.gyp +24 -0
  1159. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toolsets/gyptest-toolsets.py +31 -0
  1160. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toolsets/main.cc +13 -0
  1161. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toolsets/toolsets.cc +11 -0
  1162. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toolsets/toolsets.gyp +62 -0
  1163. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toolsets/toolsets_shared.cc +11 -0
  1164. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toplevel-dir/gyptest-toplevel-dir.py +31 -0
  1165. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toplevel-dir/src/sub1/main.gyp +18 -0
  1166. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toplevel-dir/src/sub1/prog1.c +7 -0
  1167. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toplevel-dir/src/sub2/prog2.c +7 -0
  1168. data/ext/tree-sitter/tree-sitter/externals/gyp/test/toplevel-dir/src/sub2/prog2.gyp +15 -0
  1169. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands-repeated.gyp +128 -0
  1170. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands-repeated.gyp.stdout +136 -0
  1171. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands-repeated.gypd.golden +77 -0
  1172. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands.gyp +91 -0
  1173. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands.gyp.ignore-env.stdout +96 -0
  1174. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands.gyp.stdout +96 -0
  1175. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands.gypd.golden +66 -0
  1176. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/commands.gypi +23 -0
  1177. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/gyptest-commands-ignore-env.py +46 -0
  1178. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/gyptest-commands-repeated.py +38 -0
  1179. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/gyptest-commands.py +39 -0
  1180. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/test.py +1 -0
  1181. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/commands/update_golden +11 -0
  1182. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/filelist.gyp.stdout +26 -0
  1183. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/filelist.gypd.golden +43 -0
  1184. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/gyptest-filelist-golden.py +51 -0
  1185. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/gyptest-filelist.py +29 -0
  1186. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/src/dummy.py +5 -0
  1187. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/src/filelist.gyp +93 -0
  1188. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/src/filelist2.gyp +40 -0
  1189. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/filelist/update_golden +8 -0
  1190. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/latelate/gyptest-latelate.py +25 -0
  1191. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/latelate/src/latelate.gyp +34 -0
  1192. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/latelate/src/program.cc +13 -0
  1193. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/variable-in-path/C1/hello.cc +7 -0
  1194. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py +23 -0
  1195. data/ext/tree-sitter/tree-sitter/externals/gyp/test/variables/variable-in-path/variable-in-path.gyp +31 -0
  1196. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/asm-files/asm-files.gyp +17 -0
  1197. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/asm-files/b.s +0 -0
  1198. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/asm-files/c.S +0 -0
  1199. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/asm-files/hello.cc +7 -0
  1200. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/batch-file-action/batch-file-action.gyp +21 -0
  1201. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/batch-file-action/infile +1 -0
  1202. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/batch-file-action/somecmd.bat +5 -0
  1203. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/command-quote/a.S +0 -0
  1204. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/command-quote/bat with spaces.bat +7 -0
  1205. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/command-quote/command-quote.gyp +84 -0
  1206. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/command-quote/go.bat +7 -0
  1207. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp +28 -0
  1208. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/additional-include-dirs.cc +10 -0
  1209. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/additional-include-dirs.gyp +20 -0
  1210. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/additional-options.cc +10 -0
  1211. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/additional-options.gyp +31 -0
  1212. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/analysis.gyp +40 -0
  1213. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/buffer-security-check.gyp +51 -0
  1214. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/buffer-security.cc +12 -0
  1215. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/character-set-mbcs.cc +11 -0
  1216. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/character-set-unicode.cc +15 -0
  1217. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/character-set.gyp +35 -0
  1218. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/debug-format.gyp +48 -0
  1219. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/default-char-is-unsigned.cc +15 -0
  1220. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp +20 -0
  1221. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/disable-specific-warnings.cc +9 -0
  1222. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/disable-specific-warnings.gyp +29 -0
  1223. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/exception-handling-on.cc +24 -0
  1224. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/exception-handling.gyp +46 -0
  1225. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc +10 -0
  1226. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/force-include-files.cc +8 -0
  1227. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/force-include-files.gyp +36 -0
  1228. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/function-level-linking.cc +11 -0
  1229. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/function-level-linking.gyp +28 -0
  1230. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/hello.cc +7 -0
  1231. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/optimizations.gyp +207 -0
  1232. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/pdbname-override.gyp +26 -0
  1233. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/pdbname.cc +7 -0
  1234. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/pdbname.gyp +24 -0
  1235. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/precomp.cc +6 -0
  1236. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/rtti-on.cc +11 -0
  1237. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/rtti.gyp +37 -0
  1238. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-checks.cc +11 -0
  1239. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-checks.gyp +29 -0
  1240. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-library-md.cc +19 -0
  1241. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-library-mdd.cc +19 -0
  1242. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-library-mt.cc +19 -0
  1243. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-library-mtd.cc +19 -0
  1244. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/runtime-library.gyp +48 -0
  1245. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/subdir/header.h +0 -0
  1246. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp +33 -0
  1247. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc +11 -0
  1248. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc +11 -0
  1249. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/uninit.cc +13 -0
  1250. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-as-error.cc +9 -0
  1251. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-as-error.gyp +37 -0
  1252. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-level.gyp +115 -0
  1253. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-level1.cc +8 -0
  1254. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-level2.cc +14 -0
  1255. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-level3.cc +11 -0
  1256. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/compiler-flags/warning-level4.cc +10 -0
  1257. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py +44 -0
  1258. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/generator-output-different-drive/prog.c +10 -0
  1259. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/generator-output-different-drive/prog.gyp +15 -0
  1260. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-asm-files.py +26 -0
  1261. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-additional-include-dirs.py +22 -0
  1262. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-additional-options.py +28 -0
  1263. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-analysis.py +30 -0
  1264. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-buffer-security-check.py +53 -0
  1265. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-character-set.py +22 -0
  1266. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-debug-format.py +43 -0
  1267. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-default-char-is-unsigned.py +22 -0
  1268. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-disable-specific-warnings.py +32 -0
  1269. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-exception-handling.py +33 -0
  1270. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-force-include-files.py +22 -0
  1271. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-function-level-linking.py +52 -0
  1272. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-optimizations.py +105 -0
  1273. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-pdbname-override.py +27 -0
  1274. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-pdbname.py +30 -0
  1275. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-rtti.py +30 -0
  1276. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-runtime-checks.py +30 -0
  1277. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-runtime-library.py +22 -0
  1278. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py +22 -0
  1279. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-warning-as-error.py +30 -0
  1280. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-cl-warning-level.py +41 -0
  1281. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-command-quote.py +37 -0
  1282. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-lib-ltcg.py +22 -0
  1283. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-additional-deps.py +22 -0
  1284. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-additional-options.py +22 -0
  1285. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-aslr.py +35 -0
  1286. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-base-address.py +62 -0
  1287. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-debug-info.py +26 -0
  1288. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-default-libs.py +22 -0
  1289. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-deffile.py +43 -0
  1290. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-defrelink.py +51 -0
  1291. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-delay-load-dlls.py +35 -0
  1292. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-embed-manifest.py +99 -0
  1293. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-enable-uac.py +95 -0
  1294. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-entrypointsymbol.py +24 -0
  1295. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-fixed-base.py +40 -0
  1296. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-force-symbol-reference.py +26 -0
  1297. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-generate-manifest.py +127 -0
  1298. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-incremental.py +37 -0
  1299. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-large-address-aware.py +35 -0
  1300. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-large-pdb.py +70 -0
  1301. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-library-adjust.py +21 -0
  1302. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-library-directories.py +35 -0
  1303. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-ltcg.py +36 -0
  1304. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-mapfile.py +44 -0
  1305. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-nodefaultlib.py +24 -0
  1306. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-nxcompat.py +37 -0
  1307. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-opt-icf.py +41 -0
  1308. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-opt-ref.py +40 -0
  1309. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-ordering.py +101 -0
  1310. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-outputfile.py +28 -0
  1311. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-pdb-output.py +34 -0
  1312. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-pdb.py +35 -0
  1313. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-pgo.py +75 -0
  1314. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-profile.py +37 -0
  1315. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-restat-importlib.py +39 -0
  1316. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-shard.py +27 -0
  1317. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-subsystem.py +38 -0
  1318. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-target-machine.py +28 -0
  1319. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-tsaware.py +33 -0
  1320. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-uldi.py +28 -0
  1321. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-unsupported-manifest.py +27 -0
  1322. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-update-manifest.py +103 -0
  1323. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-link-warnings-as-errors.py +24 -0
  1324. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-long-command-line.py +23 -0
  1325. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-macro-projectname.py +24 -0
  1326. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-macro-targetname.py +29 -0
  1327. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-macro-vcinstalldir.py +24 -0
  1328. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-macros-containing-gyp.py +21 -0
  1329. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py +27 -0
  1330. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-midl-rules.py +24 -0
  1331. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-quoting-commands.py +25 -0
  1332. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/gyptest-rc-build.py +24 -0
  1333. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/idl-rules/basic-idl.gyp +42 -0
  1334. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/idl-rules/history_indexer.idl +17 -0
  1335. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/idl-rules/history_indexer_user.cc +15 -0
  1336. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/importlib/has-exports.cc +10 -0
  1337. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/importlib/hello.cc +9 -0
  1338. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/importlib/importlib.gyp +30 -0
  1339. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/large-pdb/dllmain.cc +9 -0
  1340. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/large-pdb/large-pdb.gyp +98 -0
  1341. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/large-pdb/main.cc +7 -0
  1342. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/lib-flags/answer.cc +9 -0
  1343. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/lib-flags/answer.h +5 -0
  1344. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/lib-flags/ltcg.gyp +21 -0
  1345. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/a/x.cc +7 -0
  1346. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/a/z.cc +7 -0
  1347. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/additional-deps.cc +10 -0
  1348. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/additional-deps.gyp +30 -0
  1349. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/additional-options.gyp +29 -0
  1350. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/aslr.gyp +35 -0
  1351. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/b/y.cc +7 -0
  1352. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/base-address.gyp +38 -0
  1353. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/debug-info.gyp +28 -0
  1354. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/deffile-multiple.gyp +17 -0
  1355. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/deffile.cc +13 -0
  1356. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/deffile.def +8 -0
  1357. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/deffile.gyp +38 -0
  1358. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/delay-load-dlls.gyp +35 -0
  1359. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/delay-load.cc +10 -0
  1360. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/embed-manifest.gyp +109 -0
  1361. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/enable-uac.gyp +45 -0
  1362. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/entrypointsymbol.cc +13 -0
  1363. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/entrypointsymbol.gyp +28 -0
  1364. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/extra.manifest +11 -0
  1365. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/extra2.manifest +11 -0
  1366. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/fixed-base.gyp +52 -0
  1367. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/force-symbol-reference.gyp +39 -0
  1368. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/generate-manifest.gyp +166 -0
  1369. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/hello.cc +7 -0
  1370. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/incremental.gyp +65 -0
  1371. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/inline_test.cc +12 -0
  1372. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/inline_test.h +5 -0
  1373. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/inline_test_main.cc +15 -0
  1374. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/large-address-aware.gyp +28 -0
  1375. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/library-adjust.cc +10 -0
  1376. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/library-adjust.gyp +16 -0
  1377. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/library-directories-define.cc +7 -0
  1378. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/library-directories-reference.cc +10 -0
  1379. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/library-directories.gyp +42 -0
  1380. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/link-ordering.gyp +95 -0
  1381. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/link-warning.cc +10 -0
  1382. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/ltcg.gyp +42 -0
  1383. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/main-crt.c +8 -0
  1384. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/manifest-in-comment.cc +13 -0
  1385. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/mapfile.cc +12 -0
  1386. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/mapfile.gyp +45 -0
  1387. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/no-default-libs.cc +18 -0
  1388. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/no-default-libs.gyp +13 -0
  1389. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/nodefaultlib.cc +13 -0
  1390. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/nodefaultlib.gyp +30 -0
  1391. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/nxcompat.gyp +35 -0
  1392. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/opt-icf.cc +29 -0
  1393. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/opt-icf.gyp +63 -0
  1394. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/opt-ref.cc +11 -0
  1395. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/opt-ref.gyp +56 -0
  1396. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/outputfile.gyp +58 -0
  1397. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/pdb-output.gyp +36 -0
  1398. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/pgo.gyp +143 -0
  1399. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/profile.gyp +50 -0
  1400. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/program-database.gyp +40 -0
  1401. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/subdir/library.gyp +13 -0
  1402. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/subsystem-windows.cc +9 -0
  1403. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/subsystem.gyp +70 -0
  1404. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/target-machine.gyp +48 -0
  1405. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/tsaware.gyp +28 -0
  1406. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/unsupported-manifest.gyp +13 -0
  1407. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/update_pgd.py +35 -0
  1408. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/warn-as-error.gyp +33 -0
  1409. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/x.cc +7 -0
  1410. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/y.cc +7 -0
  1411. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/linker-flags/z.cc +7 -0
  1412. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/long-command-line/function.cc +7 -0
  1413. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/long-command-line/hello.cc +7 -0
  1414. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/long-command-line/long-command-line.gyp +54 -0
  1415. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/precompiled/gyptest-all.py +21 -0
  1416. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/precompiled/hello.c +14 -0
  1417. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/precompiled/hello.gyp +28 -0
  1418. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/precompiled/hello2.c +13 -0
  1419. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/precompiled/precomp.c +8 -0
  1420. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/Resource.h +26 -0
  1421. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/hello.cpp +30 -0
  1422. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/hello.gyp +92 -0
  1423. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/hello.h +3 -0
  1424. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/hello.ico +0 -0
  1425. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/hello.rc +86 -0
  1426. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/hello3.rc +87 -0
  1427. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/small.ico +0 -0
  1428. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/subdir/hello2.rc +87 -0
  1429. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/subdir/include.h +1 -0
  1430. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/rc-build/targetver.h +24 -0
  1431. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/shard/hello1.cc +7 -0
  1432. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/shard/hello2.cc +7 -0
  1433. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/shard/hello3.cc +7 -0
  1434. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/shard/hello4.cc +7 -0
  1435. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/shard/shard.gyp +20 -0
  1436. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/uldi/a.cc +7 -0
  1437. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/uldi/b.cc +7 -0
  1438. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/uldi/main.cc +10 -0
  1439. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/uldi/uldi.gyp +45 -0
  1440. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/as.py +18 -0
  1441. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/containing-gyp.gyp +40 -0
  1442. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/do_stuff.py +8 -0
  1443. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/hello.cc +7 -0
  1444. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/input-output-macros.gyp +33 -0
  1445. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/input.S +0 -0
  1446. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/projectname.gyp +29 -0
  1447. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/stuff.blah +1 -0
  1448. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/targetname.gyp +52 -0
  1449. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/test_exists.py +10 -0
  1450. data/ext/tree-sitter/tree-sitter/externals/gyp/test/win/vs-macros/vcinstalldir.gyp +41 -0
  1451. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/README +15 -0
  1452. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/Xcode/README +5 -0
  1453. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  1454. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  1455. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/emacs/README +12 -0
  1456. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/emacs/gyp-tests.el +63 -0
  1457. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/emacs/gyp.el +252 -0
  1458. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/emacs/run-unit-tests.sh +7 -0
  1459. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/emacs/testdata/media.gyp +1105 -0
  1460. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  1461. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/graphviz.py +100 -0
  1462. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/pretty_gyp.py +155 -0
  1463. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/pretty_sln.py +168 -0
  1464. data/ext/tree-sitter/tree-sitter/externals/gyp/tools/pretty_vcproj.py +329 -0
  1465. data/ext/tree-sitter/tree-sitter/externals/json-parser/AUTHORS +20 -0
  1466. data/ext/tree-sitter/tree-sitter/externals/json-parser/LICENSE +26 -0
  1467. data/ext/tree-sitter/tree-sitter/externals/json-parser/Makefile.in +68 -0
  1468. data/ext/tree-sitter/tree-sitter/externals/json-parser/README.md +97 -0
  1469. data/ext/tree-sitter/tree-sitter/externals/json-parser/bindings/python/example/test.json +88 -0
  1470. data/ext/tree-sitter/tree-sitter/externals/json-parser/bindings/python/example/test.py +11 -0
  1471. data/ext/tree-sitter/tree-sitter/externals/json-parser/bindings/python/jsonparser.pyx +9 -0
  1472. data/ext/tree-sitter/tree-sitter/externals/json-parser/bindings/python/setup.py +14 -0
  1473. data/ext/tree-sitter/tree-sitter/externals/json-parser/bindings/python/wrap_json.c +95 -0
  1474. data/ext/tree-sitter/tree-sitter/externals/json-parser/configure +3796 -0
  1475. data/ext/tree-sitter/tree-sitter/externals/json-parser/configure.ac +30 -0
  1476. data/ext/tree-sitter/tree-sitter/externals/json-parser/examples/test_json.c +180 -0
  1477. data/ext/tree-sitter/tree-sitter/externals/json-parser/json-parser.pc.in +10 -0
  1478. data/ext/tree-sitter/tree-sitter/externals/json-parser/json.c +1011 -0
  1479. data/ext/tree-sitter/tree-sitter/externals/json-parser/json.h +283 -0
  1480. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/ext-invalid-0001.json +3 -0
  1481. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/ext-invalid-0002.json +1 -0
  1482. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/ext-valid-0001.json +9 -0
  1483. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/ext-valid-0002.json +4 -0
  1484. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/ext-valid-0003.json +3 -0
  1485. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0000.json +0 -0
  1486. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0001.json +2 -0
  1487. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0002.json +2 -0
  1488. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0003.json +88 -0
  1489. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0004.json +2 -0
  1490. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0005.json +2 -0
  1491. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0006.json +3 -0
  1492. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0007.json +1 -0
  1493. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0008.json +1 -0
  1494. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0009.json +1 -0
  1495. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/invalid-0010.json +1 -0
  1496. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/test.py +70 -0
  1497. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0000.json +88 -0
  1498. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0001.json +2 -0
  1499. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0002.json +2 -0
  1500. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0003.json +3 -0
  1501. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0004.json +1 -0
  1502. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0005.json +15 -0
  1503. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0006.json +1 -0
  1504. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0007.json +2 -0
  1505. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0008.json +8 -0
  1506. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0009.json +1 -0
  1507. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0010.json +1 -0
  1508. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0011.json +1 -0
  1509. data/ext/tree-sitter/tree-sitter/externals/json-parser/tests/valid-0012.json +5 -0
  1510. data/ext/tree-sitter/tree-sitter/externals/utf8proc/CMakeLists.txt +31 -0
  1511. data/ext/tree-sitter/tree-sitter/externals/utf8proc/Doxyfile +1528 -0
  1512. data/ext/tree-sitter/tree-sitter/externals/utf8proc/LICENSE.md +93 -0
  1513. data/ext/tree-sitter/tree-sitter/externals/utf8proc/MANIFEST +7 -0
  1514. data/ext/tree-sitter/tree-sitter/externals/utf8proc/Makefile +145 -0
  1515. data/ext/tree-sitter/tree-sitter/externals/utf8proc/NEWS.md +234 -0
  1516. data/ext/tree-sitter/tree-sitter/externals/utf8proc/README.md +67 -0
  1517. data/ext/tree-sitter/tree-sitter/externals/utf8proc/appveyor.yml +42 -0
  1518. data/ext/tree-sitter/tree-sitter/externals/utf8proc/bench/Makefile +39 -0
  1519. data/ext/tree-sitter/tree-sitter/externals/utf8proc/bench/bench.c +56 -0
  1520. data/ext/tree-sitter/tree-sitter/externals/utf8proc/bench/icu.c +61 -0
  1521. data/ext/tree-sitter/tree-sitter/externals/utf8proc/bench/unistring.c +60 -0
  1522. data/ext/tree-sitter/tree-sitter/externals/utf8proc/bench/util.c +39 -0
  1523. data/ext/tree-sitter/tree-sitter/externals/utf8proc/bench/util.h +22 -0
  1524. data/ext/tree-sitter/tree-sitter/externals/utf8proc/data/Makefile +63 -0
  1525. data/ext/tree-sitter/tree-sitter/externals/utf8proc/data/charwidths.jl +190 -0
  1526. data/ext/tree-sitter/tree-sitter/externals/utf8proc/data/data_generator.rb +328 -0
  1527. data/ext/tree-sitter/tree-sitter/externals/utf8proc/lump.md +27 -0
  1528. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/case.c +50 -0
  1529. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/charwidth.c +71 -0
  1530. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/graphemetest.c +74 -0
  1531. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/iterate.c +160 -0
  1532. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/normtest.c +64 -0
  1533. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/printproperty.c +51 -0
  1534. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/tests.c +46 -0
  1535. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/tests.h +23 -0
  1536. data/ext/tree-sitter/tree-sitter/externals/utf8proc/test/valid.c +41 -0
  1537. data/ext/tree-sitter/tree-sitter/externals/utf8proc/utf8proc.c +644 -0
  1538. data/ext/tree-sitter/tree-sitter/externals/utf8proc/utf8proc.h +601 -0
  1539. data/ext/tree-sitter/tree-sitter/externals/utf8proc/utf8proc_data.c +16752 -0
  1540. data/ext/tree-sitter/tree-sitter/externals/utf8proc/utils.cmake +20 -0
  1541. data/ext/tree-sitter/tree-sitter/gyp-mac-tool +511 -0
  1542. data/ext/tree-sitter/tree-sitter/include/tree_sitter/compiler.h +32 -0
  1543. data/ext/tree-sitter/tree-sitter/include/tree_sitter/parser.h +188 -0
  1544. data/ext/tree-sitter/tree-sitter/include/tree_sitter/runtime.h +126 -0
  1545. data/ext/tree-sitter/tree-sitter/out/Release/libcompiler.a +0 -0
  1546. data/ext/tree-sitter/tree-sitter/out/Release/libruntime.a +0 -0
  1547. data/ext/tree-sitter/tree-sitter/out/Release/linker.lock +0 -0
  1548. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/externals/json-parser/json.o +0 -0
  1549. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/externals/utf8proc/utf8proc.o +0 -0
  1550. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/build_lex_table.o +0 -0
  1551. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/build_parse_table.o +0 -0
  1552. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/build_tables.o +0 -0
  1553. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/lex_conflict_manager.o +0 -0
  1554. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/lex_item.o +0 -0
  1555. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/lex_item_transitions.o +0 -0
  1556. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/lookahead_set.o +0 -0
  1557. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/parse_item.o +0 -0
  1558. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/parse_item_set_builder.o +0 -0
  1559. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/recovery_tokens.o +0 -0
  1560. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/build_tables/rule_can_be_blank.o +0 -0
  1561. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/compile.o +0 -0
  1562. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/generate_code/c_code.o +0 -0
  1563. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/lex_table.o +0 -0
  1564. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/parse_grammar.o +0 -0
  1565. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/parse_table.o +0 -0
  1566. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/precedence_range.o +0 -0
  1567. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/expand_repeats.o +0 -0
  1568. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/expand_tokens.o +0 -0
  1569. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/extract_choices.o +0 -0
  1570. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/extract_tokens.o +0 -0
  1571. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/flatten_grammar.o +0 -0
  1572. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/intern_symbols.o +0 -0
  1573. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/is_token.o +0 -0
  1574. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/normalize_rules.o +0 -0
  1575. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/parse_regex.o +0 -0
  1576. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/prepare_grammar.o +0 -0
  1577. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/prepare_grammar/token_description.o +0 -0
  1578. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rule.o +0 -0
  1579. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/blank.o +0 -0
  1580. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/built_in_symbols.o +0 -0
  1581. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/character_range.o +0 -0
  1582. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/character_set.o +0 -0
  1583. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/choice.o +0 -0
  1584. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/metadata.o +0 -0
  1585. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/named_symbol.o +0 -0
  1586. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/pattern.o +0 -0
  1587. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/repeat.o +0 -0
  1588. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/rules.o +0 -0
  1589. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/seq.o +0 -0
  1590. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/string.o +0 -0
  1591. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/symbol.o +0 -0
  1592. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/rules/visitor.o +0 -0
  1593. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/syntax_grammar.o +0 -0
  1594. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/util/string_helpers.o +0 -0
  1595. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/compiler/src/compiler/variable.o +0 -0
  1596. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/externals/utf8proc/utf8proc.o +0 -0
  1597. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/document.o +0 -0
  1598. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/error_costs.o +0 -0
  1599. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/language.o +0 -0
  1600. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/lexer.o +0 -0
  1601. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/node.o +0 -0
  1602. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/parser.o +0 -0
  1603. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/stack.o +0 -0
  1604. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/string_input.o +0 -0
  1605. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/tree.o +0 -0
  1606. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/runtime/src/runtime/utf16.o +0 -0
  1607. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/build_tables/distinctive_tokens_spec.o +0 -0
  1608. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/build_tables/lex_conflict_manager_spec.o +0 -0
  1609. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/build_tables/lex_item_spec.o +0 -0
  1610. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/build_tables/parse_item_set_builder_spec.o +0 -0
  1611. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/build_tables/rule_can_be_blank_spec.o +0 -0
  1612. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/expand_repeats_spec.o +0 -0
  1613. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/expand_tokens_spec.o +0 -0
  1614. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/extract_choices_spec.o +0 -0
  1615. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/extract_tokens_spec.o +0 -0
  1616. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/flatten_grammar_spec.o +0 -0
  1617. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/intern_symbols_spec.o +0 -0
  1618. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/prepare_grammar/parse_regex_spec.o +0 -0
  1619. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/rules/character_set_spec.o +0 -0
  1620. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/rules/choice_spec.o +0 -0
  1621. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/rules/repeat_spec.o +0 -0
  1622. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/compiler/util/string_helpers_spec.o +0 -0
  1623. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/encoding_helpers.o +0 -0
  1624. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/load_language.o +0 -0
  1625. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/point_helpers.o +0 -0
  1626. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/random_helpers.o +0 -0
  1627. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/read_test_entries.o +0 -0
  1628. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/record_alloc.o +0 -0
  1629. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/rule_helpers.o +0 -0
  1630. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/scope_sequence.o +0 -0
  1631. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/spy_input.o +0 -0
  1632. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/spy_logger.o +0 -0
  1633. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/stderr_logger.o +0 -0
  1634. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/stream_methods.o +0 -0
  1635. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/helpers/tree_helpers.o +0 -0
  1636. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/integration/compile_grammar_spec.o +0 -0
  1637. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/integration/corpus_specs.o +0 -0
  1638. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/runtime/document_spec.o +0 -0
  1639. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/runtime/node_spec.o +0 -0
  1640. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/runtime/parser_spec.o +0 -0
  1641. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/runtime/stack_spec.o +0 -0
  1642. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/runtime/tree_spec.o +0 -0
  1643. data/ext/tree-sitter/tree-sitter/out/Release/obj.target/tests/spec/specs.o +0 -0
  1644. data/ext/tree-sitter/tree-sitter/out/Release/tests +0 -0
  1645. data/ext/tree-sitter/tree-sitter/project.Makefile +6 -0
  1646. data/ext/tree-sitter/tree-sitter/project.gyp +175 -0
  1647. data/ext/tree-sitter/tree-sitter/runtime.target.mk +174 -0
  1648. data/ext/tree-sitter/tree-sitter/script/check-mallocs +20 -0
  1649. data/ext/tree-sitter/tree-sitter/script/ci +7 -0
  1650. data/ext/tree-sitter/tree-sitter/script/clean +7 -0
  1651. data/ext/tree-sitter/tree-sitter/script/configure +7 -0
  1652. data/ext/tree-sitter/tree-sitter/script/fetch-fixtures +28 -0
  1653. data/ext/tree-sitter/tree-sitter/script/format +7 -0
  1654. data/ext/tree-sitter/tree-sitter/script/lint +14 -0
  1655. data/ext/tree-sitter/tree-sitter/script/test +122 -0
  1656. data/ext/tree-sitter/tree-sitter/script/trim-whitespace +3 -0
  1657. data/ext/tree-sitter/tree-sitter/script/util/valgrind.supp +256 -0
  1658. data/ext/tree-sitter/tree-sitter/spec/compiler/build_tables/distinctive_tokens_spec.cc +34 -0
  1659. data/ext/tree-sitter/tree-sitter/spec/compiler/build_tables/lex_conflict_manager_spec.cc +88 -0
  1660. data/ext/tree-sitter/tree-sitter/spec/compiler/build_tables/lex_item_spec.cc +517 -0
  1661. data/ext/tree-sitter/tree-sitter/spec/compiler/build_tables/parse_item_set_builder_spec.cc +133 -0
  1662. data/ext/tree-sitter/tree-sitter/spec/compiler/build_tables/rule_can_be_blank_spec.cc +60 -0
  1663. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/expand_repeats_spec.cc +152 -0
  1664. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/expand_tokens_spec.cc +109 -0
  1665. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/extract_choices_spec.cc +106 -0
  1666. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/extract_tokens_spec.cc +251 -0
  1667. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/flatten_grammar_spec.cc +89 -0
  1668. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/intern_symbols_spec.cc +89 -0
  1669. data/ext/tree-sitter/tree-sitter/spec/compiler/prepare_grammar/parse_regex_spec.cc +245 -0
  1670. data/ext/tree-sitter/tree-sitter/spec/compiler/rules/character_set_spec.cc +337 -0
  1671. data/ext/tree-sitter/tree-sitter/spec/compiler/rules/choice_spec.cc +53 -0
  1672. data/ext/tree-sitter/tree-sitter/spec/compiler/rules/repeat_spec.cc +22 -0
  1673. data/ext/tree-sitter/tree-sitter/spec/compiler/util/string_helpers_spec.cc +26 -0
  1674. data/ext/tree-sitter/tree-sitter/spec/fixtures/error_corpus/c_errors.txt +130 -0
  1675. data/ext/tree-sitter/tree-sitter/spec/fixtures/error_corpus/javascript_errors.txt +157 -0
  1676. data/ext/tree-sitter/tree-sitter/spec/fixtures/error_corpus/json_errors.txt +56 -0
  1677. data/ext/tree-sitter/tree-sitter/spec/fixtures/error_corpus/python_errors.txt +29 -0
  1678. data/ext/tree-sitter/tree-sitter/spec/fixtures/external_scanners/extra_external_tokens.c +42 -0
  1679. data/ext/tree-sitter/tree-sitter/spec/fixtures/external_scanners/percent_strings.c +118 -0
  1680. data/ext/tree-sitter/tree-sitter/spec/fixtures/external_scanners/shared_external_tokens.c +63 -0
  1681. data/ext/tree-sitter/tree-sitter/spec/helpers/dedent.h +12 -0
  1682. data/ext/tree-sitter/tree-sitter/spec/helpers/encoding_helpers.cc +58 -0
  1683. data/ext/tree-sitter/tree-sitter/spec/helpers/encoding_helpers.h +15 -0
  1684. data/ext/tree-sitter/tree-sitter/spec/helpers/equals_pointer.h +37 -0
  1685. data/ext/tree-sitter/tree-sitter/spec/helpers/load_language.cc +206 -0
  1686. data/ext/tree-sitter/tree-sitter/spec/helpers/load_language.h +12 -0
  1687. data/ext/tree-sitter/tree-sitter/spec/helpers/point_helpers.cc +45 -0
  1688. data/ext/tree-sitter/tree-sitter/spec/helpers/point_helpers.h +23 -0
  1689. data/ext/tree-sitter/tree-sitter/spec/helpers/random_helpers.cc +35 -0
  1690. data/ext/tree-sitter/tree-sitter/spec/helpers/random_helpers.h +8 -0
  1691. data/ext/tree-sitter/tree-sitter/spec/helpers/read_test_entries.cc +105 -0
  1692. data/ext/tree-sitter/tree-sitter/spec/helpers/read_test_entries.h +15 -0
  1693. data/ext/tree-sitter/tree-sitter/spec/helpers/record_alloc.cc +84 -0
  1694. data/ext/tree-sitter/tree-sitter/spec/helpers/record_alloc.h +16 -0
  1695. data/ext/tree-sitter/tree-sitter/spec/helpers/rule_helpers.cc +55 -0
  1696. data/ext/tree-sitter/tree-sitter/spec/helpers/rule_helpers.h +21 -0
  1697. data/ext/tree-sitter/tree-sitter/spec/helpers/scope_sequence.cc +106 -0
  1698. data/ext/tree-sitter/tree-sitter/spec/helpers/scope_sequence.h +16 -0
  1699. data/ext/tree-sitter/tree-sitter/spec/helpers/spy_input.cc +133 -0
  1700. data/ext/tree-sitter/tree-sitter/spec/helpers/spy_input.h +39 -0
  1701. data/ext/tree-sitter/tree-sitter/spec/helpers/spy_logger.cc +22 -0
  1702. data/ext/tree-sitter/tree-sitter/spec/helpers/spy_logger.h +15 -0
  1703. data/ext/tree-sitter/tree-sitter/spec/helpers/stderr_logger.cc +22 -0
  1704. data/ext/tree-sitter/tree-sitter/spec/helpers/stderr_logger.h +8 -0
  1705. data/ext/tree-sitter/tree-sitter/spec/helpers/stream_methods.cc +140 -0
  1706. data/ext/tree-sitter/tree-sitter/spec/helpers/stream_methods.h +136 -0
  1707. data/ext/tree-sitter/tree-sitter/spec/helpers/tree_helpers.cc +50 -0
  1708. data/ext/tree-sitter/tree-sitter/spec/helpers/tree_helpers.h +16 -0
  1709. data/ext/tree-sitter/tree-sitter/spec/integration/compile_grammar_spec.cc +847 -0
  1710. data/ext/tree-sitter/tree-sitter/spec/integration/corpus_specs.cc +185 -0
  1711. data/ext/tree-sitter/tree-sitter/spec/runtime/document_spec.cc +372 -0
  1712. data/ext/tree-sitter/tree-sitter/spec/runtime/node_spec.cc +436 -0
  1713. data/ext/tree-sitter/tree-sitter/spec/runtime/parser_spec.cc +479 -0
  1714. data/ext/tree-sitter/tree-sitter/spec/runtime/stack_spec.cc +571 -0
  1715. data/ext/tree-sitter/tree-sitter/spec/runtime/tree_spec.cc +439 -0
  1716. data/ext/tree-sitter/tree-sitter/spec/spec_helper.h +19 -0
  1717. data/ext/tree-sitter/tree-sitter/spec/specs.cc +16 -0
  1718. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/build_lex_table.cc +195 -0
  1719. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/build_lex_table.h +18 -0
  1720. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/build_parse_table.cc +604 -0
  1721. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/build_parse_table.h +22 -0
  1722. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/build_tables.cc +27 -0
  1723. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/build_tables.h +24 -0
  1724. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/conflict_type.h +16 -0
  1725. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lex_conflict_manager.cc +55 -0
  1726. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lex_conflict_manager.h +31 -0
  1727. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lex_item.cc +118 -0
  1728. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lex_item.h +82 -0
  1729. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lex_item_transitions.cc +188 -0
  1730. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lex_item_transitions.h +17 -0
  1731. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lookahead_set.cc +47 -0
  1732. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/lookahead_set.h +28 -0
  1733. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/parse_item.cc +148 -0
  1734. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/parse_item.h +65 -0
  1735. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/parse_item_set_builder.cc +167 -0
  1736. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/parse_item_set_builder.h +35 -0
  1737. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/recovery_tokens.cc +89 -0
  1738. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/recovery_tokens.h +19 -0
  1739. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/remove_duplicate_states.h +65 -0
  1740. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/rule_can_be_blank.cc +44 -0
  1741. data/ext/tree-sitter/tree-sitter/src/compiler/build_tables/rule_can_be_blank.h +14 -0
  1742. data/ext/tree-sitter/tree-sitter/src/compiler/compile.cc +72 -0
  1743. data/ext/tree-sitter/tree-sitter/src/compiler/compile.h +16 -0
  1744. data/ext/tree-sitter/tree-sitter/src/compiler/compile_error.h +28 -0
  1745. data/ext/tree-sitter/tree-sitter/src/compiler/generate_code/c_code.cc +691 -0
  1746. data/ext/tree-sitter/tree-sitter/src/compiler/generate_code/c_code.h +21 -0
  1747. data/ext/tree-sitter/tree-sitter/src/compiler/grammar.h +20 -0
  1748. data/ext/tree-sitter/tree-sitter/src/compiler/lex_table.cc +78 -0
  1749. data/ext/tree-sitter/tree-sitter/src/compiler/lex_table.h +75 -0
  1750. data/ext/tree-sitter/tree-sitter/src/compiler/lexical_grammar.h +19 -0
  1751. data/ext/tree-sitter/tree-sitter/src/compiler/parse_grammar.cc +335 -0
  1752. data/ext/tree-sitter/tree-sitter/src/compiler/parse_grammar.h +20 -0
  1753. data/ext/tree-sitter/tree-sitter/src/compiler/parse_table.cc +258 -0
  1754. data/ext/tree-sitter/tree-sitter/src/compiler/parse_table.h +106 -0
  1755. data/ext/tree-sitter/tree-sitter/src/compiler/precedence_range.cc +45 -0
  1756. data/ext/tree-sitter/tree-sitter/src/compiler/precedence_range.h +23 -0
  1757. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/expand_repeats.cc +80 -0
  1758. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/expand_repeats.h +16 -0
  1759. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/expand_tokens.cc +88 -0
  1760. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/expand_tokens.h +18 -0
  1761. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/extract_choices.cc +55 -0
  1762. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/extract_choices.h +15 -0
  1763. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/extract_tokens.cc +213 -0
  1764. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/extract_tokens.h +19 -0
  1765. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/flatten_grammar.cc +124 -0
  1766. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/flatten_grammar.h +20 -0
  1767. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/initial_syntax_grammar.h +24 -0
  1768. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/intern_symbols.cc +110 -0
  1769. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/intern_symbols.h +20 -0
  1770. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/interned_grammar.h +24 -0
  1771. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/is_token.cc +30 -0
  1772. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/is_token.h +14 -0
  1773. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/normalize_rules.cc +19 -0
  1774. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/normalize_rules.h +14 -0
  1775. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/parse_regex.cc +252 -0
  1776. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/parse_regex.h +17 -0
  1777. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/prepare_grammar.cc +69 -0
  1778. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/prepare_grammar.h +21 -0
  1779. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/token_description.cc +69 -0
  1780. data/ext/tree-sitter/tree-sitter/src/compiler/prepare_grammar/token_description.h +15 -0
  1781. data/ext/tree-sitter/tree-sitter/src/compiler/rule.cc +15 -0
  1782. data/ext/tree-sitter/tree-sitter/src/compiler/rule.h +45 -0
  1783. data/ext/tree-sitter/tree-sitter/src/compiler/rules.h +28 -0
  1784. data/ext/tree-sitter/tree-sitter/src/compiler/rules/blank.cc +36 -0
  1785. data/ext/tree-sitter/tree-sitter/src/compiler/rules/blank.h +25 -0
  1786. data/ext/tree-sitter/tree-sitter/src/compiler/rules/built_in_symbols.cc +19 -0
  1787. data/ext/tree-sitter/tree-sitter/src/compiler/rules/built_in_symbols.h +16 -0
  1788. data/ext/tree-sitter/tree-sitter/src/compiler/rules/character_range.cc +36 -0
  1789. data/ext/tree-sitter/tree-sitter/src/compiler/rules/character_range.h +25 -0
  1790. data/ext/tree-sitter/tree-sitter/src/compiler/rules/character_set.cc +220 -0
  1791. data/ext/tree-sitter/tree-sitter/src/compiler/rules/character_set.h +59 -0
  1792. data/ext/tree-sitter/tree-sitter/src/compiler/rules/choice.cc +78 -0
  1793. data/ext/tree-sitter/tree-sitter/src/compiler/rules/choice.h +28 -0
  1794. data/ext/tree-sitter/tree-sitter/src/compiler/rules/metadata.cc +98 -0
  1795. data/ext/tree-sitter/tree-sitter/src/compiler/rules/metadata.h +51 -0
  1796. data/ext/tree-sitter/tree-sitter/src/compiler/rules/named_symbol.cc +35 -0
  1797. data/ext/tree-sitter/tree-sitter/src/compiler/rules/named_symbol.h +26 -0
  1798. data/ext/tree-sitter/tree-sitter/src/compiler/rules/pattern.cc +36 -0
  1799. data/ext/tree-sitter/tree-sitter/src/compiler/rules/pattern.h +26 -0
  1800. data/ext/tree-sitter/tree-sitter/src/compiler/rules/repeat.cc +44 -0
  1801. data/ext/tree-sitter/tree-sitter/src/compiler/rules/repeat.h +27 -0
  1802. data/ext/tree-sitter/tree-sitter/src/compiler/rules/rules.cc +108 -0
  1803. data/ext/tree-sitter/tree-sitter/src/compiler/rules/seq.cc +57 -0
  1804. data/ext/tree-sitter/tree-sitter/src/compiler/rules/seq.h +29 -0
  1805. data/ext/tree-sitter/tree-sitter/src/compiler/rules/string.cc +35 -0
  1806. data/ext/tree-sitter/tree-sitter/src/compiler/rules/string.h +26 -0
  1807. data/ext/tree-sitter/tree-sitter/src/compiler/rules/symbol.cc +82 -0
  1808. data/ext/tree-sitter/tree-sitter/src/compiler/rules/symbol.h +55 -0
  1809. data/ext/tree-sitter/tree-sitter/src/compiler/rules/visitor.cc +44 -0
  1810. data/ext/tree-sitter/tree-sitter/src/compiler/rules/visitor.h +234 -0
  1811. data/ext/tree-sitter/tree-sitter/src/compiler/syntax_grammar.cc +34 -0
  1812. data/ext/tree-sitter/tree-sitter/src/compiler/syntax_grammar.h +52 -0
  1813. data/ext/tree-sitter/tree-sitter/src/compiler/util/hash_combine.h +24 -0
  1814. data/ext/tree-sitter/tree-sitter/src/compiler/util/string_helpers.cc +54 -0
  1815. data/ext/tree-sitter/tree-sitter/src/compiler/util/string_helpers.h +19 -0
  1816. data/ext/tree-sitter/tree-sitter/src/compiler/variable.cc +11 -0
  1817. data/ext/tree-sitter/tree-sitter/src/compiler/variable.h +27 -0
  1818. data/ext/tree-sitter/tree-sitter/src/runtime/alloc.h +85 -0
  1819. data/ext/tree-sitter/tree-sitter/src/runtime/array.h +137 -0
  1820. data/ext/tree-sitter/tree-sitter/src/runtime/document.c +152 -0
  1821. data/ext/tree-sitter/tree-sitter/src/runtime/document.h +17 -0
  1822. data/ext/tree-sitter/tree-sitter/src/runtime/error_costs.c +28 -0
  1823. data/ext/tree-sitter/tree-sitter/src/runtime/error_costs.h +25 -0
  1824. data/ext/tree-sitter/tree-sitter/src/runtime/language.c +56 -0
  1825. data/ext/tree-sitter/tree-sitter/src/runtime/language.h +70 -0
  1826. data/ext/tree-sitter/tree-sitter/src/runtime/length.h +59 -0
  1827. data/ext/tree-sitter/tree-sitter/src/runtime/lexer.c +131 -0
  1828. data/ext/tree-sitter/tree-sitter/src/runtime/lexer.h +40 -0
  1829. data/ext/tree-sitter/tree-sitter/src/runtime/node.c +393 -0
  1830. data/ext/tree-sitter/tree-sitter/src/runtime/node.h +8 -0
  1831. data/ext/tree-sitter/tree-sitter/src/runtime/parser.c +1227 -0
  1832. data/ext/tree-sitter/tree-sitter/src/runtime/parser.h +41 -0
  1833. data/ext/tree-sitter/tree-sitter/src/runtime/point.h +46 -0
  1834. data/ext/tree-sitter/tree-sitter/src/runtime/reduce_action.h +32 -0
  1835. data/ext/tree-sitter/tree-sitter/src/runtime/reusable_node.h +50 -0
  1836. data/ext/tree-sitter/tree-sitter/src/runtime/stack.c +658 -0
  1837. data/ext/tree-sitter/tree-sitter/src/runtime/stack.h +130 -0
  1838. data/ext/tree-sitter/tree-sitter/src/runtime/string_input.c +50 -0
  1839. data/ext/tree-sitter/tree-sitter/src/runtime/string_input.h +17 -0
  1840. data/ext/tree-sitter/tree-sitter/src/runtime/tree.c +551 -0
  1841. data/ext/tree-sitter/tree-sitter/src/runtime/tree.h +117 -0
  1842. data/ext/tree-sitter/tree-sitter/src/runtime/tree_path.h +217 -0
  1843. data/ext/tree-sitter/tree-sitter/src/runtime/utf16.c +24 -0
  1844. data/ext/tree-sitter/tree-sitter/src/runtime/utf16.h +20 -0
  1845. data/ext/tree-sitter/tree-sitter/tests.Makefile +6 -0
  1846. data/ext/tree-sitter/tree-sitter/tests.gyp +58 -0
  1847. data/ext/tree-sitter/tree-sitter/tests.target.mk +176 -0
  1848. data/lib/tree-sitter.rb +11 -0
  1849. data/lib/tree-sitter/version.rb +3 -0
  1850. data/test/test_helper.rb +9 -0
  1851. data/test/tree-sitter/fixtures/arithmetic/grammar.json +67 -0
  1852. data/test/tree-sitter/fixtures/ruby/grammar.json +4803 -0
  1853. data/test/tree-sitter/test_basic.rb +7 -0
  1854. data/test/tree-sitter/test_document.rb +7 -0
  1855. data/test/tree-sitter/test_grammar.rb +34 -0
  1856. data/tree-sitter.gemspec +33 -0
  1857. metadata +2018 -0
@@ -0,0 +1,3342 @@
1
+ # Copyright (c) 2012 Google Inc. All rights reserved.
2
+ # Use of this source code is governed by a BSD-style license that can be
3
+ # found in the LICENSE file.
4
+
5
+ import collections
6
+ import copy
7
+ import ntpath
8
+ import os
9
+ import posixpath
10
+ import re
11
+ import subprocess
12
+ import sys
13
+
14
+ import gyp.common
15
+ import gyp.easy_xml as easy_xml
16
+ import gyp.MSVSNew as MSVSNew
17
+ import gyp.MSVSProject as MSVSProject
18
+ import gyp.MSVSSettings as MSVSSettings
19
+ import gyp.MSVSToolFile as MSVSToolFile
20
+ import gyp.MSVSUserFile as MSVSUserFile
21
+ import gyp.MSVSUtil as MSVSUtil
22
+ import gyp.MSVSVersion as MSVSVersion
23
+ from gyp.common import GypError
24
+
25
+ # TODO: Remove once bots are on 2.7, http://crbug.com/241769
26
+ def _import_OrderedDict():
27
+ import collections
28
+ try:
29
+ return collections.OrderedDict
30
+ except AttributeError:
31
+ import gyp.ordered_dict
32
+ return gyp.ordered_dict.OrderedDict
33
+ OrderedDict = _import_OrderedDict()
34
+
35
+
36
+ # Regular expression for validating Visual Studio GUIDs. If the GUID
37
+ # contains lowercase hex letters, MSVS will be fine. However,
38
+ # IncrediBuild BuildConsole will parse the solution file, but then
39
+ # silently skip building the target causing hard to track down errors.
40
+ # Note that this only happens with the BuildConsole, and does not occur
41
+ # if IncrediBuild is executed from inside Visual Studio. This regex
42
+ # validates that the string looks like a GUID with all uppercase hex
43
+ # letters.
44
+ VALID_MSVS_GUID_CHARS = re.compile('^[A-F0-9\-]+$')
45
+
46
+
47
+ generator_default_variables = {
48
+ 'EXECUTABLE_PREFIX': '',
49
+ 'EXECUTABLE_SUFFIX': '.exe',
50
+ 'STATIC_LIB_PREFIX': '',
51
+ 'SHARED_LIB_PREFIX': '',
52
+ 'STATIC_LIB_SUFFIX': '.lib',
53
+ 'SHARED_LIB_SUFFIX': '.dll',
54
+ 'INTERMEDIATE_DIR': '$(IntDir)',
55
+ 'SHARED_INTERMEDIATE_DIR': '$(OutDir)obj/global_intermediate',
56
+ 'OS': 'win',
57
+ 'PRODUCT_DIR': '$(OutDir)',
58
+ 'LIB_DIR': '$(OutDir)lib',
59
+ 'RULE_INPUT_ROOT': '$(InputName)',
60
+ 'RULE_INPUT_DIRNAME': '$(InputDir)',
61
+ 'RULE_INPUT_EXT': '$(InputExt)',
62
+ 'RULE_INPUT_NAME': '$(InputFileName)',
63
+ 'RULE_INPUT_PATH': '$(InputPath)',
64
+ 'CONFIGURATION_NAME': '$(ConfigurationName)',
65
+ }
66
+
67
+
68
+ # The msvs specific sections that hold paths
69
+ generator_additional_path_sections = [
70
+ 'msvs_cygwin_dirs',
71
+ 'msvs_props',
72
+ ]
73
+
74
+
75
+ generator_additional_non_configuration_keys = [
76
+ 'msvs_cygwin_dirs',
77
+ 'msvs_cygwin_shell',
78
+ 'msvs_large_pdb',
79
+ 'msvs_shard',
80
+ 'msvs_external_builder',
81
+ 'msvs_external_builder_out_dir',
82
+ 'msvs_external_builder_build_cmd',
83
+ 'msvs_external_builder_clean_cmd',
84
+ ]
85
+
86
+
87
+ # List of precompiled header related keys.
88
+ precomp_keys = [
89
+ 'msvs_precompiled_header',
90
+ 'msvs_precompiled_source',
91
+ ]
92
+
93
+
94
+ cached_username = None
95
+
96
+
97
+ cached_domain = None
98
+
99
+
100
+ # Based on http://code.activestate.com/recipes/576694/.
101
+ class OrderedSet(collections.MutableSet):
102
+ def __init__(self, iterable=None):
103
+ self.end = end = []
104
+ end += [None, end, end] # sentinel node for doubly linked list
105
+ self.map = {} # key --> [key, prev, next]
106
+ if iterable is not None:
107
+ self |= iterable
108
+
109
+ def __len__(self):
110
+ return len(self.map)
111
+
112
+ def discard(self, key):
113
+ if key in self.map:
114
+ key, prev, next = self.map.pop(key)
115
+ prev[2] = next
116
+ next[1] = prev
117
+
118
+ def __contains__(self, key):
119
+ return key in self.map
120
+
121
+ def add(self, key):
122
+ if key not in self.map:
123
+ end = self.end
124
+ curr = end[1]
125
+ curr[2] = end[1] = self.map[key] = [key, curr, end]
126
+
127
+ def update(self, iterable):
128
+ for i in iterable:
129
+ if i not in self:
130
+ self.add(i)
131
+
132
+ def __iter__(self):
133
+ end = self.end
134
+ curr = end[2]
135
+ while curr is not end:
136
+ yield curr[0]
137
+ curr = curr[2]
138
+
139
+
140
+ # TODO(gspencer): Switch the os.environ calls to be
141
+ # win32api.GetDomainName() and win32api.GetUserName() once the
142
+ # python version in depot_tools has been updated to work on Vista
143
+ # 64-bit.
144
+ def _GetDomainAndUserName():
145
+ if sys.platform not in ('win32', 'cygwin'):
146
+ return ('DOMAIN', 'USERNAME')
147
+ global cached_username
148
+ global cached_domain
149
+ if not cached_domain or not cached_username:
150
+ domain = os.environ.get('USERDOMAIN')
151
+ username = os.environ.get('USERNAME')
152
+ if not domain or not username:
153
+ call = subprocess.Popen(['net', 'config', 'Workstation'],
154
+ stdout=subprocess.PIPE)
155
+ config = call.communicate()[0]
156
+ username_re = re.compile('^User name\s+(\S+)', re.MULTILINE)
157
+ username_match = username_re.search(config)
158
+ if username_match:
159
+ username = username_match.group(1)
160
+ domain_re = re.compile('^Logon domain\s+(\S+)', re.MULTILINE)
161
+ domain_match = domain_re.search(config)
162
+ if domain_match:
163
+ domain = domain_match.group(1)
164
+ cached_domain = domain
165
+ cached_username = username
166
+ return (cached_domain, cached_username)
167
+
168
+ fixpath_prefix = None
169
+
170
+
171
+ def _NormalizedSource(source):
172
+ """Normalize the path.
173
+
174
+ But not if that gets rid of a variable, as this may expand to something
175
+ larger than one directory.
176
+
177
+ Arguments:
178
+ source: The path to be normalize.d
179
+
180
+ Returns:
181
+ The normalized path.
182
+ """
183
+ normalized = os.path.normpath(source)
184
+ if source.count('$') == normalized.count('$'):
185
+ source = normalized
186
+ return source
187
+
188
+
189
+ def _FixPath(path):
190
+ """Convert paths to a form that will make sense in a vcproj file.
191
+
192
+ Arguments:
193
+ path: The path to convert, may contain / etc.
194
+ Returns:
195
+ The path with all slashes made into backslashes.
196
+ """
197
+ if fixpath_prefix and path and not os.path.isabs(path) and not path[0] == '$':
198
+ path = os.path.join(fixpath_prefix, path)
199
+ path = path.replace('/', '\\')
200
+ path = _NormalizedSource(path)
201
+ if path and path[-1] == '\\':
202
+ path = path[:-1]
203
+ return path
204
+
205
+
206
+ def _FixPaths(paths):
207
+ """Fix each of the paths of the list."""
208
+ return [_FixPath(i) for i in paths]
209
+
210
+
211
+ def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
212
+ list_excluded=True, msvs_version=None):
213
+ """Converts a list split source file paths into a vcproj folder hierarchy.
214
+
215
+ Arguments:
216
+ sources: A list of source file paths split.
217
+ prefix: A list of source file path layers meant to apply to each of sources.
218
+ excluded: A set of excluded files.
219
+ msvs_version: A MSVSVersion object.
220
+
221
+ Returns:
222
+ A hierarchy of filenames and MSVSProject.Filter objects that matches the
223
+ layout of the source tree.
224
+ For example:
225
+ _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']],
226
+ prefix=['joe'])
227
+ -->
228
+ [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']),
229
+ MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])]
230
+ """
231
+ if not prefix: prefix = []
232
+ result = []
233
+ excluded_result = []
234
+ folders = OrderedDict()
235
+ # Gather files into the final result, excluded, or folders.
236
+ for s in sources:
237
+ if len(s) == 1:
238
+ filename = _NormalizedSource('\\'.join(prefix + s))
239
+ if filename in excluded:
240
+ excluded_result.append(filename)
241
+ else:
242
+ result.append(filename)
243
+ elif msvs_version and not msvs_version.UsesVcxproj():
244
+ # For MSVS 2008 and earlier, we need to process all files before walking
245
+ # the sub folders.
246
+ if not folders.get(s[0]):
247
+ folders[s[0]] = []
248
+ folders[s[0]].append(s[1:])
249
+ else:
250
+ contents = _ConvertSourcesToFilterHierarchy([s[1:]], prefix + [s[0]],
251
+ excluded=excluded,
252
+ list_excluded=list_excluded,
253
+ msvs_version=msvs_version)
254
+ contents = MSVSProject.Filter(s[0], contents=contents)
255
+ result.append(contents)
256
+ # Add a folder for excluded files.
257
+ if excluded_result and list_excluded:
258
+ excluded_folder = MSVSProject.Filter('_excluded_files',
259
+ contents=excluded_result)
260
+ result.append(excluded_folder)
261
+
262
+ if msvs_version and msvs_version.UsesVcxproj():
263
+ return result
264
+
265
+ # Populate all the folders.
266
+ for f in folders:
267
+ contents = _ConvertSourcesToFilterHierarchy(folders[f], prefix=prefix + [f],
268
+ excluded=excluded,
269
+ list_excluded=list_excluded,
270
+ msvs_version=msvs_version)
271
+ contents = MSVSProject.Filter(f, contents=contents)
272
+ result.append(contents)
273
+ return result
274
+
275
+
276
+ def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False):
277
+ if not value: return
278
+ _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset)
279
+
280
+
281
+ def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False):
282
+ # TODO(bradnelson): ugly hack, fix this more generally!!!
283
+ if 'Directories' in setting or 'Dependencies' in setting:
284
+ if type(value) == str:
285
+ value = value.replace('/', '\\')
286
+ else:
287
+ value = [i.replace('/', '\\') for i in value]
288
+ if not tools.get(tool_name):
289
+ tools[tool_name] = dict()
290
+ tool = tools[tool_name]
291
+ if tool.get(setting):
292
+ if only_if_unset: return
293
+ if type(tool[setting]) == list and type(value) == list:
294
+ tool[setting] += value
295
+ else:
296
+ raise TypeError(
297
+ 'Appending "%s" to a non-list setting "%s" for tool "%s" is '
298
+ 'not allowed, previous value: %s' % (
299
+ value, setting, tool_name, str(tool[setting])))
300
+ else:
301
+ tool[setting] = value
302
+
303
+
304
+ def _ConfigPlatform(config_data):
305
+ return config_data.get('msvs_configuration_platform', 'Win32')
306
+
307
+
308
+ def _ConfigBaseName(config_name, platform_name):
309
+ if config_name.endswith('_' + platform_name):
310
+ return config_name[0:-len(platform_name) - 1]
311
+ else:
312
+ return config_name
313
+
314
+
315
+ def _ConfigFullName(config_name, config_data):
316
+ platform_name = _ConfigPlatform(config_data)
317
+ return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name)
318
+
319
+
320
+ def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
321
+ quote_cmd, do_setup_env):
322
+
323
+ if [x for x in cmd if '$(InputDir)' in x]:
324
+ input_dir_preamble = (
325
+ 'set INPUTDIR=$(InputDir)\n'
326
+ 'set INPUTDIR=%INPUTDIR:$(ProjectDir)=%\n'
327
+ 'set INPUTDIR=%INPUTDIR:~0,-1%\n'
328
+ )
329
+ else:
330
+ input_dir_preamble = ''
331
+
332
+ if cygwin_shell:
333
+ # Find path to cygwin.
334
+ cygwin_dir = _FixPath(spec.get('msvs_cygwin_dirs', ['.'])[0])
335
+ # Prepare command.
336
+ direct_cmd = cmd
337
+ direct_cmd = [i.replace('$(IntDir)',
338
+ '`cygpath -m "${INTDIR}"`') for i in direct_cmd]
339
+ direct_cmd = [i.replace('$(OutDir)',
340
+ '`cygpath -m "${OUTDIR}"`') for i in direct_cmd]
341
+ direct_cmd = [i.replace('$(InputDir)',
342
+ '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd]
343
+ if has_input_path:
344
+ direct_cmd = [i.replace('$(InputPath)',
345
+ '`cygpath -m "${INPUTPATH}"`')
346
+ for i in direct_cmd]
347
+ direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd]
348
+ # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd)
349
+ direct_cmd = ' '.join(direct_cmd)
350
+ # TODO(quote): regularize quoting path names throughout the module
351
+ cmd = ''
352
+ if do_setup_env:
353
+ cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && '
354
+ cmd += 'set CYGWIN=nontsec&& '
355
+ if direct_cmd.find('NUMBER_OF_PROCESSORS') >= 0:
356
+ cmd += 'set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& '
357
+ if direct_cmd.find('INTDIR') >= 0:
358
+ cmd += 'set INTDIR=$(IntDir)&& '
359
+ if direct_cmd.find('OUTDIR') >= 0:
360
+ cmd += 'set OUTDIR=$(OutDir)&& '
361
+ if has_input_path and direct_cmd.find('INPUTPATH') >= 0:
362
+ cmd += 'set INPUTPATH=$(InputPath) && '
363
+ cmd += 'bash -c "%(cmd)s"'
364
+ cmd = cmd % {'cygwin_dir': cygwin_dir,
365
+ 'cmd': direct_cmd}
366
+ return input_dir_preamble + cmd
367
+ else:
368
+ # Convert cat --> type to mimic unix.
369
+ if cmd[0] == 'cat':
370
+ command = ['type']
371
+ else:
372
+ command = [cmd[0].replace('/', '\\')]
373
+ # Add call before command to ensure that commands can be tied together one
374
+ # after the other without aborting in Incredibuild, since IB makes a bat
375
+ # file out of the raw command string, and some commands (like python) are
376
+ # actually batch files themselves.
377
+ command.insert(0, 'call')
378
+ # Fix the paths
379
+ # TODO(quote): This is a really ugly heuristic, and will miss path fixing
380
+ # for arguments like "--arg=path" or "/opt:path".
381
+ # If the argument starts with a slash or dash, it's probably a command line
382
+ # switch
383
+ arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]]
384
+ arguments = [i.replace('$(InputDir)', '%INPUTDIR%') for i in arguments]
385
+ arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
386
+ if quote_cmd:
387
+ # Support a mode for using cmd directly.
388
+ # Convert any paths to native form (first element is used directly).
389
+ # TODO(quote): regularize quoting path names throughout the module
390
+ arguments = ['"%s"' % i for i in arguments]
391
+ # Collapse into a single command.
392
+ return input_dir_preamble + ' '.join(command + arguments)
393
+
394
+
395
+ def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env):
396
+ # Currently this weird argument munging is used to duplicate the way a
397
+ # python script would need to be run as part of the chrome tree.
398
+ # Eventually we should add some sort of rule_default option to set this
399
+ # per project. For now the behavior chrome needs is the default.
400
+ mcs = rule.get('msvs_cygwin_shell')
401
+ if mcs is None:
402
+ mcs = int(spec.get('msvs_cygwin_shell', 1))
403
+ elif isinstance(mcs, str):
404
+ mcs = int(mcs)
405
+ quote_cmd = int(rule.get('msvs_quote_cmd', 1))
406
+ return _BuildCommandLineForRuleRaw(spec, rule['action'], mcs, has_input_path,
407
+ quote_cmd, do_setup_env=do_setup_env)
408
+
409
+
410
+ def _AddActionStep(actions_dict, inputs, outputs, description, command):
411
+ """Merge action into an existing list of actions.
412
+
413
+ Care must be taken so that actions which have overlapping inputs either don't
414
+ get assigned to the same input, or get collapsed into one.
415
+
416
+ Arguments:
417
+ actions_dict: dictionary keyed on input name, which maps to a list of
418
+ dicts describing the actions attached to that input file.
419
+ inputs: list of inputs
420
+ outputs: list of outputs
421
+ description: description of the action
422
+ command: command line to execute
423
+ """
424
+ # Require there to be at least one input (call sites will ensure this).
425
+ assert inputs
426
+
427
+ action = {
428
+ 'inputs': inputs,
429
+ 'outputs': outputs,
430
+ 'description': description,
431
+ 'command': command,
432
+ }
433
+
434
+ # Pick where to stick this action.
435
+ # While less than optimal in terms of build time, attach them to the first
436
+ # input for now.
437
+ chosen_input = inputs[0]
438
+
439
+ # Add it there.
440
+ if chosen_input not in actions_dict:
441
+ actions_dict[chosen_input] = []
442
+ actions_dict[chosen_input].append(action)
443
+
444
+
445
+ def _AddCustomBuildToolForMSVS(p, spec, primary_input,
446
+ inputs, outputs, description, cmd):
447
+ """Add a custom build tool to execute something.
448
+
449
+ Arguments:
450
+ p: the target project
451
+ spec: the target project dict
452
+ primary_input: input file to attach the build tool to
453
+ inputs: list of inputs
454
+ outputs: list of outputs
455
+ description: description of the action
456
+ cmd: command line to execute
457
+ """
458
+ inputs = _FixPaths(inputs)
459
+ outputs = _FixPaths(outputs)
460
+ tool = MSVSProject.Tool(
461
+ 'VCCustomBuildTool',
462
+ {'Description': description,
463
+ 'AdditionalDependencies': ';'.join(inputs),
464
+ 'Outputs': ';'.join(outputs),
465
+ 'CommandLine': cmd,
466
+ })
467
+ # Add to the properties of primary input for each config.
468
+ for config_name, c_data in spec['configurations'].iteritems():
469
+ p.AddFileConfig(_FixPath(primary_input),
470
+ _ConfigFullName(config_name, c_data), tools=[tool])
471
+
472
+
473
+ def _AddAccumulatedActionsToMSVS(p, spec, actions_dict):
474
+ """Add actions accumulated into an actions_dict, merging as needed.
475
+
476
+ Arguments:
477
+ p: the target project
478
+ spec: the target project dict
479
+ actions_dict: dictionary keyed on input name, which maps to a list of
480
+ dicts describing the actions attached to that input file.
481
+ """
482
+ for primary_input in actions_dict:
483
+ inputs = OrderedSet()
484
+ outputs = OrderedSet()
485
+ descriptions = []
486
+ commands = []
487
+ for action in actions_dict[primary_input]:
488
+ inputs.update(OrderedSet(action['inputs']))
489
+ outputs.update(OrderedSet(action['outputs']))
490
+ descriptions.append(action['description'])
491
+ commands.append(action['command'])
492
+ # Add the custom build step for one input file.
493
+ description = ', and also '.join(descriptions)
494
+ command = '\r\n'.join(commands)
495
+ _AddCustomBuildToolForMSVS(p, spec,
496
+ primary_input=primary_input,
497
+ inputs=inputs,
498
+ outputs=outputs,
499
+ description=description,
500
+ cmd=command)
501
+
502
+
503
+ def _RuleExpandPath(path, input_file):
504
+ """Given the input file to which a rule applied, string substitute a path.
505
+
506
+ Arguments:
507
+ path: a path to string expand
508
+ input_file: the file to which the rule applied.
509
+ Returns:
510
+ The string substituted path.
511
+ """
512
+ path = path.replace('$(InputName)',
513
+ os.path.splitext(os.path.split(input_file)[1])[0])
514
+ path = path.replace('$(InputDir)', os.path.dirname(input_file))
515
+ path = path.replace('$(InputExt)',
516
+ os.path.splitext(os.path.split(input_file)[1])[1])
517
+ path = path.replace('$(InputFileName)', os.path.split(input_file)[1])
518
+ path = path.replace('$(InputPath)', input_file)
519
+ return path
520
+
521
+
522
+ def _FindRuleTriggerFiles(rule, sources):
523
+ """Find the list of files which a particular rule applies to.
524
+
525
+ Arguments:
526
+ rule: the rule in question
527
+ sources: the set of all known source files for this project
528
+ Returns:
529
+ The list of sources that trigger a particular rule.
530
+ """
531
+ return rule.get('rule_sources', [])
532
+
533
+
534
+ def _RuleInputsAndOutputs(rule, trigger_file):
535
+ """Find the inputs and outputs generated by a rule.
536
+
537
+ Arguments:
538
+ rule: the rule in question.
539
+ trigger_file: the main trigger for this rule.
540
+ Returns:
541
+ The pair of (inputs, outputs) involved in this rule.
542
+ """
543
+ raw_inputs = _FixPaths(rule.get('inputs', []))
544
+ raw_outputs = _FixPaths(rule.get('outputs', []))
545
+ inputs = OrderedSet()
546
+ outputs = OrderedSet()
547
+ inputs.add(trigger_file)
548
+ for i in raw_inputs:
549
+ inputs.add(_RuleExpandPath(i, trigger_file))
550
+ for o in raw_outputs:
551
+ outputs.add(_RuleExpandPath(o, trigger_file))
552
+ return (inputs, outputs)
553
+
554
+
555
+ def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options):
556
+ """Generate a native rules file.
557
+
558
+ Arguments:
559
+ p: the target project
560
+ rules: the set of rules to include
561
+ output_dir: the directory in which the project/gyp resides
562
+ spec: the project dict
563
+ options: global generator options
564
+ """
565
+ rules_filename = '%s%s.rules' % (spec['target_name'],
566
+ options.suffix)
567
+ rules_file = MSVSToolFile.Writer(os.path.join(output_dir, rules_filename),
568
+ spec['target_name'])
569
+ # Add each rule.
570
+ for r in rules:
571
+ rule_name = r['rule_name']
572
+ rule_ext = r['extension']
573
+ inputs = _FixPaths(r.get('inputs', []))
574
+ outputs = _FixPaths(r.get('outputs', []))
575
+ # Skip a rule with no action and no inputs.
576
+ if 'action' not in r and not r.get('rule_sources', []):
577
+ continue
578
+ cmd = _BuildCommandLineForRule(spec, r, has_input_path=True,
579
+ do_setup_env=True)
580
+ rules_file.AddCustomBuildRule(name=rule_name,
581
+ description=r.get('message', rule_name),
582
+ extensions=[rule_ext],
583
+ additional_dependencies=inputs,
584
+ outputs=outputs,
585
+ cmd=cmd)
586
+ # Write out rules file.
587
+ rules_file.WriteIfChanged()
588
+
589
+ # Add rules file to project.
590
+ p.AddToolFile(rules_filename)
591
+
592
+
593
+ def _Cygwinify(path):
594
+ path = path.replace('$(OutDir)', '$(OutDirCygwin)')
595
+ path = path.replace('$(IntDir)', '$(IntDirCygwin)')
596
+ return path
597
+
598
+
599
+ def _GenerateExternalRules(rules, output_dir, spec,
600
+ sources, options, actions_to_add):
601
+ """Generate an external makefile to do a set of rules.
602
+
603
+ Arguments:
604
+ rules: the list of rules to include
605
+ output_dir: path containing project and gyp files
606
+ spec: project specification data
607
+ sources: set of sources known
608
+ options: global generator options
609
+ actions_to_add: The list of actions we will add to.
610
+ """
611
+ filename = '%s_rules%s.mk' % (spec['target_name'], options.suffix)
612
+ mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename))
613
+ # Find cygwin style versions of some paths.
614
+ mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n')
615
+ mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n')
616
+ # Gather stuff needed to emit all: target.
617
+ all_inputs = OrderedSet()
618
+ all_outputs = OrderedSet()
619
+ all_output_dirs = OrderedSet()
620
+ first_outputs = []
621
+ for rule in rules:
622
+ trigger_files = _FindRuleTriggerFiles(rule, sources)
623
+ for tf in trigger_files:
624
+ inputs, outputs = _RuleInputsAndOutputs(rule, tf)
625
+ all_inputs.update(OrderedSet(inputs))
626
+ all_outputs.update(OrderedSet(outputs))
627
+ # Only use one target from each rule as the dependency for
628
+ # 'all' so we don't try to build each rule multiple times.
629
+ first_outputs.append(list(outputs)[0])
630
+ # Get the unique output directories for this rule.
631
+ output_dirs = [os.path.split(i)[0] for i in outputs]
632
+ for od in output_dirs:
633
+ all_output_dirs.add(od)
634
+ first_outputs_cyg = [_Cygwinify(i) for i in first_outputs]
635
+ # Write out all: target, including mkdir for each output directory.
636
+ mk_file.write('all: %s\n' % ' '.join(first_outputs_cyg))
637
+ for od in all_output_dirs:
638
+ if od:
639
+ mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od)
640
+ mk_file.write('\n')
641
+ # Define how each output is generated.
642
+ for rule in rules:
643
+ trigger_files = _FindRuleTriggerFiles(rule, sources)
644
+ for tf in trigger_files:
645
+ # Get all the inputs and outputs for this rule for this trigger file.
646
+ inputs, outputs = _RuleInputsAndOutputs(rule, tf)
647
+ inputs = [_Cygwinify(i) for i in inputs]
648
+ outputs = [_Cygwinify(i) for i in outputs]
649
+ # Prepare the command line for this rule.
650
+ cmd = [_RuleExpandPath(c, tf) for c in rule['action']]
651
+ cmd = ['"%s"' % i for i in cmd]
652
+ cmd = ' '.join(cmd)
653
+ # Add it to the makefile.
654
+ mk_file.write('%s: %s\n' % (' '.join(outputs), ' '.join(inputs)))
655
+ mk_file.write('\t%s\n\n' % cmd)
656
+ # Close up the file.
657
+ mk_file.close()
658
+
659
+ # Add makefile to list of sources.
660
+ sources.add(filename)
661
+ # Add a build action to call makefile.
662
+ cmd = ['make',
663
+ 'OutDir=$(OutDir)',
664
+ 'IntDir=$(IntDir)',
665
+ '-j', '${NUMBER_OF_PROCESSORS_PLUS_1}',
666
+ '-f', filename]
667
+ cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True)
668
+ # Insert makefile as 0'th input, so it gets the action attached there,
669
+ # as this is easier to understand from in the IDE.
670
+ all_inputs = list(all_inputs)
671
+ all_inputs.insert(0, filename)
672
+ _AddActionStep(actions_to_add,
673
+ inputs=_FixPaths(all_inputs),
674
+ outputs=_FixPaths(all_outputs),
675
+ description='Running external rules for %s' %
676
+ spec['target_name'],
677
+ command=cmd)
678
+
679
+
680
+ def _EscapeEnvironmentVariableExpansion(s):
681
+ """Escapes % characters.
682
+
683
+ Escapes any % characters so that Windows-style environment variable
684
+ expansions will leave them alone.
685
+ See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
686
+ to understand why we have to do this.
687
+
688
+ Args:
689
+ s: The string to be escaped.
690
+
691
+ Returns:
692
+ The escaped string.
693
+ """
694
+ s = s.replace('%', '%%')
695
+ return s
696
+
697
+
698
+ quote_replacer_regex = re.compile(r'(\\*)"')
699
+
700
+
701
+ def _EscapeCommandLineArgumentForMSVS(s):
702
+ """Escapes a Windows command-line argument.
703
+
704
+ So that the Win32 CommandLineToArgv function will turn the escaped result back
705
+ into the original string.
706
+ See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
707
+ ("Parsing C++ Command-Line Arguments") to understand why we have to do
708
+ this.
709
+
710
+ Args:
711
+ s: the string to be escaped.
712
+ Returns:
713
+ the escaped string.
714
+ """
715
+
716
+ def _Replace(match):
717
+ # For a literal quote, CommandLineToArgv requires an odd number of
718
+ # backslashes preceding it, and it produces half as many literal backslashes
719
+ # (rounded down). So we need to produce 2n+1 backslashes.
720
+ return 2 * match.group(1) + '\\"'
721
+
722
+ # Escape all quotes so that they are interpreted literally.
723
+ s = quote_replacer_regex.sub(_Replace, s)
724
+ # Now add unescaped quotes so that any whitespace is interpreted literally.
725
+ s = '"' + s + '"'
726
+ return s
727
+
728
+
729
+ delimiters_replacer_regex = re.compile(r'(\\*)([,;]+)')
730
+
731
+
732
+ def _EscapeVCProjCommandLineArgListItem(s):
733
+ """Escapes command line arguments for MSVS.
734
+
735
+ The VCProj format stores string lists in a single string using commas and
736
+ semi-colons as separators, which must be quoted if they are to be
737
+ interpreted literally. However, command-line arguments may already have
738
+ quotes, and the VCProj parser is ignorant of the backslash escaping
739
+ convention used by CommandLineToArgv, so the command-line quotes and the
740
+ VCProj quotes may not be the same quotes. So to store a general
741
+ command-line argument in a VCProj list, we need to parse the existing
742
+ quoting according to VCProj's convention and quote any delimiters that are
743
+ not already quoted by that convention. The quotes that we add will also be
744
+ seen by CommandLineToArgv, so if backslashes precede them then we also have
745
+ to escape those backslashes according to the CommandLineToArgv
746
+ convention.
747
+
748
+ Args:
749
+ s: the string to be escaped.
750
+ Returns:
751
+ the escaped string.
752
+ """
753
+
754
+ def _Replace(match):
755
+ # For a non-literal quote, CommandLineToArgv requires an even number of
756
+ # backslashes preceding it, and it produces half as many literal
757
+ # backslashes. So we need to produce 2n backslashes.
758
+ return 2 * match.group(1) + '"' + match.group(2) + '"'
759
+
760
+ segments = s.split('"')
761
+ # The unquoted segments are at the even-numbered indices.
762
+ for i in range(0, len(segments), 2):
763
+ segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i])
764
+ # Concatenate back into a single string
765
+ s = '"'.join(segments)
766
+ if len(segments) % 2 == 0:
767
+ # String ends while still quoted according to VCProj's convention. This
768
+ # means the delimiter and the next list item that follow this one in the
769
+ # .vcproj file will be misinterpreted as part of this item. There is nothing
770
+ # we can do about this. Adding an extra quote would correct the problem in
771
+ # the VCProj but cause the same problem on the final command-line. Moving
772
+ # the item to the end of the list does works, but that's only possible if
773
+ # there's only one such item. Let's just warn the user.
774
+ print >> sys.stderr, ('Warning: MSVS may misinterpret the odd number of ' +
775
+ 'quotes in ' + s)
776
+ return s
777
+
778
+
779
+ def _EscapeCppDefineForMSVS(s):
780
+ """Escapes a CPP define so that it will reach the compiler unaltered."""
781
+ s = _EscapeEnvironmentVariableExpansion(s)
782
+ s = _EscapeCommandLineArgumentForMSVS(s)
783
+ s = _EscapeVCProjCommandLineArgListItem(s)
784
+ # cl.exe replaces literal # characters with = in preprocesor definitions for
785
+ # some reason. Octal-encode to work around that.
786
+ s = s.replace('#', '\\%03o' % ord('#'))
787
+ return s
788
+
789
+
790
+ quote_replacer_regex2 = re.compile(r'(\\+)"')
791
+
792
+
793
+ def _EscapeCommandLineArgumentForMSBuild(s):
794
+ """Escapes a Windows command-line argument for use by MSBuild."""
795
+
796
+ def _Replace(match):
797
+ return (len(match.group(1)) / 2 * 4) * '\\' + '\\"'
798
+
799
+ # Escape all quotes so that they are interpreted literally.
800
+ s = quote_replacer_regex2.sub(_Replace, s)
801
+ return s
802
+
803
+
804
+ def _EscapeMSBuildSpecialCharacters(s):
805
+ escape_dictionary = {
806
+ '%': '%25',
807
+ '$': '%24',
808
+ '@': '%40',
809
+ "'": '%27',
810
+ ';': '%3B',
811
+ '?': '%3F',
812
+ '*': '%2A'
813
+ }
814
+ result = ''.join([escape_dictionary.get(c, c) for c in s])
815
+ return result
816
+
817
+
818
+ def _EscapeCppDefineForMSBuild(s):
819
+ """Escapes a CPP define so that it will reach the compiler unaltered."""
820
+ s = _EscapeEnvironmentVariableExpansion(s)
821
+ s = _EscapeCommandLineArgumentForMSBuild(s)
822
+ s = _EscapeMSBuildSpecialCharacters(s)
823
+ # cl.exe replaces literal # characters with = in preprocesor definitions for
824
+ # some reason. Octal-encode to work around that.
825
+ s = s.replace('#', '\\%03o' % ord('#'))
826
+ return s
827
+
828
+
829
+ def _GenerateRulesForMSVS(p, output_dir, options, spec,
830
+ sources, excluded_sources,
831
+ actions_to_add):
832
+ """Generate all the rules for a particular project.
833
+
834
+ Arguments:
835
+ p: the project
836
+ output_dir: directory to emit rules to
837
+ options: global options passed to the generator
838
+ spec: the specification for this project
839
+ sources: the set of all known source files in this project
840
+ excluded_sources: the set of sources excluded from normal processing
841
+ actions_to_add: deferred list of actions to add in
842
+ """
843
+ rules = spec.get('rules', [])
844
+ rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))]
845
+ rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))]
846
+
847
+ # Handle rules that use a native rules file.
848
+ if rules_native:
849
+ _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options)
850
+
851
+ # Handle external rules (non-native rules).
852
+ if rules_external:
853
+ _GenerateExternalRules(rules_external, output_dir, spec,
854
+ sources, options, actions_to_add)
855
+ _AdjustSourcesForRules(spec, rules, sources, excluded_sources)
856
+
857
+
858
+ def _AdjustSourcesForRules(spec, rules, sources, excluded_sources):
859
+ # Add outputs generated by each rule (if applicable).
860
+ for rule in rules:
861
+ # Done if not processing outputs as sources.
862
+ if int(rule.get('process_outputs_as_sources', False)):
863
+ # Add in the outputs from this rule.
864
+ trigger_files = _FindRuleTriggerFiles(rule, sources)
865
+ for trigger_file in trigger_files:
866
+ inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file)
867
+ inputs = OrderedSet(_FixPaths(inputs))
868
+ outputs = OrderedSet(_FixPaths(outputs))
869
+ inputs.remove(_FixPath(trigger_file))
870
+ sources.update(inputs)
871
+ if not spec.get('msvs_external_builder'):
872
+ excluded_sources.update(inputs)
873
+ sources.update(outputs)
874
+
875
+
876
+ def _FilterActionsFromExcluded(excluded_sources, actions_to_add):
877
+ """Take inputs with actions attached out of the list of exclusions.
878
+
879
+ Arguments:
880
+ excluded_sources: list of source files not to be built.
881
+ actions_to_add: dict of actions keyed on source file they're attached to.
882
+ Returns:
883
+ excluded_sources with files that have actions attached removed.
884
+ """
885
+ must_keep = OrderedSet(_FixPaths(actions_to_add.keys()))
886
+ return [s for s in excluded_sources if s not in must_keep]
887
+
888
+
889
+ def _GetDefaultConfiguration(spec):
890
+ return spec['configurations'][spec['default_configuration']]
891
+
892
+
893
+ def _GetGuidOfProject(proj_path, spec):
894
+ """Get the guid for the project.
895
+
896
+ Arguments:
897
+ proj_path: Path of the vcproj or vcxproj file to generate.
898
+ spec: The target dictionary containing the properties of the target.
899
+ Returns:
900
+ the guid.
901
+ Raises:
902
+ ValueError: if the specified GUID is invalid.
903
+ """
904
+ # Pluck out the default configuration.
905
+ default_config = _GetDefaultConfiguration(spec)
906
+ # Decide the guid of the project.
907
+ guid = default_config.get('msvs_guid')
908
+ if guid:
909
+ if VALID_MSVS_GUID_CHARS.match(guid) is None:
910
+ raise ValueError('Invalid MSVS guid: "%s". Must match regex: "%s".' %
911
+ (guid, VALID_MSVS_GUID_CHARS.pattern))
912
+ guid = '{%s}' % guid
913
+ guid = guid or MSVSNew.MakeGuid(proj_path)
914
+ return guid
915
+
916
+
917
+ def _GetMsbuildToolsetOfProject(proj_path, spec, version):
918
+ """Get the platform toolset for the project.
919
+
920
+ Arguments:
921
+ proj_path: Path of the vcproj or vcxproj file to generate.
922
+ spec: The target dictionary containing the properties of the target.
923
+ version: The MSVSVersion object.
924
+ Returns:
925
+ the platform toolset string or None.
926
+ """
927
+ # Pluck out the default configuration.
928
+ default_config = _GetDefaultConfiguration(spec)
929
+ toolset = default_config.get('msbuild_toolset')
930
+ if not toolset and version.DefaultToolset():
931
+ toolset = version.DefaultToolset()
932
+ return toolset
933
+
934
+
935
+ def _GenerateProject(project, options, version, generator_flags):
936
+ """Generates a vcproj file.
937
+
938
+ Arguments:
939
+ project: the MSVSProject object.
940
+ options: global generator options.
941
+ version: the MSVSVersion object.
942
+ generator_flags: dict of generator-specific flags.
943
+ Returns:
944
+ A list of source files that cannot be found on disk.
945
+ """
946
+ default_config = _GetDefaultConfiguration(project.spec)
947
+
948
+ # Skip emitting anything if told to with msvs_existing_vcproj option.
949
+ if default_config.get('msvs_existing_vcproj'):
950
+ return []
951
+
952
+ if version.UsesVcxproj():
953
+ return _GenerateMSBuildProject(project, options, version, generator_flags)
954
+ else:
955
+ return _GenerateMSVSProject(project, options, version, generator_flags)
956
+
957
+
958
+ def _GenerateMSVSProject(project, options, version, generator_flags):
959
+ """Generates a .vcproj file. It may create .rules and .user files too.
960
+
961
+ Arguments:
962
+ project: The project object we will generate the file for.
963
+ options: Global options passed to the generator.
964
+ version: The VisualStudioVersion object.
965
+ generator_flags: dict of generator-specific flags.
966
+ """
967
+ spec = project.spec
968
+ gyp.common.EnsureDirExists(project.path)
969
+
970
+ platforms = _GetUniquePlatforms(spec)
971
+ p = MSVSProject.Writer(project.path, version, spec['target_name'],
972
+ project.guid, platforms)
973
+
974
+ # Get directory project file is in.
975
+ project_dir = os.path.split(project.path)[0]
976
+ gyp_path = _NormalizedSource(project.build_file)
977
+ relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)
978
+
979
+ config_type = _GetMSVSConfigurationType(spec, project.build_file)
980
+ for config_name, config in spec['configurations'].iteritems():
981
+ _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config)
982
+
983
+ # Prepare list of sources and excluded sources.
984
+ gyp_file = os.path.split(project.build_file)[1]
985
+ sources, excluded_sources = _PrepareListOfSources(spec, generator_flags,
986
+ gyp_file)
987
+
988
+ # Add rules.
989
+ actions_to_add = {}
990
+ _GenerateRulesForMSVS(p, project_dir, options, spec,
991
+ sources, excluded_sources,
992
+ actions_to_add)
993
+ list_excluded = generator_flags.get('msvs_list_excluded_files', True)
994
+ sources, excluded_sources, excluded_idl = (
995
+ _AdjustSourcesAndConvertToFilterHierarchy(spec, options, project_dir,
996
+ sources, excluded_sources,
997
+ list_excluded, version))
998
+
999
+ # Add in files.
1000
+ missing_sources = _VerifySourcesExist(sources, project_dir)
1001
+ p.AddFiles(sources)
1002
+
1003
+ _AddToolFilesToMSVS(p, spec)
1004
+ _HandlePreCompiledHeaders(p, sources, spec)
1005
+ _AddActions(actions_to_add, spec, relative_path_of_gyp_file)
1006
+ _AddCopies(actions_to_add, spec)
1007
+ _WriteMSVSUserFile(project.path, version, spec)
1008
+
1009
+ # NOTE: this stanza must appear after all actions have been decided.
1010
+ # Don't excluded sources with actions attached, or they won't run.
1011
+ excluded_sources = _FilterActionsFromExcluded(
1012
+ excluded_sources, actions_to_add)
1013
+ _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl,
1014
+ list_excluded)
1015
+ _AddAccumulatedActionsToMSVS(p, spec, actions_to_add)
1016
+
1017
+ # Write it out.
1018
+ p.WriteIfChanged()
1019
+
1020
+ return missing_sources
1021
+
1022
+
1023
+ def _GetUniquePlatforms(spec):
1024
+ """Returns the list of unique platforms for this spec, e.g ['win32', ...].
1025
+
1026
+ Arguments:
1027
+ spec: The target dictionary containing the properties of the target.
1028
+ Returns:
1029
+ The MSVSUserFile object created.
1030
+ """
1031
+ # Gather list of unique platforms.
1032
+ platforms = OrderedSet()
1033
+ for configuration in spec['configurations']:
1034
+ platforms.add(_ConfigPlatform(spec['configurations'][configuration]))
1035
+ platforms = list(platforms)
1036
+ return platforms
1037
+
1038
+
1039
+ def _CreateMSVSUserFile(proj_path, version, spec):
1040
+ """Generates a .user file for the user running this Gyp program.
1041
+
1042
+ Arguments:
1043
+ proj_path: The path of the project file being created. The .user file
1044
+ shares the same path (with an appropriate suffix).
1045
+ version: The VisualStudioVersion object.
1046
+ spec: The target dictionary containing the properties of the target.
1047
+ Returns:
1048
+ The MSVSUserFile object created.
1049
+ """
1050
+ (domain, username) = _GetDomainAndUserName()
1051
+ vcuser_filename = '.'.join([proj_path, domain, username, 'user'])
1052
+ user_file = MSVSUserFile.Writer(vcuser_filename, version,
1053
+ spec['target_name'])
1054
+ return user_file
1055
+
1056
+
1057
+ def _GetMSVSConfigurationType(spec, build_file):
1058
+ """Returns the configuration type for this project.
1059
+
1060
+ It's a number defined by Microsoft. May raise an exception.
1061
+
1062
+ Args:
1063
+ spec: The target dictionary containing the properties of the target.
1064
+ build_file: The path of the gyp file.
1065
+ Returns:
1066
+ An integer, the configuration type.
1067
+ """
1068
+ try:
1069
+ config_type = {
1070
+ 'executable': '1', # .exe
1071
+ 'shared_library': '2', # .dll
1072
+ 'loadable_module': '2', # .dll
1073
+ 'static_library': '4', # .lib
1074
+ 'none': '10', # Utility type
1075
+ }[spec['type']]
1076
+ except KeyError:
1077
+ if spec.get('type'):
1078
+ raise GypError('Target type %s is not a valid target type for '
1079
+ 'target %s in %s.' %
1080
+ (spec['type'], spec['target_name'], build_file))
1081
+ else:
1082
+ raise GypError('Missing type field for target %s in %s.' %
1083
+ (spec['target_name'], build_file))
1084
+ return config_type
1085
+
1086
+
1087
+ def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
1088
+ """Adds a configuration to the MSVS project.
1089
+
1090
+ Many settings in a vcproj file are specific to a configuration. This
1091
+ function the main part of the vcproj file that's configuration specific.
1092
+
1093
+ Arguments:
1094
+ p: The target project being generated.
1095
+ spec: The target dictionary containing the properties of the target.
1096
+ config_type: The configuration type, a number as defined by Microsoft.
1097
+ config_name: The name of the configuration.
1098
+ config: The dictionary that defines the special processing to be done
1099
+ for this configuration.
1100
+ """
1101
+ # Get the information for this configuration
1102
+ include_dirs, resource_include_dirs = _GetIncludeDirs(config)
1103
+ libraries = _GetLibraries(spec)
1104
+ library_dirs = _GetLibraryDirs(config)
1105
+ out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False)
1106
+ defines = _GetDefines(config)
1107
+ defines = [_EscapeCppDefineForMSVS(d) for d in defines]
1108
+ disabled_warnings = _GetDisabledWarnings(config)
1109
+ prebuild = config.get('msvs_prebuild')
1110
+ postbuild = config.get('msvs_postbuild')
1111
+ def_file = _GetModuleDefinition(spec)
1112
+ precompiled_header = config.get('msvs_precompiled_header')
1113
+
1114
+ # Prepare the list of tools as a dictionary.
1115
+ tools = dict()
1116
+ # Add in user specified msvs_settings.
1117
+ msvs_settings = config.get('msvs_settings', {})
1118
+ MSVSSettings.ValidateMSVSSettings(msvs_settings)
1119
+
1120
+ # Prevent default library inheritance from the environment.
1121
+ _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', ['$(NOINHERIT)'])
1122
+
1123
+ for tool in msvs_settings:
1124
+ settings = config['msvs_settings'][tool]
1125
+ for setting in settings:
1126
+ _ToolAppend(tools, tool, setting, settings[setting])
1127
+ # Add the information to the appropriate tool
1128
+ _ToolAppend(tools, 'VCCLCompilerTool',
1129
+ 'AdditionalIncludeDirectories', include_dirs)
1130
+ _ToolAppend(tools, 'VCResourceCompilerTool',
1131
+ 'AdditionalIncludeDirectories', resource_include_dirs)
1132
+ # Add in libraries.
1133
+ _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries)
1134
+ _ToolAppend(tools, 'VCLinkerTool', 'AdditionalLibraryDirectories',
1135
+ library_dirs)
1136
+ if out_file:
1137
+ _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True)
1138
+ # Add defines.
1139
+ _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines)
1140
+ _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions',
1141
+ defines)
1142
+ # Change program database directory to prevent collisions.
1143
+ _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName',
1144
+ '$(IntDir)$(ProjectName)\\vc80.pdb', only_if_unset=True)
1145
+ # Add disabled warnings.
1146
+ _ToolAppend(tools, 'VCCLCompilerTool',
1147
+ 'DisableSpecificWarnings', disabled_warnings)
1148
+ # Add Pre-build.
1149
+ _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild)
1150
+ # Add Post-build.
1151
+ _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild)
1152
+ # Turn on precompiled headers if appropriate.
1153
+ if precompiled_header:
1154
+ precompiled_header = os.path.split(precompiled_header)[1]
1155
+ _ToolAppend(tools, 'VCCLCompilerTool', 'UsePrecompiledHeader', '2')
1156
+ _ToolAppend(tools, 'VCCLCompilerTool',
1157
+ 'PrecompiledHeaderThrough', precompiled_header)
1158
+ _ToolAppend(tools, 'VCCLCompilerTool',
1159
+ 'ForcedIncludeFiles', precompiled_header)
1160
+ # Loadable modules don't generate import libraries;
1161
+ # tell dependent projects to not expect one.
1162
+ if spec['type'] == 'loadable_module':
1163
+ _ToolAppend(tools, 'VCLinkerTool', 'IgnoreImportLibrary', 'true')
1164
+ # Set the module definition file if any.
1165
+ if def_file:
1166
+ _ToolAppend(tools, 'VCLinkerTool', 'ModuleDefinitionFile', def_file)
1167
+
1168
+ _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name)
1169
+
1170
+
1171
+ def _GetIncludeDirs(config):
1172
+ """Returns the list of directories to be used for #include directives.
1173
+
1174
+ Arguments:
1175
+ config: The dictionary that defines the special processing to be done
1176
+ for this configuration.
1177
+ Returns:
1178
+ The list of directory paths.
1179
+ """
1180
+ # TODO(bradnelson): include_dirs should really be flexible enough not to
1181
+ # require this sort of thing.
1182
+ include_dirs = (
1183
+ config.get('include_dirs', []) +
1184
+ config.get('msvs_system_include_dirs', []))
1185
+ resource_include_dirs = config.get('resource_include_dirs', include_dirs)
1186
+ include_dirs = _FixPaths(include_dirs)
1187
+ resource_include_dirs = _FixPaths(resource_include_dirs)
1188
+ return include_dirs, resource_include_dirs
1189
+
1190
+
1191
+ def _GetLibraryDirs(config):
1192
+ """Returns the list of directories to be used for library search paths.
1193
+
1194
+ Arguments:
1195
+ config: The dictionary that defines the special processing to be done
1196
+ for this configuration.
1197
+ Returns:
1198
+ The list of directory paths.
1199
+ """
1200
+
1201
+ library_dirs = config.get('library_dirs', [])
1202
+ library_dirs = _FixPaths(library_dirs)
1203
+ return library_dirs
1204
+
1205
+
1206
+ def _GetLibraries(spec):
1207
+ """Returns the list of libraries for this configuration.
1208
+
1209
+ Arguments:
1210
+ spec: The target dictionary containing the properties of the target.
1211
+ Returns:
1212
+ The list of directory paths.
1213
+ """
1214
+ libraries = spec.get('libraries', [])
1215
+ # Strip out -l, as it is not used on windows (but is needed so we can pass
1216
+ # in libraries that are assumed to be in the default library path).
1217
+ # Also remove duplicate entries, leaving only the last duplicate, while
1218
+ # preserving order.
1219
+ found = OrderedSet()
1220
+ unique_libraries_list = []
1221
+ for entry in reversed(libraries):
1222
+ library = re.sub('^\-l', '', entry)
1223
+ if not os.path.splitext(library)[1]:
1224
+ library += '.lib'
1225
+ if library not in found:
1226
+ found.add(library)
1227
+ unique_libraries_list.append(library)
1228
+ unique_libraries_list.reverse()
1229
+ return unique_libraries_list
1230
+
1231
+
1232
+ def _GetOutputFilePathAndTool(spec, msbuild):
1233
+ """Returns the path and tool to use for this target.
1234
+
1235
+ Figures out the path of the file this spec will create and the name of
1236
+ the VC tool that will create it.
1237
+
1238
+ Arguments:
1239
+ spec: The target dictionary containing the properties of the target.
1240
+ Returns:
1241
+ A triple of (file path, name of the vc tool, name of the msbuild tool)
1242
+ """
1243
+ # Select a name for the output file.
1244
+ out_file = ''
1245
+ vc_tool = ''
1246
+ msbuild_tool = ''
1247
+ output_file_map = {
1248
+ 'executable': ('VCLinkerTool', 'Link', '$(OutDir)', '.exe'),
1249
+ 'shared_library': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'),
1250
+ 'loadable_module': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'),
1251
+ 'static_library': ('VCLibrarianTool', 'Lib', '$(OutDir)lib\\', '.lib'),
1252
+ }
1253
+ output_file_props = output_file_map.get(spec['type'])
1254
+ if output_file_props and int(spec.get('msvs_auto_output_file', 1)):
1255
+ vc_tool, msbuild_tool, out_dir, suffix = output_file_props
1256
+ if spec.get('standalone_static_library', 0):
1257
+ out_dir = '$(OutDir)'
1258
+ out_dir = spec.get('product_dir', out_dir)
1259
+ product_extension = spec.get('product_extension')
1260
+ if product_extension:
1261
+ suffix = '.' + product_extension
1262
+ elif msbuild:
1263
+ suffix = '$(TargetExt)'
1264
+ prefix = spec.get('product_prefix', '')
1265
+ product_name = spec.get('product_name', '$(ProjectName)')
1266
+ out_file = ntpath.join(out_dir, prefix + product_name + suffix)
1267
+ return out_file, vc_tool, msbuild_tool
1268
+
1269
+
1270
+ def _GetOutputTargetExt(spec):
1271
+ """Returns the extension for this target, including the dot
1272
+
1273
+ If product_extension is specified, set target_extension to this to avoid
1274
+ MSB8012, returns None otherwise. Ignores any target_extension settings in
1275
+ the input files.
1276
+
1277
+ Arguments:
1278
+ spec: The target dictionary containing the properties of the target.
1279
+ Returns:
1280
+ A string with the extension, or None
1281
+ """
1282
+ target_extension = spec.get('product_extension')
1283
+ if target_extension:
1284
+ return '.' + target_extension
1285
+ return None
1286
+
1287
+
1288
+ def _GetDefines(config):
1289
+ """Returns the list of preprocessor definitions for this configuation.
1290
+
1291
+ Arguments:
1292
+ config: The dictionary that defines the special processing to be done
1293
+ for this configuration.
1294
+ Returns:
1295
+ The list of preprocessor definitions.
1296
+ """
1297
+ defines = []
1298
+ for d in config.get('defines', []):
1299
+ if type(d) == list:
1300
+ fd = '='.join([str(dpart) for dpart in d])
1301
+ else:
1302
+ fd = str(d)
1303
+ defines.append(fd)
1304
+ return defines
1305
+
1306
+
1307
+ def _GetDisabledWarnings(config):
1308
+ return [str(i) for i in config.get('msvs_disabled_warnings', [])]
1309
+
1310
+
1311
+ def _GetModuleDefinition(spec):
1312
+ def_file = ''
1313
+ if spec['type'] in ['shared_library', 'loadable_module', 'executable']:
1314
+ def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
1315
+ if len(def_files) == 1:
1316
+ def_file = _FixPath(def_files[0])
1317
+ elif def_files:
1318
+ raise ValueError(
1319
+ 'Multiple module definition files in one target, target %s lists '
1320
+ 'multiple .def files: %s' % (
1321
+ spec['target_name'], ' '.join(def_files)))
1322
+ return def_file
1323
+
1324
+
1325
+ def _ConvertToolsToExpectedForm(tools):
1326
+ """Convert tools to a form expected by Visual Studio.
1327
+
1328
+ Arguments:
1329
+ tools: A dictionary of settings; the tool name is the key.
1330
+ Returns:
1331
+ A list of Tool objects.
1332
+ """
1333
+ tool_list = []
1334
+ for tool, settings in tools.iteritems():
1335
+ # Collapse settings with lists.
1336
+ settings_fixed = {}
1337
+ for setting, value in settings.iteritems():
1338
+ if type(value) == list:
1339
+ if ((tool == 'VCLinkerTool' and
1340
+ setting == 'AdditionalDependencies') or
1341
+ setting == 'AdditionalOptions'):
1342
+ settings_fixed[setting] = ' '.join(value)
1343
+ else:
1344
+ settings_fixed[setting] = ';'.join(value)
1345
+ else:
1346
+ settings_fixed[setting] = value
1347
+ # Add in this tool.
1348
+ tool_list.append(MSVSProject.Tool(tool, settings_fixed))
1349
+ return tool_list
1350
+
1351
+
1352
+ def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name):
1353
+ """Add to the project file the configuration specified by config.
1354
+
1355
+ Arguments:
1356
+ p: The target project being generated.
1357
+ spec: the target project dict.
1358
+ tools: A dictionary of settings; the tool name is the key.
1359
+ config: The dictionary that defines the special processing to be done
1360
+ for this configuration.
1361
+ config_type: The configuration type, a number as defined by Microsoft.
1362
+ config_name: The name of the configuration.
1363
+ """
1364
+ attributes = _GetMSVSAttributes(spec, config, config_type)
1365
+ # Add in this configuration.
1366
+ tool_list = _ConvertToolsToExpectedForm(tools)
1367
+ p.AddConfig(_ConfigFullName(config_name, config),
1368
+ attrs=attributes, tools=tool_list)
1369
+
1370
+
1371
+ def _GetMSVSAttributes(spec, config, config_type):
1372
+ # Prepare configuration attributes.
1373
+ prepared_attrs = {}
1374
+ source_attrs = config.get('msvs_configuration_attributes', {})
1375
+ for a in source_attrs:
1376
+ prepared_attrs[a] = source_attrs[a]
1377
+ # Add props files.
1378
+ vsprops_dirs = config.get('msvs_props', [])
1379
+ vsprops_dirs = _FixPaths(vsprops_dirs)
1380
+ if vsprops_dirs:
1381
+ prepared_attrs['InheritedPropertySheets'] = ';'.join(vsprops_dirs)
1382
+ # Set configuration type.
1383
+ prepared_attrs['ConfigurationType'] = config_type
1384
+ output_dir = prepared_attrs.get('OutputDirectory',
1385
+ '$(SolutionDir)$(ConfigurationName)')
1386
+ prepared_attrs['OutputDirectory'] = _FixPath(output_dir) + '\\'
1387
+ if 'IntermediateDirectory' not in prepared_attrs:
1388
+ intermediate = '$(ConfigurationName)\\obj\\$(ProjectName)'
1389
+ prepared_attrs['IntermediateDirectory'] = _FixPath(intermediate) + '\\'
1390
+ else:
1391
+ intermediate = _FixPath(prepared_attrs['IntermediateDirectory']) + '\\'
1392
+ intermediate = MSVSSettings.FixVCMacroSlashes(intermediate)
1393
+ prepared_attrs['IntermediateDirectory'] = intermediate
1394
+ return prepared_attrs
1395
+
1396
+
1397
+ def _AddNormalizedSources(sources_set, sources_array):
1398
+ sources_set.update(_NormalizedSource(s) for s in sources_array)
1399
+
1400
+
1401
+ def _PrepareListOfSources(spec, generator_flags, gyp_file):
1402
+ """Prepare list of sources and excluded sources.
1403
+
1404
+ Besides the sources specified directly in the spec, adds the gyp file so
1405
+ that a change to it will cause a re-compile. Also adds appropriate sources
1406
+ for actions and copies. Assumes later stage will un-exclude files which
1407
+ have custom build steps attached.
1408
+
1409
+ Arguments:
1410
+ spec: The target dictionary containing the properties of the target.
1411
+ gyp_file: The name of the gyp file.
1412
+ Returns:
1413
+ A pair of (list of sources, list of excluded sources).
1414
+ The sources will be relative to the gyp file.
1415
+ """
1416
+ sources = OrderedSet()
1417
+ _AddNormalizedSources(sources, spec.get('sources', []))
1418
+ excluded_sources = OrderedSet()
1419
+ # Add in the gyp file.
1420
+ if not generator_flags.get('standalone'):
1421
+ sources.add(gyp_file)
1422
+
1423
+ # Add in 'action' inputs and outputs.
1424
+ for a in spec.get('actions', []):
1425
+ inputs = a['inputs']
1426
+ inputs = [_NormalizedSource(i) for i in inputs]
1427
+ # Add all inputs to sources and excluded sources.
1428
+ inputs = OrderedSet(inputs)
1429
+ sources.update(inputs)
1430
+ if not spec.get('msvs_external_builder'):
1431
+ excluded_sources.update(inputs)
1432
+ if int(a.get('process_outputs_as_sources', False)):
1433
+ _AddNormalizedSources(sources, a.get('outputs', []))
1434
+ # Add in 'copies' inputs and outputs.
1435
+ for cpy in spec.get('copies', []):
1436
+ _AddNormalizedSources(sources, cpy.get('files', []))
1437
+ return (sources, excluded_sources)
1438
+
1439
+
1440
+ def _AdjustSourcesAndConvertToFilterHierarchy(
1441
+ spec, options, gyp_dir, sources, excluded_sources, list_excluded, version):
1442
+ """Adjusts the list of sources and excluded sources.
1443
+
1444
+ Also converts the sets to lists.
1445
+
1446
+ Arguments:
1447
+ spec: The target dictionary containing the properties of the target.
1448
+ options: Global generator options.
1449
+ gyp_dir: The path to the gyp file being processed.
1450
+ sources: A set of sources to be included for this project.
1451
+ excluded_sources: A set of sources to be excluded for this project.
1452
+ version: A MSVSVersion object.
1453
+ Returns:
1454
+ A trio of (list of sources, list of excluded sources,
1455
+ path of excluded IDL file)
1456
+ """
1457
+ # Exclude excluded sources coming into the generator.
1458
+ excluded_sources.update(OrderedSet(spec.get('sources_excluded', [])))
1459
+ # Add excluded sources into sources for good measure.
1460
+ sources.update(excluded_sources)
1461
+ # Convert to proper windows form.
1462
+ # NOTE: sources goes from being a set to a list here.
1463
+ # NOTE: excluded_sources goes from being a set to a list here.
1464
+ sources = _FixPaths(sources)
1465
+ # Convert to proper windows form.
1466
+ excluded_sources = _FixPaths(excluded_sources)
1467
+
1468
+ excluded_idl = _IdlFilesHandledNonNatively(spec, sources)
1469
+
1470
+ precompiled_related = _GetPrecompileRelatedFiles(spec)
1471
+ # Find the excluded ones, minus the precompiled header related ones.
1472
+ fully_excluded = [i for i in excluded_sources if i not in precompiled_related]
1473
+
1474
+ # Convert to folders and the right slashes.
1475
+ sources = [i.split('\\') for i in sources]
1476
+ sources = _ConvertSourcesToFilterHierarchy(sources, excluded=fully_excluded,
1477
+ list_excluded=list_excluded,
1478
+ msvs_version=version)
1479
+
1480
+ # Prune filters with a single child to flatten ugly directory structures
1481
+ # such as ../../src/modules/module1 etc.
1482
+ if version.UsesVcxproj():
1483
+ while all([isinstance(s, MSVSProject.Filter) for s in sources]) \
1484
+ and len(set([s.name for s in sources])) == 1:
1485
+ assert all([len(s.contents) == 1 for s in sources])
1486
+ sources = [s.contents[0] for s in sources]
1487
+ else:
1488
+ while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter):
1489
+ sources = sources[0].contents
1490
+
1491
+ return sources, excluded_sources, excluded_idl
1492
+
1493
+
1494
+ def _IdlFilesHandledNonNatively(spec, sources):
1495
+ # If any non-native rules use 'idl' as an extension exclude idl files.
1496
+ # Gather a list here to use later.
1497
+ using_idl = False
1498
+ for rule in spec.get('rules', []):
1499
+ if rule['extension'] == 'idl' and int(rule.get('msvs_external_rule', 0)):
1500
+ using_idl = True
1501
+ break
1502
+ if using_idl:
1503
+ excluded_idl = [i for i in sources if i.endswith('.idl')]
1504
+ else:
1505
+ excluded_idl = []
1506
+ return excluded_idl
1507
+
1508
+
1509
+ def _GetPrecompileRelatedFiles(spec):
1510
+ # Gather a list of precompiled header related sources.
1511
+ precompiled_related = []
1512
+ for _, config in spec['configurations'].iteritems():
1513
+ for k in precomp_keys:
1514
+ f = config.get(k)
1515
+ if f:
1516
+ precompiled_related.append(_FixPath(f))
1517
+ return precompiled_related
1518
+
1519
+
1520
+ def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl,
1521
+ list_excluded):
1522
+ exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
1523
+ for file_name, excluded_configs in exclusions.iteritems():
1524
+ if (not list_excluded and
1525
+ len(excluded_configs) == len(spec['configurations'])):
1526
+ # If we're not listing excluded files, then they won't appear in the
1527
+ # project, so don't try to configure them to be excluded.
1528
+ pass
1529
+ else:
1530
+ for config_name, config in excluded_configs:
1531
+ p.AddFileConfig(file_name, _ConfigFullName(config_name, config),
1532
+ {'ExcludedFromBuild': 'true'})
1533
+
1534
+
1535
+ def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl):
1536
+ exclusions = {}
1537
+ # Exclude excluded sources from being built.
1538
+ for f in excluded_sources:
1539
+ excluded_configs = []
1540
+ for config_name, config in spec['configurations'].iteritems():
1541
+ precomped = [_FixPath(config.get(i, '')) for i in precomp_keys]
1542
+ # Don't do this for ones that are precompiled header related.
1543
+ if f not in precomped:
1544
+ excluded_configs.append((config_name, config))
1545
+ exclusions[f] = excluded_configs
1546
+ # If any non-native rules use 'idl' as an extension exclude idl files.
1547
+ # Exclude them now.
1548
+ for f in excluded_idl:
1549
+ excluded_configs = []
1550
+ for config_name, config in spec['configurations'].iteritems():
1551
+ excluded_configs.append((config_name, config))
1552
+ exclusions[f] = excluded_configs
1553
+ return exclusions
1554
+
1555
+
1556
+ def _AddToolFilesToMSVS(p, spec):
1557
+ # Add in tool files (rules).
1558
+ tool_files = OrderedSet()
1559
+ for _, config in spec['configurations'].iteritems():
1560
+ for f in config.get('msvs_tool_files', []):
1561
+ tool_files.add(f)
1562
+ for f in tool_files:
1563
+ p.AddToolFile(f)
1564
+
1565
+
1566
+ def _HandlePreCompiledHeaders(p, sources, spec):
1567
+ # Pre-compiled header source stubs need a different compiler flag
1568
+ # (generate precompiled header) and any source file not of the same
1569
+ # kind (i.e. C vs. C++) as the precompiled header source stub needs
1570
+ # to have use of precompiled headers disabled.
1571
+ extensions_excluded_from_precompile = []
1572
+ for config_name, config in spec['configurations'].iteritems():
1573
+ source = config.get('msvs_precompiled_source')
1574
+ if source:
1575
+ source = _FixPath(source)
1576
+ # UsePrecompiledHeader=1 for if using precompiled headers.
1577
+ tool = MSVSProject.Tool('VCCLCompilerTool',
1578
+ {'UsePrecompiledHeader': '1'})
1579
+ p.AddFileConfig(source, _ConfigFullName(config_name, config),
1580
+ {}, tools=[tool])
1581
+ basename, extension = os.path.splitext(source)
1582
+ if extension == '.c':
1583
+ extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx']
1584
+ else:
1585
+ extensions_excluded_from_precompile = ['.c']
1586
+ def DisableForSourceTree(source_tree):
1587
+ for source in source_tree:
1588
+ if isinstance(source, MSVSProject.Filter):
1589
+ DisableForSourceTree(source.contents)
1590
+ else:
1591
+ basename, extension = os.path.splitext(source)
1592
+ if extension in extensions_excluded_from_precompile:
1593
+ for config_name, config in spec['configurations'].iteritems():
1594
+ tool = MSVSProject.Tool('VCCLCompilerTool',
1595
+ {'UsePrecompiledHeader': '0',
1596
+ 'ForcedIncludeFiles': '$(NOINHERIT)'})
1597
+ p.AddFileConfig(_FixPath(source),
1598
+ _ConfigFullName(config_name, config),
1599
+ {}, tools=[tool])
1600
+ # Do nothing if there was no precompiled source.
1601
+ if extensions_excluded_from_precompile:
1602
+ DisableForSourceTree(sources)
1603
+
1604
+
1605
+ def _AddActions(actions_to_add, spec, relative_path_of_gyp_file):
1606
+ # Add actions.
1607
+ actions = spec.get('actions', [])
1608
+ # Don't setup_env every time. When all the actions are run together in one
1609
+ # batch file in VS, the PATH will grow too long.
1610
+ # Membership in this set means that the cygwin environment has been set up,
1611
+ # and does not need to be set up again.
1612
+ have_setup_env = set()
1613
+ for a in actions:
1614
+ # Attach actions to the gyp file if nothing else is there.
1615
+ inputs = a.get('inputs') or [relative_path_of_gyp_file]
1616
+ attached_to = inputs[0]
1617
+ need_setup_env = attached_to not in have_setup_env
1618
+ cmd = _BuildCommandLineForRule(spec, a, has_input_path=False,
1619
+ do_setup_env=need_setup_env)
1620
+ have_setup_env.add(attached_to)
1621
+ # Add the action.
1622
+ _AddActionStep(actions_to_add,
1623
+ inputs=inputs,
1624
+ outputs=a.get('outputs', []),
1625
+ description=a.get('message', a['action_name']),
1626
+ command=cmd)
1627
+
1628
+
1629
+ def _WriteMSVSUserFile(project_path, version, spec):
1630
+ # Add run_as and test targets.
1631
+ if 'run_as' in spec:
1632
+ run_as = spec['run_as']
1633
+ action = run_as.get('action', [])
1634
+ environment = run_as.get('environment', [])
1635
+ working_directory = run_as.get('working_directory', '.')
1636
+ elif int(spec.get('test', 0)):
1637
+ action = ['$(TargetPath)', '--gtest_print_time']
1638
+ environment = []
1639
+ working_directory = '.'
1640
+ else:
1641
+ return # Nothing to add
1642
+ # Write out the user file.
1643
+ user_file = _CreateMSVSUserFile(project_path, version, spec)
1644
+ for config_name, c_data in spec['configurations'].iteritems():
1645
+ user_file.AddDebugSettings(_ConfigFullName(config_name, c_data),
1646
+ action, environment, working_directory)
1647
+ user_file.WriteIfChanged()
1648
+
1649
+
1650
+ def _AddCopies(actions_to_add, spec):
1651
+ copies = _GetCopies(spec)
1652
+ for inputs, outputs, cmd, description in copies:
1653
+ _AddActionStep(actions_to_add, inputs=inputs, outputs=outputs,
1654
+ description=description, command=cmd)
1655
+
1656
+
1657
+ def _GetCopies(spec):
1658
+ copies = []
1659
+ # Add copies.
1660
+ for cpy in spec.get('copies', []):
1661
+ for src in cpy.get('files', []):
1662
+ dst = os.path.join(cpy['destination'], os.path.basename(src))
1663
+ # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and
1664
+ # outputs, so do the same for our generated command line.
1665
+ if src.endswith('/'):
1666
+ src_bare = src[:-1]
1667
+ base_dir = posixpath.split(src_bare)[0]
1668
+ outer_dir = posixpath.split(src_bare)[1]
1669
+ cmd = 'cd "%s" && xcopy /e /f /y "%s" "%s\\%s\\"' % (
1670
+ _FixPath(base_dir), outer_dir, _FixPath(dst), outer_dir)
1671
+ copies.append(([src], ['dummy_copies', dst], cmd,
1672
+ 'Copying %s to %s' % (src, dst)))
1673
+ else:
1674
+ cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % (
1675
+ _FixPath(cpy['destination']), _FixPath(src), _FixPath(dst))
1676
+ copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, dst)))
1677
+ return copies
1678
+
1679
+
1680
+ def _GetPathDict(root, path):
1681
+ # |path| will eventually be empty (in the recursive calls) if it was initially
1682
+ # relative; otherwise it will eventually end up as '\', 'D:\', etc.
1683
+ if not path or path.endswith(os.sep):
1684
+ return root
1685
+ parent, folder = os.path.split(path)
1686
+ parent_dict = _GetPathDict(root, parent)
1687
+ if folder not in parent_dict:
1688
+ parent_dict[folder] = dict()
1689
+ return parent_dict[folder]
1690
+
1691
+
1692
+ def _DictsToFolders(base_path, bucket, flat):
1693
+ # Convert to folders recursively.
1694
+ children = []
1695
+ for folder, contents in bucket.iteritems():
1696
+ if type(contents) == dict:
1697
+ folder_children = _DictsToFolders(os.path.join(base_path, folder),
1698
+ contents, flat)
1699
+ if flat:
1700
+ children += folder_children
1701
+ else:
1702
+ folder_children = MSVSNew.MSVSFolder(os.path.join(base_path, folder),
1703
+ name='(' + folder + ')',
1704
+ entries=folder_children)
1705
+ children.append(folder_children)
1706
+ else:
1707
+ children.append(contents)
1708
+ return children
1709
+
1710
+
1711
+ def _CollapseSingles(parent, node):
1712
+ # Recursively explorer the tree of dicts looking for projects which are
1713
+ # the sole item in a folder which has the same name as the project. Bring
1714
+ # such projects up one level.
1715
+ if (type(node) == dict and
1716
+ len(node) == 1 and
1717
+ node.keys()[0] == parent + '.vcproj'):
1718
+ return node[node.keys()[0]]
1719
+ if type(node) != dict:
1720
+ return node
1721
+ for child in node:
1722
+ node[child] = _CollapseSingles(child, node[child])
1723
+ return node
1724
+
1725
+
1726
+ def _GatherSolutionFolders(sln_projects, project_objects, flat):
1727
+ root = {}
1728
+ # Convert into a tree of dicts on path.
1729
+ for p in sln_projects:
1730
+ gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2]
1731
+ gyp_dir = os.path.dirname(gyp_file)
1732
+ path_dict = _GetPathDict(root, gyp_dir)
1733
+ path_dict[target + '.vcproj'] = project_objects[p]
1734
+ # Walk down from the top until we hit a folder that has more than one entry.
1735
+ # In practice, this strips the top-level "src/" dir from the hierarchy in
1736
+ # the solution.
1737
+ while len(root) == 1 and type(root[root.keys()[0]]) == dict:
1738
+ root = root[root.keys()[0]]
1739
+ # Collapse singles.
1740
+ root = _CollapseSingles('', root)
1741
+ # Merge buckets until everything is a root entry.
1742
+ return _DictsToFolders('', root, flat)
1743
+
1744
+
1745
+ def _GetPathOfProject(qualified_target, spec, options, msvs_version):
1746
+ default_config = _GetDefaultConfiguration(spec)
1747
+ proj_filename = default_config.get('msvs_existing_vcproj')
1748
+ if not proj_filename:
1749
+ proj_filename = (spec['target_name'] + options.suffix +
1750
+ msvs_version.ProjectExtension())
1751
+
1752
+ build_file = gyp.common.BuildFile(qualified_target)
1753
+ proj_path = os.path.join(os.path.dirname(build_file), proj_filename)
1754
+ fix_prefix = None
1755
+ if options.generator_output:
1756
+ project_dir_path = os.path.dirname(os.path.abspath(proj_path))
1757
+ proj_path = os.path.join(options.generator_output, proj_path)
1758
+ fix_prefix = gyp.common.RelativePath(project_dir_path,
1759
+ os.path.dirname(proj_path))
1760
+ return proj_path, fix_prefix
1761
+
1762
+
1763
+ def _GetPlatformOverridesOfProject(spec):
1764
+ # Prepare a dict indicating which project configurations are used for which
1765
+ # solution configurations for this target.
1766
+ config_platform_overrides = {}
1767
+ for config_name, c in spec['configurations'].iteritems():
1768
+ config_fullname = _ConfigFullName(config_name, c)
1769
+ platform = c.get('msvs_target_platform', _ConfigPlatform(c))
1770
+ fixed_config_fullname = '%s|%s' % (
1771
+ _ConfigBaseName(config_name, _ConfigPlatform(c)), platform)
1772
+ config_platform_overrides[config_fullname] = fixed_config_fullname
1773
+ return config_platform_overrides
1774
+
1775
+
1776
+ def _CreateProjectObjects(target_list, target_dicts, options, msvs_version):
1777
+ """Create a MSVSProject object for the targets found in target list.
1778
+
1779
+ Arguments:
1780
+ target_list: the list of targets to generate project objects for.
1781
+ target_dicts: the dictionary of specifications.
1782
+ options: global generator options.
1783
+ msvs_version: the MSVSVersion object.
1784
+ Returns:
1785
+ A set of created projects, keyed by target.
1786
+ """
1787
+ global fixpath_prefix
1788
+ # Generate each project.
1789
+ projects = {}
1790
+ for qualified_target in target_list:
1791
+ spec = target_dicts[qualified_target]
1792
+ if spec['toolset'] != 'target':
1793
+ raise GypError(
1794
+ 'Multiple toolsets not supported in msvs build (target %s)' %
1795
+ qualified_target)
1796
+ proj_path, fixpath_prefix = _GetPathOfProject(qualified_target, spec,
1797
+ options, msvs_version)
1798
+ guid = _GetGuidOfProject(proj_path, spec)
1799
+ overrides = _GetPlatformOverridesOfProject(spec)
1800
+ build_file = gyp.common.BuildFile(qualified_target)
1801
+ # Create object for this project.
1802
+ obj = MSVSNew.MSVSProject(
1803
+ proj_path,
1804
+ name=spec['target_name'],
1805
+ guid=guid,
1806
+ spec=spec,
1807
+ build_file=build_file,
1808
+ config_platform_overrides=overrides,
1809
+ fixpath_prefix=fixpath_prefix)
1810
+ # Set project toolset if any (MS build only)
1811
+ if msvs_version.UsesVcxproj():
1812
+ obj.set_msbuild_toolset(
1813
+ _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version))
1814
+ projects[qualified_target] = obj
1815
+ # Set all the dependencies, but not if we are using an external builder like
1816
+ # ninja
1817
+ for project in projects.values():
1818
+ if not project.spec.get('msvs_external_builder'):
1819
+ deps = project.spec.get('dependencies', [])
1820
+ deps = [projects[d] for d in deps]
1821
+ project.set_dependencies(deps)
1822
+ return projects
1823
+
1824
+
1825
+ def _InitNinjaFlavor(options, target_list, target_dicts):
1826
+ """Initialize targets for the ninja flavor.
1827
+
1828
+ This sets up the necessary variables in the targets to generate msvs projects
1829
+ that use ninja as an external builder. The variables in the spec are only set
1830
+ if they have not been set. This allows individual specs to override the
1831
+ default values initialized here.
1832
+ Arguments:
1833
+ options: Options provided to the generator.
1834
+ target_list: List of target pairs: 'base/base.gyp:base'.
1835
+ target_dicts: Dict of target properties keyed on target pair.
1836
+ """
1837
+ for qualified_target in target_list:
1838
+ spec = target_dicts[qualified_target]
1839
+ if spec.get('msvs_external_builder'):
1840
+ # The spec explicitly defined an external builder, so don't change it.
1841
+ continue
1842
+
1843
+ path_to_ninja = spec.get('msvs_path_to_ninja', 'ninja.exe')
1844
+
1845
+ spec['msvs_external_builder'] = 'ninja'
1846
+ if not spec.get('msvs_external_builder_out_dir'):
1847
+ spec['msvs_external_builder_out_dir'] = \
1848
+ options.depth + '/out/$(Configuration)'
1849
+ if not spec.get('msvs_external_builder_build_cmd'):
1850
+ spec['msvs_external_builder_build_cmd'] = [
1851
+ path_to_ninja,
1852
+ '-C',
1853
+ '$(OutDir)',
1854
+ '$(ProjectName)',
1855
+ ]
1856
+ if not spec.get('msvs_external_builder_clean_cmd'):
1857
+ spec['msvs_external_builder_clean_cmd'] = [
1858
+ path_to_ninja,
1859
+ '-C',
1860
+ '$(OutDir)',
1861
+ '-t',
1862
+ 'clean',
1863
+ '$(ProjectName)',
1864
+ ]
1865
+
1866
+
1867
+ def CalculateVariables(default_variables, params):
1868
+ """Generated variables that require params to be known."""
1869
+
1870
+ generator_flags = params.get('generator_flags', {})
1871
+
1872
+ # Select project file format version (if unset, default to auto detecting).
1873
+ msvs_version = MSVSVersion.SelectVisualStudioVersion(
1874
+ generator_flags.get('msvs_version', 'auto'))
1875
+ # Stash msvs_version for later (so we don't have to probe the system twice).
1876
+ params['msvs_version'] = msvs_version
1877
+
1878
+ # Set a variable so conditions can be based on msvs_version.
1879
+ default_variables['MSVS_VERSION'] = msvs_version.ShortName()
1880
+
1881
+ # To determine processor word size on Windows, in addition to checking
1882
+ # PROCESSOR_ARCHITECTURE (which reflects the word size of the current
1883
+ # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which
1884
+ # contains the actual word size of the system when running thru WOW64).
1885
+ if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or
1886
+ os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0):
1887
+ default_variables['MSVS_OS_BITS'] = 64
1888
+ else:
1889
+ default_variables['MSVS_OS_BITS'] = 32
1890
+
1891
+ if gyp.common.GetFlavor(params) == 'ninja':
1892
+ default_variables['SHARED_INTERMEDIATE_DIR'] = '$(OutDir)gen'
1893
+
1894
+
1895
+ def PerformBuild(data, configurations, params):
1896
+ options = params['options']
1897
+ msvs_version = params['msvs_version']
1898
+ devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com')
1899
+
1900
+ for build_file, build_file_dict in data.iteritems():
1901
+ (build_file_root, build_file_ext) = os.path.splitext(build_file)
1902
+ if build_file_ext != '.gyp':
1903
+ continue
1904
+ sln_path = build_file_root + options.suffix + '.sln'
1905
+ if options.generator_output:
1906
+ sln_path = os.path.join(options.generator_output, sln_path)
1907
+
1908
+ for config in configurations:
1909
+ arguments = [devenv, sln_path, '/Build', config]
1910
+ print 'Building [%s]: %s' % (config, arguments)
1911
+ rtn = subprocess.check_call(arguments)
1912
+
1913
+
1914
+ def GenerateOutput(target_list, target_dicts, data, params):
1915
+ """Generate .sln and .vcproj files.
1916
+
1917
+ This is the entry point for this generator.
1918
+ Arguments:
1919
+ target_list: List of target pairs: 'base/base.gyp:base'.
1920
+ target_dicts: Dict of target properties keyed on target pair.
1921
+ data: Dictionary containing per .gyp data.
1922
+ """
1923
+ global fixpath_prefix
1924
+
1925
+ options = params['options']
1926
+
1927
+ # Get the project file format version back out of where we stashed it in
1928
+ # GeneratorCalculatedVariables.
1929
+ msvs_version = params['msvs_version']
1930
+
1931
+ generator_flags = params.get('generator_flags', {})
1932
+
1933
+ # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT.
1934
+ (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts)
1935
+
1936
+ # Optionally use the large PDB workaround for targets marked with
1937
+ # 'msvs_large_pdb': 1.
1938
+ (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims(
1939
+ target_list, target_dicts, generator_default_variables)
1940
+
1941
+ # Optionally configure each spec to use ninja as the external builder.
1942
+ if params.get('flavor') == 'ninja':
1943
+ _InitNinjaFlavor(options, target_list, target_dicts)
1944
+
1945
+ # Prepare the set of configurations.
1946
+ configs = set()
1947
+ for qualified_target in target_list:
1948
+ spec = target_dicts[qualified_target]
1949
+ for config_name, config in spec['configurations'].iteritems():
1950
+ configs.add(_ConfigFullName(config_name, config))
1951
+ configs = list(configs)
1952
+
1953
+ # Figure out all the projects that will be generated and their guids
1954
+ project_objects = _CreateProjectObjects(target_list, target_dicts, options,
1955
+ msvs_version)
1956
+
1957
+ # Generate each project.
1958
+ missing_sources = []
1959
+ for project in project_objects.values():
1960
+ fixpath_prefix = project.fixpath_prefix
1961
+ missing_sources.extend(_GenerateProject(project, options, msvs_version,
1962
+ generator_flags))
1963
+ fixpath_prefix = None
1964
+
1965
+ for build_file in data:
1966
+ # Validate build_file extension
1967
+ if not build_file.endswith('.gyp'):
1968
+ continue
1969
+ sln_path = os.path.splitext(build_file)[0] + options.suffix + '.sln'
1970
+ if options.generator_output:
1971
+ sln_path = os.path.join(options.generator_output, sln_path)
1972
+ # Get projects in the solution, and their dependents.
1973
+ sln_projects = gyp.common.BuildFileTargets(target_list, build_file)
1974
+ sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects)
1975
+ # Create folder hierarchy.
1976
+ root_entries = _GatherSolutionFolders(
1977
+ sln_projects, project_objects, flat=msvs_version.FlatSolution())
1978
+ # Create solution.
1979
+ sln = MSVSNew.MSVSSolution(sln_path,
1980
+ entries=root_entries,
1981
+ variants=configs,
1982
+ websiteProperties=False,
1983
+ version=msvs_version)
1984
+ sln.Write()
1985
+
1986
+ if missing_sources:
1987
+ error_message = "Missing input files:\n" + \
1988
+ '\n'.join(set(missing_sources))
1989
+ if generator_flags.get('msvs_error_on_missing_sources', False):
1990
+ raise GypError(error_message)
1991
+ else:
1992
+ print >> sys.stdout, "Warning: " + error_message
1993
+
1994
+
1995
+ def _GenerateMSBuildFiltersFile(filters_path, source_files,
1996
+ extension_to_rule_name):
1997
+ """Generate the filters file.
1998
+
1999
+ This file is used by Visual Studio to organize the presentation of source
2000
+ files into folders.
2001
+
2002
+ Arguments:
2003
+ filters_path: The path of the file to be created.
2004
+ source_files: The hierarchical structure of all the sources.
2005
+ extension_to_rule_name: A dictionary mapping file extensions to rules.
2006
+ """
2007
+ filter_group = []
2008
+ source_group = []
2009
+ _AppendFiltersForMSBuild('', source_files, extension_to_rule_name,
2010
+ filter_group, source_group)
2011
+ if filter_group:
2012
+ content = ['Project',
2013
+ {'ToolsVersion': '4.0',
2014
+ 'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'
2015
+ },
2016
+ ['ItemGroup'] + filter_group,
2017
+ ['ItemGroup'] + source_group
2018
+ ]
2019
+ easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True)
2020
+ elif os.path.exists(filters_path):
2021
+ # We don't need this filter anymore. Delete the old filter file.
2022
+ os.unlink(filters_path)
2023
+
2024
+
2025
+ def _AppendFiltersForMSBuild(parent_filter_name, sources,
2026
+ extension_to_rule_name,
2027
+ filter_group, source_group):
2028
+ """Creates the list of filters and sources to be added in the filter file.
2029
+
2030
+ Args:
2031
+ parent_filter_name: The name of the filter under which the sources are
2032
+ found.
2033
+ sources: The hierarchy of filters and sources to process.
2034
+ extension_to_rule_name: A dictionary mapping file extensions to rules.
2035
+ filter_group: The list to which filter entries will be appended.
2036
+ source_group: The list to which source entries will be appeneded.
2037
+ """
2038
+ for source in sources:
2039
+ if isinstance(source, MSVSProject.Filter):
2040
+ # We have a sub-filter. Create the name of that sub-filter.
2041
+ if not parent_filter_name:
2042
+ filter_name = source.name
2043
+ else:
2044
+ filter_name = '%s\\%s' % (parent_filter_name, source.name)
2045
+ # Add the filter to the group.
2046
+ filter_group.append(
2047
+ ['Filter', {'Include': filter_name},
2048
+ ['UniqueIdentifier', MSVSNew.MakeGuid(source.name)]])
2049
+ # Recurse and add its dependents.
2050
+ _AppendFiltersForMSBuild(filter_name, source.contents,
2051
+ extension_to_rule_name,
2052
+ filter_group, source_group)
2053
+ else:
2054
+ # It's a source. Create a source entry.
2055
+ _, element = _MapFileToMsBuildSourceType(source, extension_to_rule_name)
2056
+ source_entry = [element, {'Include': source}]
2057
+ # Specify the filter it is part of, if any.
2058
+ if parent_filter_name:
2059
+ source_entry.append(['Filter', parent_filter_name])
2060
+ source_group.append(source_entry)
2061
+
2062
+
2063
+ def _MapFileToMsBuildSourceType(source, extension_to_rule_name):
2064
+ """Returns the group and element type of the source file.
2065
+
2066
+ Arguments:
2067
+ source: The source file name.
2068
+ extension_to_rule_name: A dictionary mapping file extensions to rules.
2069
+
2070
+ Returns:
2071
+ A pair of (group this file should be part of, the label of element)
2072
+ """
2073
+ _, ext = os.path.splitext(source)
2074
+ if ext in extension_to_rule_name:
2075
+ group = 'rule'
2076
+ element = extension_to_rule_name[ext]
2077
+ elif ext in ['.cc', '.cpp', '.c', '.cxx']:
2078
+ group = 'compile'
2079
+ element = 'ClCompile'
2080
+ elif ext in ['.h', '.hxx']:
2081
+ group = 'include'
2082
+ element = 'ClInclude'
2083
+ elif ext == '.rc':
2084
+ group = 'resource'
2085
+ element = 'ResourceCompile'
2086
+ elif ext == '.idl':
2087
+ group = 'midl'
2088
+ element = 'Midl'
2089
+ else:
2090
+ group = 'none'
2091
+ element = 'None'
2092
+ return (group, element)
2093
+
2094
+
2095
+ def _GenerateRulesForMSBuild(output_dir, options, spec,
2096
+ sources, excluded_sources,
2097
+ props_files_of_rules, targets_files_of_rules,
2098
+ actions_to_add, extension_to_rule_name):
2099
+ # MSBuild rules are implemented using three files: an XML file, a .targets
2100
+ # file and a .props file.
2101
+ # See http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx
2102
+ # for more details.
2103
+ rules = spec.get('rules', [])
2104
+ rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))]
2105
+ rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))]
2106
+
2107
+ msbuild_rules = []
2108
+ for rule in rules_native:
2109
+ # Skip a rule with no action and no inputs.
2110
+ if 'action' not in rule and not rule.get('rule_sources', []):
2111
+ continue
2112
+ msbuild_rule = MSBuildRule(rule, spec)
2113
+ msbuild_rules.append(msbuild_rule)
2114
+ extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name
2115
+ if msbuild_rules:
2116
+ base = spec['target_name'] + options.suffix
2117
+ props_name = base + '.props'
2118
+ targets_name = base + '.targets'
2119
+ xml_name = base + '.xml'
2120
+
2121
+ props_files_of_rules.add(props_name)
2122
+ targets_files_of_rules.add(targets_name)
2123
+
2124
+ props_path = os.path.join(output_dir, props_name)
2125
+ targets_path = os.path.join(output_dir, targets_name)
2126
+ xml_path = os.path.join(output_dir, xml_name)
2127
+
2128
+ _GenerateMSBuildRulePropsFile(props_path, msbuild_rules)
2129
+ _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules)
2130
+ _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules)
2131
+
2132
+ if rules_external:
2133
+ _GenerateExternalRules(rules_external, output_dir, spec,
2134
+ sources, options, actions_to_add)
2135
+ _AdjustSourcesForRules(spec, rules, sources, excluded_sources)
2136
+
2137
+
2138
+ class MSBuildRule(object):
2139
+ """Used to store information used to generate an MSBuild rule.
2140
+
2141
+ Attributes:
2142
+ rule_name: The rule name, sanitized to use in XML.
2143
+ target_name: The name of the target.
2144
+ after_targets: The name of the AfterTargets element.
2145
+ before_targets: The name of the BeforeTargets element.
2146
+ depends_on: The name of the DependsOn element.
2147
+ compute_output: The name of the ComputeOutput element.
2148
+ dirs_to_make: The name of the DirsToMake element.
2149
+ inputs: The name of the _inputs element.
2150
+ tlog: The name of the _tlog element.
2151
+ extension: The extension this rule applies to.
2152
+ description: The message displayed when this rule is invoked.
2153
+ additional_dependencies: A string listing additional dependencies.
2154
+ outputs: The outputs of this rule.
2155
+ command: The command used to run the rule.
2156
+ """
2157
+
2158
+ def __init__(self, rule, spec):
2159
+ self.display_name = rule['rule_name']
2160
+ # Assure that the rule name is only characters and numbers
2161
+ self.rule_name = re.sub(r'\W', '_', self.display_name)
2162
+ # Create the various element names, following the example set by the
2163
+ # Visual Studio 2008 to 2010 conversion. I don't know if VS2010
2164
+ # is sensitive to the exact names.
2165
+ self.target_name = '_' + self.rule_name
2166
+ self.after_targets = self.rule_name + 'AfterTargets'
2167
+ self.before_targets = self.rule_name + 'BeforeTargets'
2168
+ self.depends_on = self.rule_name + 'DependsOn'
2169
+ self.compute_output = 'Compute%sOutput' % self.rule_name
2170
+ self.dirs_to_make = self.rule_name + 'DirsToMake'
2171
+ self.inputs = self.rule_name + '_inputs'
2172
+ self.tlog = self.rule_name + '_tlog'
2173
+ self.extension = rule['extension']
2174
+ if not self.extension.startswith('.'):
2175
+ self.extension = '.' + self.extension
2176
+
2177
+ self.description = MSVSSettings.ConvertVCMacrosToMSBuild(
2178
+ rule.get('message', self.rule_name))
2179
+ old_additional_dependencies = _FixPaths(rule.get('inputs', []))
2180
+ self.additional_dependencies = (
2181
+ ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i)
2182
+ for i in old_additional_dependencies]))
2183
+ old_outputs = _FixPaths(rule.get('outputs', []))
2184
+ self.outputs = ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i)
2185
+ for i in old_outputs])
2186
+ old_command = _BuildCommandLineForRule(spec, rule, has_input_path=True,
2187
+ do_setup_env=True)
2188
+ self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command)
2189
+
2190
+
2191
+ def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules):
2192
+ """Generate the .props file."""
2193
+ content = ['Project',
2194
+ {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'}]
2195
+ for rule in msbuild_rules:
2196
+ content.extend([
2197
+ ['PropertyGroup',
2198
+ {'Condition': "'$(%s)' == '' and '$(%s)' == '' and "
2199
+ "'$(ConfigurationType)' != 'Makefile'" % (rule.before_targets,
2200
+ rule.after_targets)
2201
+ },
2202
+ [rule.before_targets, 'Midl'],
2203
+ [rule.after_targets, 'CustomBuild'],
2204
+ ],
2205
+ ['PropertyGroup',
2206
+ [rule.depends_on,
2207
+ {'Condition': "'$(ConfigurationType)' != 'Makefile'"},
2208
+ '_SelectedFiles;$(%s)' % rule.depends_on
2209
+ ],
2210
+ ],
2211
+ ['ItemDefinitionGroup',
2212
+ [rule.rule_name,
2213
+ ['CommandLineTemplate', rule.command],
2214
+ ['Outputs', rule.outputs],
2215
+ ['ExecutionDescription', rule.description],
2216
+ ['AdditionalDependencies', rule.additional_dependencies],
2217
+ ],
2218
+ ]
2219
+ ])
2220
+ easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True)
2221
+
2222
+
2223
+ def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules):
2224
+ """Generate the .targets file."""
2225
+ content = ['Project',
2226
+ {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'
2227
+ }
2228
+ ]
2229
+ item_group = [
2230
+ 'ItemGroup',
2231
+ ['PropertyPageSchema',
2232
+ {'Include': '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'}
2233
+ ]
2234
+ ]
2235
+ for rule in msbuild_rules:
2236
+ item_group.append(
2237
+ ['AvailableItemName',
2238
+ {'Include': rule.rule_name},
2239
+ ['Targets', rule.target_name],
2240
+ ])
2241
+ content.append(item_group)
2242
+
2243
+ for rule in msbuild_rules:
2244
+ content.append(
2245
+ ['UsingTask',
2246
+ {'TaskName': rule.rule_name,
2247
+ 'TaskFactory': 'XamlTaskFactory',
2248
+ 'AssemblyName': 'Microsoft.Build.Tasks.v4.0'
2249
+ },
2250
+ ['Task', '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'],
2251
+ ])
2252
+ for rule in msbuild_rules:
2253
+ rule_name = rule.rule_name
2254
+ target_outputs = '%%(%s.Outputs)' % rule_name
2255
+ target_inputs = ('%%(%s.Identity);%%(%s.AdditionalDependencies);'
2256
+ '$(MSBuildProjectFile)') % (rule_name, rule_name)
2257
+ rule_inputs = '%%(%s.Identity)' % rule_name
2258
+ extension_condition = ("'%(Extension)'=='.obj' or "
2259
+ "'%(Extension)'=='.res' or "
2260
+ "'%(Extension)'=='.rsc' or "
2261
+ "'%(Extension)'=='.lib'")
2262
+ remove_section = [
2263
+ 'ItemGroup',
2264
+ {'Condition': "'@(SelectedFiles)' != ''"},
2265
+ [rule_name,
2266
+ {'Remove': '@(%s)' % rule_name,
2267
+ 'Condition': "'%(Identity)' != '@(SelectedFiles)'"
2268
+ }
2269
+ ]
2270
+ ]
2271
+ inputs_section = [
2272
+ 'ItemGroup',
2273
+ [rule.inputs, {'Include': '%%(%s.AdditionalDependencies)' % rule_name}]
2274
+ ]
2275
+ logging_section = [
2276
+ 'ItemGroup',
2277
+ [rule.tlog,
2278
+ {'Include': '%%(%s.Outputs)' % rule_name,
2279
+ 'Condition': ("'%%(%s.Outputs)' != '' and "
2280
+ "'%%(%s.ExcludedFromBuild)' != 'true'" %
2281
+ (rule_name, rule_name))
2282
+ },
2283
+ ['Source', "@(%s, '|')" % rule_name],
2284
+ ['Inputs', "@(%s -> '%%(Fullpath)', ';')" % rule.inputs],
2285
+ ],
2286
+ ]
2287
+ message_section = [
2288
+ 'Message',
2289
+ {'Importance': 'High',
2290
+ 'Text': '%%(%s.ExecutionDescription)' % rule_name
2291
+ }
2292
+ ]
2293
+ write_tlog_section = [
2294
+ 'WriteLinesToFile',
2295
+ {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
2296
+ "'true'" % (rule.tlog, rule.tlog),
2297
+ 'File': '$(IntDir)$(ProjectName).write.1.tlog',
2298
+ 'Lines': "^%%(%s.Source);@(%s->'%%(Fullpath)')" % (rule.tlog,
2299
+ rule.tlog)
2300
+ }
2301
+ ]
2302
+ read_tlog_section = [
2303
+ 'WriteLinesToFile',
2304
+ {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
2305
+ "'true'" % (rule.tlog, rule.tlog),
2306
+ 'File': '$(IntDir)$(ProjectName).read.1.tlog',
2307
+ 'Lines': "^%%(%s.Source);%%(%s.Inputs)" % (rule.tlog, rule.tlog)
2308
+ }
2309
+ ]
2310
+ command_and_input_section = [
2311
+ rule_name,
2312
+ {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
2313
+ "'true'" % (rule_name, rule_name),
2314
+ 'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name,
2315
+ 'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name,
2316
+ 'Inputs': rule_inputs
2317
+ }
2318
+ ]
2319
+ content.extend([
2320
+ ['Target',
2321
+ {'Name': rule.target_name,
2322
+ 'BeforeTargets': '$(%s)' % rule.before_targets,
2323
+ 'AfterTargets': '$(%s)' % rule.after_targets,
2324
+ 'Condition': "'@(%s)' != ''" % rule_name,
2325
+ 'DependsOnTargets': '$(%s);%s' % (rule.depends_on,
2326
+ rule.compute_output),
2327
+ 'Outputs': target_outputs,
2328
+ 'Inputs': target_inputs
2329
+ },
2330
+ remove_section,
2331
+ inputs_section,
2332
+ logging_section,
2333
+ message_section,
2334
+ write_tlog_section,
2335
+ read_tlog_section,
2336
+ command_and_input_section,
2337
+ ],
2338
+ ['PropertyGroup',
2339
+ ['ComputeLinkInputsTargets',
2340
+ '$(ComputeLinkInputsTargets);',
2341
+ '%s;' % rule.compute_output
2342
+ ],
2343
+ ['ComputeLibInputsTargets',
2344
+ '$(ComputeLibInputsTargets);',
2345
+ '%s;' % rule.compute_output
2346
+ ],
2347
+ ],
2348
+ ['Target',
2349
+ {'Name': rule.compute_output,
2350
+ 'Condition': "'@(%s)' != ''" % rule_name
2351
+ },
2352
+ ['ItemGroup',
2353
+ [rule.dirs_to_make,
2354
+ {'Condition': "'@(%s)' != '' and "
2355
+ "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name),
2356
+ 'Include': '%%(%s.Outputs)' % rule_name
2357
+ }
2358
+ ],
2359
+ ['Link',
2360
+ {'Include': '%%(%s.Identity)' % rule.dirs_to_make,
2361
+ 'Condition': extension_condition
2362
+ }
2363
+ ],
2364
+ ['Lib',
2365
+ {'Include': '%%(%s.Identity)' % rule.dirs_to_make,
2366
+ 'Condition': extension_condition
2367
+ }
2368
+ ],
2369
+ ['ImpLib',
2370
+ {'Include': '%%(%s.Identity)' % rule.dirs_to_make,
2371
+ 'Condition': extension_condition
2372
+ }
2373
+ ],
2374
+ ],
2375
+ ['MakeDir',
2376
+ {'Directories': ("@(%s->'%%(RootDir)%%(Directory)')" %
2377
+ rule.dirs_to_make)
2378
+ }
2379
+ ]
2380
+ ],
2381
+ ])
2382
+ easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True)
2383
+
2384
+
2385
+ def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules):
2386
+ # Generate the .xml file
2387
+ content = [
2388
+ 'ProjectSchemaDefinitions',
2389
+ {'xmlns': ('clr-namespace:Microsoft.Build.Framework.XamlTypes;'
2390
+ 'assembly=Microsoft.Build.Framework'),
2391
+ 'xmlns:x': 'http://schemas.microsoft.com/winfx/2006/xaml',
2392
+ 'xmlns:sys': 'clr-namespace:System;assembly=mscorlib',
2393
+ 'xmlns:transformCallback':
2394
+ 'Microsoft.Cpp.Dev10.ConvertPropertyCallback'
2395
+ }
2396
+ ]
2397
+ for rule in msbuild_rules:
2398
+ content.extend([
2399
+ ['Rule',
2400
+ {'Name': rule.rule_name,
2401
+ 'PageTemplate': 'tool',
2402
+ 'DisplayName': rule.display_name,
2403
+ 'Order': '200'
2404
+ },
2405
+ ['Rule.DataSource',
2406
+ ['DataSource',
2407
+ {'Persistence': 'ProjectFile',
2408
+ 'ItemType': rule.rule_name
2409
+ }
2410
+ ]
2411
+ ],
2412
+ ['Rule.Categories',
2413
+ ['Category',
2414
+ {'Name': 'General'},
2415
+ ['Category.DisplayName',
2416
+ ['sys:String', 'General'],
2417
+ ],
2418
+ ],
2419
+ ['Category',
2420
+ {'Name': 'Command Line',
2421
+ 'Subtype': 'CommandLine'
2422
+ },
2423
+ ['Category.DisplayName',
2424
+ ['sys:String', 'Command Line'],
2425
+ ],
2426
+ ],
2427
+ ],
2428
+ ['StringListProperty',
2429
+ {'Name': 'Inputs',
2430
+ 'Category': 'Command Line',
2431
+ 'IsRequired': 'true',
2432
+ 'Switch': ' '
2433
+ },
2434
+ ['StringListProperty.DataSource',
2435
+ ['DataSource',
2436
+ {'Persistence': 'ProjectFile',
2437
+ 'ItemType': rule.rule_name,
2438
+ 'SourceType': 'Item'
2439
+ }
2440
+ ]
2441
+ ],
2442
+ ],
2443
+ ['StringProperty',
2444
+ {'Name': 'CommandLineTemplate',
2445
+ 'DisplayName': 'Command Line',
2446
+ 'Visible': 'False',
2447
+ 'IncludeInCommandLine': 'False'
2448
+ }
2449
+ ],
2450
+ ['DynamicEnumProperty',
2451
+ {'Name': rule.before_targets,
2452
+ 'Category': 'General',
2453
+ 'EnumProvider': 'Targets',
2454
+ 'IncludeInCommandLine': 'False'
2455
+ },
2456
+ ['DynamicEnumProperty.DisplayName',
2457
+ ['sys:String', 'Execute Before'],
2458
+ ],
2459
+ ['DynamicEnumProperty.Description',
2460
+ ['sys:String', 'Specifies the targets for the build customization'
2461
+ ' to run before.'
2462
+ ],
2463
+ ],
2464
+ ['DynamicEnumProperty.ProviderSettings',
2465
+ ['NameValuePair',
2466
+ {'Name': 'Exclude',
2467
+ 'Value': '^%s|^Compute' % rule.before_targets
2468
+ }
2469
+ ]
2470
+ ],
2471
+ ['DynamicEnumProperty.DataSource',
2472
+ ['DataSource',
2473
+ {'Persistence': 'ProjectFile',
2474
+ 'HasConfigurationCondition': 'true'
2475
+ }
2476
+ ]
2477
+ ],
2478
+ ],
2479
+ ['DynamicEnumProperty',
2480
+ {'Name': rule.after_targets,
2481
+ 'Category': 'General',
2482
+ 'EnumProvider': 'Targets',
2483
+ 'IncludeInCommandLine': 'False'
2484
+ },
2485
+ ['DynamicEnumProperty.DisplayName',
2486
+ ['sys:String', 'Execute After'],
2487
+ ],
2488
+ ['DynamicEnumProperty.Description',
2489
+ ['sys:String', ('Specifies the targets for the build customization'
2490
+ ' to run after.')
2491
+ ],
2492
+ ],
2493
+ ['DynamicEnumProperty.ProviderSettings',
2494
+ ['NameValuePair',
2495
+ {'Name': 'Exclude',
2496
+ 'Value': '^%s|^Compute' % rule.after_targets
2497
+ }
2498
+ ]
2499
+ ],
2500
+ ['DynamicEnumProperty.DataSource',
2501
+ ['DataSource',
2502
+ {'Persistence': 'ProjectFile',
2503
+ 'ItemType': '',
2504
+ 'HasConfigurationCondition': 'true'
2505
+ }
2506
+ ]
2507
+ ],
2508
+ ],
2509
+ ['StringListProperty',
2510
+ {'Name': 'Outputs',
2511
+ 'DisplayName': 'Outputs',
2512
+ 'Visible': 'False',
2513
+ 'IncludeInCommandLine': 'False'
2514
+ }
2515
+ ],
2516
+ ['StringProperty',
2517
+ {'Name': 'ExecutionDescription',
2518
+ 'DisplayName': 'Execution Description',
2519
+ 'Visible': 'False',
2520
+ 'IncludeInCommandLine': 'False'
2521
+ }
2522
+ ],
2523
+ ['StringListProperty',
2524
+ {'Name': 'AdditionalDependencies',
2525
+ 'DisplayName': 'Additional Dependencies',
2526
+ 'IncludeInCommandLine': 'False',
2527
+ 'Visible': 'false'
2528
+ }
2529
+ ],
2530
+ ['StringProperty',
2531
+ {'Subtype': 'AdditionalOptions',
2532
+ 'Name': 'AdditionalOptions',
2533
+ 'Category': 'Command Line'
2534
+ },
2535
+ ['StringProperty.DisplayName',
2536
+ ['sys:String', 'Additional Options'],
2537
+ ],
2538
+ ['StringProperty.Description',
2539
+ ['sys:String', 'Additional Options'],
2540
+ ],
2541
+ ],
2542
+ ],
2543
+ ['ItemType',
2544
+ {'Name': rule.rule_name,
2545
+ 'DisplayName': rule.display_name
2546
+ }
2547
+ ],
2548
+ ['FileExtension',
2549
+ {'Name': '*' + rule.extension,
2550
+ 'ContentType': rule.rule_name
2551
+ }
2552
+ ],
2553
+ ['ContentType',
2554
+ {'Name': rule.rule_name,
2555
+ 'DisplayName': '',
2556
+ 'ItemType': rule.rule_name
2557
+ }
2558
+ ]
2559
+ ])
2560
+ easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True)
2561
+
2562
+
2563
+ def _GetConfigurationAndPlatform(name, settings):
2564
+ configuration = name.rsplit('_', 1)[0]
2565
+ platform = settings.get('msvs_configuration_platform', 'Win32')
2566
+ return (configuration, platform)
2567
+
2568
+
2569
+ def _GetConfigurationCondition(name, settings):
2570
+ return (r"'$(Configuration)|$(Platform)'=='%s|%s'" %
2571
+ _GetConfigurationAndPlatform(name, settings))
2572
+
2573
+
2574
+ def _GetMSBuildProjectConfigurations(configurations):
2575
+ group = ['ItemGroup', {'Label': 'ProjectConfigurations'}]
2576
+ for (name, settings) in sorted(configurations.iteritems()):
2577
+ configuration, platform = _GetConfigurationAndPlatform(name, settings)
2578
+ designation = '%s|%s' % (configuration, platform)
2579
+ group.append(
2580
+ ['ProjectConfiguration', {'Include': designation},
2581
+ ['Configuration', configuration],
2582
+ ['Platform', platform]])
2583
+ return [group]
2584
+
2585
+
2586
+ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
2587
+ namespace = os.path.splitext(gyp_file_name)[0]
2588
+ return [
2589
+ ['PropertyGroup', {'Label': 'Globals'},
2590
+ ['ProjectGuid', guid],
2591
+ ['Keyword', 'Win32Proj'],
2592
+ ['RootNamespace', namespace],
2593
+ ['IgnoreWarnCompileDuplicatedFilename', 'true'],
2594
+ ]
2595
+ ]
2596
+
2597
+
2598
+ def _GetMSBuildConfigurationDetails(spec, build_file):
2599
+ properties = {}
2600
+ for name, settings in spec['configurations'].iteritems():
2601
+ msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file)
2602
+ condition = _GetConfigurationCondition(name, settings)
2603
+ character_set = msbuild_attributes.get('CharacterSet')
2604
+ _AddConditionalProperty(properties, condition, 'ConfigurationType',
2605
+ msbuild_attributes['ConfigurationType'])
2606
+ if character_set:
2607
+ _AddConditionalProperty(properties, condition, 'CharacterSet',
2608
+ character_set)
2609
+ return _GetMSBuildPropertyGroup(spec, 'Configuration', properties)
2610
+
2611
+
2612
+ def _GetMSBuildLocalProperties(msbuild_toolset):
2613
+ # Currently the only local property we support is PlatformToolset
2614
+ properties = {}
2615
+ if msbuild_toolset:
2616
+ properties = [
2617
+ ['PropertyGroup', {'Label': 'Locals'},
2618
+ ['PlatformToolset', msbuild_toolset],
2619
+ ]
2620
+ ]
2621
+ return properties
2622
+
2623
+
2624
+ def _GetMSBuildPropertySheets(configurations):
2625
+ user_props = r'$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props'
2626
+ additional_props = {}
2627
+ props_specified = False
2628
+ for name, settings in sorted(configurations.iteritems()):
2629
+ configuration = _GetConfigurationCondition(name, settings)
2630
+ if settings.has_key('msbuild_props'):
2631
+ additional_props[configuration] = _FixPaths(settings['msbuild_props'])
2632
+ props_specified = True
2633
+ else:
2634
+ additional_props[configuration] = ''
2635
+
2636
+ if not props_specified:
2637
+ return [
2638
+ ['ImportGroup',
2639
+ {'Label': 'PropertySheets'},
2640
+ ['Import',
2641
+ {'Project': user_props,
2642
+ 'Condition': "exists('%s')" % user_props,
2643
+ 'Label': 'LocalAppDataPlatform'
2644
+ }
2645
+ ]
2646
+ ]
2647
+ ]
2648
+ else:
2649
+ sheets = []
2650
+ for condition, props in additional_props.iteritems():
2651
+ import_group = [
2652
+ 'ImportGroup',
2653
+ {'Label': 'PropertySheets',
2654
+ 'Condition': condition
2655
+ },
2656
+ ['Import',
2657
+ {'Project': user_props,
2658
+ 'Condition': "exists('%s')" % user_props,
2659
+ 'Label': 'LocalAppDataPlatform'
2660
+ }
2661
+ ]
2662
+ ]
2663
+ for props_file in props:
2664
+ import_group.append(['Import', {'Project':props_file}])
2665
+ sheets.append(import_group)
2666
+ return sheets
2667
+
2668
+ def _ConvertMSVSBuildAttributes(spec, config, build_file):
2669
+ config_type = _GetMSVSConfigurationType(spec, build_file)
2670
+ msvs_attributes = _GetMSVSAttributes(spec, config, config_type)
2671
+ msbuild_attributes = {}
2672
+ for a in msvs_attributes:
2673
+ if a in ['IntermediateDirectory', 'OutputDirectory']:
2674
+ directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a])
2675
+ if not directory.endswith('\\'):
2676
+ directory += '\\'
2677
+ msbuild_attributes[a] = directory
2678
+ elif a == 'CharacterSet':
2679
+ msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a])
2680
+ elif a == 'ConfigurationType':
2681
+ msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a])
2682
+ else:
2683
+ print 'Warning: Do not know how to convert MSVS attribute ' + a
2684
+ return msbuild_attributes
2685
+
2686
+
2687
+ def _ConvertMSVSCharacterSet(char_set):
2688
+ if char_set.isdigit():
2689
+ char_set = {
2690
+ '0': 'MultiByte',
2691
+ '1': 'Unicode',
2692
+ '2': 'MultiByte',
2693
+ }[char_set]
2694
+ return char_set
2695
+
2696
+
2697
+ def _ConvertMSVSConfigurationType(config_type):
2698
+ if config_type.isdigit():
2699
+ config_type = {
2700
+ '1': 'Application',
2701
+ '2': 'DynamicLibrary',
2702
+ '4': 'StaticLibrary',
2703
+ '10': 'Utility'
2704
+ }[config_type]
2705
+ return config_type
2706
+
2707
+
2708
+ def _GetMSBuildAttributes(spec, config, build_file):
2709
+ if 'msbuild_configuration_attributes' not in config:
2710
+ msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file)
2711
+
2712
+ else:
2713
+ config_type = _GetMSVSConfigurationType(spec, build_file)
2714
+ config_type = _ConvertMSVSConfigurationType(config_type)
2715
+ msbuild_attributes = config.get('msbuild_configuration_attributes', {})
2716
+ msbuild_attributes.setdefault('ConfigurationType', config_type)
2717
+ output_dir = msbuild_attributes.get('OutputDirectory',
2718
+ '$(SolutionDir)$(Configuration)')
2719
+ msbuild_attributes['OutputDirectory'] = _FixPath(output_dir) + '\\'
2720
+ if 'IntermediateDirectory' not in msbuild_attributes:
2721
+ intermediate = _FixPath('$(Configuration)') + '\\'
2722
+ msbuild_attributes['IntermediateDirectory'] = intermediate
2723
+ if 'CharacterSet' in msbuild_attributes:
2724
+ msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet(
2725
+ msbuild_attributes['CharacterSet'])
2726
+ if 'TargetName' not in msbuild_attributes:
2727
+ prefix = spec.get('product_prefix', '')
2728
+ product_name = spec.get('product_name', '$(ProjectName)')
2729
+ target_name = prefix + product_name
2730
+ msbuild_attributes['TargetName'] = target_name
2731
+
2732
+ if spec.get('msvs_external_builder'):
2733
+ external_out_dir = spec.get('msvs_external_builder_out_dir', '.')
2734
+ msbuild_attributes['OutputDirectory'] = _FixPath(external_out_dir) + '\\'
2735
+
2736
+ # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile'
2737
+ # (depending on the tool used) to avoid MSB8012 warning.
2738
+ msbuild_tool_map = {
2739
+ 'executable': 'Link',
2740
+ 'shared_library': 'Link',
2741
+ 'loadable_module': 'Link',
2742
+ 'static_library': 'Lib',
2743
+ }
2744
+ msbuild_tool = msbuild_tool_map.get(spec['type'])
2745
+ if msbuild_tool:
2746
+ msbuild_settings = config['finalized_msbuild_settings']
2747
+ out_file = msbuild_settings[msbuild_tool].get('OutputFile')
2748
+ if out_file:
2749
+ msbuild_attributes['TargetPath'] = _FixPath(out_file)
2750
+ target_ext = msbuild_settings[msbuild_tool].get('TargetExt')
2751
+ if target_ext:
2752
+ msbuild_attributes['TargetExt'] = target_ext
2753
+
2754
+ return msbuild_attributes
2755
+
2756
+
2757
+ def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file):
2758
+ # TODO(jeanluc) We could optimize out the following and do it only if
2759
+ # there are actions.
2760
+ # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'.
2761
+ new_paths = []
2762
+ cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.'])[0]
2763
+ if cygwin_dirs:
2764
+ cyg_path = '$(MSBuildProjectDirectory)\\%s\\bin\\' % _FixPath(cygwin_dirs)
2765
+ new_paths.append(cyg_path)
2766
+ # TODO(jeanluc) Change the convention to have both a cygwin_dir and a
2767
+ # python_dir.
2768
+ python_path = cyg_path.replace('cygwin\\bin', 'python_26')
2769
+ new_paths.append(python_path)
2770
+ if new_paths:
2771
+ new_paths = '$(ExecutablePath);' + ';'.join(new_paths)
2772
+
2773
+ properties = {}
2774
+ for (name, configuration) in sorted(configurations.iteritems()):
2775
+ condition = _GetConfigurationCondition(name, configuration)
2776
+ attributes = _GetMSBuildAttributes(spec, configuration, build_file)
2777
+ msbuild_settings = configuration['finalized_msbuild_settings']
2778
+ _AddConditionalProperty(properties, condition, 'IntDir',
2779
+ attributes['IntermediateDirectory'])
2780
+ _AddConditionalProperty(properties, condition, 'OutDir',
2781
+ attributes['OutputDirectory'])
2782
+ _AddConditionalProperty(properties, condition, 'TargetName',
2783
+ attributes['TargetName'])
2784
+
2785
+ if attributes.get('TargetPath'):
2786
+ _AddConditionalProperty(properties, condition, 'TargetPath',
2787
+ attributes['TargetPath'])
2788
+ if attributes.get('TargetExt'):
2789
+ _AddConditionalProperty(properties, condition, 'TargetExt',
2790
+ attributes['TargetExt'])
2791
+
2792
+ if new_paths:
2793
+ _AddConditionalProperty(properties, condition, 'ExecutablePath',
2794
+ new_paths)
2795
+ tool_settings = msbuild_settings.get('', {})
2796
+ for name, value in sorted(tool_settings.iteritems()):
2797
+ formatted_value = _GetValueFormattedForMSBuild('', name, value)
2798
+ _AddConditionalProperty(properties, condition, name, formatted_value)
2799
+ return _GetMSBuildPropertyGroup(spec, None, properties)
2800
+
2801
+
2802
+ def _AddConditionalProperty(properties, condition, name, value):
2803
+ """Adds a property / conditional value pair to a dictionary.
2804
+
2805
+ Arguments:
2806
+ properties: The dictionary to be modified. The key is the name of the
2807
+ property. The value is itself a dictionary; its key is the value and
2808
+ the value a list of condition for which this value is true.
2809
+ condition: The condition under which the named property has the value.
2810
+ name: The name of the property.
2811
+ value: The value of the property.
2812
+ """
2813
+ if name not in properties:
2814
+ properties[name] = {}
2815
+ values = properties[name]
2816
+ if value not in values:
2817
+ values[value] = []
2818
+ conditions = values[value]
2819
+ conditions.append(condition)
2820
+
2821
+
2822
+ # Regex for msvs variable references ( i.e. $(FOO) ).
2823
+ MSVS_VARIABLE_REFERENCE = re.compile('\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)')
2824
+
2825
+
2826
+ def _GetMSBuildPropertyGroup(spec, label, properties):
2827
+ """Returns a PropertyGroup definition for the specified properties.
2828
+
2829
+ Arguments:
2830
+ spec: The target project dict.
2831
+ label: An optional label for the PropertyGroup.
2832
+ properties: The dictionary to be converted. The key is the name of the
2833
+ property. The value is itself a dictionary; its key is the value and
2834
+ the value a list of condition for which this value is true.
2835
+ """
2836
+ group = ['PropertyGroup']
2837
+ if label:
2838
+ group.append({'Label': label})
2839
+ num_configurations = len(spec['configurations'])
2840
+ def GetEdges(node):
2841
+ # Use a definition of edges such that user_of_variable -> used_varible.
2842
+ # This happens to be easier in this case, since a variable's
2843
+ # definition contains all variables it references in a single string.
2844
+ edges = set()
2845
+ for value in sorted(properties[node].keys()):
2846
+ # Add to edges all $(...) references to variables.
2847
+ #
2848
+ # Variable references that refer to names not in properties are excluded
2849
+ # These can exist for instance to refer built in definitions like
2850
+ # $(SolutionDir).
2851
+ #
2852
+ # Self references are ignored. Self reference is used in a few places to
2853
+ # append to the default value. I.e. PATH=$(PATH);other_path
2854
+ edges.update(set([v for v in MSVS_VARIABLE_REFERENCE.findall(value)
2855
+ if v in properties and v != node]))
2856
+ return edges
2857
+ properties_ordered = gyp.common.TopologicallySorted(
2858
+ properties.keys(), GetEdges)
2859
+ # Walk properties in the reverse of a topological sort on
2860
+ # user_of_variable -> used_variable as this ensures variables are
2861
+ # defined before they are used.
2862
+ # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG))
2863
+ for name in reversed(properties_ordered):
2864
+ values = properties[name]
2865
+ for value, conditions in sorted(values.iteritems()):
2866
+ if len(conditions) == num_configurations:
2867
+ # If the value is the same all configurations,
2868
+ # just add one unconditional entry.
2869
+ group.append([name, value])
2870
+ else:
2871
+ for condition in conditions:
2872
+ group.append([name, {'Condition': condition}, value])
2873
+ return [group]
2874
+
2875
+
2876
+ def _GetMSBuildToolSettingsSections(spec, configurations):
2877
+ groups = []
2878
+ for (name, configuration) in sorted(configurations.iteritems()):
2879
+ msbuild_settings = configuration['finalized_msbuild_settings']
2880
+ group = ['ItemDefinitionGroup',
2881
+ {'Condition': _GetConfigurationCondition(name, configuration)}
2882
+ ]
2883
+ for tool_name, tool_settings in sorted(msbuild_settings.iteritems()):
2884
+ # Skip the tool named '' which is a holder of global settings handled
2885
+ # by _GetMSBuildConfigurationGlobalProperties.
2886
+ if tool_name:
2887
+ if tool_settings:
2888
+ tool = [tool_name]
2889
+ for name, value in sorted(tool_settings.iteritems()):
2890
+ formatted_value = _GetValueFormattedForMSBuild(tool_name, name,
2891
+ value)
2892
+ tool.append([name, formatted_value])
2893
+ group.append(tool)
2894
+ groups.append(group)
2895
+ return groups
2896
+
2897
+
2898
+ def _FinalizeMSBuildSettings(spec, configuration):
2899
+ if 'msbuild_settings' in configuration:
2900
+ converted = False
2901
+ msbuild_settings = configuration['msbuild_settings']
2902
+ MSVSSettings.ValidateMSBuildSettings(msbuild_settings)
2903
+ else:
2904
+ converted = True
2905
+ msvs_settings = configuration.get('msvs_settings', {})
2906
+ msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings)
2907
+ include_dirs, resource_include_dirs = _GetIncludeDirs(configuration)
2908
+ libraries = _GetLibraries(spec)
2909
+ library_dirs = _GetLibraryDirs(configuration)
2910
+ out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True)
2911
+ target_ext = _GetOutputTargetExt(spec)
2912
+ defines = _GetDefines(configuration)
2913
+ if converted:
2914
+ # Visual Studio 2010 has TR1
2915
+ defines = [d for d in defines if d != '_HAS_TR1=0']
2916
+ # Warn of ignored settings
2917
+ ignored_settings = ['msvs_tool_files']
2918
+ for ignored_setting in ignored_settings:
2919
+ value = configuration.get(ignored_setting)
2920
+ if value:
2921
+ print ('Warning: The automatic conversion to MSBuild does not handle '
2922
+ '%s. Ignoring setting of %s' % (ignored_setting, str(value)))
2923
+
2924
+ defines = [_EscapeCppDefineForMSBuild(d) for d in defines]
2925
+ disabled_warnings = _GetDisabledWarnings(configuration)
2926
+ prebuild = configuration.get('msvs_prebuild')
2927
+ postbuild = configuration.get('msvs_postbuild')
2928
+ def_file = _GetModuleDefinition(spec)
2929
+ precompiled_header = configuration.get('msvs_precompiled_header')
2930
+
2931
+ # Add the information to the appropriate tool
2932
+ # TODO(jeanluc) We could optimize and generate these settings only if
2933
+ # the corresponding files are found, e.g. don't generate ResourceCompile
2934
+ # if you don't have any resources.
2935
+ _ToolAppend(msbuild_settings, 'ClCompile',
2936
+ 'AdditionalIncludeDirectories', include_dirs)
2937
+ _ToolAppend(msbuild_settings, 'ResourceCompile',
2938
+ 'AdditionalIncludeDirectories', resource_include_dirs)
2939
+ # Add in libraries, note that even for empty libraries, we want this
2940
+ # set, to prevent inheriting default libraries from the enviroment.
2941
+ _ToolSetOrAppend(msbuild_settings, 'Link', 'AdditionalDependencies',
2942
+ libraries)
2943
+ _ToolAppend(msbuild_settings, 'Link', 'AdditionalLibraryDirectories',
2944
+ library_dirs)
2945
+ if out_file:
2946
+ _ToolAppend(msbuild_settings, msbuild_tool, 'OutputFile', out_file,
2947
+ only_if_unset=True)
2948
+ if target_ext:
2949
+ _ToolAppend(msbuild_settings, msbuild_tool, 'TargetExt', target_ext,
2950
+ only_if_unset=True)
2951
+ # Add defines.
2952
+ _ToolAppend(msbuild_settings, 'ClCompile',
2953
+ 'PreprocessorDefinitions', defines)
2954
+ _ToolAppend(msbuild_settings, 'ResourceCompile',
2955
+ 'PreprocessorDefinitions', defines)
2956
+ # Add disabled warnings.
2957
+ _ToolAppend(msbuild_settings, 'ClCompile',
2958
+ 'DisableSpecificWarnings', disabled_warnings)
2959
+ # Turn on precompiled headers if appropriate.
2960
+ if precompiled_header:
2961
+ precompiled_header = os.path.split(precompiled_header)[1]
2962
+ _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'Use')
2963
+ _ToolAppend(msbuild_settings, 'ClCompile',
2964
+ 'PrecompiledHeaderFile', precompiled_header)
2965
+ _ToolAppend(msbuild_settings, 'ClCompile',
2966
+ 'ForcedIncludeFiles', [precompiled_header])
2967
+ # Loadable modules don't generate import libraries;
2968
+ # tell dependent projects to not expect one.
2969
+ if spec['type'] == 'loadable_module':
2970
+ _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'true')
2971
+ # Set the module definition file if any.
2972
+ if def_file:
2973
+ _ToolAppend(msbuild_settings, 'Link', 'ModuleDefinitionFile', def_file)
2974
+ configuration['finalized_msbuild_settings'] = msbuild_settings
2975
+ if prebuild:
2976
+ _ToolAppend(msbuild_settings, 'PreBuildEvent', 'Command', prebuild)
2977
+ if postbuild:
2978
+ _ToolAppend(msbuild_settings, 'PostBuildEvent', 'Command', postbuild)
2979
+
2980
+
2981
+ def _GetValueFormattedForMSBuild(tool_name, name, value):
2982
+ if type(value) == list:
2983
+ # For some settings, VS2010 does not automatically extends the settings
2984
+ # TODO(jeanluc) Is this what we want?
2985
+ if name in ['AdditionalIncludeDirectories',
2986
+ 'AdditionalLibraryDirectories',
2987
+ 'AdditionalOptions',
2988
+ 'DelayLoadDLLs',
2989
+ 'DisableSpecificWarnings',
2990
+ 'PreprocessorDefinitions']:
2991
+ value.append('%%(%s)' % name)
2992
+ # For most tools, entries in a list should be separated with ';' but some
2993
+ # settings use a space. Check for those first.
2994
+ exceptions = {
2995
+ 'ClCompile': ['AdditionalOptions'],
2996
+ 'Link': ['AdditionalOptions'],
2997
+ 'Lib': ['AdditionalOptions']}
2998
+ if tool_name in exceptions and name in exceptions[tool_name]:
2999
+ char = ' '
3000
+ else:
3001
+ char = ';'
3002
+ formatted_value = char.join(
3003
+ [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value])
3004
+ else:
3005
+ formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value)
3006
+ return formatted_value
3007
+
3008
+
3009
+ def _VerifySourcesExist(sources, root_dir):
3010
+ """Verifies that all source files exist on disk.
3011
+
3012
+ Checks that all regular source files, i.e. not created at run time,
3013
+ exist on disk. Missing files cause needless recompilation but no otherwise
3014
+ visible errors.
3015
+
3016
+ Arguments:
3017
+ sources: A recursive list of Filter/file names.
3018
+ root_dir: The root directory for the relative path names.
3019
+ Returns:
3020
+ A list of source files that cannot be found on disk.
3021
+ """
3022
+ missing_sources = []
3023
+ for source in sources:
3024
+ if isinstance(source, MSVSProject.Filter):
3025
+ missing_sources.extend(_VerifySourcesExist(source.contents, root_dir))
3026
+ else:
3027
+ if '$' not in source:
3028
+ full_path = os.path.join(root_dir, source)
3029
+ if not os.path.exists(full_path):
3030
+ missing_sources.append(full_path)
3031
+ return missing_sources
3032
+
3033
+
3034
+ def _GetMSBuildSources(spec, sources, exclusions, extension_to_rule_name,
3035
+ actions_spec, sources_handled_by_action, list_excluded):
3036
+ groups = ['none', 'midl', 'include', 'compile', 'resource', 'rule']
3037
+ grouped_sources = {}
3038
+ for g in groups:
3039
+ grouped_sources[g] = []
3040
+
3041
+ _AddSources2(spec, sources, exclusions, grouped_sources,
3042
+ extension_to_rule_name, sources_handled_by_action, list_excluded)
3043
+ sources = []
3044
+ for g in groups:
3045
+ if grouped_sources[g]:
3046
+ sources.append(['ItemGroup'] + grouped_sources[g])
3047
+ if actions_spec:
3048
+ sources.append(['ItemGroup'] + actions_spec)
3049
+ return sources
3050
+
3051
+
3052
+ def _AddSources2(spec, sources, exclusions, grouped_sources,
3053
+ extension_to_rule_name, sources_handled_by_action,
3054
+ list_excluded):
3055
+ extensions_excluded_from_precompile = []
3056
+ for source in sources:
3057
+ if isinstance(source, MSVSProject.Filter):
3058
+ _AddSources2(spec, source.contents, exclusions, grouped_sources,
3059
+ extension_to_rule_name, sources_handled_by_action,
3060
+ list_excluded)
3061
+ else:
3062
+ if not source in sources_handled_by_action:
3063
+ detail = []
3064
+ excluded_configurations = exclusions.get(source, [])
3065
+ if len(excluded_configurations) == len(spec['configurations']):
3066
+ detail.append(['ExcludedFromBuild', 'true'])
3067
+ else:
3068
+ for config_name, configuration in sorted(excluded_configurations):
3069
+ condition = _GetConfigurationCondition(config_name, configuration)
3070
+ detail.append(['ExcludedFromBuild',
3071
+ {'Condition': condition},
3072
+ 'true'])
3073
+ # Add precompile if needed
3074
+ for config_name, configuration in spec['configurations'].iteritems():
3075
+ precompiled_source = configuration.get('msvs_precompiled_source', '')
3076
+ if precompiled_source != '':
3077
+ precompiled_source = _FixPath(precompiled_source)
3078
+ if not extensions_excluded_from_precompile:
3079
+ # If the precompiled header is generated by a C source, we must
3080
+ # not try to use it for C++ sources, and vice versa.
3081
+ basename, extension = os.path.splitext(precompiled_source)
3082
+ if extension == '.c':
3083
+ extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx']
3084
+ else:
3085
+ extensions_excluded_from_precompile = ['.c']
3086
+
3087
+ if precompiled_source == source:
3088
+ condition = _GetConfigurationCondition(config_name, configuration)
3089
+ detail.append(['PrecompiledHeader',
3090
+ {'Condition': condition},
3091
+ 'Create'
3092
+ ])
3093
+ else:
3094
+ # Turn off precompiled header usage for source files of a
3095
+ # different type than the file that generated the
3096
+ # precompiled header.
3097
+ for extension in extensions_excluded_from_precompile:
3098
+ if source.endswith(extension):
3099
+ detail.append(['PrecompiledHeader', ''])
3100
+ detail.append(['ForcedIncludeFiles', ''])
3101
+
3102
+ group, element = _MapFileToMsBuildSourceType(source,
3103
+ extension_to_rule_name)
3104
+ grouped_sources[group].append([element, {'Include': source}] + detail)
3105
+
3106
+
3107
+ def _GetMSBuildProjectReferences(project):
3108
+ references = []
3109
+ if project.dependencies:
3110
+ group = ['ItemGroup']
3111
+ for dependency in project.dependencies:
3112
+ guid = dependency.guid
3113
+ project_dir = os.path.split(project.path)[0]
3114
+ relative_path = gyp.common.RelativePath(dependency.path, project_dir)
3115
+ project_ref = ['ProjectReference',
3116
+ {'Include': relative_path},
3117
+ ['Project', guid],
3118
+ ['ReferenceOutputAssembly', 'false']
3119
+ ]
3120
+ for config in dependency.spec.get('configurations', {}).itervalues():
3121
+ # If it's disabled in any config, turn it off in the reference.
3122
+ if config.get('msvs_2010_disable_uldi_when_referenced', 0):
3123
+ project_ref.append(['UseLibraryDependencyInputs', 'false'])
3124
+ break
3125
+ group.append(project_ref)
3126
+ references.append(group)
3127
+ return references
3128
+
3129
+
3130
+ def _GenerateMSBuildProject(project, options, version, generator_flags):
3131
+ spec = project.spec
3132
+ configurations = spec['configurations']
3133
+ project_dir, project_file_name = os.path.split(project.path)
3134
+ gyp.common.EnsureDirExists(project.path)
3135
+ # Prepare list of sources and excluded sources.
3136
+ gyp_path = _NormalizedSource(project.build_file)
3137
+ relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)
3138
+
3139
+ gyp_file = os.path.split(project.build_file)[1]
3140
+ sources, excluded_sources = _PrepareListOfSources(spec, generator_flags,
3141
+ gyp_file)
3142
+ # Add rules.
3143
+ actions_to_add = {}
3144
+ props_files_of_rules = set()
3145
+ targets_files_of_rules = set()
3146
+ extension_to_rule_name = {}
3147
+ list_excluded = generator_flags.get('msvs_list_excluded_files', True)
3148
+
3149
+ # Don't generate rules if we are using an external builder like ninja.
3150
+ if not spec.get('msvs_external_builder'):
3151
+ _GenerateRulesForMSBuild(project_dir, options, spec,
3152
+ sources, excluded_sources,
3153
+ props_files_of_rules, targets_files_of_rules,
3154
+ actions_to_add, extension_to_rule_name)
3155
+ else:
3156
+ rules = spec.get('rules', [])
3157
+ _AdjustSourcesForRules(spec, rules, sources, excluded_sources)
3158
+
3159
+ sources, excluded_sources, excluded_idl = (
3160
+ _AdjustSourcesAndConvertToFilterHierarchy(spec, options,
3161
+ project_dir, sources,
3162
+ excluded_sources,
3163
+ list_excluded, version))
3164
+
3165
+ # Don't add actions if we are using an external builder like ninja.
3166
+ if not spec.get('msvs_external_builder'):
3167
+ _AddActions(actions_to_add, spec, project.build_file)
3168
+ _AddCopies(actions_to_add, spec)
3169
+
3170
+ # NOTE: this stanza must appear after all actions have been decided.
3171
+ # Don't excluded sources with actions attached, or they won't run.
3172
+ excluded_sources = _FilterActionsFromExcluded(
3173
+ excluded_sources, actions_to_add)
3174
+
3175
+ exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
3176
+ actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild(
3177
+ spec, actions_to_add)
3178
+
3179
+ _GenerateMSBuildFiltersFile(project.path + '.filters', sources,
3180
+ extension_to_rule_name)
3181
+ missing_sources = _VerifySourcesExist(sources, project_dir)
3182
+
3183
+ for configuration in configurations.itervalues():
3184
+ _FinalizeMSBuildSettings(spec, configuration)
3185
+
3186
+ # Add attributes to root element
3187
+
3188
+ import_default_section = [
3189
+ ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.Default.props'}]]
3190
+ import_cpp_props_section = [
3191
+ ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.props'}]]
3192
+ import_cpp_targets_section = [
3193
+ ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.targets'}]]
3194
+ macro_section = [['PropertyGroup', {'Label': 'UserMacros'}]]
3195
+
3196
+ content = [
3197
+ 'Project',
3198
+ {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003',
3199
+ 'ToolsVersion': version.ProjectVersion(),
3200
+ 'DefaultTargets': 'Build'
3201
+ }]
3202
+
3203
+ content += _GetMSBuildProjectConfigurations(configurations)
3204
+ content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name)
3205
+ content += import_default_section
3206
+ content += _GetMSBuildConfigurationDetails(spec, project.build_file)
3207
+ content += _GetMSBuildLocalProperties(project.msbuild_toolset)
3208
+ content += import_cpp_props_section
3209
+ content += _GetMSBuildExtensions(props_files_of_rules)
3210
+ content += _GetMSBuildPropertySheets(configurations)
3211
+ content += macro_section
3212
+ content += _GetMSBuildConfigurationGlobalProperties(spec, configurations,
3213
+ project.build_file)
3214
+ content += _GetMSBuildToolSettingsSections(spec, configurations)
3215
+ content += _GetMSBuildSources(
3216
+ spec, sources, exclusions, extension_to_rule_name, actions_spec,
3217
+ sources_handled_by_action, list_excluded)
3218
+ content += _GetMSBuildProjectReferences(project)
3219
+ content += import_cpp_targets_section
3220
+ content += _GetMSBuildExtensionTargets(targets_files_of_rules)
3221
+
3222
+ if spec.get('msvs_external_builder'):
3223
+ content += _GetMSBuildExternalBuilderTargets(spec)
3224
+
3225
+ # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS:
3226
+ # has_run_as = _WriteMSVSUserFile(project.path, version, spec)
3227
+
3228
+ easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True)
3229
+
3230
+ return missing_sources
3231
+
3232
+
3233
+ def _GetMSBuildExternalBuilderTargets(spec):
3234
+ """Return a list of MSBuild targets for external builders.
3235
+
3236
+ Right now, only "Build" and "Clean" targets are generated.
3237
+
3238
+ Arguments:
3239
+ spec: The gyp target spec.
3240
+ Returns:
3241
+ List of MSBuild 'Target' specs.
3242
+ """
3243
+ build_cmd = _BuildCommandLineForRuleRaw(
3244
+ spec, spec['msvs_external_builder_build_cmd'],
3245
+ False, False, False, False)
3246
+ build_target = ['Target', {'Name': 'Build'}]
3247
+ build_target.append(['Exec', {'Command': build_cmd}])
3248
+
3249
+ clean_cmd = _BuildCommandLineForRuleRaw(
3250
+ spec, spec['msvs_external_builder_clean_cmd'],
3251
+ False, False, False, False)
3252
+ clean_target = ['Target', {'Name': 'Clean'}]
3253
+ clean_target.append(['Exec', {'Command': clean_cmd}])
3254
+
3255
+ return [build_target, clean_target]
3256
+
3257
+
3258
+ def _GetMSBuildExtensions(props_files_of_rules):
3259
+ extensions = ['ImportGroup', {'Label': 'ExtensionSettings'}]
3260
+ for props_file in props_files_of_rules:
3261
+ extensions.append(['Import', {'Project': props_file}])
3262
+ return [extensions]
3263
+
3264
+
3265
+ def _GetMSBuildExtensionTargets(targets_files_of_rules):
3266
+ targets_node = ['ImportGroup', {'Label': 'ExtensionTargets'}]
3267
+ for targets_file in sorted(targets_files_of_rules):
3268
+ targets_node.append(['Import', {'Project': targets_file}])
3269
+ return [targets_node]
3270
+
3271
+
3272
+ def _GenerateActionsForMSBuild(spec, actions_to_add):
3273
+ """Add actions accumulated into an actions_to_add, merging as needed.
3274
+
3275
+ Arguments:
3276
+ spec: the target project dict
3277
+ actions_to_add: dictionary keyed on input name, which maps to a list of
3278
+ dicts describing the actions attached to that input file.
3279
+
3280
+ Returns:
3281
+ A pair of (action specification, the sources handled by this action).
3282
+ """
3283
+ sources_handled_by_action = OrderedSet()
3284
+ actions_spec = []
3285
+ for primary_input, actions in actions_to_add.iteritems():
3286
+ inputs = OrderedSet()
3287
+ outputs = OrderedSet()
3288
+ descriptions = []
3289
+ commands = []
3290
+ for action in actions:
3291
+ inputs.update(OrderedSet(action['inputs']))
3292
+ outputs.update(OrderedSet(action['outputs']))
3293
+ descriptions.append(action['description'])
3294
+ cmd = action['command']
3295
+ # For most actions, add 'call' so that actions that invoke batch files
3296
+ # return and continue executing. msbuild_use_call provides a way to
3297
+ # disable this but I have not seen any adverse effect from doing that
3298
+ # for everything.
3299
+ if action.get('msbuild_use_call', True):
3300
+ cmd = 'call ' + cmd
3301
+ commands.append(cmd)
3302
+ # Add the custom build action for one input file.
3303
+ description = ', and also '.join(descriptions)
3304
+
3305
+ # We can't join the commands simply with && because the command line will
3306
+ # get too long. See also _AddActions: cygwin's setup_env mustn't be called
3307
+ # for every invocation or the command that sets the PATH will grow too
3308
+ # long.
3309
+ command = (
3310
+ '\r\nif %errorlevel% neq 0 exit /b %errorlevel%\r\n'.join(commands))
3311
+ _AddMSBuildAction(spec,
3312
+ primary_input,
3313
+ inputs,
3314
+ outputs,
3315
+ command,
3316
+ description,
3317
+ sources_handled_by_action,
3318
+ actions_spec)
3319
+ return actions_spec, sources_handled_by_action
3320
+
3321
+
3322
+ def _AddMSBuildAction(spec, primary_input, inputs, outputs, cmd, description,
3323
+ sources_handled_by_action, actions_spec):
3324
+ command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd)
3325
+ primary_input = _FixPath(primary_input)
3326
+ inputs_array = _FixPaths(inputs)
3327
+ outputs_array = _FixPaths(outputs)
3328
+ additional_inputs = ';'.join([i for i in inputs_array
3329
+ if i != primary_input])
3330
+ outputs = ';'.join(outputs_array)
3331
+ sources_handled_by_action.add(primary_input)
3332
+ action_spec = ['CustomBuild', {'Include': primary_input}]
3333
+ action_spec.extend(
3334
+ # TODO(jeanluc) 'Document' for all or just if as_sources?
3335
+ [['FileType', 'Document'],
3336
+ ['Command', command],
3337
+ ['Message', description],
3338
+ ['Outputs', outputs]
3339
+ ])
3340
+ if additional_inputs:
3341
+ action_spec.append(['AdditionalInputs', additional_inputs])
3342
+ actions_spec.append(action_spec)