graphql 1.13.19 → 2.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/install_generator.rb +1 -1
  3. data/lib/generators/graphql/relay.rb +3 -17
  4. data/lib/generators/graphql/templates/schema.erb +3 -0
  5. data/lib/graphql/analysis/ast/field_usage.rb +3 -1
  6. data/lib/graphql/analysis/ast/max_query_complexity.rb +0 -1
  7. data/lib/graphql/analysis/ast/query_complexity.rb +1 -1
  8. data/lib/graphql/analysis/ast/query_depth.rb +0 -1
  9. data/lib/graphql/analysis/ast/visitor.rb +43 -36
  10. data/lib/graphql/analysis/ast.rb +2 -12
  11. data/lib/graphql/analysis.rb +0 -7
  12. data/lib/graphql/backtrace/table.rb +2 -20
  13. data/lib/graphql/backtrace/tracer.rb +2 -3
  14. data/lib/graphql/backtrace.rb +2 -8
  15. data/lib/graphql/dataloader/null_dataloader.rb +3 -1
  16. data/lib/graphql/dataloader/source.rb +9 -0
  17. data/lib/graphql/dataloader.rb +4 -1
  18. data/lib/graphql/dig.rb +1 -1
  19. data/lib/graphql/execution/errors.rb +12 -82
  20. data/lib/graphql/execution/interpreter/resolve.rb +26 -0
  21. data/lib/graphql/execution/interpreter/runtime.rb +162 -119
  22. data/lib/graphql/execution/interpreter.rb +187 -78
  23. data/lib/graphql/execution/lazy.rb +7 -21
  24. data/lib/graphql/execution/lookahead.rb +44 -40
  25. data/lib/graphql/execution/multiplex.rb +3 -174
  26. data/lib/graphql/execution.rb +11 -4
  27. data/lib/graphql/introspection/dynamic_fields.rb +3 -8
  28. data/lib/graphql/introspection/entry_points.rb +2 -15
  29. data/lib/graphql/introspection/type_type.rb +8 -1
  30. data/lib/graphql/introspection.rb +4 -3
  31. data/lib/graphql/language/document_from_schema_definition.rb +18 -35
  32. data/lib/graphql/language/lexer.rb +216 -1488
  33. data/lib/graphql/language/lexer.ri +744 -0
  34. data/lib/graphql/language/nodes.rb +41 -33
  35. data/lib/graphql/language/parser.rb +375 -363
  36. data/lib/graphql/language/parser.y +48 -43
  37. data/lib/graphql/language/printer.rb +37 -21
  38. data/lib/graphql/language/visitor.rb +191 -83
  39. data/lib/graphql/pagination/active_record_relation_connection.rb +0 -8
  40. data/lib/graphql/pagination/array_connection.rb +4 -2
  41. data/lib/graphql/pagination/connection.rb +31 -4
  42. data/lib/graphql/pagination/connections.rb +3 -28
  43. data/lib/graphql/pagination/relation_connection.rb +2 -0
  44. data/lib/graphql/query/context.rb +155 -196
  45. data/lib/graphql/query/input_validation_result.rb +1 -1
  46. data/lib/graphql/query/null_context.rb +0 -3
  47. data/lib/graphql/query/validation_pipeline.rb +10 -34
  48. data/lib/graphql/query/variables.rb +7 -20
  49. data/lib/graphql/query.rb +32 -42
  50. data/lib/graphql/railtie.rb +0 -104
  51. data/lib/graphql/rake_task/validate.rb +1 -1
  52. data/lib/graphql/rake_task.rb +29 -1
  53. data/lib/graphql/relay/range_add.rb +9 -20
  54. data/lib/graphql/relay.rb +0 -15
  55. data/lib/graphql/schema/addition.rb +7 -9
  56. data/lib/graphql/schema/argument.rb +36 -43
  57. data/lib/graphql/schema/build_from_definition.rb +32 -18
  58. data/lib/graphql/schema/directive/one_of.rb +12 -0
  59. data/lib/graphql/schema/directive/transform.rb +1 -1
  60. data/lib/graphql/schema/directive.rb +11 -22
  61. data/lib/graphql/schema/enum.rb +28 -39
  62. data/lib/graphql/schema/enum_value.rb +5 -25
  63. data/lib/graphql/schema/field/connection_extension.rb +4 -0
  64. data/lib/graphql/schema/field.rb +214 -327
  65. data/lib/graphql/schema/input_object.rb +56 -67
  66. data/lib/graphql/schema/interface.rb +0 -35
  67. data/lib/graphql/schema/introspection_system.rb +3 -8
  68. data/lib/graphql/schema/late_bound_type.rb +8 -2
  69. data/lib/graphql/schema/list.rb +0 -6
  70. data/lib/graphql/schema/loader.rb +1 -2
  71. data/lib/graphql/schema/member/base_dsl_methods.rb +15 -19
  72. data/lib/graphql/schema/member/build_type.rb +5 -7
  73. data/lib/graphql/schema/member/has_arguments.rb +144 -53
  74. data/lib/graphql/schema/member/has_deprecation_reason.rb +3 -4
  75. data/lib/graphql/schema/member/has_directives.rb +71 -56
  76. data/lib/graphql/schema/member/has_fields.rb +15 -3
  77. data/lib/graphql/schema/member/has_interfaces.rb +47 -18
  78. data/lib/graphql/schema/member/has_validators.rb +31 -5
  79. data/lib/graphql/schema/member/relay_shortcuts.rb +28 -2
  80. data/lib/graphql/schema/member/type_system_helpers.rb +17 -0
  81. data/lib/graphql/schema/member/validates_input.rb +1 -1
  82. data/lib/graphql/schema/member.rb +0 -6
  83. data/lib/graphql/schema/mutation.rb +0 -9
  84. data/lib/graphql/schema/non_null.rb +1 -7
  85. data/lib/graphql/schema/object.rb +15 -52
  86. data/lib/graphql/schema/relay_classic_mutation.rb +53 -42
  87. data/lib/graphql/schema/resolver/has_payload_type.rb +20 -10
  88. data/lib/graphql/schema/resolver.rb +41 -42
  89. data/lib/graphql/schema/scalar.rb +7 -22
  90. data/lib/graphql/schema/subscription.rb +0 -7
  91. data/lib/graphql/schema/timeout.rb +24 -28
  92. data/lib/graphql/schema/type_membership.rb +3 -0
  93. data/lib/graphql/schema/union.rb +10 -17
  94. data/lib/graphql/schema/warden.rb +23 -6
  95. data/lib/graphql/schema/wrapper.rb +0 -5
  96. data/lib/graphql/schema.rb +240 -968
  97. data/lib/graphql/static_validation/all_rules.rb +1 -0
  98. data/lib/graphql/static_validation/base_visitor.rb +4 -21
  99. data/lib/graphql/static_validation/definition_dependencies.rb +7 -1
  100. data/lib/graphql/static_validation/error.rb +2 -2
  101. data/lib/graphql/static_validation/literal_validator.rb +19 -1
  102. data/lib/graphql/static_validation/rules/directives_are_defined.rb +11 -5
  103. data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +12 -12
  104. data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb +66 -0
  105. data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb +29 -0
  106. data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +12 -6
  107. data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +1 -1
  108. data/lib/graphql/static_validation/validator.rb +3 -25
  109. data/lib/graphql/static_validation.rb +0 -2
  110. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +7 -1
  111. data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +38 -1
  112. data/lib/graphql/subscriptions/event.rb +3 -8
  113. data/lib/graphql/subscriptions/instrumentation.rb +0 -51
  114. data/lib/graphql/subscriptions.rb +32 -20
  115. data/lib/graphql/tracing/active_support_notifications_trace.rb +16 -0
  116. data/lib/graphql/tracing/appoptics_trace.rb +231 -0
  117. data/lib/graphql/tracing/appsignal_trace.rb +66 -0
  118. data/lib/graphql/tracing/data_dog_trace.rb +148 -0
  119. data/lib/graphql/tracing/data_dog_tracing.rb +2 -0
  120. data/lib/graphql/tracing/new_relic_trace.rb +75 -0
  121. data/lib/graphql/tracing/notifications_trace.rb +41 -0
  122. data/lib/graphql/tracing/platform_trace.rb +107 -0
  123. data/lib/graphql/tracing/platform_tracing.rb +26 -41
  124. data/lib/graphql/tracing/prometheus_trace.rb +89 -0
  125. data/lib/graphql/tracing/prometheus_tracing.rb +3 -3
  126. data/lib/graphql/tracing/scout_trace.rb +72 -0
  127. data/lib/graphql/tracing/statsd_trace.rb +56 -0
  128. data/lib/graphql/tracing.rb +136 -40
  129. data/lib/graphql/type_kinds.rb +6 -3
  130. data/lib/graphql/types/iso_8601_date.rb +4 -1
  131. data/lib/graphql/types/iso_8601_date_time.rb +4 -0
  132. data/lib/graphql/types/relay/base_connection.rb +16 -6
  133. data/lib/graphql/types/relay/connection_behaviors.rb +5 -25
  134. data/lib/graphql/types/relay/default_relay.rb +5 -9
  135. data/lib/graphql/types/relay/edge_behaviors.rb +1 -4
  136. data/lib/graphql/types/relay/node_behaviors.rb +5 -1
  137. data/lib/graphql/types/relay.rb +0 -2
  138. data/lib/graphql/types/string.rb +1 -1
  139. data/lib/graphql/version.rb +1 -1
  140. data/lib/graphql.rb +11 -72
  141. metadata +31 -132
  142. data/lib/graphql/analysis/analyze_query.rb +0 -98
  143. data/lib/graphql/analysis/field_usage.rb +0 -45
  144. data/lib/graphql/analysis/max_query_complexity.rb +0 -26
  145. data/lib/graphql/analysis/max_query_depth.rb +0 -26
  146. data/lib/graphql/analysis/query_complexity.rb +0 -88
  147. data/lib/graphql/analysis/query_depth.rb +0 -43
  148. data/lib/graphql/analysis/reducer_state.rb +0 -48
  149. data/lib/graphql/argument.rb +0 -131
  150. data/lib/graphql/authorization.rb +0 -82
  151. data/lib/graphql/backtrace/legacy_tracer.rb +0 -56
  152. data/lib/graphql/backwards_compatibility.rb +0 -61
  153. data/lib/graphql/base_type.rb +0 -232
  154. data/lib/graphql/boolean_type.rb +0 -2
  155. data/lib/graphql/compatibility/execution_specification/counter_schema.rb +0 -53
  156. data/lib/graphql/compatibility/execution_specification/specification_schema.rb +0 -200
  157. data/lib/graphql/compatibility/execution_specification.rb +0 -436
  158. data/lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb +0 -111
  159. data/lib/graphql/compatibility/lazy_execution_specification.rb +0 -215
  160. data/lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb +0 -87
  161. data/lib/graphql/compatibility/query_parser_specification/query_assertions.rb +0 -79
  162. data/lib/graphql/compatibility/query_parser_specification.rb +0 -266
  163. data/lib/graphql/compatibility/schema_parser_specification.rb +0 -682
  164. data/lib/graphql/compatibility.rb +0 -5
  165. data/lib/graphql/define/assign_argument.rb +0 -12
  166. data/lib/graphql/define/assign_connection.rb +0 -13
  167. data/lib/graphql/define/assign_enum_value.rb +0 -18
  168. data/lib/graphql/define/assign_global_id_field.rb +0 -11
  169. data/lib/graphql/define/assign_mutation_function.rb +0 -34
  170. data/lib/graphql/define/assign_object_field.rb +0 -42
  171. data/lib/graphql/define/defined_object_proxy.rb +0 -53
  172. data/lib/graphql/define/instance_definable.rb +0 -255
  173. data/lib/graphql/define/no_definition_error.rb +0 -7
  174. data/lib/graphql/define/non_null_with_bang.rb +0 -16
  175. data/lib/graphql/define/type_definer.rb +0 -31
  176. data/lib/graphql/define.rb +0 -31
  177. data/lib/graphql/deprecated_dsl.rb +0 -55
  178. data/lib/graphql/directive/deprecated_directive.rb +0 -2
  179. data/lib/graphql/directive/include_directive.rb +0 -2
  180. data/lib/graphql/directive/skip_directive.rb +0 -2
  181. data/lib/graphql/directive.rb +0 -107
  182. data/lib/graphql/enum_type.rb +0 -133
  183. data/lib/graphql/execution/execute.rb +0 -333
  184. data/lib/graphql/execution/flatten.rb +0 -40
  185. data/lib/graphql/execution/instrumentation.rb +0 -92
  186. data/lib/graphql/execution/lazy/resolve.rb +0 -91
  187. data/lib/graphql/execution/typecast.rb +0 -50
  188. data/lib/graphql/field/resolve.rb +0 -59
  189. data/lib/graphql/field.rb +0 -226
  190. data/lib/graphql/float_type.rb +0 -2
  191. data/lib/graphql/function.rb +0 -128
  192. data/lib/graphql/id_type.rb +0 -2
  193. data/lib/graphql/input_object_type.rb +0 -138
  194. data/lib/graphql/int_type.rb +0 -2
  195. data/lib/graphql/interface_type.rb +0 -72
  196. data/lib/graphql/internal_representation/document.rb +0 -27
  197. data/lib/graphql/internal_representation/node.rb +0 -206
  198. data/lib/graphql/internal_representation/print.rb +0 -51
  199. data/lib/graphql/internal_representation/rewrite.rb +0 -184
  200. data/lib/graphql/internal_representation/scope.rb +0 -88
  201. data/lib/graphql/internal_representation/visit.rb +0 -36
  202. data/lib/graphql/internal_representation.rb +0 -7
  203. data/lib/graphql/language/lexer.rl +0 -260
  204. data/lib/graphql/list_type.rb +0 -80
  205. data/lib/graphql/non_null_type.rb +0 -71
  206. data/lib/graphql/object_type.rb +0 -130
  207. data/lib/graphql/query/arguments.rb +0 -189
  208. data/lib/graphql/query/arguments_cache.rb +0 -24
  209. data/lib/graphql/query/executor.rb +0 -52
  210. data/lib/graphql/query/literal_input.rb +0 -136
  211. data/lib/graphql/query/serial_execution/field_resolution.rb +0 -92
  212. data/lib/graphql/query/serial_execution/operation_resolution.rb +0 -19
  213. data/lib/graphql/query/serial_execution/selection_resolution.rb +0 -23
  214. data/lib/graphql/query/serial_execution/value_resolution.rb +0 -87
  215. data/lib/graphql/query/serial_execution.rb +0 -40
  216. data/lib/graphql/relay/array_connection.rb +0 -83
  217. data/lib/graphql/relay/base_connection.rb +0 -189
  218. data/lib/graphql/relay/connection_instrumentation.rb +0 -54
  219. data/lib/graphql/relay/connection_resolve.rb +0 -43
  220. data/lib/graphql/relay/connection_type.rb +0 -54
  221. data/lib/graphql/relay/edge.rb +0 -27
  222. data/lib/graphql/relay/edge_type.rb +0 -19
  223. data/lib/graphql/relay/edges_instrumentation.rb +0 -39
  224. data/lib/graphql/relay/global_id_resolve.rb +0 -17
  225. data/lib/graphql/relay/mongo_relation_connection.rb +0 -50
  226. data/lib/graphql/relay/mutation/instrumentation.rb +0 -23
  227. data/lib/graphql/relay/mutation/resolve.rb +0 -56
  228. data/lib/graphql/relay/mutation/result.rb +0 -38
  229. data/lib/graphql/relay/mutation.rb +0 -106
  230. data/lib/graphql/relay/node.rb +0 -39
  231. data/lib/graphql/relay/page_info.rb +0 -7
  232. data/lib/graphql/relay/relation_connection.rb +0 -188
  233. data/lib/graphql/relay/type_extensions.rb +0 -32
  234. data/lib/graphql/scalar_type.rb +0 -91
  235. data/lib/graphql/schema/catchall_middleware.rb +0 -35
  236. data/lib/graphql/schema/default_parse_error.rb +0 -10
  237. data/lib/graphql/schema/default_type_error.rb +0 -17
  238. data/lib/graphql/schema/member/accepts_definition.rb +0 -164
  239. data/lib/graphql/schema/member/cached_graphql_definition.rb +0 -58
  240. data/lib/graphql/schema/member/instrumentation.rb +0 -131
  241. data/lib/graphql/schema/middleware_chain.rb +0 -82
  242. data/lib/graphql/schema/possible_types.rb +0 -44
  243. data/lib/graphql/schema/rescue_middleware.rb +0 -60
  244. data/lib/graphql/schema/timeout_middleware.rb +0 -88
  245. data/lib/graphql/schema/traversal.rb +0 -228
  246. data/lib/graphql/schema/validation.rb +0 -313
  247. data/lib/graphql/static_validation/default_visitor.rb +0 -15
  248. data/lib/graphql/static_validation/no_validate_visitor.rb +0 -10
  249. data/lib/graphql/string_type.rb +0 -2
  250. data/lib/graphql/subscriptions/subscription_root.rb +0 -76
  251. data/lib/graphql/tracing/skylight_tracing.rb +0 -70
  252. data/lib/graphql/types/relay/node_field.rb +0 -24
  253. data/lib/graphql/types/relay/nodes_field.rb +0 -43
  254. data/lib/graphql/union_type.rb +0 -115
  255. data/lib/graphql/upgrader/member.rb +0 -937
  256. data/lib/graphql/upgrader/schema.rb +0 -38
@@ -1,1492 +1,220 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GraphQL
4
- module Language
5
- module Lexer
6
- def self.tokenize(query_string)
7
- run_lexer(query_string)
8
- end
9
-
10
- # Replace any escaped unicode or whitespace with the _actual_ characters
11
- # To avoid allocating more strings, this modifies the string passed into it
12
- def self.replace_escaped_characters_in_place(raw_string)
13
- raw_string.gsub!(ESCAPES, ESCAPES_REPLACE)
14
- raw_string.gsub!(UTF_8, &UTF_8_REPLACE)
15
- nil
16
- end
17
-
18
- private
19
-
20
- class << self
21
- attr_accessor :_graphql_lexer_trans_keys
22
- private :_graphql_lexer_trans_keys, :_graphql_lexer_trans_keys=
23
- end
24
- self._graphql_lexer_trans_keys = [
25
- 1, 0, 4, 22, 4, 43, 14, 46, 14, 46, 14, 46, 14, 46, 4, 22, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 14, 15, 14, 15, 10, 15, 12, 12, 4, 22, 4, 43, 14, 46, 14, 46, 14, 46, 14, 46, 0, 49, 0, 0, 4, 22, 4, 4, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 1, 1, 14, 15, 10, 29, 14, 15, 10, 29, 10, 29, 12, 12, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 4, 4, 0 ,
26
- ]
27
-
28
- class << self
29
- attr_accessor :_graphql_lexer_char_class
30
- private :_graphql_lexer_char_class, :_graphql_lexer_char_class=
31
- end
32
- self._graphql_lexer_char_class = [
33
- 0, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 4, 5, 6, 2, 7, 2, 8, 9, 2, 10, 0, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 2, 2, 17, 2, 2, 18, 19, 19, 19, 19, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 22, 23, 2, 24, 2, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 19, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 19, 45, 46, 19, 47, 48, 49, 0 ,
34
- ]
35
-
36
- class << self
37
- attr_accessor :_graphql_lexer_index_offsets
38
- private :_graphql_lexer_index_offsets, :_graphql_lexer_index_offsets=
39
- end
40
- self._graphql_lexer_index_offsets = [
41
- 0, 0, 19, 59, 92, 125, 158, 191, 210, 211, 212, 231, 232, 233, 235, 237, 243, 244, 263, 303, 336, 369, 402, 435, 485, 486, 505, 506, 507, 508, 527, 528, 529, 530, 532, 552, 554, 574, 594, 595, 628, 661, 694, 727, 760, 793, 826, 859, 892, 925, 958, 991, 1024, 1057, 1090, 1123, 1156, 1189, 1222, 1255, 1288, 1321, 1354, 1387, 1420, 1453, 1486, 1519, 1552, 1585, 1618, 1651, 1684, 1717, 1750, 1783, 1816, 1849, 1882, 1915, 1948, 1981, 2014, 2047, 2080, 2113, 2146, 2179, 2212, 2245, 2278, 2311, 2344, 2377, 2410, 2443, 2476, 2509, 2542, 2575, 2608, 2641, 2674, 2707, 2740, 2773, 2806, 2839, 2872, 2905, 2938, 2971, 3004, 3037, 3070, 3103, 3136, 3169, 3202, 3235, 3268, 3301, 3334, 3367, 3400, 3433, 3466, 3499, 3532, 3565, 3598, 3631, 3664, 3697, 3730, 0 ,
42
- ]
43
-
44
- class << self
45
- attr_accessor :_graphql_lexer_indicies
46
- private :_graphql_lexer_indicies, :_graphql_lexer_indicies=
47
- end
48
- self._graphql_lexer_indicies = [
49
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 4, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 0, 0, 0, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 15, 16, 17, 17, 19, 19, 20, 20, 8, 8, 17, 17, 21, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 24, 22, 25, 25, 25, 25, 25, 25, 25, 25, 22, 25, 25, 25, 25, 25, 25, 25, 25, 22, 25, 25, 25, 22, 25, 25, 25, 22, 25, 25, 25, 25, 25, 22, 25, 25, 25, 22, 25, 22, 26, 27, 27, 25, 25, 25, 27, 27, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 25, 25, 25, 28, 28, 25, 25, 25, 25, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 25, 25, 25, 29, 29, 25, 25, 25, 25, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 22, 22, 25, 25, 25, 22, 22, 25, 25, 25, 25, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 31, 32, 30, 33, 34, 35, 36, 37, 38, 39, 30, 40, 41, 30, 42, 43, 44, 45, 46, 47, 47, 48, 30, 49, 47, 47, 47, 47, 50, 51, 52, 47, 47, 53, 47, 54, 55, 56, 47, 57, 58, 59, 60, 61, 47, 47, 47, 62, 63, 64, 31, 67, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 9, 70, 71, 72, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 73, 13, 74, 42, 43, 20, 20, 76, 75, 17, 17, 75, 75, 75, 75, 77, 75, 75, 75, 75, 75, 75, 75, 75, 77, 17, 17, 20, 20, 78, 78, 19, 19, 78, 78, 78, 78, 77, 78, 78, 78, 78, 78, 78, 78, 78, 77, 20, 20, 76, 75, 43, 43, 75, 75, 75, 75, 77, 75, 75, 75, 75, 75, 75, 75, 75, 77, 79, 47, 47, 8, 8, 8, 47, 47, 8, 8, 8, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 81, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 82, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 83, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 84, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 85, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 86, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 87, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 88, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 89, 47, 47, 47, 47, 47, 47, 47, 47, 90, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 91, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 92, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 93, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 94, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 95, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 96, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 97, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 98, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 99, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 100, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 101, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 102, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 103, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 104, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 105, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 106, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 107, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 108, 109, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 110, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 111, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 112, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 113, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 114, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 115, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 116, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 117, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 118, 47, 47, 47, 119, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 120, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 121, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 122, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 123, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 124, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 125, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 126, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 127, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 128, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 129, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 130, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 131, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 132, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 133, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 134, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 135, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 137, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 138, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 139, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 140, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 141, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 142, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 143, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 144, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 145, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 146, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 147, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 148, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 149, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 150, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 151, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 152, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 153, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 154, 47, 47, 47, 47, 47, 47, 155, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 156, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 157, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 158, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 159, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 160, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 161, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 162, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 163, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 164, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 165, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 166, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 167, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 168, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 169, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 170, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 171, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 172, 47, 47, 47, 47, 47, 173, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 174, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 175, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 176, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 177, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 178, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 179, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 180, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 181, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 22, 0 ,
50
- ]
51
-
52
- class << self
53
- attr_accessor :_graphql_lexer_index_defaults
54
- private :_graphql_lexer_index_defaults, :_graphql_lexer_index_defaults=
55
- end
56
- self._graphql_lexer_index_defaults = [
57
- 0, 1, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 8, 18, 8, 0, 22, 25, 25, 25, 25, 25, 30, 65, 1, 68, 69, 69, 9, 9, 9, 35, 66, 75, 78, 78, 75, 66, 8, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 25, 0 ,
58
- ]
59
-
60
- class << self
61
- attr_accessor :_graphql_lexer_trans_cond_spaces
62
- private :_graphql_lexer_trans_cond_spaces, :_graphql_lexer_trans_cond_spaces=
63
- end
64
- self._graphql_lexer_trans_cond_spaces = [
65
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 ,
66
- ]
67
-
68
- class << self
69
- attr_accessor :_graphql_lexer_cond_targs
70
- private :_graphql_lexer_cond_targs, :_graphql_lexer_cond_targs=
71
- end
72
- self._graphql_lexer_cond_targs = [
73
- 23, 1, 23, 2, 3, 4, 5, 6, 23, 7, 8, 10, 9, 27, 11, 12, 29, 35, 23, 36, 13, 23, 17, 134, 18, 0, 19, 20, 21, 22, 23, 24, 23, 23, 25, 32, 23, 23, 23, 23, 33, 38, 34, 37, 23, 23, 23, 39, 23, 23, 40, 48, 55, 65, 83, 90, 93, 94, 98, 107, 125, 130, 23, 23, 23, 23, 23, 26, 23, 23, 28, 23, 30, 31, 23, 23, 14, 15, 23, 16, 23, 41, 42, 43, 44, 45, 46, 47, 39, 49, 51, 50, 39, 52, 53, 54, 39, 56, 59, 57, 58, 39, 60, 61, 62, 63, 64, 39, 66, 74, 67, 68, 69, 70, 71, 72, 73, 39, 75, 77, 76, 39, 78, 79, 80, 81, 82, 39, 84, 85, 86, 87, 88, 89, 39, 91, 92, 39, 39, 95, 96, 97, 39, 99, 100, 101, 102, 103, 104, 105, 106, 39, 108, 115, 109, 112, 110, 111, 39, 113, 114, 39, 116, 117, 118, 119, 120, 121, 122, 123, 124, 39, 126, 128, 127, 39, 129, 39, 131, 132, 133, 39, 0 ,
74
- ]
75
-
76
- class << self
77
- attr_accessor :_graphql_lexer_cond_actions
78
- private :_graphql_lexer_cond_actions, :_graphql_lexer_cond_actions=
79
- end
80
- self._graphql_lexer_cond_actions = [
81
- 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 6, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0, 11, 0, 12, 13, 14, 0, 15, 16, 17, 18, 0, 14, 19, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 0, 34, 4, 4, 35, 36, 0, 0, 37, 0, 38, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 45, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 52, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 55, 0, 56, 0, 0, 0, 57, 0 ,
82
- ]
83
-
84
- class << self
85
- attr_accessor :_graphql_lexer_to_state_actions
86
- private :_graphql_lexer_to_state_actions, :_graphql_lexer_to_state_actions=
87
- end
88
- self._graphql_lexer_to_state_actions = [
89
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0 ,
90
- ]
91
-
92
- class << self
93
- attr_accessor :_graphql_lexer_from_state_actions
94
- private :_graphql_lexer_from_state_actions, :_graphql_lexer_from_state_actions=
95
- end
96
- self._graphql_lexer_from_state_actions = [
97
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0 ,
98
- ]
99
-
100
- class << self
101
- attr_accessor :_graphql_lexer_eof_trans
102
- private :_graphql_lexer_eof_trans, :_graphql_lexer_eof_trans=
103
- end
104
- self._graphql_lexer_eof_trans = [
105
- 0, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 19, 9, 1, 0, 0, 0, 0, 0, 0, 0, 66, 67, 69, 70, 70, 70, 70, 70, 75, 67, 76, 79, 79, 76, 67, 9, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 0, 0 ,
106
- ]
107
-
108
- class << self
109
- attr_accessor :_graphql_lexer_nfa_targs
110
- private :_graphql_lexer_nfa_targs, :_graphql_lexer_nfa_targs=
111
- end
112
- self._graphql_lexer_nfa_targs = [
113
- 0, 0 ,
114
- ]
115
-
116
- class << self
117
- attr_accessor :_graphql_lexer_nfa_offsets
118
- private :_graphql_lexer_nfa_offsets, :_graphql_lexer_nfa_offsets=
119
- end
120
- self._graphql_lexer_nfa_offsets = [
121
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,
122
- ]
123
-
124
- class << self
125
- attr_accessor :_graphql_lexer_nfa_push_actions
126
- private :_graphql_lexer_nfa_push_actions, :_graphql_lexer_nfa_push_actions=
127
- end
128
- self._graphql_lexer_nfa_push_actions = [
129
- 0, 0 ,
130
- ]
131
-
132
- class << self
133
- attr_accessor :_graphql_lexer_nfa_pop_trans
134
- private :_graphql_lexer_nfa_pop_trans, :_graphql_lexer_nfa_pop_trans=
135
- end
136
- self._graphql_lexer_nfa_pop_trans = [
137
- 0, 0 ,
138
- ]
139
-
140
- class << self
141
- attr_accessor :graphql_lexer_start
142
- end
143
- self.graphql_lexer_start = 23;
144
-
145
- class << self
146
- attr_accessor :graphql_lexer_first_final
147
- end
148
- self.graphql_lexer_first_final = 23;
149
-
150
- class << self
151
- attr_accessor :graphql_lexer_error
152
- end
153
- self.graphql_lexer_error = 0;
154
-
155
- class << self
156
- attr_accessor :graphql_lexer_en_str
157
- end
158
- self.graphql_lexer_en_str = 134;
159
-
160
- class << self
161
- attr_accessor :graphql_lexer_en_main
162
- end
163
- self.graphql_lexer_en_main = 23;
164
-
165
- def self.run_lexer(query_string)
166
- data = query_string.unpack(PACK_DIRECTIVE)
167
- eof = data.length
168
-
169
- # Since `Lexer` is a module, store all lexer state
170
- # in this local variable:
171
- meta = {
172
- line: 1,
173
- col: 1,
174
- data: data,
175
- tokens: [],
176
- previous_token: nil,
177
- }
178
-
179
- p ||= 0
180
- pe ||= data.length
181
-
182
- begin
183
- cs = graphql_lexer_start;
184
- ts = 0;
185
- te = 0;
186
- act = 0;
187
-
188
- end
189
- begin
190
- _trans = 0;
191
- _have = 0;
192
- _cont = 1;
193
- _keys = 0;
194
- _inds = 0;
195
- while ( _cont == 1 )
196
- begin
197
- if ( cs == 0 )
198
- _cont = 0;
199
-
200
- end
201
- _have = 0;
202
- if ( p == pe )
203
- begin
204
- if ( p == eof )
205
- begin
206
- if ( _graphql_lexer_eof_trans[cs] > 0 )
207
- begin
208
- _trans = _graphql_lexer_eof_trans[cs] - 1;
209
- _have = 1;
210
-
211
- end
212
-
213
- end
214
- if ( _have == 0 )
215
- begin
216
-
217
- end
218
-
219
- end
220
-
221
- end
222
-
223
- end
224
- if ( _have == 0 )
225
- _cont = 0;
226
-
227
- end
228
-
229
- end
230
-
231
- end
232
- if ( _cont == 1 )
233
- begin
234
- if ( _have == 0 )
235
- begin
236
- case _graphql_lexer_from_state_actions[cs]
237
- when -2 then
238
- begin
239
- end
240
- when 10 then
241
- begin
242
- begin
243
- begin
244
- ts = p;
245
-
246
- end
247
-
248
- end
249
-
250
-
251
- end
252
- end
253
- _keys = (cs<<1) ;
254
- _inds = _graphql_lexer_index_offsets[cs] ;
255
- if ( ( data[p ].ord) <= 125 && ( data[p ].ord) >= 9 )
256
- begin
257
- _ic = _graphql_lexer_char_class[( data[p ].ord) - 9];
258
- if ( _ic <= _graphql_lexer_trans_keys[_keys+1 ]&& _ic >= _graphql_lexer_trans_keys[_keys ] )
259
- _trans = _graphql_lexer_indicies[_inds + ( _ic - _graphql_lexer_trans_keys[_keys ]) ];
260
-
261
- else
262
- _trans = _graphql_lexer_index_defaults[cs];
263
-
264
- end
265
-
266
- end
267
-
268
- else
269
- begin
270
- _trans = _graphql_lexer_index_defaults[cs];
271
-
272
- end
273
-
274
- end
275
-
276
- end
277
-
278
- end
279
- if ( _cont == 1 )
280
- begin
281
- cs = _graphql_lexer_cond_targs[_trans];
282
- case _graphql_lexer_cond_actions[_trans]
283
- when -2 then
284
- begin
285
- end
286
- when 14 then
287
- begin
288
- begin
289
- begin
290
- te = p+1;
291
-
292
- end
293
-
294
- end
295
-
296
- end
297
- when 8 then
298
- begin
299
- begin
300
- begin
301
- te = p+1;
302
- begin
303
- emit_string(ts, te, meta, block: false)
304
- end
305
-
306
- end
307
-
308
- end
309
-
310
- end
311
- when 28 then
312
- begin
313
- begin
314
- begin
315
- te = p+1;
316
- begin
317
- emit(:RCURLY, ts, te, meta, "}")
318
- end
319
-
320
- end
321
-
322
- end
323
-
324
- end
325
- when 26 then
326
- begin
327
- begin
328
- begin
329
- te = p+1;
330
- begin
331
- emit(:LCURLY, ts, te, meta, "{")
332
- end
333
-
334
- end
335
-
336
- end
337
-
338
- end
339
- when 18 then
340
- begin
341
- begin
342
- begin
343
- te = p+1;
344
- begin
345
- emit(:RPAREN, ts, te, meta, ")")
346
- end
347
-
348
- end
349
-
350
- end
351
-
352
- end
353
- when 17 then
354
- begin
355
- begin
356
- begin
357
- te = p+1;
358
- begin
359
- emit(:LPAREN, ts, te, meta, "(")
360
- end
361
-
362
- end
363
-
364
- end
365
-
366
- end
367
- when 25 then
368
- begin
369
- begin
370
- begin
371
- te = p+1;
372
- begin
373
- emit(:RBRACKET, ts, te, meta, "]")
374
- end
375
-
376
- end
377
-
378
- end
379
-
380
- end
381
- when 24 then
382
- begin
383
- begin
384
- begin
385
- te = p+1;
386
- begin
387
- emit(:LBRACKET, ts, te, meta, "[")
388
- end
389
-
390
- end
391
-
392
- end
393
-
394
- end
395
- when 20 then
396
- begin
397
- begin
398
- begin
399
- te = p+1;
400
- begin
401
- emit(:COLON, ts, te, meta, ":")
402
- end
403
-
404
- end
405
-
406
- end
407
-
408
- end
409
- when 2 then
410
- begin
411
- begin
412
- begin
413
- te = p+1;
414
- begin
415
- emit_string(ts, te, meta, block: false)
416
- end
417
-
418
- end
419
-
420
- end
421
-
422
- end
423
- when 34 then
424
- begin
425
- begin
426
- begin
427
- te = p+1;
428
- begin
429
- emit_string(ts, te, meta, block: true)
430
- end
431
-
432
- end
433
-
434
- end
435
-
436
- end
437
- when 15 then
438
- begin
439
- begin
440
- begin
441
- te = p+1;
442
- begin
443
- emit(:VAR_SIGN, ts, te, meta, "$")
444
- end
445
-
446
- end
447
-
448
- end
449
-
450
- end
451
- when 22 then
452
- begin
453
- begin
454
- begin
455
- te = p+1;
456
- begin
457
- emit(:DIR_SIGN, ts, te, meta, "@")
458
- end
459
-
460
- end
461
-
462
- end
463
-
464
- end
465
- when 7 then
466
- begin
467
- begin
468
- begin
469
- te = p+1;
470
- begin
471
- emit(:ELLIPSIS, ts, te, meta, "...")
472
- end
473
-
474
- end
475
-
476
- end
477
-
478
- end
479
- when 21 then
480
- begin
481
- begin
482
- begin
483
- te = p+1;
484
- begin
485
- emit(:EQUALS, ts, te, meta, "=")
486
- end
487
-
488
- end
489
-
490
- end
491
-
492
- end
493
- when 13 then
494
- begin
495
- begin
496
- begin
497
- te = p+1;
498
- begin
499
- emit(:BANG, ts, te, meta, "!")
500
- end
501
-
502
- end
503
-
504
- end
505
-
506
- end
507
- when 27 then
508
- begin
509
- begin
510
- begin
511
- te = p+1;
512
- begin
513
- emit(:PIPE, ts, te, meta, "|")
514
- end
515
-
516
- end
517
-
518
- end
519
-
520
- end
521
- when 16 then
522
- begin
523
- begin
524
- begin
525
- te = p+1;
526
- begin
527
- emit(:AMP, ts, te, meta, "&")
528
- end
529
-
530
- end
531
-
532
- end
533
-
534
- end
535
- when 12 then
536
- begin
537
- begin
538
- begin
539
- te = p+1;
540
- begin
541
- meta[:line] += 1
542
- meta[:col] = 1
543
-
544
- end
545
-
546
- end
547
-
548
- end
549
-
550
- end
551
- when 11 then
552
- begin
553
- begin
554
- begin
555
- te = p+1;
556
- begin
557
- emit(:UNKNOWN_CHAR, ts, te, meta)
558
- end
559
-
560
- end
561
-
562
- end
563
-
564
- end
565
- when 36 then
566
- begin
567
- begin
568
- begin
569
- te = p;
570
- p = p - 1;
571
- begin
572
- emit(:INT, ts, te, meta)
573
- end
574
-
575
- end
576
-
577
- end
578
-
579
- end
580
- when 37 then
581
- begin
582
- begin
583
- begin
584
- te = p;
585
- p = p - 1;
586
- begin
587
- emit(:FLOAT, ts, te, meta)
588
- end
589
-
590
- end
591
-
592
- end
593
-
594
- end
595
- when 32 then
596
- begin
597
- begin
598
- begin
599
- te = p;
600
- p = p - 1;
601
- begin
602
- emit_string(ts, te, meta, block: false)
603
- end
604
-
605
- end
606
-
607
- end
608
-
609
- end
610
- when 33 then
611
- begin
612
- begin
613
- begin
614
- te = p;
615
- p = p - 1;
616
- begin
617
- emit_string(ts, te, meta, block: true)
618
- end
619
-
620
- end
621
-
622
- end
623
-
624
- end
625
- when 38 then
626
- begin
627
- begin
628
- begin
629
- te = p;
630
- p = p - 1;
631
- begin
632
- emit(:IDENTIFIER, ts, te, meta)
633
- end
634
-
635
- end
636
-
637
- end
638
-
639
- end
640
- when 35 then
641
- begin
642
- begin
643
- begin
644
- te = p;
645
- p = p - 1;
646
- begin
647
- record_comment(ts, te, meta)
648
- end
649
-
650
- end
651
-
652
- end
653
-
654
- end
655
- when 29 then
656
- begin
657
- begin
658
- begin
659
- te = p;
660
- p = p - 1;
661
- begin
662
- meta[:col] += te - ts
663
- end
664
-
665
- end
666
-
667
- end
668
-
669
- end
670
- when 30 then
671
- begin
672
- begin
673
- begin
674
- te = p;
675
- p = p - 1;
676
- begin
677
- emit(:UNKNOWN_CHAR, ts, te, meta)
678
- end
679
-
680
- end
681
-
682
- end
683
-
684
- end
685
- when 5 then
686
- begin
687
- begin
688
- begin
689
- p = ((te))-1;
690
- begin
691
- emit(:INT, ts, te, meta)
692
- end
693
-
694
- end
695
-
696
- end
697
-
698
- end
699
- when 1 then
700
- begin
701
- begin
702
- begin
703
- p = ((te))-1;
704
- begin
705
- emit(:UNKNOWN_CHAR, ts, te, meta)
706
- end
707
-
708
- end
709
-
710
- end
711
-
712
- end
713
- when 3 then
714
- begin
715
- begin
716
- begin
717
- case act
718
- when -2 then
719
- begin
720
- end
721
- when 2 then
722
- begin
723
- p = ((te))-1;
724
- begin
725
- emit(:INT, ts, te, meta)
726
- end
727
-
728
- end
729
- when 3 then
730
- begin
731
- p = ((te))-1;
732
- begin
733
- emit(:FLOAT, ts, te, meta)
734
- end
735
-
736
- end
737
- when 4 then
738
- begin
739
- p = ((te))-1;
740
- begin
741
- emit(:ON, ts, te, meta, "on")
742
- end
743
-
744
- end
745
- when 5 then
746
- begin
747
- p = ((te))-1;
748
- begin
749
- emit(:FRAGMENT, ts, te, meta, "fragment")
750
- end
751
-
752
- end
753
- when 6 then
754
- begin
755
- p = ((te))-1;
756
- begin
757
- emit(:TRUE, ts, te, meta, "true")
758
- end
759
-
760
- end
761
- when 7 then
762
- begin
763
- p = ((te))-1;
764
- begin
765
- emit(:FALSE, ts, te, meta, "false")
766
- end
767
-
768
- end
769
- when 8 then
770
- begin
771
- p = ((te))-1;
772
- begin
773
- emit(:NULL, ts, te, meta, "null")
774
- end
775
-
776
- end
777
- when 9 then
778
- begin
779
- p = ((te))-1;
780
- begin
781
- emit(:QUERY, ts, te, meta, "query")
782
- end
783
-
784
- end
785
- when 10 then
786
- begin
787
- p = ((te))-1;
788
- begin
789
- emit(:MUTATION, ts, te, meta, "mutation")
790
- end
791
-
792
- end
793
- when 11 then
794
- begin
795
- p = ((te))-1;
796
- begin
797
- emit(:SUBSCRIPTION, ts, te, meta, "subscription")
798
- end
799
-
800
- end
801
- when 12 then
802
- begin
803
- p = ((te))-1;
804
- begin
805
- emit(:SCHEMA, ts, te, meta)
806
- end
807
-
808
- end
809
- when 13 then
810
- begin
811
- p = ((te))-1;
812
- begin
813
- emit(:SCALAR, ts, te, meta)
814
- end
815
-
816
- end
817
- when 14 then
818
- begin
819
- p = ((te))-1;
820
- begin
821
- emit(:TYPE, ts, te, meta)
822
- end
823
-
824
- end
825
- when 15 then
826
- begin
827
- p = ((te))-1;
828
- begin
829
- emit(:EXTEND, ts, te, meta)
830
- end
831
-
832
- end
833
- when 16 then
834
- begin
835
- p = ((te))-1;
836
- begin
837
- emit(:IMPLEMENTS, ts, te, meta)
838
- end
839
-
840
- end
841
- when 17 then
842
- begin
843
- p = ((te))-1;
844
- begin
845
- emit(:INTERFACE, ts, te, meta)
846
- end
847
-
848
- end
849
- when 18 then
850
- begin
851
- p = ((te))-1;
852
- begin
853
- emit(:UNION, ts, te, meta)
854
- end
855
-
856
- end
857
- when 19 then
858
- begin
859
- p = ((te))-1;
860
- begin
861
- emit(:ENUM, ts, te, meta)
862
- end
863
-
864
- end
865
- when 20 then
866
- begin
867
- p = ((te))-1;
868
- begin
869
- emit(:INPUT, ts, te, meta)
870
- end
871
-
872
- end
873
- when 21 then
874
- begin
875
- p = ((te))-1;
876
- begin
877
- emit(:DIRECTIVE, ts, te, meta)
878
- end
879
-
880
- end
881
- when 22 then
882
- begin
883
- p = ((te))-1;
884
- begin
885
- emit(:REPEATABLE, ts, te, meta, "repeatable")
886
- end
887
-
888
- end
889
- when 30 then
890
- begin
891
- p = ((te))-1;
892
- begin
893
- emit_string(ts, te, meta, block: false)
894
- end
895
-
896
- end
897
- when 31 then
898
- begin
899
- p = ((te))-1;
900
- begin
901
- emit_string(ts, te, meta, block: true)
902
- end
903
-
904
- end
905
- when 39 then
906
- begin
907
- p = ((te))-1;
908
- begin
909
- emit(:IDENTIFIER, ts, te, meta)
910
- end
911
-
912
-
913
- end
914
- end
915
-
916
- end
917
-
918
-
919
- end
920
-
921
- end
922
- when 19 then
923
- begin
924
- begin
925
- begin
926
- te = p+1;
927
-
928
- end
929
-
930
- end
931
- begin
932
- begin
933
- act = 2;
934
-
935
- end
936
-
937
- end
938
-
939
- end
940
- when 6 then
941
- begin
942
- begin
943
- begin
944
- te = p+1;
945
-
946
- end
947
-
948
- end
949
- begin
950
- begin
951
- act = 3;
952
-
953
- end
954
-
955
- end
956
-
957
- end
958
- when 49 then
959
- begin
960
- begin
961
- begin
962
- te = p+1;
963
-
964
- end
965
-
966
- end
967
- begin
968
- begin
969
- act = 4;
970
-
971
- end
972
-
973
- end
974
-
975
- end
976
- when 43 then
977
- begin
978
- begin
979
- begin
980
- te = p+1;
981
-
982
- end
983
-
984
- end
985
- begin
986
- begin
987
- act = 5;
988
-
989
- end
990
-
991
- end
992
-
993
- end
994
- when 55 then
995
- begin
996
- begin
997
- begin
998
- te = p+1;
999
-
1000
- end
1001
-
1002
- end
1003
- begin
1004
- begin
1005
- act = 6;
1006
-
1007
- end
1008
-
1009
- end
1010
-
1011
- end
1012
- when 42 then
1013
- begin
1014
- begin
1015
- begin
1016
- te = p+1;
1017
-
1018
- end
1019
-
1020
- end
1021
- begin
1022
- begin
1023
- act = 7;
1024
-
1025
- end
1026
-
1027
- end
1028
-
1029
- end
1030
- when 48 then
1031
- begin
1032
- begin
1033
- begin
1034
- te = p+1;
1035
-
1036
- end
1037
-
1038
- end
1039
- begin
1040
- begin
1041
- act = 8;
1042
-
1043
- end
1044
-
1045
- end
1046
-
1047
- end
1048
- when 50 then
1049
- begin
1050
- begin
1051
- begin
1052
- te = p+1;
1053
-
1054
- end
1055
-
1056
- end
1057
- begin
1058
- begin
1059
- act = 9;
1060
-
1061
- end
1062
-
1063
- end
1064
-
1065
- end
1066
- when 47 then
1067
- begin
1068
- begin
1069
- begin
1070
- te = p+1;
1071
-
1072
- end
1073
-
1074
- end
1075
- begin
1076
- begin
1077
- act = 10;
1078
-
1079
- end
1080
-
1081
- end
1082
-
1083
- end
1084
- when 54 then
1085
- begin
1086
- begin
1087
- begin
1088
- te = p+1;
1089
-
1090
- end
1091
-
1092
- end
1093
- begin
1094
- begin
1095
- act = 11;
1096
-
1097
- end
1098
-
1099
- end
1100
-
1101
- end
1102
- when 53 then
1103
- begin
1104
- begin
1105
- begin
1106
- te = p+1;
1107
-
1108
- end
1109
-
1110
- end
1111
- begin
1112
- begin
1113
- act = 12;
1114
-
1115
- end
1116
-
1117
- end
1118
-
1119
- end
1120
- when 52 then
1121
- begin
1122
- begin
1123
- begin
1124
- te = p+1;
1125
-
1126
- end
1127
-
1128
- end
1129
- begin
1130
- begin
1131
- act = 13;
1132
-
1133
- end
1134
-
1135
- end
1136
-
1137
- end
1138
- when 56 then
1139
- begin
1140
- begin
1141
- begin
1142
- te = p+1;
1143
-
1144
- end
1145
-
1146
- end
1147
- begin
1148
- begin
1149
- act = 14;
1150
-
1151
- end
1152
-
1153
- end
1154
-
1155
- end
1156
- when 41 then
1157
- begin
1158
- begin
1159
- begin
1160
- te = p+1;
1161
-
1162
- end
1163
-
1164
- end
1165
- begin
1166
- begin
1167
- act = 15;
1168
-
1169
- end
1170
-
1171
- end
1172
-
1173
- end
1174
- when 44 then
1175
- begin
1176
- begin
1177
- begin
1178
- te = p+1;
1179
-
1180
- end
1181
-
1182
- end
1183
- begin
1184
- begin
1185
- act = 16;
1186
-
1187
- end
1188
-
1189
- end
1190
-
1191
- end
1192
- when 46 then
1193
- begin
1194
- begin
1195
- begin
1196
- te = p+1;
1197
-
1198
- end
1199
-
1200
- end
1201
- begin
1202
- begin
1203
- act = 17;
1204
-
1205
- end
1206
-
1207
- end
1208
-
1209
- end
1210
- when 57 then
1211
- begin
1212
- begin
1213
- begin
1214
- te = p+1;
1215
-
1216
- end
1217
-
1218
- end
1219
- begin
1220
- begin
1221
- act = 18;
1222
-
1223
- end
1224
-
1225
- end
1226
-
1227
- end
1228
- when 40 then
1229
- begin
1230
- begin
1231
- begin
1232
- te = p+1;
1233
-
1234
- end
1235
-
1236
- end
1237
- begin
1238
- begin
1239
- act = 19;
1240
-
1241
- end
1242
-
1243
- end
1244
-
1245
- end
1246
- when 45 then
1247
- begin
1248
- begin
1249
- begin
1250
- te = p+1;
1251
-
1252
- end
1253
-
1254
- end
1255
- begin
1256
- begin
1257
- act = 20;
1258
-
1259
- end
1260
-
1261
- end
1262
-
1263
- end
1264
- when 39 then
1265
- begin
1266
- begin
1267
- begin
1268
- te = p+1;
1269
-
1270
- end
1271
-
1272
- end
1273
- begin
1274
- begin
1275
- act = 21;
1276
-
1277
- end
1278
-
1279
- end
1280
-
1281
- end
1282
- when 51 then
1283
- begin
1284
- begin
1285
- begin
1286
- te = p+1;
1287
-
1288
- end
1289
-
1290
- end
1291
- begin
1292
- begin
1293
- act = 22;
1294
-
1295
- end
1296
-
1297
- end
1298
-
1299
- end
1300
- when 31 then
1301
- begin
1302
- begin
1303
- begin
1304
- te = p+1;
1305
-
1306
- end
1307
-
1308
- end
1309
- begin
1310
- begin
1311
- act = 30;
1312
-
1313
- end
1314
-
1315
- end
1316
-
1317
- end
1318
- when 4 then
1319
- begin
1320
- begin
1321
- begin
1322
- te = p+1;
1323
-
1324
- end
1325
-
1326
- end
1327
- begin
1328
- begin
1329
- act = 31;
1330
-
1331
- end
1332
-
1333
- end
1334
-
1335
- end
1336
- when 23 then
1337
- begin
1338
- begin
1339
- begin
1340
- te = p+1;
1341
-
1342
- end
1343
-
1344
- end
1345
- begin
1346
- begin
1347
- act = 39;
1348
-
1349
- end
1350
-
1351
- end
1352
-
1353
-
1354
- end
1355
- end
1356
- case _graphql_lexer_to_state_actions[cs]
1357
- when -2 then
1358
- begin
1359
- end
1360
- when 9 then
1361
- begin
1362
- begin
1363
- begin
1364
- ts = 0;
1365
-
1366
- end
1367
-
1368
- end
1369
-
1370
-
1371
- end
1372
- end
1373
- if ( cs == 0 )
1374
- _cont = 0;
1375
-
1376
- end
1377
- if ( _cont == 1 )
1378
- p += 1;
1379
-
1380
- end
1381
-
1382
- end
1383
-
1384
- end
1385
-
1386
- end
1387
-
1388
- end
1389
-
1390
- end
1391
-
1392
- end
1393
-
1394
- end
1395
- meta[:tokens]
1396
- end
3
+ require "strscan"
1397
4
 
1398
- def self.record_comment(ts, te, meta)
1399
- token = GraphQL::Language::Token.new(
1400
- :COMMENT,
1401
- meta[:data][ts, te - ts].pack(PACK_DIRECTIVE).force_encoding(UTF_8_ENCODING),
1402
- meta[:line],
1403
- meta[:col],
1404
- meta[:previous_token],
1405
- )
1406
-
1407
- meta[:previous_token] = token
1408
-
1409
- meta[:col] += te - ts
1410
- end
1411
-
1412
- def self.emit(token_name, ts, te, meta, token_value = nil)
1413
- token_value ||= meta[:data][ts, te - ts].pack(PACK_DIRECTIVE).force_encoding(UTF_8_ENCODING)
1414
- meta[:tokens] << token = GraphQL::Language::Token.new(
1415
- token_name,
1416
- token_value,
1417
- meta[:line],
1418
- meta[:col],
1419
- meta[:previous_token],
1420
- )
1421
- meta[:previous_token] = token
1422
- # Bump the column counter for the next token
1423
- meta[:col] += te - ts
1424
- end
1425
-
1426
- ESCAPES = /\\["\\\/bfnrt]/
1427
- ESCAPES_REPLACE = {
1428
- '\\"' => '"',
1429
- "\\\\" => "\\",
1430
- "\\/" => '/',
1431
- "\\b" => "\b",
1432
- "\\f" => "\f",
1433
- "\\n" => "\n",
1434
- "\\r" => "\r",
1435
- "\\t" => "\t",
1436
- }
1437
-
1438
- UTF_8 = /\\u[\dAa-f]{4}/i
1439
- UTF_8_REPLACE = ->(m) { [m[-4..-1].to_i(16)].pack('U'.freeze) }
1440
-
1441
- VALID_STRING = /\A(?:[^\\]|#{ESCAPES}|#{UTF_8})*\z/o
1442
-
1443
- PACK_DIRECTIVE = "c*"
1444
- UTF_8_ENCODING = "UTF-8"
1445
-
1446
- def self.emit_string(ts, te, meta, block:)
1447
- quotes_length = block ? 3 : 1
1448
- value = meta[:data][ts + quotes_length, te - ts - 2 * quotes_length].pack(PACK_DIRECTIVE).force_encoding(UTF_8_ENCODING) || ''
1449
- line_incr = 0
1450
- if block && !value.empty?
1451
- line_incr = value.count("\n")
1452
- value = GraphQL::Language::BlockString.trim_whitespace(value)
1453
- end
1454
- # TODO: replace with `String#match?` when we support only Ruby 2.4+
1455
- # (It's faster: https://bugs.ruby-lang.org/issues/8110)
1456
- if !value.valid_encoding? || !value.match?(VALID_STRING)
1457
- meta[:tokens] << token = GraphQL::Language::Token.new(
1458
- :BAD_UNICODE_ESCAPE,
1459
- value,
1460
- meta[:line],
1461
- meta[:col],
1462
- meta[:previous_token],
1463
- )
1464
- else
1465
- replace_escaped_characters_in_place(value)
1466
-
1467
- if !value.valid_encoding?
1468
- meta[:tokens] << token = GraphQL::Language::Token.new(
1469
- :BAD_UNICODE_ESCAPE,
1470
- value,
1471
- meta[:line],
1472
- meta[:col],
1473
- meta[:previous_token],
1474
- )
1475
- else
1476
- meta[:tokens] << token = GraphQL::Language::Token.new(
1477
- :STRING,
1478
- value,
1479
- meta[:line],
1480
- meta[:col],
1481
- meta[:previous_token],
1482
- )
1483
- end
1484
- end
1485
-
1486
- meta[:previous_token] = token
1487
- meta[:col] += te - ts
1488
- meta[:line] += line_incr
1489
- end
1490
- end
1491
- end
5
+ module GraphQL
6
+ module Language
7
+ module Lexer
8
+ IDENTIFIER = /[_A-Za-z][_0-9A-Za-z]*/
9
+ NEWLINE = /[\c\r\n]/
10
+ BLANK = /[, \t]+/
11
+ COMMENT = /#[^\n\r]*/
12
+ INT = /[-]?(?:[0]|[1-9][0-9]*)/
13
+ FLOAT_DECIMAL = /[.][0-9]+/
14
+ FLOAT_EXP = /[eE][+-]?[0-9]+/
15
+ FLOAT = /#{INT}(#{FLOAT_DECIMAL}#{FLOAT_EXP}|#{FLOAT_DECIMAL}|#{FLOAT_EXP})/
16
+
17
+ module Literals
18
+ ON = /on\b/
19
+ FRAGMENT = /fragment\b/
20
+ TRUE = /true\b/
21
+ FALSE = /false\b/
22
+ NULL = /null\b/
23
+ QUERY = /query\b/
24
+ MUTATION = /mutation\b/
25
+ SUBSCRIPTION = /subscription\b/
26
+ SCHEMA = /schema\b/
27
+ SCALAR = /scalar\b/
28
+ TYPE = /type\b/
29
+ EXTEND = /extend\b/
30
+ IMPLEMENTS = /implements\b/
31
+ INTERFACE = /interface\b/
32
+ UNION = /union\b/
33
+ ENUM = /enum\b/
34
+ INPUT = /input\b/
35
+ DIRECTIVE = /directive\b/
36
+ REPEATABLE = /repeatable\b/
37
+ LCURLY = '{'
38
+ RCURLY = '}'
39
+ LPAREN = '('
40
+ RPAREN = ')'
41
+ LBRACKET = '['
42
+ RBRACKET = ']'
43
+ COLON = ':'
44
+ VAR_SIGN = '$'
45
+ DIR_SIGN = '@'
46
+ ELLIPSIS = '...'
47
+ EQUALS = '='
48
+ BANG = '!'
49
+ PIPE = '|'
50
+ AMP = '&'
51
+ end
52
+
53
+ include Literals
54
+
55
+ QUOTE = '"'
56
+ UNICODE_DIGIT = /[0-9A-Za-z]/
57
+ FOUR_DIGIT_UNICODE = /#{UNICODE_DIGIT}{4}/
58
+ N_DIGIT_UNICODE = %r{#{LCURLY}#{UNICODE_DIGIT}{4,}#{RCURLY}}x
59
+ UNICODE_ESCAPE = %r{\\u(?:#{FOUR_DIGIT_UNICODE}|#{N_DIGIT_UNICODE})}
60
+ # # https://graphql.github.io/graphql-spec/June2018/#sec-String-Value
61
+ STRING_ESCAPE = %r{[\\][\\/bfnrt]}
62
+ BLOCK_QUOTE = '"""'
63
+ ESCAPED_QUOTE = /\\"/;
64
+ STRING_CHAR = /#{ESCAPED_QUOTE}|[^"\\]|#{UNICODE_ESCAPE}|#{STRING_ESCAPE}/
65
+
66
+ LIT_NAME_LUT = Literals.constants.each_with_object({}) { |n, o|
67
+ key = Literals.const_get(n)
68
+ key = key.is_a?(Regexp) ? key.source.gsub(/(\\b|\\)/, '') : key
69
+ o[key] = n
70
+ }
71
+
72
+ LIT = Regexp.union(Literals.constants.map { |n| Literals.const_get(n) })
73
+
74
+ QUOTED_STRING = %r{#{QUOTE} (?:#{STRING_CHAR})* #{QUOTE}}x
75
+ BLOCK_STRING = %r{
76
+ #{BLOCK_QUOTE}
77
+ (?: [^"\\] | # Any characters that aren't a quote or slash
78
+ (?<!") ["]{1,2} (?!") | # Any quotes that don't have quotes next to them
79
+ \\"{0,3}(?!") | # A slash followed by <= 3 quotes that aren't followed by a quote
80
+ \\ | # A slash
81
+ "{1,2}(?!") # 1 or 2 " followed by something that isn't a quote
82
+ )*
83
+ (?:"")?
84
+ #{BLOCK_QUOTE}
85
+ }xm
86
+
87
+ # # catch-all for anything else. must be at the bottom for precedence.
88
+ UNKNOWN_CHAR = /./
89
+
90
+ def self.tokenize string
91
+ meta = {
92
+ line: 1,
93
+ col: 1,
94
+ tokens: [],
95
+ previous_token: nil,
96
+ }
97
+
98
+ unless string.valid_encoding?
99
+ emit(:BAD_UNICODE_ESCAPE, 0, 0, meta, string)
100
+ return meta[:tokens]
101
+ end
102
+
103
+ scan = StringScanner.new string
104
+
105
+ while !scan.eos?
106
+ pos = scan.pos
107
+
108
+ case
109
+ when str = scan.scan(FLOAT) then emit(:FLOAT, pos, scan.pos, meta, str)
110
+ when str = scan.scan(INT) then emit(:INT, pos, scan.pos, meta, str)
111
+ when str = scan.scan(LIT) then emit(LIT_NAME_LUT[str], pos, scan.pos, meta, -str)
112
+ when str = scan.scan(IDENTIFIER) then emit(:IDENTIFIER, pos, scan.pos, meta, str)
113
+ when str = scan.scan(BLOCK_STRING) then emit_block(pos, scan.pos, meta, str.gsub(/^#{BLOCK_QUOTE}|#{BLOCK_QUOTE}$/, ''))
114
+ when str = scan.scan(QUOTED_STRING) then emit_string(pos, scan.pos, meta, str.gsub(/^"|"$/, ''))
115
+ when str = scan.scan(COMMENT) then record_comment(pos, scan.pos, meta, str)
116
+ when str = scan.scan(NEWLINE)
117
+ meta[:line] += 1
118
+ meta[:col] = 1
119
+ when scan.scan(BLANK)
120
+ meta[:col] += scan.pos - pos
121
+ when str = scan.scan(UNKNOWN_CHAR) then emit(:UNKNOWN_CHAR, pos, scan.pos, meta, str)
122
+ else
123
+ # This should never happen since `UNKNOWN_CHAR` ensures we make progress
124
+ raise "Unknown string?"
125
+ end
126
+ end
127
+
128
+ meta[:tokens]
129
+ end
130
+
131
+ def self.emit(token_name, ts, te, meta, token_value)
132
+ meta[:tokens] << token = [
133
+ token_name,
134
+ meta[:line],
135
+ meta[:col],
136
+ token_value,
137
+ meta[:previous_token],
138
+ ]
139
+ meta[:previous_token] = token
140
+ # Bump the column counter for the next token
141
+ meta[:col] += te - ts
142
+ end
143
+
144
+ # Replace any escaped unicode or whitespace with the _actual_ characters
145
+ # To avoid allocating more strings, this modifies the string passed into it
146
+ def self.replace_escaped_characters_in_place(raw_string)
147
+ raw_string.gsub!(ESCAPES, ESCAPES_REPLACE)
148
+ raw_string.gsub!(UTF_8) do |_matched_str|
149
+ codepoint_1 = ($1 || $2).to_i(16)
150
+ codepoint_2 = $3
151
+
152
+ if codepoint_2
153
+ codepoint_2 = codepoint_2.to_i(16)
154
+ if (codepoint_1 >= 0xD800 && codepoint_1 <= 0xDBFF) && # leading surrogate
155
+ (codepoint_2 >= 0xDC00 && codepoint_2 <= 0xDFFF) # trailing surrogate
156
+ # A surrogate pair
157
+ combined = ((codepoint_1 - 0xD800) * 0x400) + (codepoint_2 - 0xDC00) + 0x10000
158
+ [combined].pack('U'.freeze)
159
+ else
160
+ # Two separate code points
161
+ [codepoint_1].pack('U'.freeze) + [codepoint_2].pack('U'.freeze)
162
+ end
163
+ else
164
+ [codepoint_1].pack('U'.freeze)
165
+ end
166
+ end
167
+ nil
168
+ end
169
+
170
+ def self.record_comment(ts, te, meta, str)
171
+ token = [
172
+ :COMMENT,
173
+ meta[:line],
174
+ meta[:col],
175
+ str,
176
+ meta[:previous_token],
177
+ ]
178
+
179
+ meta[:previous_token] = token
180
+
181
+ meta[:col] += te - ts
182
+ end
183
+
184
+ ESCAPES = /\\["\\\/bfnrt]/
185
+ ESCAPES_REPLACE = {
186
+ '\\"' => '"',
187
+ "\\\\" => "\\",
188
+ "\\/" => '/',
189
+ "\\b" => "\b",
190
+ "\\f" => "\f",
191
+ "\\n" => "\n",
192
+ "\\r" => "\r",
193
+ "\\t" => "\t",
194
+ }
195
+ UTF_8 = /\\u(?:([\dAa-f]{4})|\{([\da-f]{4,})\})(?:\\u([\dAa-f]{4}))?/i
196
+ VALID_STRING = /\A(?:[^\\]|#{ESCAPES}|#{UTF_8})*\z/o
197
+
198
+ def self.emit_block(ts, te, meta, value)
199
+ line_incr = value.count("\n")
200
+ value = GraphQL::Language::BlockString.trim_whitespace(value)
201
+ emit_string(ts, te, meta, value)
202
+ meta[:line] += line_incr
203
+ end
204
+
205
+ def self.emit_string(ts, te, meta, value)
206
+ if !value.valid_encoding? || !value.match?(VALID_STRING)
207
+ emit(:BAD_UNICODE_ESCAPE, ts, te, meta, value)
208
+ else
209
+ replace_escaped_characters_in_place(value)
210
+
211
+ if !value.valid_encoding?
212
+ emit(:BAD_UNICODE_ESCAPE, ts, te, meta, value)
213
+ else
214
+ emit(:STRING, ts, te, meta, value)
215
+ end
216
+ end
217
+ end
218
+ end
219
+ end
1492
220
  end