graphql-idl-parser 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/Rakefile +6 -4
  4. data/ext/graphql-idl-parser/graphql-idl-parser/Cargo.lock +295 -0
  5. data/ext/graphql-idl-parser/graphql-idl-parser/Cargo.toml +16 -0
  6. data/ext/graphql-idl-parser/graphql-idl-parser/LICENSE.txt +21 -0
  7. data/ext/graphql-idl-parser/graphql-idl-parser/README.md +53 -0
  8. data/ext/graphql-idl-parser/graphql-idl-parser/build.rs +5 -0
  9. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/Cargo.lock +305 -0
  10. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/Cargo.toml +18 -0
  11. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/README.md +48 -0
  12. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/example/example.c +33 -0
  13. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/includes/gql-idl-parser.h +138 -0
  14. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/src/lib.rs +128 -0
  15. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/src/types.rs +485 -0
  16. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-1d630313aa5d216c/build-script-build +0 -0
  17. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-1d630313aa5d216c/build_script_build-1d630313aa5d216c +0 -0
  18. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-3e27951e7158def5/build-script-build +0 -0
  19. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-3e27951e7158def5/build_script_build-3e27951e7158def5 +0 -0
  20. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-481c4176d6a6472d/output +0 -0
  21. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-481c4176d6a6472d/stderr +0 -0
  22. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-5e9a4656cd081ee1/output +0 -0
  23. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-5e9a4656cd081ee1/stderr +0 -0
  24. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-2b7eb293aa6c1ae8/output +0 -0
  25. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-2b7eb293aa6c1ae8/stderr +0 -0
  26. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-da175f6bc66f228c/build-script-build +0 -0
  27. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-da175f6bc66f228c/build_script_build-da175f6bc66f228c +0 -0
  28. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-d0f0dc8a044bb86f/build-script-build +0 -0
  29. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-d0f0dc8a044bb86f/build_script_build-d0f0dc8a044bb86f +0 -0
  30. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-db9b482018d6c515/output +0 -0
  31. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-db9b482018d6c515/stderr +0 -0
  32. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libaho_corasick-07ac37ff1c5ebb39.rlib +0 -0
  33. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libascii_canvas-37ba58d788f6e28b.rlib +0 -0
  34. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libatty-3d34ead0eff1f49c.rlib +0 -0
  35. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbit_set-05034a00bed6372c.rlib +0 -0
  36. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbit_vec-ba66b7b721a96204.rlib +0 -0
  37. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbuild-d4f96a70b883038d.rlib +0 -0
  38. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libdiff-9cac472257fa481b.rlib +0 -0
  39. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libdocopt-5b3087b1b6e5d091.rlib +0 -0
  40. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libeither-8157fecd348c1485.rlib +0 -0
  41. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libena-b40ce2cd268672c3.rlib +0 -0
  42. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libfixedbitset-c7f65ed08cebcf3b.rlib +0 -0
  43. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphql_idl_parser-38237266b2814db0.rlib +0 -0
  44. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphql_idl_parser-85dc5bc4abe95968.rlib +0 -0
  45. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphqlidlparser.dylib +0 -0
  46. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libitertools-8d570d6c59d3b2d0.rlib +0 -0
  47. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libkernel32-fa4855bd85e0519b.rlib +0 -0
  48. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop-8888f5942735b084.rlib +0 -0
  49. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_intern-70b4cf4d149e3995.rlib +0 -0
  50. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_snap-695e4827988eac78.rlib +0 -0
  51. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_util-90bdd1a9fd691a70.rlib +0 -0
  52. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblazy_static-a6b1325db7ee41a1.rlib +0 -0
  53. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblibc-0d055c7503ac4180.rlib +0 -0
  54. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libmemchr-7e8d0bb06e3caae0.rlib +0 -0
  55. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libordermap-f92645c599568d9f.rlib +0 -0
  56. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libpetgraph-62c5b51f9db3f0c7.rlib +0 -0
  57. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libregex-5d259a9431f27ed9.rlib +0 -0
  58. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libregex_syntax-e6a16469e776d773.rlib +0 -0
  59. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/librustc_serialize-21d20a12dd90991b.rlib +0 -0
  60. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libstrsim-8e26967d29bdf2e6.rlib +0 -0
  61. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libterm-189de8985c74cf03.rlib +0 -0
  62. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libthread_local-036458f1fbee14fb.rlib +0 -0
  63. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libunicode_xid-8adffabb9e6dd184.rlib +0 -0
  64. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libunreachable-bd47b36c4e87f432.rlib +0 -0
  65. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libutf8_ranges-220e9d44a3644657.rlib +0 -0
  66. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libvoid-d761da60d30362e9.rlib +0 -0
  67. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libwinapi-753252e15931e6fc.rlib +0 -0
  68. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/libgraphqlidlparser.d +1 -0
  69. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/libgraphqlidlparser.dylib +0 -0
  70. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar.c +673 -0
  71. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar.h +161 -0
  72. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/fixtures.h +54 -0
  73. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/fs.h +341 -0
  74. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/print.h +74 -0
  75. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/sandbox.h +154 -0
  76. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar_test.h +19 -0
  77. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/enums.c +40 -0
  78. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/generate.py +243 -0
  79. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/helpers.c +60 -0
  80. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/helpers.h +6 -0
  81. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/input_objects.c +48 -0
  82. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/interfaces.c +41 -0
  83. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/main.c +35 -0
  84. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/objects.c +130 -0
  85. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/scalars.c +39 -0
  86. data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/unions.c +38 -0
  87. data/ext/graphql-idl-parser/graphql-idl-parser/script/compile +11 -0
  88. data/ext/graphql-idl-parser/graphql-idl-parser/script/fmt +23 -0
  89. data/ext/graphql-idl-parser/graphql-idl-parser/script/test +30 -0
  90. data/ext/graphql-idl-parser/graphql-idl-parser/src/gqlidl.lalrpop +199 -0
  91. data/ext/graphql-idl-parser/graphql-idl-parser/src/gqlidl.rs +29491 -0
  92. data/ext/graphql-idl-parser/graphql-idl-parser/src/lib.rs +9 -0
  93. data/ext/graphql-idl-parser/graphql-idl-parser/src/macros.rs +61 -0
  94. data/ext/graphql-idl-parser/graphql-idl-parser/src/tests.rs +561 -0
  95. data/ext/graphql-idl-parser/graphql-idl-parser/src/type_definition.rs +404 -0
  96. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0ed64d9cad312f79/output +0 -0
  97. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0ed64d9cad312f79/stderr +0 -0
  98. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build-script-build +0 -0
  99. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a +0 -0
  100. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a.dSYM/Contents/Info.plist +20 -0
  101. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a.dSYM/Contents/Resources/DWARF/build_script_build-0fa24f7f5e35d20a +0 -0
  102. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build-script-build +0 -0
  103. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2 +0 -0
  104. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2.dSYM/Contents/Info.plist +20 -0
  105. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2.dSYM/Contents/Resources/DWARF/build_script_build-57f7e3c3ef8471d2 +0 -0
  106. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-5e9a4656cd081ee1/output +0 -0
  107. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-5e9a4656cd081ee1/stderr +0 -0
  108. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-2b7eb293aa6c1ae8/output +0 -0
  109. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-2b7eb293aa6c1ae8/stderr +0 -0
  110. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build-script-build +0 -0
  111. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163 +0 -0
  112. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163.dSYM/Contents/Info.plist +20 -0
  113. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163.dSYM/Contents/Resources/DWARF/build_script_build-d2306aba19864163 +0 -0
  114. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build-script-build +0 -0
  115. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2 +0 -0
  116. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2.dSYM/Contents/Info.plist +20 -0
  117. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2.dSYM/Contents/Resources/DWARF/build_script_build-4a05302baa5fb2a2 +0 -0
  118. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-db9b482018d6c515/output +0 -0
  119. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-db9b482018d6c515/stderr +0 -0
  120. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libaho_corasick-a9ec1f95080d1f6a.rlib +0 -0
  121. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libascii_canvas-92c3bf0cf98f6d67.rlib +0 -0
  122. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libatty-35b65e46cfc403bc.rlib +0 -0
  123. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbit_set-d9484919f1726cf1.rlib +0 -0
  124. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbit_vec-8716b059e7c4619b.rlib +0 -0
  125. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbuild-0b12b372edd4cd19.rlib +0 -0
  126. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libdiff-c81afd03f1d10610.rlib +0 -0
  127. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libdocopt-f02dfd6fea4878cc.rlib +0 -0
  128. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libeither-20b79fd67623dec7.rlib +0 -0
  129. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libena-e8706d9d37da725b.rlib +0 -0
  130. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libfixedbitset-da616d0027237c90.rlib +0 -0
  131. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libgraphql_idl_parser-33a4c3bdcdc654b7.rlib +0 -0
  132. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libgraphql_idl_parser-d6636cf90a34aa47.rlib +0 -0
  133. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libitertools-34d50068529acf4d.rlib +0 -0
  134. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libkernel32-56b5a11a7716f7c7.rlib +0 -0
  135. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop-65f3c84608c05ce1.rlib +0 -0
  136. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_intern-a3c97188386c0872.rlib +0 -0
  137. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_snap-d6e467def27f0a55.rlib +0 -0
  138. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_util-e59e6b2e2aec1b3e.rlib +0 -0
  139. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblazy_static-4518bdaa60b81936.rlib +0 -0
  140. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblibc-ab7be4fcfaa3a31b.rlib +0 -0
  141. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libmemchr-85dd561868acc188.rlib +0 -0
  142. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libordermap-4691b832eea88398.rlib +0 -0
  143. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libpetgraph-0220c5a13678d70e.rlib +0 -0
  144. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libregex-44e22d9874a5fb64.rlib +0 -0
  145. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libregex_syntax-490c2654111b5bf0.rlib +0 -0
  146. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/librustc_serialize-a7771718d4ee73a5.rlib +0 -0
  147. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libstrsim-038156debd12bd7a.rlib +0 -0
  148. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libterm-d12b955648e4f4b4.rlib +0 -0
  149. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libthread_local-84091b6b04cf1914.rlib +0 -0
  150. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libunicode_xid-89ce822c6e6dbe69.rlib +0 -0
  151. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libunreachable-654322b1fcb434b1.rlib +0 -0
  152. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libutf8_ranges-53f91d3b6e8885c9.rlib +0 -0
  153. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libvoid-181e881e54467554.rlib +0 -0
  154. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libwinapi-9c9d2aba65add76c.rlib +0 -0
  155. data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/libgraphql_idl_parser.rlib +0 -0
  156. data/ext/graphql-idl-parser/graphql-idl-parser/test/enums.graphql +8 -0
  157. data/ext/graphql-idl-parser/graphql-idl-parser/test/github.graphql +5115 -0
  158. data/ext/graphql-idl-parser/graphql-idl-parser/test/input_objects.graphql +11 -0
  159. data/ext/graphql-idl-parser/graphql-idl-parser/test/interfaces.graphql +5 -0
  160. data/ext/graphql-idl-parser/graphql-idl-parser/test/objects.graphql +54 -0
  161. data/ext/graphql-idl-parser/graphql-idl-parser/test/scalars.graphql +4 -0
  162. data/ext/graphql-idl-parser/graphql-idl-parser/test/unions.graphql +2 -0
  163. data/graphql-idl-parser.gemspec +8 -6
  164. data/lib/graphql-idl-parser/version.rb +1 -1
  165. data/test/graphql-idl-parser/enums_test.rb +20 -0
  166. data/test/graphql-idl-parser/graphql-idl-parser_test.rb +48 -0
  167. data/test/graphql-idl-parser/input_objects_test.rb +28 -0
  168. data/test/graphql-idl-parser/interfaces_test.rb +20 -0
  169. data/test/graphql-idl-parser/objects_test.rb +104 -0
  170. data/test/graphql-idl-parser/scalars_test.rb +19 -0
  171. data/test/graphql-idl-parser/unions_test.rb +18 -0
  172. data/test/test_helper.rb +12 -0
  173. metadata +194 -12
  174. data/.gitignore +0 -18
  175. data/.gitmodules +0 -4
  176. data/.rubocop.yml +0 -10
  177. data/.travis.yml +0 -28
  178. data/Gemfile +0 -4
  179. data/script/bootstrap +0 -11
  180. data/script/cibuild +0 -5
  181. data/script/update_submodules +0 -21
@@ -0,0 +1,74 @@
1
+
2
+ static void clar_print_init(int test_count, int suite_count, const char *suite_names)
3
+ {
4
+ (void)test_count;
5
+ printf("Loaded %d suites: %s\n", (int)suite_count, suite_names);
6
+ printf("Started\n");
7
+ }
8
+
9
+ static void clar_print_shutdown(int test_count, int suite_count, int error_count)
10
+ {
11
+ (void)test_count;
12
+ (void)suite_count;
13
+ (void)error_count;
14
+
15
+ printf("\n\n");
16
+ clar_report_errors();
17
+ }
18
+
19
+ static void clar_print_error(int num, const struct clar_error *error)
20
+ {
21
+ printf(" %d) Failure:\n", num);
22
+
23
+ printf("%s::%s [%s:%d]\n",
24
+ error->suite,
25
+ error->test,
26
+ error->file,
27
+ error->line_number);
28
+
29
+ printf(" %s\n", error->error_msg);
30
+
31
+ if (error->description != NULL) {
32
+ printf(" %s\n", error->description);
33
+ }
34
+
35
+ printf("\n");
36
+ fflush(stdout);
37
+ }
38
+
39
+ static void clar_print_ontest(const char *test_name, int test_number, enum cl_test_status status)
40
+ {
41
+ (void)test_name;
42
+ (void)test_number;
43
+
44
+ switch(status) {
45
+ case CL_TEST_OK:
46
+ printf(".");
47
+ break;
48
+ case CL_TEST_FAILURE:
49
+ printf("F");
50
+ break;
51
+ case CL_TEST_SKIP:
52
+ printf("S");
53
+ break;
54
+ }
55
+
56
+ fflush(stdout);
57
+ }
58
+
59
+ static void clar_print_onsuite(const char *suite_name, int suite_index)
60
+ {
61
+ if (_clar.report_suite_names) {
62
+ printf("\n%s", suite_name);
63
+ }
64
+
65
+ (void)suite_index;
66
+ }
67
+
68
+ static void clar_print_onabort(const char *msg, ...)
69
+ {
70
+ va_list argp;
71
+ va_start(argp, msg);
72
+ vfprintf(stderr, msg, argp);
73
+ va_end(argp);
74
+ }
@@ -0,0 +1,154 @@
1
+ static char _clar_path[4096];
2
+
3
+ static int
4
+ is_valid_tmp_path(const char *path)
5
+ {
6
+ STAT_T st;
7
+
8
+ if (stat(path, &st) != 0) {
9
+ return 0;
10
+ }
11
+
12
+ if (!S_ISDIR(st.st_mode)) {
13
+ return 0;
14
+ }
15
+
16
+ return (access(path, W_OK) == 0);
17
+ }
18
+
19
+ static int
20
+ find_tmp_path(char *buffer, size_t length)
21
+ {
22
+ #ifndef _WIN32
23
+ static const size_t var_count = 5;
24
+ static const char *env_vars[] = {
25
+ "CLAR_TMP", "TMPDIR", "TMP", "TEMP", "USERPROFILE"
26
+ };
27
+
28
+ size_t i;
29
+
30
+ for (i = 0; i < var_count; ++i) {
31
+ const char *env = getenv(env_vars[i]);
32
+ if (!env) {
33
+ continue;
34
+ }
35
+
36
+ if (is_valid_tmp_path(env)) {
37
+ strncpy(buffer, env, length);
38
+ return 0;
39
+ }
40
+ }
41
+
42
+ /* If the environment doesn't say anything, try to use /tmp */
43
+ if (is_valid_tmp_path("/tmp")) {
44
+ strncpy(buffer, "/tmp", length);
45
+ return 0;
46
+ }
47
+
48
+ #else
49
+ DWORD env_len = GetEnvironmentVariable("CLAR_TMP", buffer, (DWORD)length);
50
+ if (env_len > 0 && env_len < (DWORD)length) {
51
+ return 0;
52
+ }
53
+
54
+ if (GetTempPath((DWORD)length, buffer)) {
55
+ return 0;
56
+ }
57
+ #endif
58
+
59
+ /* This system doesn't like us, try to use the current directory */
60
+ if (is_valid_tmp_path(".")) {
61
+ strncpy(buffer, ".", length);
62
+ return 0;
63
+ }
64
+
65
+ return -1;
66
+ }
67
+
68
+ static void clar_unsandbox(void)
69
+ {
70
+ if (_clar_path[0] == '\0') {
71
+ return;
72
+ }
73
+
74
+ cl_must_pass(chdir(".."));
75
+
76
+ fs_rm(_clar_path);
77
+ }
78
+
79
+ static int build_sandbox_path(void)
80
+ {
81
+ #ifdef CLAR_TMPDIR
82
+ const char path_tail[] = CLAR_TMPDIR "_XXXXXX";
83
+ #else
84
+ const char path_tail[] = "clar_tmp_XXXXXX";
85
+ #endif
86
+
87
+ size_t len;
88
+
89
+ if (find_tmp_path(_clar_path, sizeof(_clar_path)) < 0) {
90
+ return -1;
91
+ }
92
+
93
+ len = strlen(_clar_path);
94
+
95
+ #ifdef _WIN32
96
+ { /* normalize path to POSIX forward slashes */
97
+ size_t i;
98
+ for (i = 0; i < len; ++i) {
99
+ if (_clar_path[i] == '\\') {
100
+ _clar_path[i] = '/';
101
+ }
102
+ }
103
+ }
104
+ #endif
105
+
106
+ if (_clar_path[len - 1] != '/') {
107
+ _clar_path[len++] = '/';
108
+ }
109
+
110
+ strncpy(_clar_path + len, path_tail, sizeof(_clar_path) - len);
111
+
112
+ #if defined(__MINGW32__)
113
+ if (_mktemp(_clar_path) == NULL) {
114
+ return -1;
115
+ }
116
+
117
+ if (mkdir(_clar_path, 0700) != 0) {
118
+ return -1;
119
+ }
120
+ #elif defined(_WIN32)
121
+ if (_mktemp_s(_clar_path, sizeof(_clar_path)) != 0) {
122
+ return -1;
123
+ }
124
+
125
+ if (mkdir(_clar_path, 0700) != 0) {
126
+ return -1;
127
+ }
128
+ #else
129
+ if (mkdtemp(_clar_path) == NULL) {
130
+ return -1;
131
+ }
132
+ #endif
133
+
134
+ return 0;
135
+ }
136
+
137
+ static int clar_sandbox(void)
138
+ {
139
+ if (_clar_path[0] == '\0' && build_sandbox_path() < 0) {
140
+ return -1;
141
+ }
142
+
143
+ if (chdir(_clar_path) != 0) {
144
+ return -1;
145
+ }
146
+
147
+ return 0;
148
+ }
149
+
150
+ const char *clar_sandbox_path(void)
151
+ {
152
+ return _clar_path;
153
+ }
154
+
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright (c) Vicent Marti. All rights reserved.
3
+ *
4
+ * This file is part of clar, distributed under the ISC license.
5
+ * For full terms see the included COPYING file.
6
+ */
7
+ #ifndef __CLAR_TEST__
8
+ #define __CLAR_TEST__
9
+
10
+ /* Import the standard clar helper functions */
11
+ #include "clar.h"
12
+
13
+ /* Your custom shared includes / defines here */
14
+ extern int global_test_counter;
15
+
16
+ #include "helpers.h"
17
+ #include "gql-idl-parser.h"
18
+
19
+ #endif
@@ -0,0 +1,40 @@
1
+ #include "clar.h"
2
+ #include "clar_test.h"
3
+ #include <stdio.h>
4
+ #include <string.h>
5
+
6
+ static char *fixture;
7
+
8
+ void test_enums__initialize(void)
9
+ {
10
+ global_test_counter++;
11
+ }
12
+
13
+ void test_enums__cleanup(void)
14
+ {
15
+ if (fixture != NULL) {
16
+ free(fixture);
17
+ }
18
+ }
19
+
20
+ void test_enums__inline(void)
21
+ {
22
+ fixture = read_fixture("enums.graphql");
23
+
24
+ GraphQLTypes* types = NULL;
25
+ size_t types_len = 0;
26
+ uint8_t err;
27
+
28
+ err = gqlidl_parse_schema(fixture, &types, &types_len);
29
+
30
+ cl_assert_equal_i(err, 0);
31
+
32
+ cl_assert_equal_s(types[0].typename, "enum");
33
+ cl_assert_equal_s("ProjectState", types[0].enum_type.name);
34
+ cl_assert_equal_s("State of the project; either 'open' or 'closed'", types[0].enum_type.description);
35
+ cl_assert_equal_i(2, types[0].enum_type.values.length);
36
+ cl_assert_equal_s("CLOSED", types[0].enum_type.values.data[0].name);
37
+ cl_assert_equal_s("The project is closed.", types[0].enum_type.values.data[0].description);
38
+ cl_assert_equal_s("OPEN", types[0].enum_type.values.data[1].name);
39
+ cl_assert_equal_s("The project is open.", types[0].enum_type.values.data[1].description);
40
+ }
@@ -0,0 +1,243 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Copyright (c) Vicent Marti. All rights reserved.
4
+ #
5
+ # This file is part of clar, distributed under the ISC license.
6
+ # For full terms see the included COPYING file.
7
+ #
8
+
9
+ from __future__ import with_statement
10
+ from string import Template
11
+ import re, fnmatch, os, codecs, pickle
12
+
13
+ class Module(object):
14
+ class Template(object):
15
+ def __init__(self, module):
16
+ self.module = module
17
+
18
+ def _render_callback(self, cb):
19
+ if not cb:
20
+ return ' { NULL, NULL }'
21
+ return ' { "%s", &%s }' % (cb['short_name'], cb['symbol'])
22
+
23
+ class DeclarationTemplate(Template):
24
+ def render(self):
25
+ out = "\n".join("extern %s;" % cb['declaration'] for cb in self.module.callbacks) + "\n"
26
+
27
+ if self.module.initialize:
28
+ out += "extern %s;\n" % self.module.initialize['declaration']
29
+
30
+ if self.module.cleanup:
31
+ out += "extern %s;\n" % self.module.cleanup['declaration']
32
+
33
+ return out
34
+
35
+ class CallbacksTemplate(Template):
36
+ def render(self):
37
+ out = "static const struct clar_func _clar_cb_%s[] = {\n" % self.module.name
38
+ out += ",\n".join(self._render_callback(cb) for cb in self.module.callbacks)
39
+ out += "\n};\n"
40
+ return out
41
+
42
+ class InfoTemplate(Template):
43
+ def render(self):
44
+ return Template(
45
+ r"""
46
+ {
47
+ "${clean_name}",
48
+ ${initialize},
49
+ ${cleanup},
50
+ ${cb_ptr}, ${cb_count}, ${enabled}
51
+ }"""
52
+ ).substitute(
53
+ clean_name = self.module.clean_name(),
54
+ initialize = self._render_callback(self.module.initialize),
55
+ cleanup = self._render_callback(self.module.cleanup),
56
+ cb_ptr = "_clar_cb_%s" % self.module.name,
57
+ cb_count = len(self.module.callbacks),
58
+ enabled = int(self.module.enabled)
59
+ )
60
+
61
+ def __init__(self, name):
62
+ self.name = name
63
+
64
+ self.mtime = 0
65
+ self.enabled = True
66
+ self.modified = False
67
+
68
+ def clean_name(self):
69
+ return self.name.replace("_", "::")
70
+
71
+ def _skip_comments(self, text):
72
+ SKIP_COMMENTS_REGEX = re.compile(
73
+ r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
74
+ re.DOTALL | re.MULTILINE)
75
+
76
+ def _replacer(match):
77
+ s = match.group(0)
78
+ return "" if s.startswith('/') else s
79
+
80
+ return re.sub(SKIP_COMMENTS_REGEX, _replacer, text)
81
+
82
+ def parse(self, contents):
83
+ TEST_FUNC_REGEX = r"^(void\s+(test_%s__(\w+))\s*\(\s*void\s*\))\s*\{"
84
+
85
+ contents = self._skip_comments(contents)
86
+ regex = re.compile(TEST_FUNC_REGEX % self.name, re.MULTILINE)
87
+
88
+ self.callbacks = []
89
+ self.initialize = None
90
+ self.cleanup = None
91
+
92
+ for (declaration, symbol, short_name) in regex.findall(contents):
93
+ data = {
94
+ "short_name" : short_name,
95
+ "declaration" : declaration,
96
+ "symbol" : symbol
97
+ }
98
+
99
+ if short_name == 'initialize':
100
+ self.initialize = data
101
+ elif short_name == 'cleanup':
102
+ self.cleanup = data
103
+ else:
104
+ self.callbacks.append(data)
105
+
106
+ return self.callbacks != []
107
+
108
+ def refresh(self, path):
109
+ self.modified = False
110
+
111
+ try:
112
+ st = os.stat(path)
113
+
114
+ # Not modified
115
+ if st.st_mtime == self.mtime:
116
+ return True
117
+
118
+ self.modified = True
119
+ self.mtime = st.st_mtime
120
+
121
+ with codecs.open(path, encoding='utf-8') as fp:
122
+ raw_content = fp.read()
123
+
124
+ except IOError:
125
+ return False
126
+
127
+ return self.parse(raw_content)
128
+
129
+ class TestSuite(object):
130
+
131
+ def __init__(self, path):
132
+ self.path = path
133
+
134
+ def should_generate(self, path):
135
+ if not os.path.isfile(path):
136
+ return True
137
+
138
+ if any(module.modified for module in self.modules.values()):
139
+ return True
140
+
141
+ return False
142
+
143
+ def find_modules(self):
144
+ modules = []
145
+ for root, _, files in os.walk(self.path):
146
+ module_root = root[len(self.path):]
147
+ module_root = [c for c in module_root.split(os.sep) if c]
148
+
149
+ tests_in_module = fnmatch.filter(files, "*.c")
150
+
151
+ for test_file in tests_in_module:
152
+ full_path = os.path.join(root, test_file)
153
+ module_name = "_".join(module_root + [test_file[:-2]]).replace("-", "_")
154
+
155
+ modules.append((full_path, module_name))
156
+
157
+ return modules
158
+
159
+ def load_cache(self):
160
+ path = os.path.join(self.path, '.clarcache')
161
+ cache = {}
162
+
163
+ try:
164
+ fp = open(path, 'rb')
165
+ cache = pickle.load(fp)
166
+ fp.close()
167
+ except (IOError, ValueError):
168
+ pass
169
+
170
+ return cache
171
+
172
+ def save_cache(self):
173
+ path = os.path.join(self.path, '.clarcache')
174
+ with open(path, 'wb') as cache:
175
+ pickle.dump(self.modules, cache)
176
+
177
+ def load(self, force = False):
178
+ module_data = self.find_modules()
179
+ self.modules = {} if force else self.load_cache()
180
+
181
+ for path, name in module_data:
182
+ if name not in self.modules:
183
+ self.modules[name] = Module(name)
184
+
185
+ if not self.modules[name].refresh(path):
186
+ del self.modules[name]
187
+
188
+ def disable(self, excluded):
189
+ for exclude in excluded:
190
+ for module in self.modules.values():
191
+ name = module.clean_name()
192
+ if name.startswith(exclude):
193
+ module.enabled = False
194
+ module.modified = True
195
+
196
+ def suite_count(self):
197
+ return len(self.modules)
198
+
199
+ def callback_count(self):
200
+ return sum(len(module.callbacks) for module in self.modules.values())
201
+
202
+ def write(self):
203
+ output = os.path.join(self.path, 'clar.suite')
204
+
205
+ if not self.should_generate(output):
206
+ return False
207
+
208
+ with open(output, 'w') as data:
209
+ for module in self.modules.values():
210
+ t = Module.DeclarationTemplate(module)
211
+ data.write(t.render())
212
+
213
+ for module in self.modules.values():
214
+ t = Module.CallbacksTemplate(module)
215
+ data.write(t.render())
216
+
217
+ suites = "static struct clar_suite _clar_suites[] = {" + ','.join(
218
+ Module.InfoTemplate(module).render() for module in sorted(self.modules.values(), key=lambda module: module.name)
219
+ ) + "\n};\n"
220
+
221
+ data.write(suites)
222
+
223
+ data.write("static const size_t _clar_suite_count = %d;\n" % self.suite_count())
224
+ data.write("static const size_t _clar_callback_count = %d;\n" % self.callback_count())
225
+
226
+ self.save_cache()
227
+ return True
228
+
229
+ if __name__ == '__main__':
230
+ from optparse import OptionParser
231
+
232
+ parser = OptionParser()
233
+ parser.add_option('-f', '--force', action="store_true", dest='force', default=False)
234
+ parser.add_option('-x', '--exclude', dest='excluded', action='append', default=[])
235
+
236
+ options, args = parser.parse_args()
237
+
238
+ for path in args or ['.']:
239
+ suite = TestSuite(path)
240
+ suite.load(options.force)
241
+ suite.disable(options.excluded)
242
+ if suite.write():
243
+ print("Written `clar.suite` (%d tests in %d suites)" % (suite.callback_count(), suite.suite_count()))