From 78ade8230b6bc56517f644457ed070bdae606e63 Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Wed, 5 Apr 2023 10:56:11 -0400 Subject: [PATCH 1/2] Properly load schema directives from SDL --- lib/graphql/language/parser.rb | 933 +++++++++--------- lib/graphql/language/parser.y | 6 +- lib/graphql/schema/build_from_definition.rb | 13 + .../schema/build_from_definition_spec.rb | 36 +- 4 files changed, 510 insertions(+), 478 deletions(-) diff --git a/lib/graphql/language/parser.rb b/lib/graphql/language/parser.rb index 103e56730d..dd50c0a05a 100644 --- a/lib/graphql/language/parser.rb +++ b/lib/graphql/language/parser.rb @@ -12,7 +12,7 @@ module GraphQL module Language class Parser < Racc::Parser -module_eval(<<'...end parser.y/module_eval...', 'parser.y', 448) +module_eval(<<'...end parser.y/module_eval...', 'parser.y', 452) EMPTY_ARRAY = [].freeze @@ -125,57 +125,57 @@ def make_node(node_name, assigns) ##### State transition tables begin ### racc_action_table = [ - -2, -170, 11, 281, 12, 13, 14, 11, -101, 12, - 13, 14, 95, 269, 275, 94, 19, 38, 74, 75, - 76, 19, 77, 78, 79, 80, 15, 35, 161, 121, - 35, 15, 35, 12, 13, 14, 28, 35, 180, 276, + -2, -172, 11, 282, 12, 13, 14, 11, -101, 12, + 13, 14, 95, 270, 276, 94, 19, 38, 74, 75, + 76, 19, 77, 78, 79, 80, 15, 35, 162, 122, + 35, 15, 35, 12, 13, 14, 28, 35, 181, 277, 72, 28, 35, 35, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 61, - 12, 13, 14, -101, -101, 279, 183, 72, 35, 88, - -154, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 12, 13, 14, -101, -101, 280, 184, 72, 35, 88, + -156, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 91, 12, 13, 14, - 280, 67, 90, 99, 35, 72, 72, -101, 43, 44, + 281, 67, 90, 99, 35, 72, 72, -101, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 227, 12, 13, 14, 72, 67, 35, - 175, 12, 13, 14, 72, 43, 44, 45, 46, 47, + 55, 56, 57, 228, 12, 13, 14, 72, 67, 35, + 176, 12, 13, 14, 72, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, 81, 82, 67, 83, 84, 85, 86, 87, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 223, 102, 12, 13, - 14, 67, 72, 221, 117, 72, 222, 121, 72, 204, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 201, - 202, 203, 211, 212, 208, 209, 210, 220, 223, 72, - 12, 13, 14, 132, 95, 221, 139, 72, 222, 259, - 143, 204, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 201, 202, 203, 211, 212, 208, 209, 210, 220, - 223, 143, 12, 13, 14, 72, 72, 221, 72, 72, - 222, 285, 143, 204, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 201, 202, 203, 211, 212, 208, 209, - 210, 220, 301, 143, 12, 13, 14, 230, 12, 13, - 14, 72, 222, 72, 72, 204, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 201, 202, 203, 211, 212, - 208, 209, 210, 220, 223, 132, 12, 13, 14, 132, - 95, 221, 169, 170, 222, 72, 72, 204, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 201, 202, 203, - 211, 212, 208, 209, 210, 220, 223, 177, 12, 13, - 14, 72, 72, 221, 72, -154, 222, 189, 190, 204, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 201, - 202, 203, 211, 212, 208, 209, 210, 220, 301, 191, - 12, 13, 14, 12, 13, 14, 72, 72, 222, 194, - 195, 204, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 201, 202, 203, 211, 212, 208, 209, 210, 220, - 12, 13, 14, 12, 13, 14, 196, 197, 199, 72, - 225, 97, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 262, 12, 13, 14, - 72, 132, 132, 72, 180, 237, 72, 180, 43, 44, + 52, 53, 54, 55, 56, 57, 224, 103, 12, 13, + 14, 67, 72, 222, 118, 72, 223, 122, 72, 205, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 202, + 203, 204, 212, 213, 209, 210, 211, 221, 224, 72, + 12, 13, 14, 133, 95, 222, 140, 72, 223, 260, + 144, 205, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 202, 203, 204, 212, 213, 209, 210, 211, 221, + 224, 144, 12, 13, 14, 72, 72, 222, 72, 72, + 223, 286, 144, 205, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 202, 203, 204, 212, 213, 209, 210, + 211, 221, 302, 144, 12, 13, 14, 231, 12, 13, + 14, 72, 223, 72, 72, 205, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 202, 203, 204, 212, 213, + 209, 210, 211, 221, 224, 133, 12, 13, 14, 133, + 95, 222, 170, 171, 223, 72, 72, 205, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 202, 203, 204, + 212, 213, 209, 210, 211, 221, 224, 178, 12, 13, + 14, 72, 72, 222, 72, -156, 223, 190, 191, 205, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 202, + 203, 204, 212, 213, 209, 210, 211, 221, 302, 192, + 12, 13, 14, 12, 13, 14, 72, 72, 223, 195, + 196, 205, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 202, 203, 204, 212, 213, 209, 210, 211, 221, + 12, 13, 14, 12, 13, 14, 197, 198, 200, 72, + 226, 97, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 263, 12, 13, 14, + 72, 133, 133, 72, 181, 238, 72, 181, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 287, 12, 13, 14, 35, 35, 180, - 180, 35, 35, 35, 255, 43, 44, 45, 46, 47, + 55, 56, 57, 288, 12, 13, 14, 35, 35, 181, + 181, 35, 35, 35, 256, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 291, 12, 13, 14, 132, 237, 272, 272, 282, 284, - 290, 197, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 309, 12, 13, - 14, 72, 297, 302, 305, 306, 308, 284, 72, 43, + 292, 12, 13, 14, 133, 238, 273, 273, 283, 285, + 291, 198, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 310, 12, 13, + 14, 72, 298, 303, 306, 307, 309, 285, 72, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, 72, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, @@ -222,20 +222,20 @@ def make_node(node_name, assigns) 12, 13, 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, - nil, nil, nil, nil, 130, nil, nil, 43, 44, 45, + nil, nil, nil, nil, 131, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, - 130, nil, nil, 43, 44, 45, 46, 47, 48, 49, + 131, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 12, 13, 14, nil, 167, nil, nil, nil, nil, nil, + 12, 13, 14, nil, 168, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, - nil, nil, nil, nil, 130, nil, nil, 43, 44, 45, + nil, nil, nil, nil, 131, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, @@ -251,7 +251,7 @@ def make_node(node_name, assigns) nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, - 130, nil, nil, 43, 44, 45, 46, 47, 48, 49, + 131, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, @@ -269,73 +269,73 @@ def make_node(node_name, assigns) 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, - nil, nil, 130, nil, nil, 43, 44, 45, 46, 47, + nil, nil, 131, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 12, 13, 14, nil, nil, nil, nil, nil, 130, nil, + 12, 13, 14, nil, nil, nil, nil, nil, 131, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, nil, nil, nil, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 12, 13, 14, nil, nil, nil, nil, nil, - nil, nil, nil, 204, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 201, 202, 203, -160, nil, nil, nil, - -160, nil, nil, nil, nil, nil, -160, nil, -160, -160, - -160 ] + nil, nil, nil, 205, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 202, 203, 204, -162, nil, nil, nil, + -162, nil, nil, nil, nil, nil, -162, nil, -162, -162, + -162 ] racc_action_check = [ - 3, 180, 3, 253, 3, 3, 3, 0, 103, 0, - 0, 0, 66, 232, 244, 66, 3, 1, 28, 28, - 28, 0, 28, 28, 28, 28, 3, 253, 119, 119, - 180, 0, 3, 143, 143, 143, 3, 0, 141, 245, - 103, 0, 232, 244, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 11, - 11, 11, 11, 148, 150, 251, 143, 19, 245, 38, - 141, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 3, 181, 3, 254, 3, 3, 3, 0, 104, 0, + 0, 0, 66, 233, 245, 66, 3, 1, 28, 28, + 28, 0, 28, 28, 28, 28, 3, 254, 120, 120, + 181, 0, 3, 144, 144, 144, 3, 0, 142, 246, + 104, 0, 233, 245, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 144, 11, + 11, 11, 11, 149, 151, 252, 144, 19, 246, 38, + 142, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 60, 60, 60, 60, - 252, 11, 40, 68, 251, 148, 150, 146, 60, 60, + 253, 11, 40, 68, 252, 149, 151, 147, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 173, 173, 173, 173, 146, 60, 252, - 136, 136, 136, 136, 70, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 132, 132, 132, 37, 37, 173, 37, 37, 37, 37, - 37, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 169, 73, 169, 169, - 169, 132, 74, 169, 87, 89, 169, 90, 93, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 222, 96, - 222, 222, 222, 98, 101, 222, 104, 105, 222, 222, - 106, 222, 222, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, - 260, 107, 260, 260, 260, 108, 109, 260, 110, 111, - 260, 260, 112, 260, 260, 260, 260, 260, 260, 260, - 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, - 260, 260, 284, 113, 284, 284, 284, 178, 178, 178, - 178, 114, 284, 115, 116, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 290, 118, 290, 290, 290, 122, - 123, 290, 126, 128, 290, 131, 134, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 302, 138, 302, 302, - 302, 140, 142, 302, 144, 145, 302, 147, 149, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, - 302, 302, 302, 302, 302, 302, 302, 302, 305, 151, - 305, 305, 305, 102, 102, 102, 153, 155, 305, 156, - 157, 305, 305, 305, 305, 305, 305, 305, 305, 305, - 305, 305, 305, 305, 305, 305, 305, 305, 305, 305, - 67, 67, 67, 139, 139, 139, 158, 159, 163, 166, - 171, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 223, 223, 223, 223, - 67, 172, 174, 181, 182, 184, 187, 188, 223, 223, + 60, 60, 60, 174, 174, 174, 174, 147, 60, 253, + 137, 137, 137, 137, 70, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 133, 133, 133, 37, 37, 174, 37, 37, 37, 37, + 37, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 170, 73, 170, 170, + 170, 133, 74, 170, 87, 89, 170, 90, 93, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 223, 96, + 223, 223, 223, 98, 101, 223, 105, 106, 223, 223, + 107, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, - 223, 223, 223, 263, 263, 263, 263, 190, 191, 192, - 193, 195, 196, 197, 198, 263, 263, 263, 263, 263, - 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, - 266, 266, 266, 266, 200, 235, 240, 250, 254, 256, - 265, 268, 266, 266, 266, 266, 266, 266, 266, 266, - 266, 266, 266, 266, 266, 266, 266, 301, 301, 301, - 301, 273, 278, 289, 293, 294, 298, 307, 311, 301, - 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, - 301, 301, 301, 301, 10, 10, 10, 312, nil, nil, + 261, 108, 261, 261, 261, 109, 110, 261, 111, 112, + 261, 261, 113, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 261, 261, 261, 261, 261, 261, 261, 261, + 261, 261, 285, 114, 285, 285, 285, 179, 179, 179, + 179, 115, 285, 116, 117, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 291, 119, 291, 291, 291, 123, + 124, 291, 127, 129, 291, 132, 135, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 303, 139, 303, 303, + 303, 141, 143, 303, 145, 146, 303, 148, 150, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 306, 152, + 306, 306, 306, 103, 103, 103, 154, 156, 306, 157, + 158, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 67, 67, 67, 140, 140, 140, 159, 160, 164, 167, + 172, 67, 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 224, 224, 224, 224, + 67, 173, 175, 182, 183, 185, 188, 189, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 264, 264, 264, 264, 191, 192, 193, + 194, 196, 197, 198, 199, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 267, 267, 267, 267, 201, 236, 241, 251, 255, 257, + 266, 269, 267, 267, 267, 267, 267, 267, 267, 267, + 267, 267, 267, 267, 267, 267, 267, 302, 302, 302, + 302, 274, 279, 290, 294, 295, 299, 308, 312, 302, + 302, 302, 302, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 302, 10, 10, 10, 313, nil, nil, nil, nil, nil, nil, nil, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15, 15, 15, nil, nil, nil, nil, nil, nil, nil, @@ -384,61 +384,61 @@ def make_node(node_name, assigns) 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 99, 99, 99, nil, nil, nil, nil, nil, 99, nil, nil, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, 117, 117, - 117, nil, nil, nil, nil, nil, nil, nil, nil, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 121, 121, 121, nil, nil, nil, - nil, nil, nil, nil, nil, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 124, 124, 124, nil, 124, nil, nil, nil, nil, nil, - nil, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 130, 130, 130, nil, - nil, nil, nil, nil, 130, nil, nil, 130, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 130, 177, 177, 177, nil, nil, nil, nil, nil, - nil, nil, nil, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 183, 183, - 183, nil, nil, nil, nil, nil, nil, nil, nil, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 185, 185, 185, nil, nil, nil, - nil, nil, nil, nil, nil, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 189, 189, 189, nil, nil, nil, nil, nil, nil, nil, - nil, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 194, 194, 194, nil, - nil, nil, nil, nil, nil, nil, nil, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 199, 199, 199, nil, nil, nil, nil, nil, - 199, nil, nil, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 221, 221, - 221, nil, nil, nil, nil, nil, nil, nil, nil, 221, - 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 231, 231, 231, nil, nil, nil, - nil, nil, nil, nil, nil, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 237, 237, 237, nil, nil, nil, nil, nil, nil, nil, - nil, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 246, 246, 246, nil, - nil, nil, nil, nil, nil, nil, nil, 246, 246, 246, - 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, - 246, 246, 272, 272, 272, nil, nil, nil, nil, nil, - nil, nil, nil, 272, 272, 272, 272, 272, 272, 272, - 272, 272, 272, 272, 272, 272, 272, 272, 282, 282, - 282, nil, nil, nil, nil, nil, nil, nil, nil, 282, - 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 297, 297, 297, nil, nil, nil, - nil, nil, 297, nil, nil, 297, 297, 297, 297, 297, - 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, - 306, 306, 306, nil, nil, nil, nil, nil, 306, nil, - nil, 306, 306, 306, 306, 306, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 308, 308, 308, nil, - nil, nil, nil, nil, nil, nil, nil, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 242, 242, 242, nil, nil, nil, nil, nil, - nil, nil, nil, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 186, nil, nil, nil, - 186, nil, nil, nil, nil, nil, 186, nil, 186, 186, - 186 ] + 99, 99, 99, 99, 99, 99, 99, 99, 118, 118, + 118, nil, nil, nil, nil, nil, nil, nil, nil, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 122, 122, 122, nil, nil, nil, + nil, nil, nil, nil, nil, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 125, 125, 125, nil, 125, nil, nil, nil, nil, nil, + nil, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 131, 131, 131, nil, + nil, nil, nil, nil, 131, nil, nil, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, + 131, 131, 178, 178, 178, nil, nil, nil, nil, nil, + nil, nil, nil, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 184, 184, + 184, nil, nil, nil, nil, nil, nil, nil, nil, 184, + 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 186, 186, 186, nil, nil, nil, + nil, nil, nil, nil, nil, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 190, 190, 190, nil, nil, nil, nil, nil, nil, nil, + nil, 190, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 195, 195, 195, nil, + nil, nil, nil, nil, nil, nil, nil, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 200, 200, 200, nil, nil, nil, nil, nil, + 200, nil, nil, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 222, 222, + 222, nil, nil, nil, nil, nil, nil, nil, nil, 222, + 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, + 222, 222, 222, 222, 232, 232, 232, nil, nil, nil, + nil, nil, nil, nil, nil, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 238, 238, 238, nil, nil, nil, nil, nil, nil, nil, + nil, 238, 238, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 238, 238, 238, 238, 247, 247, 247, nil, + nil, nil, nil, nil, nil, nil, nil, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 273, 273, 273, nil, nil, nil, nil, nil, + nil, nil, nil, 273, 273, 273, 273, 273, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 273, 283, 283, + 283, nil, nil, nil, nil, nil, nil, nil, nil, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 298, 298, 298, nil, nil, nil, + nil, nil, 298, nil, nil, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 307, 307, 307, nil, nil, nil, nil, nil, 307, nil, + nil, 307, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 307, 307, 307, 307, 309, 309, 309, nil, + nil, nil, nil, nil, nil, nil, nil, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 243, 243, 243, nil, nil, nil, nil, nil, + nil, nil, nil, 243, 243, 243, 243, 243, 243, 243, + 243, 243, 243, 243, 243, 243, 187, nil, nil, nil, + 187, nil, nil, nil, nil, nil, 187, nil, 187, 187, + 187 ] racc_action_pointer = [ 5, 17, nil, 0, nil, nil, nil, nil, nil, nil, @@ -451,152 +451,152 @@ def make_node(node_name, assigns) 90, nil, 572, 165, 138, 598, 624, 650, 676, 702, 728, 754, 780, 806, 832, 858, 884, 140, nil, 141, 168, nil, nil, 144, 910, 936, 165, 962, 201, 988, - nil, 197, 359, 6, 204, 173, 191, 212, 201, 202, - 204, 205, 223, 244, 237, 239, 240, 1014, 293, 20, - nil, 1040, 297, 293, 1066, nil, 292, nil, 292, nil, - 1092, 271, 136, nil, 272, nil, 117, nil, 317, 389, - 297, 36, 298, 29, 300, 301, 83, 323, 61, 336, - 62, 357, nil, 332, nil, 333, 355, 368, 394, 390, - nil, nil, nil, 388, nil, nil, 365, nil, nil, 164, - nil, 387, 419, 110, 420, nil, nil, 1118, 264, nil, - -2, 389, 422, 1144, 388, 1170, 1521, 392, 425, 1196, - 415, 416, 447, 448, 1222, 419, 420, 421, 427, 1248, - 472, nil, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 197, nil, 359, 6, 204, 173, 191, 212, 201, + 202, 204, 205, 223, 244, 237, 239, 240, 1014, 293, + 20, nil, 1040, 297, 293, 1066, nil, 292, nil, 292, + nil, 1092, 271, 136, nil, 272, nil, 117, nil, 317, + 389, 297, 36, 298, 29, 300, 301, 83, 323, 61, + 336, 62, 357, nil, 332, nil, 333, 355, 368, 394, + 390, nil, nil, nil, 388, nil, nil, 365, nil, nil, + 164, nil, 387, 419, 110, 420, nil, nil, 1118, 264, + nil, -2, 389, 422, 1144, 388, 1170, 1521, 392, 425, + 1196, 415, 416, 447, 448, 1222, 419, 420, 421, 427, + 1248, 472, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, 1274, 196, 413, nil, nil, nil, nil, nil, nil, - nil, 1300, 10, nil, nil, 438, nil, 1326, nil, nil, - 438, nil, 1508, nil, 11, 36, 1352, nil, nil, nil, - 439, 62, 87, -5, 463, nil, 465, nil, nil, nil, - 228, nil, nil, 440, nil, 470, 467, nil, 474, nil, - nil, nil, 1378, 467, nil, nil, nil, nil, 492, nil, - nil, nil, 1404, nil, 260, nil, nil, nil, nil, 493, - 292, nil, nil, 494, 495, nil, nil, 1430, 468, nil, - nil, 494, 324, nil, nil, 356, 1456, 493, 1482, nil, - nil, 474, 493, nil, nil, nil ] + nil, nil, 1274, 196, 413, nil, nil, nil, nil, nil, + nil, nil, 1300, 10, nil, nil, 438, nil, 1326, nil, + nil, 438, nil, 1508, nil, 11, 36, 1352, nil, nil, + nil, 439, 62, 87, -5, 463, nil, 465, nil, nil, + nil, 228, nil, nil, 440, nil, 470, 467, nil, 474, + nil, nil, nil, 1378, 467, nil, nil, nil, nil, 492, + nil, nil, nil, 1404, nil, 260, nil, nil, nil, nil, + 493, 292, nil, nil, 494, 495, nil, nil, 1430, 468, + nil, nil, 494, 324, nil, nil, 356, 1456, 493, 1482, + nil, nil, 474, 493, nil, nil, nil ] racc_action_default = [ - -149, -184, -1, -149, -3, -5, -6, -7, -8, -9, - -16, -184, -13, -14, -15, -109, -111, -112, -113, -100, - -118, -119, -120, -121, -122, -123, -124, -125, -184, -128, - -129, -130, -131, -132, -133, -148, -150, -184, -184, -4, + -151, -186, -1, -151, -3, -5, -6, -7, -8, -9, + -16, -186, -13, -14, -15, -109, -111, -112, -113, -100, + -120, -121, -122, -123, -124, -125, -126, -127, -186, -130, + -131, -132, -133, -134, -135, -150, -152, -186, -186, -4, -18, -17, -39, -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51, -52, -53, -54, -55, -56, - -184, -12, -32, -34, -35, -36, -66, -100, -184, -110, - -101, -102, -184, -184, -100, -184, -184, -184, -184, -184, - -184, -184, -184, -184, -184, -184, -184, -184, 316, -100, - -184, -11, -33, -100, -184, -184, -100, -184, -184, -184, - -103, -66, -184, -127, -184, -184, -153, -153, -100, -100, - -100, -100, -153, -153, -100, -100, -100, -184, -184, -184, - -20, -184, -30, -66, -184, -68, -184, -105, -23, -25, - -184, -100, -184, -107, -100, -104, -184, -115, -184, -184, - -134, -138, -100, -184, -100, -141, -143, -184, -145, -184, - -147, -184, -151, -100, -154, -100, -184, -184, -184, -165, - -10, -19, -21, -184, -31, -37, -100, -67, -69, -184, - -24, -184, -184, -184, -184, -114, -116, -184, -184, -135, - -149, -101, -168, -184, -156, -157, -158, -101, -168, -184, - -149, -149, -168, -168, -184, -149, -149, -149, -180, -184, - -30, -57, -58, -59, -60, -61, -62, -70, -71, -72, - -73, -74, -75, -76, -77, -78, -79, -80, -81, -82, - -83, -184, -184, -184, -99, -26, -106, -29, -108, -117, - -126, -184, -149, -171, -136, -155, -158, -184, -161, -139, - -142, -174, -184, -64, -149, -149, -184, -163, -152, -173, - -176, -149, -149, -149, -184, -181, -27, -38, -84, -85, - -184, -87, -89, -184, -91, -184, -184, -96, -165, -169, - -172, -159, -184, -100, -65, -144, -146, -164, -184, -177, - -178, -166, -184, -22, -184, -86, -88, -90, -92, -184, - -184, -95, -97, -184, -184, -175, -63, -184, -179, -182, - -28, -184, -184, -80, -93, -184, -184, -27, -184, -94, - -98, -100, -100, -183, -167, -162 ] + -186, -12, -32, -34, -35, -36, -66, -100, -186, -110, + -101, -102, -186, -115, -100, -186, -186, -186, -186, -186, + -186, -186, -186, -186, -186, -186, -186, -186, 317, -100, + -186, -11, -33, -100, -186, -186, -100, -186, -186, -186, + -103, -66, -114, -186, -129, -186, -186, -155, -155, -100, + -100, -100, -100, -155, -155, -100, -100, -100, -186, -186, + -186, -20, -186, -30, -66, -186, -68, -186, -105, -23, + -25, -186, -100, -186, -107, -100, -104, -186, -117, -186, + -186, -136, -140, -100, -186, -100, -143, -145, -186, -147, + -186, -149, -186, -153, -100, -156, -100, -186, -186, -186, + -167, -10, -19, -21, -186, -31, -37, -100, -67, -69, + -186, -24, -186, -186, -186, -186, -116, -118, -186, -186, + -137, -151, -101, -170, -186, -158, -159, -160, -101, -170, + -186, -151, -151, -170, -170, -186, -151, -151, -151, -182, + -186, -30, -57, -58, -59, -60, -61, -62, -70, -71, + -72, -73, -74, -75, -76, -77, -78, -79, -80, -81, + -82, -83, -186, -186, -186, -99, -26, -106, -29, -108, + -119, -128, -186, -151, -173, -138, -157, -160, -186, -163, + -141, -144, -176, -186, -64, -151, -151, -186, -165, -154, + -175, -178, -151, -151, -151, -186, -183, -27, -38, -84, + -85, -186, -87, -89, -186, -91, -186, -186, -96, -167, + -171, -174, -161, -186, -100, -65, -146, -148, -166, -186, + -179, -180, -168, -186, -22, -186, -86, -88, -90, -92, + -186, -186, -95, -97, -186, -186, -177, -63, -186, -181, + -184, -28, -186, -186, -80, -93, -186, -186, -27, -186, + -94, -98, -100, -100, -185, -169, -164 ] racc_goto_table = [ - 10, 198, 60, 10, 37, 92, 207, 37, 41, 66, - 165, 93, 69, 206, 131, 233, 134, 73, 283, 176, - 100, 120, 264, 184, 277, 133, 125, 300, 274, 141, - 145, 277, 277, 303, 136, 274, 142, 144, 4, 244, - 1, 39, 153, 155, 251, 160, 135, 171, 310, 240, - 162, 245, 2, 100, 250, 168, 252, 253, 66, 261, - 3, 176, 288, 235, 96, 98, 206, 270, 166, 312, - 101, 178, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 40, 206, 118, 257, 89, - 100, 122, 123, 126, 127, 119, 100, 286, 100, 226, - 100, 228, 138, 273, 206, 124, 147, 149, 151, 152, - 294, 260, 156, 157, 158, 159, 256, 263, 92, 163, - 292, 103, 126, 173, 68, 179, 185, 232, 206, 172, - 66, 100, 174, 254, 206, 298, 138, 100, nil, 138, - 182, 186, 188, nil, nil, nil, 206, nil, nil, 206, - nil, 192, 140, 193, nil, 146, 148, 150, nil, nil, - nil, nil, nil, nil, 200, nil, 234, nil, nil, 205, - nil, 66, 239, nil, nil, 229, 248, 249, 138, nil, - nil, 236, nil, 238, 231, nil, nil, 241, nil, 181, - nil, 187, 241, nil, 242, nil, nil, nil, nil, 242, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 307, nil, nil, nil, nil, 258, - nil, 265, 205, 311, nil, nil, nil, nil, nil, 268, - nil, nil, nil, nil, nil, 271, 231, nil, nil, nil, - nil, nil, 205, nil, 278, nil, nil, nil, 242, nil, - nil, nil, nil, nil, nil, 242, nil, nil, nil, nil, - 205, 289, nil, nil, 293, nil, nil, nil, nil, nil, - 295, 296, nil, nil, nil, nil, nil, nil, nil, nil, - 299, nil, nil, nil, 205, nil, nil, nil, nil, nil, - 205, nil, nil, nil, nil, nil, nil, nil, nil, 293, - nil, nil, 205, nil, nil, 205, 313, nil, nil, 314, - 315 ] + 10, 69, 60, 10, 37, 93, 208, 37, 41, 66, + 166, 92, 199, 207, 132, 234, 135, 73, 284, 177, + 265, 134, 185, 301, 278, 121, 126, 137, 275, 304, + 1, 278, 278, 246, 4, 275, 245, 39, 253, 254, + 136, 252, 161, 2, 311, 143, 145, 3, 172, 142, + 146, 154, 156, 96, 180, 163, 169, 40, 66, 262, + 289, 177, 236, 167, 179, 98, 207, 271, 89, 313, + 101, 120, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 100, 207, 119, 258, 274, + 125, 123, 124, 127, 128, 235, 227, 287, 229, 261, + 264, 240, 293, 139, 207, 249, 250, 148, 150, 152, + 153, 68, 102, 157, 158, 159, 160, 257, 186, 100, + 164, 295, 241, 127, 174, 92, 233, 251, 207, 255, + 173, 66, 299, 175, 207, nil, nil, 139, nil, nil, + 139, 183, 187, 189, nil, nil, 207, nil, nil, 207, + nil, nil, 193, nil, 194, nil, 100, nil, nil, nil, + nil, nil, 100, nil, 100, 201, 100, nil, nil, 104, + 206, nil, 66, nil, nil, nil, 230, nil, nil, 139, + nil, nil, 237, nil, 239, 232, nil, nil, 242, nil, + nil, nil, nil, 242, nil, 243, nil, 100, nil, nil, + 243, 141, nil, 100, 147, 149, 151, nil, nil, nil, + nil, nil, nil, nil, nil, 308, nil, nil, nil, nil, + 259, nil, 266, 206, 312, nil, nil, nil, nil, nil, + 269, nil, nil, nil, nil, nil, 272, 232, 182, nil, + 188, nil, nil, 206, nil, 279, nil, nil, nil, 243, + nil, nil, nil, nil, nil, nil, 243, nil, nil, nil, + nil, 206, 290, nil, nil, 294, nil, nil, nil, nil, + nil, 296, 297, nil, nil, nil, nil, nil, nil, nil, + nil, 300, nil, nil, nil, 206, nil, nil, nil, nil, + nil, 206, nil, nil, nil, nil, nil, nil, nil, nil, + 294, nil, nil, 206, nil, nil, 206, 314, nil, nil, + 315, 316 ] racc_goto_check = [ - 10, 80, 15, 10, 33, 24, 37, 33, 16, 16, - 23, 28, 29, 30, 19, 81, 19, 13, 20, 56, - 50, 18, 46, 77, 79, 14, 36, 22, 32, 71, - 71, 79, 79, 22, 55, 32, 73, 73, 4, 34, - 1, 4, 73, 73, 34, 14, 28, 19, 22, 74, - 18, 75, 2, 50, 74, 36, 75, 75, 16, 37, - 3, 56, 46, 77, 29, 13, 30, 81, 28, 20, - 16, 55, 13, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 11, 30, 13, 23, 12, - 50, 13, 16, 16, 13, 17, 50, 37, 50, 14, - 50, 14, 10, 31, 30, 35, 13, 13, 13, 13, - 80, 44, 13, 13, 13, 16, 19, 45, 24, 16, - 48, 49, 16, 15, 51, 72, 78, 82, 30, 13, - 16, 50, 13, 83, 30, 84, 10, 50, nil, 10, - 13, 16, 13, nil, nil, nil, 30, nil, nil, 30, - nil, 13, 49, 13, nil, 49, 49, 49, nil, nil, - nil, nil, nil, nil, 13, nil, 72, nil, nil, 10, - nil, 16, 72, nil, nil, 16, 72, 72, 10, nil, - nil, 16, nil, 16, 33, nil, nil, 16, nil, 49, - nil, 49, 16, nil, 33, nil, nil, nil, nil, 33, - nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, 19, nil, nil, nil, nil, 16, - nil, 16, 10, 19, nil, nil, nil, nil, nil, 16, - nil, nil, nil, nil, nil, 16, 33, nil, nil, nil, - nil, nil, 10, nil, 16, nil, nil, nil, 33, nil, - nil, nil, nil, nil, nil, 33, nil, nil, nil, nil, - 10, 16, nil, nil, 16, nil, nil, nil, nil, nil, - 16, 13, nil, nil, nil, nil, nil, nil, nil, nil, - 16, nil, nil, nil, 10, nil, nil, nil, nil, nil, - 10, nil, nil, nil, nil, nil, nil, nil, nil, 16, - nil, nil, 10, nil, nil, 10, 16, nil, nil, 13, - 13 ] + 10, 29, 15, 10, 33, 28, 37, 33, 16, 16, + 23, 24, 81, 30, 19, 82, 19, 13, 20, 57, + 46, 14, 78, 22, 80, 18, 36, 56, 32, 22, + 1, 80, 80, 76, 4, 32, 34, 4, 76, 76, + 28, 34, 14, 2, 22, 74, 74, 3, 19, 72, + 72, 74, 74, 29, 73, 18, 36, 11, 16, 37, + 46, 57, 78, 28, 56, 13, 30, 82, 12, 20, + 16, 17, 13, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 50, 30, 13, 23, 31, + 35, 13, 16, 16, 13, 73, 14, 37, 14, 44, + 45, 73, 48, 10, 30, 73, 73, 13, 13, 13, + 13, 51, 55, 13, 13, 13, 16, 19, 79, 50, + 16, 81, 75, 16, 15, 24, 83, 75, 30, 84, + 13, 16, 85, 13, 30, nil, nil, 10, nil, nil, + 10, 13, 16, 13, nil, nil, 30, nil, nil, 30, + nil, nil, 13, nil, 13, nil, 50, nil, nil, nil, + nil, nil, 50, nil, 50, 13, 50, nil, nil, 49, + 10, nil, 16, nil, nil, nil, 16, nil, nil, 10, + nil, nil, 16, nil, 16, 33, nil, nil, 16, nil, + nil, nil, nil, 16, nil, 33, nil, 50, nil, nil, + 33, 49, nil, 50, 49, 49, 49, nil, nil, nil, + nil, nil, nil, nil, nil, 19, nil, nil, nil, nil, + 16, nil, 16, 10, 19, nil, nil, nil, nil, nil, + 16, nil, nil, nil, nil, nil, 16, 33, 49, nil, + 49, nil, nil, 10, nil, 16, nil, nil, nil, 33, + nil, nil, nil, nil, nil, nil, 33, nil, nil, nil, + nil, 10, 16, nil, nil, 16, nil, nil, nil, nil, + nil, 16, 13, nil, nil, nil, nil, nil, nil, nil, + nil, 16, nil, nil, nil, 10, nil, nil, nil, nil, + nil, 10, nil, nil, nil, nil, nil, nil, nil, nil, + 16, nil, nil, 10, nil, nil, 10, 16, nil, nil, + 13, 13 ] racc_goto_pointer = [ - nil, 40, 52, 60, 38, nil, nil, nil, nil, nil, - 0, 75, 49, -2, -73, -9, -2, 5, -69, -83, - -238, nil, -257, -112, -55, nil, nil, nil, -55, -3, - -156, -139, -216, 4, -151, 10, -69, -163, nil, nil, - nil, nil, nil, nil, -111, -106, -201, nil, -146, 47, - -50, 109, nil, nil, nil, -68, -117, nil, nil, nil, + nil, 30, 43, 47, 34, nil, nil, nil, nil, nil, + 0, 47, 28, -2, -77, -9, -2, -19, -65, -83, + -239, nil, -262, -113, -49, nil, nil, nil, -61, -14, + -157, -154, -217, 4, -155, -5, -69, -164, nil, nil, + nil, nil, nil, nil, -124, -124, -204, nil, -165, 95, + 15, 96, nil, nil, nil, 39, -76, -118, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, -77, -16, -70, -140, -140, nil, -120, -17, -221, - -158, -165, -53, -65, -147 ] + nil, nil, -58, -88, -62, -68, -159, nil, -122, -26, + -222, -148, -166, -55, -70, -151 ] racc_goto_default = [ nil, nil, nil, nil, nil, 5, 6, 7, 8, 9, - 58, nil, nil, nil, 164, nil, 129, nil, nil, nil, - nil, 128, 217, nil, 62, 63, 64, 65, nil, 42, - 59, 224, 243, 246, nil, nil, nil, 304, 213, 214, - 215, 216, 218, 219, nil, nil, nil, 266, 267, 70, - 71, nil, 16, 17, 18, nil, 137, 20, 21, 22, - 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, - 34, 154, nil, nil, nil, nil, 36, nil, nil, 247, - nil, nil, nil, nil, nil ] + 58, nil, nil, nil, 165, nil, 130, nil, nil, nil, + nil, 129, 218, nil, 62, 63, 64, 65, nil, 42, + 59, 225, 244, 247, nil, nil, nil, 305, 214, 215, + 216, 217, 219, 220, nil, nil, nil, 267, 268, 70, + 71, nil, 16, 17, 18, nil, nil, 138, 20, 21, + 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, + 33, 34, 155, nil, nil, nil, nil, 36, nil, nil, + 248, nil, nil, nil, nil, nil ] racc_reduce_table = [ 0, 0, :racc_error, @@ -713,10 +713,12 @@ def make_node(node_name, assigns) 1, 45, :_reduce_none, 1, 45, :_reduce_none, 1, 45, :_reduce_none, - 5, 91, :_reduce_114, - 1, 94, :_reduce_none, - 2, 94, :_reduce_116, - 3, 95, :_reduce_117, + 3, 91, :_reduce_114, + 0, 94, :_reduce_115, + 3, 94, :_reduce_116, + 1, 95, :_reduce_none, + 2, 95, :_reduce_118, + 3, 96, :_reduce_119, 1, 92, :_reduce_none, 1, 92, :_reduce_none, 1, 92, :_reduce_none, @@ -725,68 +727,68 @@ def make_node(node_name, assigns) 1, 92, :_reduce_none, 1, 46, :_reduce_none, 1, 46, :_reduce_none, - 6, 102, :_reduce_126, - 3, 102, :_reduce_127, - 1, 103, :_reduce_none, - 1, 103, :_reduce_none, - 1, 103, :_reduce_none, - 1, 103, :_reduce_none, - 1, 103, :_reduce_none, - 1, 103, :_reduce_none, - 4, 104, :_reduce_134, - 5, 105, :_reduce_135, - 6, 105, :_reduce_136, - 5, 105, :_reduce_137, - 4, 105, :_reduce_138, - 6, 106, :_reduce_139, - 5, 106, :_reduce_140, - 4, 106, :_reduce_141, - 6, 107, :_reduce_142, + 6, 103, :_reduce_128, + 3, 103, :_reduce_129, + 1, 104, :_reduce_none, + 1, 104, :_reduce_none, + 1, 104, :_reduce_none, + 1, 104, :_reduce_none, + 1, 104, :_reduce_none, + 1, 104, :_reduce_none, + 4, 105, :_reduce_136, + 5, 106, :_reduce_137, + 6, 106, :_reduce_138, + 5, 106, :_reduce_139, + 4, 106, :_reduce_140, + 6, 107, :_reduce_141, + 5, 107, :_reduce_142, 4, 107, :_reduce_143, - 7, 108, :_reduce_144, + 6, 108, :_reduce_144, 4, 108, :_reduce_145, 7, 109, :_reduce_146, 4, 109, :_reduce_147, - 1, 115, :_reduce_none, + 7, 110, :_reduce_148, + 4, 110, :_reduce_149, + 1, 116, :_reduce_none, 0, 72, :_reduce_none, 1, 72, :_reduce_none, - 4, 96, :_reduce_151, - 6, 97, :_reduce_152, - 0, 112, :_reduce_153, - 1, 112, :_reduce_none, - 3, 110, :_reduce_155, - 2, 110, :_reduce_156, - 2, 110, :_reduce_157, - 1, 116, :_reduce_158, - 3, 116, :_reduce_159, + 4, 97, :_reduce_153, + 6, 98, :_reduce_154, + 0, 113, :_reduce_155, + 1, 113, :_reduce_none, + 3, 111, :_reduce_157, + 2, 111, :_reduce_158, + 2, 111, :_reduce_159, 1, 117, :_reduce_160, - 2, 117, :_reduce_161, - 6, 118, :_reduce_162, - 1, 114, :_reduce_163, - 2, 114, :_reduce_164, - 0, 119, :_reduce_165, - 3, 119, :_reduce_166, - 6, 120, :_reduce_167, - 0, 111, :_reduce_168, - 3, 111, :_reduce_169, - 0, 121, :_reduce_170, - 1, 121, :_reduce_171, - 2, 121, :_reduce_172, - 6, 98, :_reduce_173, - 1, 113, :_reduce_174, - 3, 113, :_reduce_175, - 6, 99, :_reduce_176, - 7, 100, :_reduce_177, - 7, 101, :_reduce_178, - 8, 93, :_reduce_179, - 0, 122, :_reduce_none, - 1, 122, :_reduce_none, - 1, 123, :_reduce_182, - 3, 123, :_reduce_183 ] - -racc_reduce_n = 184 - -racc_shift_n = 316 + 3, 117, :_reduce_161, + 1, 118, :_reduce_162, + 2, 118, :_reduce_163, + 6, 119, :_reduce_164, + 1, 115, :_reduce_165, + 2, 115, :_reduce_166, + 0, 120, :_reduce_167, + 3, 120, :_reduce_168, + 6, 121, :_reduce_169, + 0, 112, :_reduce_170, + 3, 112, :_reduce_171, + 0, 122, :_reduce_172, + 1, 122, :_reduce_173, + 2, 122, :_reduce_174, + 6, 99, :_reduce_175, + 1, 114, :_reduce_176, + 3, 114, :_reduce_177, + 6, 100, :_reduce_178, + 7, 101, :_reduce_179, + 7, 102, :_reduce_180, + 8, 93, :_reduce_181, + 0, 123, :_reduce_none, + 1, 123, :_reduce_none, + 1, 124, :_reduce_184, + 3, 124, :_reduce_185 ] + +racc_reduce_n = 186 + +racc_shift_n = 317 racc_token_table = { false => 0, @@ -944,6 +946,7 @@ def make_node(node_name, assigns) "schema_definition", "type_definition", "directive_definition", + "operation_type_definition_list_opt", "operation_type_definition_list", "operation_type_definition", "scalar_type_definition", @@ -1598,31 +1601,41 @@ def _reduce_109(val, _values, result) module_eval(<<'.,.,', 'parser.y', 286) def _reduce_114(val, _values, result) - result = make_node(:SchemaDefinition, position_source: val[0], definition_line: val[0][1], directives: val[1], **val[3]) + result = make_node(:SchemaDefinition, position_source: val[0], definition_line: val[0][1], directives: val[1], **val[2]) result end .,., -# reduce 115 omitted +module_eval(<<'.,.,', 'parser.y', 289) + def _reduce_115(val, _values, result) + result = {} + result + end +.,., module_eval(<<'.,.,', 'parser.y', 290) def _reduce_116(val, _values, result) + result = val[1] + result + end +.,., + +# reduce 117 omitted + +module_eval(<<'.,.,', 'parser.y', 294) + def _reduce_118(val, _values, result) result = val[0].merge(val[1]) result end .,., -module_eval(<<'.,.,', 'parser.y', 293) - def _reduce_117(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 297) + def _reduce_119(val, _values, result) result = { val[0][3].to_sym => val[2] } result end .,., -# reduce 118 omitted - -# reduce 119 omitted - # reduce 120 omitted # reduce 121 omitted @@ -1635,24 +1648,24 @@ def _reduce_117(val, _values, result) # reduce 125 omitted -module_eval(<<'.,.,', 'parser.y', 308) - def _reduce_126(val, _values, result) +# reduce 126 omitted + +# reduce 127 omitted + +module_eval(<<'.,.,', 'parser.y', 312) + def _reduce_128(val, _values, result) result = make_node(:SchemaExtension, position_source: val[0], directives: val[2], **val[4]) result end .,., -module_eval(<<'.,.,', 'parser.y', 309) - def _reduce_127(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 313) + def _reduce_129(val, _values, result) result = make_node(:SchemaExtension, position_source: val[0], directives: val[2]) result end .,., -# reduce 128 omitted - -# reduce 129 omitted - # reduce 130 omitted # reduce 131 omitted @@ -1661,166 +1674,156 @@ def _reduce_127(val, _values, result) # reduce 133 omitted -module_eval(<<'.,.,', 'parser.y', 319) - def _reduce_134(val, _values, result) - result = make_node(:ScalarTypeExtension, name: val[2], directives: val[3], position_source: val[0]) - result - end -.,., +# reduce 134 omitted -module_eval(<<'.,.,', 'parser.y', 323) - def _reduce_135(val, _values, result) - result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: [], fields: val[4], position_source: val[0]) - result - end -.,., +# reduce 135 omitted -module_eval(<<'.,.,', 'parser.y', 324) +module_eval(<<'.,.,', 'parser.y', 323) def _reduce_136(val, _values, result) - result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], position_source: val[0]) + result = make_node(:ScalarTypeExtension, name: val[2], directives: val[3], position_source: val[0]) result end .,., -module_eval(<<'.,.,', 'parser.y', 325) +module_eval(<<'.,.,', 'parser.y', 327) def _reduce_137(val, _values, result) - result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: [], position_source: val[0]) + result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: [], fields: val[4], position_source: val[0]) result end .,., -module_eval(<<'.,.,', 'parser.y', 326) +module_eval(<<'.,.,', 'parser.y', 328) def _reduce_138(val, _values, result) - result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: [], fields: [], position_source: val[0]) + result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 329) def _reduce_139(val, _values, result) - result = make_node(:InterfaceTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], position_source: val[0]) + result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: [], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 330) def _reduce_140(val, _values, result) - result = make_node(:InterfaceTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: [], position_source: val[0]) + result = make_node(:ObjectTypeExtension, name: val[2], interfaces: val[3], directives: [], fields: [], position_source: val[0]) result end .,., -module_eval(<<'.,.,', 'parser.y', 331) +module_eval(<<'.,.,', 'parser.y', 333) def _reduce_141(val, _values, result) - result = make_node(:InterfaceTypeExtension, name: val[2], interfaces: val[3], directives: [], fields: [], position_source: val[0]) + result = make_node(:InterfaceTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 334) def _reduce_142(val, _values, result) - result = make_node(:UnionTypeExtension, name: val[2], directives: val[3], types: val[5], position_source: val[0]) + result = make_node(:InterfaceTypeExtension, name: val[2], interfaces: val[3], directives: val[4], fields: [], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 335) def _reduce_143(val, _values, result) - result = make_node(:UnionTypeExtension, name: val[2], directives: val[3], types: [], position_source: val[0]) + result = make_node(:InterfaceTypeExtension, name: val[2], interfaces: val[3], directives: [], fields: [], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 338) def _reduce_144(val, _values, result) - result = make_node(:EnumTypeExtension, name: val[2], directives: val[3], values: val[5], position_source: val[0]) + result = make_node(:UnionTypeExtension, name: val[2], directives: val[3], types: val[5], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 339) def _reduce_145(val, _values, result) - result = make_node(:EnumTypeExtension, name: val[2], directives: val[3], values: [], position_source: val[0]) + result = make_node(:UnionTypeExtension, name: val[2], directives: val[3], types: [], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 342) def _reduce_146(val, _values, result) - result = make_node(:InputObjectTypeExtension, name: val[2], directives: val[3], fields: val[5], position_source: val[0]) + result = make_node(:EnumTypeExtension, name: val[2], directives: val[3], values: val[5], position_source: val[0]) result end .,., module_eval(<<'.,.,', 'parser.y', 343) def _reduce_147(val, _values, result) - result = make_node(:InputObjectTypeExtension, name: val[2], directives: val[3], fields: [], position_source: val[0]) + result = make_node(:EnumTypeExtension, name: val[2], directives: val[3], values: [], position_source: val[0]) result end .,., -# reduce 148 omitted +module_eval(<<'.,.,', 'parser.y', 346) + def _reduce_148(val, _values, result) + result = make_node(:InputObjectTypeExtension, name: val[2], directives: val[3], fields: val[5], position_source: val[0]) + result + end +.,., -# reduce 149 omitted +module_eval(<<'.,.,', 'parser.y', 347) + def _reduce_149(val, _values, result) + result = make_node(:InputObjectTypeExtension, name: val[2], directives: val[3], fields: [], position_source: val[0]) + result + end +.,., # reduce 150 omitted -module_eval(<<'.,.,', 'parser.y', 353) - def _reduce_151(val, _values, result) - result = make_node(:ScalarTypeDefinition, name: val[2], directives: val[3], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) +# reduce 151 omitted - result - end -.,., +# reduce 152 omitted -module_eval(<<'.,.,', 'parser.y', 358) - def _reduce_152(val, _values, result) - result = make_node(:ObjectTypeDefinition, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) +module_eval(<<'.,.,', 'parser.y', 357) + def _reduce_153(val, _values, result) + result = make_node(:ScalarTypeDefinition, name: val[2], directives: val[3], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 362) - def _reduce_153(val, _values, result) - result = EMPTY_ARRAY + def _reduce_154(val, _values, result) + result = make_node(:ObjectTypeDefinition, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) + result end .,., -# reduce 154 omitted - module_eval(<<'.,.,', 'parser.y', 366) def _reduce_155(val, _values, result) - result = val[2] + result = EMPTY_ARRAY result end .,., -module_eval(<<'.,.,', 'parser.y', 367) - def _reduce_156(val, _values, result) - result = val[1] - result - end -.,., +# reduce 156 omitted -module_eval(<<'.,.,', 'parser.y', 368) +module_eval(<<'.,.,', 'parser.y', 370) def _reduce_157(val, _values, result) - result = val[1] + result = val[2] result end .,., module_eval(<<'.,.,', 'parser.y', 371) def _reduce_158(val, _values, result) - result = [make_node(:TypeName, name: val[0], position_source: val[0])] + result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 372) def _reduce_159(val, _values, result) - val[0] << make_node(:TypeName, name: val[2], position_source: val[2]) + result = val[1] result end .,., @@ -1834,65 +1837,65 @@ def _reduce_160(val, _values, result) module_eval(<<'.,.,', 'parser.y', 376) def _reduce_161(val, _values, result) - val[0] << make_node(:TypeName, name: val[1], position_source: val[1]) + val[0] << make_node(:TypeName, name: val[2], position_source: val[2]) result end .,., -module_eval(<<'.,.,', 'parser.y', 380) +module_eval(<<'.,.,', 'parser.y', 379) def _reduce_162(val, _values, result) - result = make_node(:InputValueDefinition, name: val[1], type: val[3], default_value: val[4], directives: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) - + result = [make_node(:TypeName, name: val[0], position_source: val[0])] result end .,., -module_eval(<<'.,.,', 'parser.y', 384) +module_eval(<<'.,.,', 'parser.y', 380) def _reduce_163(val, _values, result) - result = [val[0]] + val[0] << make_node(:TypeName, name: val[1], position_source: val[1]) result end .,., -module_eval(<<'.,.,', 'parser.y', 385) +module_eval(<<'.,.,', 'parser.y', 384) def _reduce_164(val, _values, result) - val[0] << val[1] + result = make_node(:InputValueDefinition, name: val[1], type: val[3], default_value: val[4], directives: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) + result end .,., module_eval(<<'.,.,', 'parser.y', 388) def _reduce_165(val, _values, result) - result = EMPTY_ARRAY + result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 389) def _reduce_166(val, _values, result) - result = val[1] + val[0] << val[1] result end .,., -module_eval(<<'.,.,', 'parser.y', 393) +module_eval(<<'.,.,', 'parser.y', 392) def _reduce_167(val, _values, result) - result = make_node(:FieldDefinition, name: val[1], arguments: val[2], type: val[4], directives: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) - + result = EMPTY_ARRAY result end .,., -module_eval(<<'.,.,', 'parser.y', 397) +module_eval(<<'.,.,', 'parser.y', 393) def _reduce_168(val, _values, result) - result = EMPTY_ARRAY + result = val[1] result end .,., -module_eval(<<'.,.,', 'parser.y', 398) +module_eval(<<'.,.,', 'parser.y', 397) def _reduce_169(val, _values, result) - result = val[1] + result = make_node(:FieldDefinition, name: val[1], arguments: val[2], type: val[4], directives: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) + result end .,., @@ -1906,85 +1909,99 @@ def _reduce_170(val, _values, result) module_eval(<<'.,.,', 'parser.y', 402) def _reduce_171(val, _values, result) - result = [val[0]] + result = val[1] result end .,., -module_eval(<<'.,.,', 'parser.y', 403) +module_eval(<<'.,.,', 'parser.y', 405) def _reduce_172(val, _values, result) - val[0] << val[1] + result = EMPTY_ARRAY result end .,., -module_eval(<<'.,.,', 'parser.y', 407) +module_eval(<<'.,.,', 'parser.y', 406) def _reduce_173(val, _values, result) - result = make_node(:InterfaceTypeDefinition, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) + result = [val[0]] + result + end +.,., +module_eval(<<'.,.,', 'parser.y', 407) + def _reduce_174(val, _values, result) + val[0] << val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 411) - def _reduce_174(val, _values, result) + def _reduce_175(val, _values, result) + result = make_node(:InterfaceTypeDefinition, name: val[2], interfaces: val[3], directives: val[4], fields: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) + + result + end +.,., + +module_eval(<<'.,.,', 'parser.y', 415) + def _reduce_176(val, _values, result) result = [make_node(:TypeName, name: val[0], position_source: val[0])] result end .,., -module_eval(<<'.,.,', 'parser.y', 412) - def _reduce_175(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 416) + def _reduce_177(val, _values, result) val[0] << make_node(:TypeName, name: val[2], position_source: val[2]) result end .,., -module_eval(<<'.,.,', 'parser.y', 416) - def _reduce_176(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 420) + def _reduce_178(val, _values, result) result = make_node(:UnionTypeDefinition, name: val[2], directives: val[3], types: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) result end .,., -module_eval(<<'.,.,', 'parser.y', 421) - def _reduce_177(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 425) + def _reduce_179(val, _values, result) result = make_node(:EnumTypeDefinition, name: val[2], directives: val[3], values: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) result end .,., -module_eval(<<'.,.,', 'parser.y', 426) - def _reduce_178(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 430) + def _reduce_180(val, _values, result) result = make_node(:InputObjectTypeDefinition, name: val[2], directives: val[3], fields: val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) result end .,., -module_eval(<<'.,.,', 'parser.y', 431) - def _reduce_179(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 435) + def _reduce_181(val, _values, result) result = make_node(:DirectiveDefinition, name: val[3], arguments: val[4], locations: val[7], repeatable: !!val[5], description: val[0] || get_description(val[1]), definition_line: val[1][1], position_source: val[0] || val[1]) result end .,., -# reduce 180 omitted +# reduce 182 omitted -# reduce 181 omitted +# reduce 183 omitted -module_eval(<<'.,.,', 'parser.y', 439) - def _reduce_182(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 443) + def _reduce_184(val, _values, result) result = [make_node(:DirectiveLocation, name: val[0][3], position_source: val[0])] result end .,., -module_eval(<<'.,.,', 'parser.y', 440) - def _reduce_183(val, _values, result) +module_eval(<<'.,.,', 'parser.y', 444) + def _reduce_185(val, _values, result) val[0] << make_node(:DirectiveLocation, name: val[2][3], position_source: val[2]) result end diff --git a/lib/graphql/language/parser.y b/lib/graphql/language/parser.y index 024404220d..61ca54720e 100644 --- a/lib/graphql/language/parser.y +++ b/lib/graphql/language/parser.y @@ -284,7 +284,11 @@ rule | directive_definition schema_definition: - SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY { result = make_node(:SchemaDefinition, position_source: val[0], definition_line: val[0][1], directives: val[1], **val[3]) } + SCHEMA directives_list_opt operation_type_definition_list_opt { result = make_node(:SchemaDefinition, position_source: val[0], definition_line: val[0][1], directives: val[1], **val[2]) } + + operation_type_definition_list_opt: + /* none */ { result = {} } + | LCURLY operation_type_definition_list RCURLY { result = val[1] } operation_type_definition_list: operation_type_definition diff --git a/lib/graphql/schema/build_from_definition.rb b/lib/graphql/schema/build_from_definition.rb index 7cefebc198..9b64a81ccf 100644 --- a/lib/graphql/schema/build_from_definition.rb +++ b/lib/graphql/schema/build_from_definition.rb @@ -99,6 +99,16 @@ def build(schema_superclass, document, default_resolve:, using: {}, relay:) raise InvalidDocumentError.new("Specified subscription type \"#{schema_definition.subscription}\" not found in document.") unless types[schema_definition.subscription] subscription_root_type = types[schema_definition.subscription] end + + if schema_definition.query.nil? && + schema_definition.mutation.nil? && + schema_definition.subscription.nil? + # This schema may have been given with directives only, + # check for defaults: + query_root_type = types['Query'] + mutation_root_type = types['Mutation'] + subscription_root_type = types['Subscription'] + end else query_root_type = types['Query'] mutation_root_type = types['Mutation'] @@ -107,6 +117,8 @@ def build(schema_superclass, document, default_resolve:, using: {}, relay:) raise InvalidDocumentError.new('Must provide schema definition with query type or a type named Query.') unless query_root_type + builder = self + schema_class = Class.new(schema_superclass) do begin # Add these first so that there's some chance of resolving late-bound types @@ -134,6 +146,7 @@ def self.resolve_type(*args) if schema_definition ast_node(schema_definition) + builder.build_directives(self, schema_definition, type_resolver) end using.each do |plugin, options| diff --git a/spec/graphql/schema/build_from_definition_spec.rb b/spec/graphql/schema/build_from_definition_spec.rb index 2263bda6b4..deb90fbb0e 100644 --- a/spec/graphql/schema/build_from_definition_spec.rb +++ b/spec/graphql/schema/build_from_definition_spec.rb @@ -919,6 +919,8 @@ def assert_schema_and_compare_output(definition) argument: String ) on SCHEMA +directive @custom(thing: Boolean) on SCHEMA + type Type implements Interface { field(argument: String): String } @@ -944,7 +946,7 @@ def assert_schema_and_compare_output(definition) assert_equal [23, 3], schema.types["Input"].arguments["argument"].ast_node.position assert_equal [26, 1], schema.directives["Directive"].ast_node.position assert_equal [28, 3], schema.directives["Directive"].arguments["argument"].ast_node.position - assert_equal [31, 22], schema.types["Type"].ast_node.interfaces[0].position + assert_equal [33, 22], schema.types["Type"].ast_node.interfaces[0].position end it 'can build a schema from a file path' do @@ -1572,15 +1574,21 @@ def self.parse(string) it "supports extending schemas with directives" do schema_sdl = <<~EOS - directive @link(url: String, import: [String]) on SCHEMA + schema + @link(import: ["@key", "@shareable"], url: "https://specs.apollo.dev/federation/v2.0") - extend schema - @link(url: "https://specs.apollo.dev/federation/v2.0", - import: ["@key", "@shareable"]) + directive @link(as: String, for: link__Purpose, import: [link__Import], url: String!) repeatable on SCHEMA - type Query { - something: Int - } + type Query { + something: Int + } + + scalar link__Import + + enum link__Purpose { + EXECUTION + SECURITY + } EOS schema = GraphQL::Schema.from_definition(schema_sdl) @@ -1588,17 +1596,7 @@ def self.parse(string) assert_equal({ url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"] }, schema.schema_directives.first.arguments.to_h) - expected_schema = <<~GRAPHQL - schema - @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key", "@shareable"]) - - directive @link(import: [String], url: String) on SCHEMA - - type Query { - something: Int - } - GRAPHQL - assert_equal expected_schema, schema.to_definition + assert_equal schema_sdl, schema.to_definition end From d611f553a4805a9be1d00f5b50c51fec74fc61d0 Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Wed, 5 Apr 2023 11:25:03 -0400 Subject: [PATCH 2/2] Make schema types optional in C parser, too --- .../ext/graphql_c_parser_ext/parser.c | 1079 +++++++++-------- .../ext/graphql_c_parser_ext/parser.y | 12 +- 2 files changed, 554 insertions(+), 537 deletions(-) diff --git a/graphql-c_parser/ext/graphql_c_parser_ext/parser.c b/graphql-c_parser/ext/graphql_c_parser_ext/parser.c index 8947b583ce..633af6465c 100644 --- a/graphql-c_parser/ext/graphql_c_parser_ext/parser.c +++ b/graphql-c_parser/ext/graphql_c_parser_ext/parser.c @@ -353,41 +353,42 @@ enum yysymbol_kind_t YYSYMBOL_nullable_type = 88, /* nullable_type */ YYSYMBOL_type_system_definition = 89, /* type_system_definition */ YYSYMBOL_schema_definition = 90, /* schema_definition */ - YYSYMBOL_operation_type_definition_list = 91, /* operation_type_definition_list */ - YYSYMBOL_operation_type_definition = 92, /* operation_type_definition */ - YYSYMBOL_type_definition = 93, /* type_definition */ - YYSYMBOL_description = 94, /* description */ - YYSYMBOL_description_opt = 95, /* description_opt */ - YYSYMBOL_scalar_type_definition = 96, /* scalar_type_definition */ - YYSYMBOL_object_type_definition = 97, /* object_type_definition */ - YYSYMBOL_implements_opt = 98, /* implements_opt */ - YYSYMBOL_interfaces_list = 99, /* interfaces_list */ - YYSYMBOL_legacy_interfaces_list = 100, /* legacy_interfaces_list */ - YYSYMBOL_input_value_definition = 101, /* input_value_definition */ - YYSYMBOL_input_value_definition_list = 102, /* input_value_definition_list */ - YYSYMBOL_arguments_definitions_opt = 103, /* arguments_definitions_opt */ - YYSYMBOL_field_definition = 104, /* field_definition */ - YYSYMBOL_field_definition_list_opt = 105, /* field_definition_list_opt */ - YYSYMBOL_field_definition_list = 106, /* field_definition_list */ - YYSYMBOL_interface_type_definition = 107, /* interface_type_definition */ - YYSYMBOL_union_members = 108, /* union_members */ - YYSYMBOL_union_type_definition = 109, /* union_type_definition */ - YYSYMBOL_enum_type_definition = 110, /* enum_type_definition */ - YYSYMBOL_enum_value_definition = 111, /* enum_value_definition */ - YYSYMBOL_enum_value_definitions = 112, /* enum_value_definitions */ - YYSYMBOL_input_object_type_definition = 113, /* input_object_type_definition */ - YYSYMBOL_directive_definition = 114, /* directive_definition */ - YYSYMBOL_directive_repeatable_opt = 115, /* directive_repeatable_opt */ - YYSYMBOL_directive_locations = 116, /* directive_locations */ - YYSYMBOL_type_system_extension = 117, /* type_system_extension */ - YYSYMBOL_schema_extension = 118, /* schema_extension */ - YYSYMBOL_type_extension = 119, /* type_extension */ - YYSYMBOL_scalar_type_extension = 120, /* scalar_type_extension */ - YYSYMBOL_object_type_extension = 121, /* object_type_extension */ - YYSYMBOL_interface_type_extension = 122, /* interface_type_extension */ - YYSYMBOL_union_type_extension = 123, /* union_type_extension */ - YYSYMBOL_enum_type_extension = 124, /* enum_type_extension */ - YYSYMBOL_input_object_type_extension = 125 /* input_object_type_extension */ + YYSYMBOL_operation_type_definition_list_opt = 91, /* operation_type_definition_list_opt */ + YYSYMBOL_operation_type_definition_list = 92, /* operation_type_definition_list */ + YYSYMBOL_operation_type_definition = 93, /* operation_type_definition */ + YYSYMBOL_type_definition = 94, /* type_definition */ + YYSYMBOL_description = 95, /* description */ + YYSYMBOL_description_opt = 96, /* description_opt */ + YYSYMBOL_scalar_type_definition = 97, /* scalar_type_definition */ + YYSYMBOL_object_type_definition = 98, /* object_type_definition */ + YYSYMBOL_implements_opt = 99, /* implements_opt */ + YYSYMBOL_interfaces_list = 100, /* interfaces_list */ + YYSYMBOL_legacy_interfaces_list = 101, /* legacy_interfaces_list */ + YYSYMBOL_input_value_definition = 102, /* input_value_definition */ + YYSYMBOL_input_value_definition_list = 103, /* input_value_definition_list */ + YYSYMBOL_arguments_definitions_opt = 104, /* arguments_definitions_opt */ + YYSYMBOL_field_definition = 105, /* field_definition */ + YYSYMBOL_field_definition_list_opt = 106, /* field_definition_list_opt */ + YYSYMBOL_field_definition_list = 107, /* field_definition_list */ + YYSYMBOL_interface_type_definition = 108, /* interface_type_definition */ + YYSYMBOL_union_members = 109, /* union_members */ + YYSYMBOL_union_type_definition = 110, /* union_type_definition */ + YYSYMBOL_enum_type_definition = 111, /* enum_type_definition */ + YYSYMBOL_enum_value_definition = 112, /* enum_value_definition */ + YYSYMBOL_enum_value_definitions = 113, /* enum_value_definitions */ + YYSYMBOL_input_object_type_definition = 114, /* input_object_type_definition */ + YYSYMBOL_directive_definition = 115, /* directive_definition */ + YYSYMBOL_directive_repeatable_opt = 116, /* directive_repeatable_opt */ + YYSYMBOL_directive_locations = 117, /* directive_locations */ + YYSYMBOL_type_system_extension = 118, /* type_system_extension */ + YYSYMBOL_schema_extension = 119, /* schema_extension */ + YYSYMBOL_type_extension = 120, /* type_extension */ + YYSYMBOL_scalar_type_extension = 121, /* scalar_type_extension */ + YYSYMBOL_object_type_extension = 122, /* object_type_extension */ + YYSYMBOL_interface_type_extension = 123, /* interface_type_extension */ + YYSYMBOL_union_type_extension = 124, /* union_type_extension */ + YYSYMBOL_enum_type_extension = 125, /* enum_type_extension */ + YYSYMBOL_input_object_type_extension = 126 /* input_object_type_extension */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -715,16 +716,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 77 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 781 +#define YYLAST 782 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 40 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 86 +#define YYNNTS 87 /* YYNRULES -- Number of rules. */ -#define YYNRULES 180 +#define YYNRULES 182 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 309 +#define YYNSTATES 310 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 257 @@ -784,14 +785,14 @@ static const yytype_int16 yyrline[] = 373, 374, 376, 386, 387, 390, 391, 392, 393, 394, 395, 396, 397, 398, 401, 402, 403, 404, 405, 406, 407, 411, 421, 430, 441, 453, 454, 457, 458, 461, - 468, 477, 478, 479, 482, 495, 499, 504, 509, 510, - 511, 512, 513, 514, 516, 519, 520, 523, 535, 549, - 550, 551, 552, 555, 563, 569, 577, 582, 596, 597, - 600, 601, 604, 618, 619, 622, 623, 624, 627, 641, - 649, 654, 667, 680, 692, 693, 696, 709, 723, 724, - 727, 728, 732, 733, 736, 747, 759, 760, 761, 762, - 763, 764, 766, 776, 788, 800, 809, 820, 829, 840, - 849 + 468, 477, 478, 479, 482, 495, 496, 499, 503, 508, + 513, 514, 515, 516, 517, 518, 520, 523, 524, 527, + 539, 553, 554, 555, 556, 559, 567, 573, 581, 586, + 600, 601, 604, 605, 608, 622, 623, 626, 627, 628, + 631, 645, 653, 658, 671, 684, 696, 697, 700, 713, + 727, 728, 731, 732, 736, 737, 740, 751, 763, 764, + 765, 766, 767, 768, 770, 780, 792, 804, 813, 824, + 833, 844, 853 }; #endif @@ -829,13 +830,13 @@ yysymbol_name (yysymbol_kind_t yysymbol) "directive", "name", "schema_keyword", "name_without_on", "fragment_spread", "inline_fragment", "fragment_definition", "fragment_name_opt", "type", "nullable_type", "type_system_definition", - "schema_definition", "operation_type_definition_list", - "operation_type_definition", "type_definition", "description", - "description_opt", "scalar_type_definition", "object_type_definition", - "implements_opt", "interfaces_list", "legacy_interfaces_list", - "input_value_definition", "input_value_definition_list", - "arguments_definitions_opt", "field_definition", - "field_definition_list_opt", "field_definition_list", + "schema_definition", "operation_type_definition_list_opt", + "operation_type_definition_list", "operation_type_definition", + "type_definition", "description", "description_opt", + "scalar_type_definition", "object_type_definition", "implements_opt", + "interfaces_list", "legacy_interfaces_list", "input_value_definition", + "input_value_definition_list", "arguments_definitions_opt", + "field_definition", "field_definition_list_opt", "field_definition_list", "interface_type_definition", "union_members", "union_type_definition", "enum_type_definition", "enum_value_definition", "enum_value_definitions", "input_object_type_definition", @@ -849,12 +850,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-185) +#define YYPACT_NINF (-269) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-146) +#define YYTABLE_NINF (-148) #define yytable_value_is_error(Yyn) \ 0 @@ -863,37 +864,37 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 205, 204, 743, 479, -185, -185, 10, -185, -185, 21, - -185, 126, -185, -185, -185, 710, -185, -185, -185, -185, - -185, 79, -185, -185, -185, -185, -185, -185, -185, -185, - -185, -185, -185, -185, -185, -185, -185, -185, 710, 710, - 710, 710, 10, 710, 710, -185, -185, -185, -185, -185, - -185, -185, -185, -185, -185, -185, -185, -185, -185, -185, - -185, -185, 2, 578, -185, -185, 512, -185, -185, 6, - -185, -185, -185, 710, 12, 10, -185, -185, -185, 27, - -185, 44, 710, 710, 710, 710, 710, 710, 10, 10, - 45, 10, 47, 22, 45, 10, 611, 611, 53, 10, - -185, -185, 710, 710, 10, 56, -1, -185, 49, 10, - 710, 10, 10, 45, 10, 45, 10, 71, 22, 83, - 22, 305, 10, 10, -1, 10, 98, 32, 611, -185, - 10, 109, 10, 644, -185, -185, 56, 677, -185, 122, - 53, -185, 128, 67, -185, 710, -16, -185, 53, 113, - 118, 124, 10, -185, 10, 138, 116, 116, 710, 264, - 148, 710, 131, 74, 131, 710, 135, 53, -185, 53, - 545, 10, -185, -185, 412, -185, -185, 710, -185, -185, - 149, -185, -185, -185, 116, 136, 116, 116, 131, 131, - 710, 250, -185, 42, 710, -185, 43, -185, 148, 710, - -185, 57, -185, -185, -185, -185, 130, -185, -185, -185, - -185, 53, -185, -185, -185, -185, -185, 338, 710, -185, - -185, -185, -185, -185, 710, -185, -185, -185, -185, -185, - -185, -185, -185, -185, -185, -185, -185, 611, 112, -185, - 140, 76, 85, -185, -185, 130, 10, -185, -185, 163, - -185, -185, -185, 710, -185, 102, 710, -185, -185, -185, - 378, 142, 710, -185, 143, 710, -185, 168, -185, 165, - -185, 710, -185, -185, -185, 611, 113, -185, -185, -185, - -185, -185, -185, -185, 173, -185, -185, 176, 412, 446, - -185, -185, 156, 165, 178, 412, 446, -185, -185, 710, - -185, 710, 10, 611, -185, -185, -185, 10, -185 + 194, 95, 744, 480, -269, -269, 21, -269, -269, 32, + -269, 115, -269, -269, -269, 711, -269, -269, -269, -269, + -269, 59, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, 711, 711, + 711, 711, 21, 711, 711, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, -269, -269, + -269, -269, 33, 579, -269, -269, 513, -269, -269, 12, + -269, -269, -269, 711, 18, 21, -269, -269, -269, 40, + -269, 64, 711, 711, 711, 711, 711, 711, 21, 21, + 70, 21, 72, 9, 70, 21, 612, 612, 73, 21, + -269, -269, 711, 711, 21, 80, 50, -269, -269, 56, + 21, 711, 21, 21, 70, 21, 70, 21, 89, 9, + 91, 9, 306, 21, 21, 50, 21, 120, 62, 612, + -269, 21, 118, 21, 645, -269, -269, 80, 678, -269, + 142, 73, -269, 148, 63, -269, 711, -8, -269, 73, + 135, 140, 141, 21, -269, 21, 154, 132, 132, 711, + 208, 164, 711, 150, 78, 150, 711, 144, 73, -269, + 73, 546, 21, -269, -269, 413, -269, -269, 711, -269, + -269, 168, -269, -269, -269, 132, 147, 132, 132, 150, + 150, 711, 251, -269, -16, 711, -269, 75, -269, 164, + 711, -269, 87, -269, -269, -269, -269, 153, -269, -269, + -269, -269, 73, -269, -269, -269, -269, -269, 339, 711, + -269, -269, -269, -269, -269, 711, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269, -269, 612, 103, + -269, 149, 111, 112, -269, -269, 153, 21, -269, -269, + 176, -269, -269, -269, 711, -269, 126, 711, -269, -269, + -269, 379, 155, 711, -269, 157, 711, -269, 177, -269, + 173, -269, 711, -269, -269, -269, 612, 135, -269, -269, + -269, -269, -269, -269, -269, 182, -269, -269, 195, 413, + 447, -269, -269, 175, 173, 198, 413, 447, -269, -269, + 711, -269, 711, 21, 612, -269, -269, -269, 21, -269 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -901,65 +902,65 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 125, 0, 105, 0, 15, 14, 78, 124, 16, 0, - 2, 125, 4, 6, 9, 17, 10, 7, 111, 112, - 126, 0, 118, 119, 120, 121, 122, 123, 113, 8, - 162, 163, 166, 167, 168, 169, 170, 171, 0, 0, + 127, 0, 105, 0, 15, 14, 78, 126, 16, 0, + 2, 127, 4, 6, 9, 17, 10, 7, 111, 112, + 128, 0, 120, 121, 122, 123, 124, 125, 113, 8, + 164, 165, 168, 169, 170, 171, 172, 173, 0, 0, 0, 0, 78, 0, 0, 93, 91, 98, 95, 94, 92, 88, 89, 96, 86, 85, 97, 87, 90, 99, 100, 106, 0, 78, 84, 13, 0, 26, 28, 36, - 83, 29, 30, 0, 0, 79, 80, 1, 5, 19, + 83, 29, 30, 0, 115, 79, 80, 1, 5, 19, 18, 0, 0, 0, 0, 0, 0, 0, 78, 78, - 129, 0, 0, 165, 129, 78, 0, 0, 0, 78, - 12, 27, 0, 0, 78, 36, 0, 81, 0, 78, - 0, 78, 78, 129, 78, 129, 78, 0, 178, 0, - 180, 0, 78, 172, 0, 78, 0, 176, 0, 109, - 78, 107, 78, 0, 103, 101, 36, 0, 38, 0, - 32, 82, 0, 0, 115, 0, 0, 21, 0, 140, - 0, 0, 78, 127, 78, 0, 125, 125, 0, 133, - 131, 132, 143, 0, 143, 0, 0, 0, 108, 0, - 0, 78, 37, 39, 0, 33, 35, 0, 114, 116, - 0, 20, 22, 11, 125, 158, 125, 125, 143, 143, - 0, 0, 154, 125, 0, 138, 125, 133, 130, 0, - 136, 125, 174, 164, 173, 149, 175, 110, 104, 102, - 31, 32, 45, 41, 60, 59, 42, 0, 67, 53, - 62, 61, 43, 44, 0, 63, 50, 40, 46, 51, - 48, 65, 47, 52, 49, 64, 117, 0, 125, 159, - 0, 125, 125, 148, 128, 151, 78, 177, 155, 0, - 179, 139, 134, 0, 146, 125, 0, 34, 55, 57, - 0, 0, 68, 69, 0, 74, 75, 0, 54, 24, - 141, 0, 152, 156, 153, 0, 140, 144, 147, 150, - 56, 58, 66, 70, 0, 72, 76, 0, 0, 0, - 23, 160, 157, 24, 0, 0, 0, 50, 71, 73, - 25, 0, 78, 0, 77, 161, 137, 78, 142 + 131, 0, 0, 167, 131, 78, 0, 0, 0, 78, + 12, 27, 0, 0, 78, 36, 0, 114, 81, 0, + 78, 0, 78, 78, 131, 78, 131, 78, 0, 180, + 0, 182, 0, 78, 174, 0, 78, 0, 178, 0, + 109, 78, 107, 78, 0, 103, 101, 36, 0, 38, + 0, 32, 82, 0, 0, 117, 0, 0, 21, 0, + 142, 0, 0, 78, 129, 78, 0, 127, 127, 0, + 135, 133, 134, 145, 0, 145, 0, 0, 0, 108, + 0, 0, 78, 37, 39, 0, 33, 35, 0, 116, + 118, 0, 20, 22, 11, 127, 160, 127, 127, 145, + 145, 0, 0, 156, 127, 0, 140, 127, 135, 132, + 0, 138, 127, 176, 166, 175, 151, 177, 110, 104, + 102, 31, 32, 45, 41, 60, 59, 42, 0, 67, + 53, 62, 61, 43, 44, 0, 63, 50, 40, 46, + 51, 48, 65, 47, 52, 49, 64, 119, 0, 127, + 161, 0, 127, 127, 150, 130, 153, 78, 179, 157, + 0, 181, 141, 136, 0, 148, 127, 0, 34, 55, + 57, 0, 0, 68, 69, 0, 74, 75, 0, 54, + 24, 143, 0, 154, 158, 155, 0, 142, 146, 149, + 152, 56, 58, 66, 70, 0, 72, 76, 0, 0, + 0, 23, 162, 159, 24, 0, 0, 0, 50, 71, + 73, 25, 0, 78, 0, 77, 163, 139, 78, 144 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -185, -185, -185, -185, 175, -185, -185, 14, -185, -185, - -185, 38, -104, 65, -64, -94, -12, -185, -89, -185, - 63, -164, -171, -185, -185, -185, -185, 11, -185, -185, - -185, -185, -58, -185, -185, -185, -57, 81, -36, -62, - -3, -167, 3, -185, -185, -185, -185, -96, -185, -185, - -185, 86, -133, -185, -185, 8, -185, -185, -46, 59, - -185, -178, -72, -54, -41, -144, -185, -185, 28, -185, - -185, -184, 39, -185, -185, -185, -185, -185, -185, -185, - -185, -185, -185, -185, -185, -185 + -269, -269, -269, -269, 188, -269, -269, 14, -269, -269, + -269, 66, -85, 77, -65, -94, 7, -269, -95, -269, + 86, -268, -173, -269, -269, -269, -269, 34, -269, -269, + -269, -269, -33, -269, -269, -269, -31, 81, -35, -60, + -3, -172, 3, -269, -269, -269, -269, -86, -269, -269, + -269, -269, 106, -120, -269, -269, 8, -269, -269, -67, + 82, -269, -191, -34, -40, -17, -139, -269, -269, 49, + -269, -269, -185, 55, -269, -269, -269, -269, -269, -269, + -269, -269, -269, -269, -269, -269, -269 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 9, 10, 11, 12, 13, 14, 59, 79, 109, - 146, 147, 290, 66, 67, 175, 176, 68, 104, 137, - 138, 226, 298, 228, 229, 230, 260, 231, 232, 233, - 261, 262, 263, 234, 264, 265, 266, 74, 75, 76, - 129, 60, 70, 71, 72, 16, 62, 130, 131, 17, - 18, 143, 144, 19, 20, 194, 22, 23, 122, 160, - 161, 195, 196, 185, 254, 202, 255, 24, 206, 25, - 26, 192, 193, 27, 28, 240, 292, 29, 30, 31, - 32, 33, 34, 35, 36, 37 + 0, 9, 10, 11, 12, 13, 14, 59, 79, 110, + 147, 148, 291, 66, 67, 176, 177, 68, 104, 138, + 139, 227, 299, 229, 230, 231, 261, 232, 233, 234, + 262, 263, 264, 235, 265, 266, 267, 74, 75, 76, + 130, 60, 70, 71, 72, 16, 62, 131, 132, 17, + 18, 107, 144, 145, 19, 20, 195, 22, 23, 123, + 161, 162, 196, 197, 186, 255, 203, 256, 24, 207, + 25, 26, 193, 194, 27, 28, 241, 293, 29, 30, + 31, 32, 33, 34, 35, 36, 37 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -967,168 +968,168 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 69, 132, 101, 227, 134, 61, 93, 235, 21, 248, - 179, 102, 80, 107, 15, 181, 141, 73, 251, 21, - 204, 77, 4, 145, 235, 15, 5, 96, 103, 73, - 179, 107, 166, 106, 8, 88, 89, 90, 91, 73, - 94, 95, -79, -79, 243, 244, 259, 171, 125, 108, - 235, 110, 118, 120, 183, 123, 107, 248, 107, 127, - 251, 107, 121, 69, 251, 107, 99, 152, 124, 154, - 105, 247, 250, 208, 133, 209, 7, 7, 103, 111, - 112, 113, 114, 115, 116, 81, -145, 82, 145, 281, - 4, 7, 156, 235, 5, 83, 178, 4, 84, 136, - 139, 5, 8, 203, 157, 272, 101, 149, 165, 8, - 7, 85, 238, 168, 273, 242, 86, 87, 159, 7, - 142, 235, 235, 92, 297, 300, -3, 174, 235, 235, - 69, 277, 304, 177, 139, 184, 7, 1, 142, 186, - 2, 269, 180, 270, 98, 187, 7, 3, 190, 4, - 7, 199, 201, 5, 237, 197, 256, 142, 200, 6, - 7, 8, 205, 207, 191, 271, 239, 69, 275, 117, - 119, 282, 285, 288, 236, 289, 126, 142, 295, 293, - 135, 296, 301, 303, 182, 140, 78, 205, 225, 302, - 148, 249, 150, 151, 191, 153, 252, 155, 170, 257, - 173, 191, 246, 162, 283, 225, 164, 307, 286, 253, - 163, 167, 38, 169, 278, 267, 1, 198, 245, 2, - 39, 268, 294, 40, 0, 241, 3, 0, 4, 0, - 0, 225, 5, 188, 0, 189, 41, 42, 6, 7, - 8, 43, 44, 0, 0, 0, 0, 0, 0, 191, - 276, 0, 211, 279, 0, 0, 45, 0, 46, 284, - 0, 0, 287, 253, 214, 215, 50, 51, 291, 52, - 0, 0, 0, 4, 225, 220, -135, 5, 0, -135, - 221, -135, 54, 55, 0, 8, 0, 57, 58, -135, - 0, 0, 0, 0, -135, 0, 287, 0, 305, 0, - -135, 0, 225, 225, 0, 0, 0, 0, 158, 225, - 225, 45, 0, 46, 0, 0, 0, 47, 0, 48, - 49, 50, 51, 0, 52, 0, 0, 274, 4, 0, - 64, 0, 5, 0, 0, 53, 0, 54, 55, 0, - 8, 56, 57, 58, 45, 0, 46, 0, 0, 0, - 212, 213, 214, 215, 50, 51, 216, 52, 217, 218, - 0, 4, 219, 220, 0, 5, 258, 0, 221, 0, - 54, 55, 222, 8, 223, 57, 58, 224, 0, 0, - 0, 0, 0, 306, 45, 0, 46, 0, 308, 0, - 212, 213, 214, 215, 50, 51, 216, 52, 217, 218, - 0, 4, 219, 220, 0, 5, 280, 0, 221, 0, - 54, 55, 222, 8, 223, 57, 58, 224, 45, 0, - 46, 0, 0, 0, 212, 213, 214, 215, 50, 51, - 216, 52, 217, 218, 0, 4, 219, 220, 0, 5, - 0, 0, 221, 0, 54, 55, 222, 8, 223, 57, - 58, 224, 45, 0, 46, 0, 0, 0, 212, 213, - 214, 215, 50, 51, 216, 52, 217, 299, 0, 4, - 219, 220, 0, 5, 0, 0, 221, 0, 54, 55, - 222, 8, 223, 57, 58, 45, 0, 46, 63, 0, + 69, 101, 228, 236, 135, 61, 252, 93, 21, 249, + 142, 133, 80, 248, 15, 108, 73, 102, 7, 21, + 236, 298, 301, 182, 180, 15, 205, 126, 73, 305, + -79, 146, 77, 108, 103, 88, 89, 90, 91, 106, + 94, 95, 172, 167, 180, 260, 236, 153, 252, 155, + 244, 245, 252, 119, 121, 184, 124, 249, 96, 108, + 128, 108, 109, 69, 108, 81, 99, 82, 108, 73, + 105, 111, -79, 4, 209, 83, 210, 5, 84, 112, + 113, 114, 115, 116, 117, 8, 4, 122, 282, 236, + 5, 85, 179, 125, 134, 146, 86, 87, 8, 137, + 140, 4, 103, 38, 251, 5, 101, 204, 150, 7, + 157, 39, 158, 8, 40, -3, -147, 236, 236, 160, + 143, 7, 169, 92, 236, 236, 1, 41, 42, 2, + 166, 69, 43, 44, 271, 140, 3, 7, 4, 143, + 273, 274, 5, 181, 98, 7, 7, 175, 6, 7, + 8, 239, 270, 178, 243, 278, 198, 185, 143, 201, + 7, 187, 188, 206, 191, 192, 7, 200, 69, 118, + 120, 202, 208, 238, 272, 237, 127, 240, 143, 257, + 136, 276, 289, 290, 283, 141, 286, 296, 206, 226, + 294, 149, 250, 151, 152, 192, 154, 253, 156, 78, + 297, 302, 192, 304, 163, 1, 226, 165, 2, 303, + 254, 171, 168, 183, 170, 3, 268, 4, 308, 258, + -137, 5, 269, -137, 174, -137, 247, 6, 7, 8, + 284, 164, 226, -137, 189, 287, 190, 295, -137, 279, + 246, 199, 242, 0, -137, 0, 0, 0, 0, 0, + 192, 277, 0, 212, 280, 0, 0, 45, 0, 46, + 285, 0, 0, 288, 254, 215, 216, 50, 51, 292, + 52, 0, 0, 0, 4, 226, 221, 0, 5, 0, + 0, 222, 0, 54, 55, 0, 8, 0, 57, 58, + 0, 0, 0, 0, 0, 0, 0, 288, 0, 306, + 0, 0, 0, 226, 226, 0, 0, 0, 0, 159, + 226, 226, 45, 0, 46, 0, 0, 0, 47, 0, + 48, 49, 50, 51, 0, 52, 0, 0, 275, 4, + 0, 64, 0, 5, 0, 0, 53, 0, 54, 55, + 0, 8, 56, 57, 58, 45, 0, 46, 0, 0, + 0, 213, 214, 215, 216, 50, 51, 217, 52, 218, + 219, 0, 4, 220, 221, 0, 5, 259, 0, 222, + 0, 54, 55, 223, 8, 224, 57, 58, 225, 0, + 0, 0, 0, 0, 307, 45, 0, 46, 0, 309, + 0, 213, 214, 215, 216, 50, 51, 217, 52, 218, + 219, 0, 4, 220, 221, 0, 5, 281, 0, 222, + 0, 54, 55, 223, 8, 224, 57, 58, 225, 45, + 0, 46, 0, 0, 0, 213, 214, 215, 216, 50, + 51, 217, 52, 218, 219, 0, 4, 220, 221, 0, + 5, 0, 0, 222, 0, 54, 55, 223, 8, 224, + 57, 58, 225, 45, 0, 46, 0, 0, 0, 213, + 214, 215, 216, 50, 51, 217, 52, 218, 300, 0, + 4, 220, 221, 0, 5, 0, 0, 222, 0, 54, + 55, 223, 8, 224, 57, 58, 45, 0, 46, 63, + 0, 0, 47, 0, 48, 49, 50, 51, 0, 52, + 0, 0, 0, 4, 0, 64, 0, 5, 0, 65, + 53, 0, 54, 55, 0, 8, 56, 57, 58, 45, + 0, 46, 63, 0, 0, 47, 0, 48, 49, 50, + 51, 0, 52, 0, 0, 0, 4, 0, 64, 0, + 5, 0, 100, 53, 0, 54, 55, 0, 8, 56, + 57, 58, 45, 0, 46, 63, 0, 0, 47, 0, + 48, 49, 50, 51, 0, 52, 0, 0, 0, 4, + 0, 64, 0, 5, 0, 211, 53, 0, 54, 55, + 0, 8, 56, 57, 58, 45, 73, 46, 0, 0, 0, 47, 0, 48, 49, 50, 51, 0, 52, 0, - 0, 0, 4, 0, 64, 0, 5, 0, 65, 53, + 0, 0, 4, 0, 97, 0, 5, 0, 0, 53, 0, 54, 55, 0, 8, 56, 57, 58, 45, 0, - 46, 63, 0, 0, 47, 0, 48, 49, 50, 51, - 0, 52, 0, 0, 0, 4, 0, 64, 0, 5, - 0, 100, 53, 0, 54, 55, 0, 8, 56, 57, + 46, 0, 0, 0, 47, 0, 48, 49, 50, 51, + 0, 52, 129, 0, 0, 4, 0, 64, 0, 5, + 0, 0, 53, 0, 54, 55, 0, 8, 56, 57, 58, 45, 0, 46, 63, 0, 0, 47, 0, 48, 49, 50, 51, 0, 52, 0, 0, 0, 4, 0, - 64, 0, 5, 0, 210, 53, 0, 54, 55, 0, - 8, 56, 57, 58, 45, 73, 46, 0, 0, 0, + 64, 0, 5, 0, 0, 53, 0, 54, 55, 0, + 8, 56, 57, 58, 45, 0, 46, 0, 0, 0, 47, 0, 48, 49, 50, 51, 0, 52, 0, 0, - 0, 4, 0, 97, 0, 5, 0, 0, 53, 0, + 0, 4, 0, 64, 0, 5, 0, 0, 53, 173, 54, 55, 0, 8, 56, 57, 58, 45, 0, 46, 0, 0, 0, 47, 0, 48, 49, 50, 51, 0, - 52, 128, 0, 0, 4, 0, 64, 0, 5, 0, + 52, 0, 0, 0, 4, 0, 64, 0, 5, 0, 0, 53, 0, 54, 55, 0, 8, 56, 57, 58, - 45, 0, 46, 63, 0, 0, 47, 0, 48, 49, - 50, 51, 0, 52, 0, 0, 0, 4, 0, 64, + 45, 0, 46, 0, 0, 0, 47, 0, 48, 49, + 50, 51, 0, 52, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 53, 0, 54, 55, 0, 8, - 56, 57, 58, 45, 0, 46, 0, 0, 0, 47, - 0, 48, 49, 50, 51, 0, 52, 0, 0, 0, - 4, 0, 64, 0, 5, 0, 0, 53, 172, 54, - 55, 0, 8, 56, 57, 58, 45, 0, 46, 0, - 0, 0, 47, 0, 48, 49, 50, 51, 0, 52, - 0, 0, 0, 4, 0, 64, 0, 5, 0, 0, - 53, 0, 54, 55, 0, 8, 56, 57, 58, 45, - 0, 46, 0, 0, 0, 47, 0, 48, 49, 50, - 51, 0, 52, 0, 0, 0, 4, 0, 0, 0, - 5, 0, 0, 53, 0, 54, 55, 0, 8, 56, - 57, 58 + 56, 57, 58 }; static const yytype_int16 yycheck[] = { - 3, 97, 66, 174, 98, 2, 42, 174, 0, 193, - 143, 5, 15, 75, 0, 31, 105, 7, 196, 11, - 164, 0, 23, 39, 191, 11, 27, 25, 22, 7, - 163, 93, 128, 21, 35, 38, 39, 40, 41, 7, - 43, 44, 10, 21, 188, 189, 217, 136, 94, 22, - 217, 7, 88, 89, 148, 91, 118, 241, 120, 95, - 238, 123, 17, 66, 242, 127, 63, 113, 21, 115, - 73, 29, 29, 167, 21, 169, 34, 34, 22, 82, - 83, 84, 85, 86, 87, 6, 29, 8, 39, 260, - 23, 34, 21, 260, 27, 16, 29, 23, 19, 102, - 103, 27, 35, 29, 21, 29, 170, 110, 10, 35, - 34, 32, 184, 4, 29, 187, 37, 38, 121, 34, - 106, 288, 289, 42, 288, 289, 0, 5, 295, 296, - 133, 29, 296, 5, 137, 22, 34, 11, 124, 21, - 14, 237, 145, 31, 63, 21, 34, 21, 10, 23, - 34, 3, 21, 27, 5, 158, 26, 143, 161, 33, - 34, 35, 165, 28, 156, 25, 30, 170, 5, 88, - 89, 29, 29, 5, 177, 10, 95, 163, 5, 275, - 99, 5, 26, 5, 146, 104, 11, 190, 174, 293, - 109, 194, 111, 112, 186, 114, 199, 116, 133, 211, - 137, 193, 191, 122, 262, 191, 125, 303, 265, 201, - 124, 130, 8, 132, 255, 218, 11, 158, 190, 14, - 16, 224, 276, 19, -1, 186, 21, -1, 23, -1, - -1, 217, 27, 152, -1, 154, 32, 33, 33, 34, - 35, 37, 38, -1, -1, -1, -1, -1, -1, 241, - 253, -1, 171, 256, -1, -1, 6, -1, 8, 262, - -1, -1, 265, 255, 14, 15, 16, 17, 271, 19, - -1, -1, -1, 23, 260, 25, 12, 27, -1, 15, - 30, 17, 32, 33, -1, 35, -1, 37, 38, 25, - -1, -1, -1, -1, 30, -1, 299, -1, 301, -1, - 36, -1, 288, 289, -1, -1, -1, -1, 3, 295, - 296, 6, -1, 8, -1, -1, -1, 12, -1, 14, - 15, 16, 17, -1, 19, -1, -1, 246, 23, -1, - 25, -1, 27, -1, -1, 30, -1, 32, 33, -1, - 35, 36, 37, 38, 6, -1, 8, -1, -1, -1, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - -1, 23, 24, 25, -1, 27, 28, -1, 30, -1, - 32, 33, 34, 35, 36, 37, 38, 39, -1, -1, - -1, -1, -1, 302, 6, -1, 8, -1, 307, -1, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - -1, 23, 24, 25, -1, 27, 28, -1, 30, -1, - 32, 33, 34, 35, 36, 37, 38, 39, 6, -1, - 8, -1, -1, -1, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, -1, 23, 24, 25, -1, 27, - -1, -1, 30, -1, 32, 33, 34, 35, 36, 37, - 38, 39, 6, -1, 8, -1, -1, -1, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, 23, - 24, 25, -1, 27, -1, -1, 30, -1, 32, 33, - 34, 35, 36, 37, 38, 6, -1, 8, 9, -1, + 3, 66, 175, 175, 98, 2, 197, 42, 0, 194, + 105, 97, 15, 29, 0, 75, 7, 5, 34, 11, + 192, 289, 290, 31, 144, 11, 165, 94, 7, 297, + 21, 39, 0, 93, 22, 38, 39, 40, 41, 21, + 43, 44, 137, 129, 164, 218, 218, 114, 239, 116, + 189, 190, 243, 88, 89, 149, 91, 242, 25, 119, + 95, 121, 22, 66, 124, 6, 63, 8, 128, 7, + 73, 7, 10, 23, 168, 16, 170, 27, 19, 82, + 83, 84, 85, 86, 87, 35, 23, 17, 261, 261, + 27, 32, 29, 21, 21, 39, 37, 38, 35, 102, + 103, 23, 22, 8, 29, 27, 171, 29, 111, 34, + 21, 16, 21, 35, 19, 0, 29, 289, 290, 122, + 106, 34, 4, 42, 296, 297, 11, 32, 33, 14, + 10, 134, 37, 38, 31, 138, 21, 34, 23, 125, + 29, 29, 27, 146, 63, 34, 34, 5, 33, 34, + 35, 185, 238, 5, 188, 29, 159, 22, 144, 162, + 34, 21, 21, 166, 10, 157, 34, 3, 171, 88, + 89, 21, 28, 5, 25, 178, 95, 30, 164, 26, + 99, 5, 5, 10, 29, 104, 29, 5, 191, 175, + 276, 110, 195, 112, 113, 187, 115, 200, 117, 11, + 5, 26, 194, 5, 123, 11, 192, 126, 14, 294, + 202, 134, 131, 147, 133, 21, 219, 23, 304, 212, + 12, 27, 225, 15, 138, 17, 192, 33, 34, 35, + 263, 125, 218, 25, 153, 266, 155, 277, 30, 256, + 191, 159, 187, -1, 36, -1, -1, -1, -1, -1, + 242, 254, -1, 172, 257, -1, -1, 6, -1, 8, + 263, -1, -1, 266, 256, 14, 15, 16, 17, 272, + 19, -1, -1, -1, 23, 261, 25, -1, 27, -1, + -1, 30, -1, 32, 33, -1, 35, -1, 37, 38, + -1, -1, -1, -1, -1, -1, -1, 300, -1, 302, + -1, -1, -1, 289, 290, -1, -1, -1, -1, 3, + 296, 297, 6, -1, 8, -1, -1, -1, 12, -1, + 14, 15, 16, 17, -1, 19, -1, -1, 247, 23, + -1, 25, -1, 27, -1, -1, 30, -1, 32, 33, + -1, 35, 36, 37, 38, 6, -1, 8, -1, -1, + -1, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, 23, 24, 25, -1, 27, 28, -1, 30, + -1, 32, 33, 34, 35, 36, 37, 38, 39, -1, + -1, -1, -1, -1, 303, 6, -1, 8, -1, 308, + -1, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, -1, 23, 24, 25, -1, 27, 28, -1, 30, + -1, 32, 33, 34, 35, 36, 37, 38, 39, 6, + -1, 8, -1, -1, -1, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, -1, 23, 24, 25, -1, + 27, -1, -1, 30, -1, 32, 33, 34, 35, 36, + 37, 38, 39, 6, -1, 8, -1, -1, -1, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, + 23, 24, 25, -1, 27, -1, -1, 30, -1, 32, + 33, 34, 35, 36, 37, 38, 6, -1, 8, 9, + -1, -1, 12, -1, 14, 15, 16, 17, -1, 19, + -1, -1, -1, 23, -1, 25, -1, 27, -1, 29, + 30, -1, 32, 33, -1, 35, 36, 37, 38, 6, + -1, 8, 9, -1, -1, 12, -1, 14, 15, 16, + 17, -1, 19, -1, -1, -1, 23, -1, 25, -1, + 27, -1, 29, 30, -1, 32, 33, -1, 35, 36, + 37, 38, 6, -1, 8, 9, -1, -1, 12, -1, + 14, 15, 16, 17, -1, 19, -1, -1, -1, 23, + -1, 25, -1, 27, -1, 29, 30, -1, 32, 33, + -1, 35, 36, 37, 38, 6, 7, 8, -1, -1, -1, 12, -1, 14, 15, 16, 17, -1, 19, -1, - -1, -1, 23, -1, 25, -1, 27, -1, 29, 30, + -1, -1, 23, -1, 25, -1, 27, -1, -1, 30, -1, 32, 33, -1, 35, 36, 37, 38, 6, -1, - 8, 9, -1, -1, 12, -1, 14, 15, 16, 17, - -1, 19, -1, -1, -1, 23, -1, 25, -1, 27, - -1, 29, 30, -1, 32, 33, -1, 35, 36, 37, + 8, -1, -1, -1, 12, -1, 14, 15, 16, 17, + -1, 19, 20, -1, -1, 23, -1, 25, -1, 27, + -1, -1, 30, -1, 32, 33, -1, 35, 36, 37, 38, 6, -1, 8, 9, -1, -1, 12, -1, 14, 15, 16, 17, -1, 19, -1, -1, -1, 23, -1, - 25, -1, 27, -1, 29, 30, -1, 32, 33, -1, - 35, 36, 37, 38, 6, 7, 8, -1, -1, -1, + 25, -1, 27, -1, -1, 30, -1, 32, 33, -1, + 35, 36, 37, 38, 6, -1, 8, -1, -1, -1, 12, -1, 14, 15, 16, 17, -1, 19, -1, -1, - -1, 23, -1, 25, -1, 27, -1, -1, 30, -1, + -1, 23, -1, 25, -1, 27, -1, -1, 30, 31, 32, 33, -1, 35, 36, 37, 38, 6, -1, 8, -1, -1, -1, 12, -1, 14, 15, 16, 17, -1, - 19, 20, -1, -1, 23, -1, 25, -1, 27, -1, + 19, -1, -1, -1, 23, -1, 25, -1, 27, -1, -1, 30, -1, 32, 33, -1, 35, 36, 37, 38, - 6, -1, 8, 9, -1, -1, 12, -1, 14, 15, - 16, 17, -1, 19, -1, -1, -1, 23, -1, 25, + 6, -1, 8, -1, -1, -1, 12, -1, 14, 15, + 16, 17, -1, 19, -1, -1, -1, 23, -1, -1, -1, 27, -1, -1, 30, -1, 32, 33, -1, 35, - 36, 37, 38, 6, -1, 8, -1, -1, -1, 12, - -1, 14, 15, 16, 17, -1, 19, -1, -1, -1, - 23, -1, 25, -1, 27, -1, -1, 30, 31, 32, - 33, -1, 35, 36, 37, 38, 6, -1, 8, -1, - -1, -1, 12, -1, 14, 15, 16, 17, -1, 19, - -1, -1, -1, 23, -1, 25, -1, 27, -1, -1, - 30, -1, 32, 33, -1, 35, 36, 37, 38, 6, - -1, 8, -1, -1, -1, 12, -1, 14, 15, 16, - 17, -1, 19, -1, -1, -1, 23, -1, -1, -1, - 27, -1, -1, 30, -1, 32, 33, -1, 35, 36, - 37, 38 + 36, 37, 38 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1136,36 +1137,36 @@ static const yytype_int16 yycheck[] = static const yytype_int8 yystos[] = { 0, 11, 14, 21, 23, 27, 33, 34, 35, 41, - 42, 43, 44, 45, 46, 47, 85, 89, 90, 93, - 94, 95, 96, 97, 107, 109, 110, 113, 114, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 8, 16, + 42, 43, 44, 45, 46, 47, 85, 89, 90, 94, + 95, 96, 97, 98, 108, 110, 111, 114, 115, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 8, 16, 19, 32, 33, 37, 38, 6, 8, 12, 14, 15, 16, 17, 19, 30, 32, 33, 36, 37, 38, 47, 81, 82, 86, 9, 25, 29, 53, 54, 57, 80, 82, 83, 84, 7, 77, 78, 79, 0, 44, 48, 80, 6, 8, 16, 19, 32, 37, 38, 80, 80, 80, 80, 77, 78, 80, 80, 25, 25, 77, 82, - 29, 54, 5, 22, 58, 80, 21, 79, 22, 49, - 7, 80, 80, 80, 80, 80, 80, 77, 78, 77, - 78, 17, 98, 78, 21, 98, 77, 78, 20, 80, - 87, 88, 87, 21, 55, 77, 80, 59, 60, 80, - 77, 58, 47, 91, 92, 39, 50, 51, 77, 80, - 77, 77, 98, 77, 98, 77, 21, 21, 3, 80, - 99, 100, 77, 91, 77, 10, 87, 77, 4, 77, - 53, 58, 31, 60, 5, 55, 56, 5, 29, 92, - 80, 31, 51, 55, 22, 103, 21, 21, 77, 77, - 10, 95, 111, 112, 95, 101, 102, 80, 99, 3, - 80, 21, 105, 29, 105, 80, 108, 28, 55, 55, - 29, 77, 12, 13, 14, 15, 18, 20, 21, 24, - 25, 30, 34, 36, 39, 47, 61, 62, 63, 64, - 65, 67, 68, 69, 73, 81, 80, 5, 102, 30, - 115, 112, 102, 105, 105, 108, 67, 29, 111, 80, - 29, 101, 80, 95, 104, 106, 26, 56, 28, 62, - 66, 70, 71, 72, 74, 75, 76, 80, 80, 87, - 31, 25, 29, 29, 77, 5, 80, 29, 104, 80, - 28, 62, 29, 72, 80, 29, 76, 80, 5, 10, - 52, 80, 116, 87, 103, 5, 5, 61, 62, 21, - 61, 26, 52, 5, 61, 80, 77, 87, 77 + 29, 54, 5, 22, 58, 80, 21, 91, 79, 22, + 49, 7, 80, 80, 80, 80, 80, 80, 77, 78, + 77, 78, 17, 99, 78, 21, 99, 77, 78, 20, + 80, 87, 88, 87, 21, 55, 77, 80, 59, 60, + 80, 77, 58, 47, 92, 93, 39, 50, 51, 77, + 80, 77, 77, 99, 77, 99, 77, 21, 21, 3, + 80, 100, 101, 77, 92, 77, 10, 87, 77, 4, + 77, 53, 58, 31, 60, 5, 55, 56, 5, 29, + 93, 80, 31, 51, 55, 22, 104, 21, 21, 77, + 77, 10, 96, 112, 113, 96, 102, 103, 80, 100, + 3, 80, 21, 106, 29, 106, 80, 109, 28, 55, + 55, 29, 77, 12, 13, 14, 15, 18, 20, 21, + 24, 25, 30, 34, 36, 39, 47, 61, 62, 63, + 64, 65, 67, 68, 69, 73, 81, 80, 5, 103, + 30, 116, 113, 103, 106, 106, 109, 67, 29, 112, + 80, 29, 102, 80, 96, 105, 107, 26, 56, 28, + 62, 66, 70, 71, 72, 74, 75, 76, 80, 80, + 87, 31, 25, 29, 29, 77, 5, 80, 29, 105, + 80, 28, 62, 29, 72, 80, 29, 76, 80, 5, + 10, 52, 80, 117, 87, 104, 5, 5, 61, 62, + 21, 61, 26, 52, 5, 61, 80, 77, 87, 77 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1182,14 +1183,14 @@ static const yytype_int8 yyr1[] = 78, 78, 79, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 83, 84, 84, 85, 86, 86, 87, 87, 88, - 88, 89, 89, 89, 90, 91, 91, 92, 93, 93, - 93, 93, 93, 93, 94, 95, 95, 96, 97, 98, - 98, 98, 98, 99, 99, 100, 100, 101, 102, 102, - 103, 103, 104, 105, 105, 106, 106, 106, 107, 108, - 108, 109, 110, 111, 112, 112, 113, 114, 115, 115, - 116, 116, 117, 117, 118, 118, 119, 119, 119, 119, - 119, 119, 120, 121, 122, 123, 123, 124, 124, 125, - 125 + 88, 89, 89, 89, 90, 91, 91, 92, 92, 93, + 94, 94, 94, 94, 94, 94, 95, 96, 96, 97, + 98, 99, 99, 99, 99, 100, 100, 101, 101, 102, + 103, 103, 104, 104, 105, 106, 106, 107, 107, 107, + 108, 109, 109, 110, 111, 112, 113, 113, 114, 115, + 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, + 120, 120, 120, 120, 121, 122, 123, 124, 124, 125, + 125, 126, 126 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1206,14 +1207,14 @@ static const yytype_int8 yyr2[] = 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 3, 6, 0, 1, 1, 2, 1, - 3, 1, 1, 1, 5, 1, 2, 3, 1, 1, - 1, 1, 1, 1, 1, 0, 1, 4, 6, 0, - 3, 2, 2, 1, 3, 1, 2, 6, 1, 2, - 0, 3, 6, 0, 3, 0, 1, 2, 6, 1, - 3, 6, 7, 3, 1, 2, 7, 8, 0, 1, - 1, 3, 1, 1, 6, 3, 1, 1, 1, 1, - 1, 1, 4, 6, 6, 6, 4, 7, 4, 7, - 4 + 3, 1, 1, 1, 3, 0, 3, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 0, 1, 4, + 6, 0, 3, 2, 2, 1, 3, 1, 2, 6, + 1, 2, 0, 3, 6, 0, 3, 0, 1, 2, + 6, 1, 3, 6, 7, 3, 1, 2, 7, 8, + 0, 1, 1, 3, 1, 1, 6, 3, 1, 1, + 1, 1, 1, 1, 4, 6, 6, 6, 4, 7, + 4, 7, 4 }; @@ -1910,7 +1911,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); case 2: /* start: document */ #line 103 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ivar_set(parser, rb_intern("@result"), yyvsp[0]); } -#line 1914 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1915 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 3: /* document: definitions_list */ @@ -1927,19 +1928,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); } yyval = MAKE_AST_NODE(Document, 3, line, col, yyvsp[0]); } -#line 1931 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1932 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 4: /* definitions_list: definition */ #line 119 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 1937 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1938 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 5: /* definitions_list: definitions_list definition */ #line 120 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 1943 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1944 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 11: /* operation_definition: operation_type operation_name_opt variable_definitions_opt directives_list_opt selection_set */ @@ -1955,7 +1956,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 1959 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1960 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 12: /* operation_definition: LCURLY selection_list RCURLY */ @@ -1971,7 +1972,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 1975 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1976 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 13: /* operation_definition: LCURLY RCURLY */ @@ -1987,37 +1988,37 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); GraphQL_Language_Nodes_NONE ); } -#line 1991 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1992 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 17: /* operation_name_opt: %empty */ #line 172 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qnil; } -#line 1997 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 1998 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 19: /* variable_definitions_opt: %empty */ #line 176 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2003 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2004 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 20: /* variable_definitions_opt: LPAREN variable_definitions_list RPAREN */ #line 177 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[-1]; } -#line 2009 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2010 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 21: /* variable_definitions_list: variable_definition */ #line 180 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2015 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2016 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 22: /* variable_definitions_list: variable_definitions_list variable_definition */ #line 181 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2021 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2022 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 23: /* variable_definition: VAR_SIGN name COLON type default_value_opt */ @@ -2031,43 +2032,43 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2035 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2036 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 24: /* default_value_opt: %empty */ #line 195 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qnil; } -#line 2041 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2042 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 25: /* default_value_opt: EQUALS literal_value */ #line 196 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[0]; } -#line 2047 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2048 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 26: /* selection_list: selection */ #line 199 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2053 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2054 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 27: /* selection_list: selection_list selection */ #line 200 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2059 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2060 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 31: /* selection_set: LCURLY selection_list RCURLY */ #line 208 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[-1]; } -#line 2065 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2066 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 32: /* selection_set_opt: %empty */ #line 211 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new(); } -#line 2071 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2072 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 34: /* field: name COLON name arguments_opt directives_list_opt selection_set_opt */ @@ -2083,7 +2084,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] // subselections ); } -#line 2087 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2088 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 35: /* field: name arguments_opt directives_list_opt selection_set_opt */ @@ -2099,31 +2100,31 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] // subselections ); } -#line 2103 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2104 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 36: /* arguments_opt: %empty */ #line 239 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2109 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2110 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 37: /* arguments_opt: LPAREN arguments_list RPAREN */ #line 240 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[-1]; } -#line 2115 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2116 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 38: /* arguments_list: argument */ #line 243 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2121 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2122 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 39: /* arguments_list: arguments_list argument */ #line 244 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2127 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2128 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 40: /* argument: name COLON input_value */ @@ -2136,37 +2137,37 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2140 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2141 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 41: /* literal_value: FLOAT */ #line 257 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_funcall(rb_ary_entry(yyvsp[0], 3), rb_intern("to_f"), 0); } -#line 2146 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2147 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 42: /* literal_value: INT */ #line 258 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_funcall(rb_ary_entry(yyvsp[0], 3), rb_intern("to_i"), 0); } -#line 2152 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2153 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 43: /* literal_value: STRING */ #line 259 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_entry(yyvsp[0], 3); } -#line 2158 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2159 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 44: /* literal_value: TRUE_LITERAL */ #line 260 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qtrue; } -#line 2164 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2165 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 45: /* literal_value: FALSE_LITERAL */ #line 261 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qfalse; } -#line 2170 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2171 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 53: /* null_value: NULL_LITERAL */ @@ -2178,7 +2179,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); rb_ary_entry(yyvsp[0], 3) ); } -#line 2182 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2183 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 54: /* variable: VAR_SIGN name */ @@ -2190,31 +2191,31 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); rb_ary_entry(yyvsp[0], 3) ); } -#line 2194 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2195 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 55: /* list_value: LBRACKET RBRACKET */ #line 289 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2200 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2201 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 56: /* list_value: LBRACKET list_value_list RBRACKET */ #line 290 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[-1]; } -#line 2206 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2207 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 57: /* list_value_list: input_value */ #line 293 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2212 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2213 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 58: /* list_value_list: list_value_list input_value */ #line 294 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2218 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2219 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 65: /* enum_value: enum_name */ @@ -2226,7 +2227,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); rb_ary_entry(yyvsp[0], 3) ); } -#line 2230 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2231 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 66: /* object_value: LCURLY object_value_list_opt RCURLY */ @@ -2238,25 +2239,25 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2242 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2243 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 67: /* object_value_list_opt: %empty */ #line 322 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2248 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2249 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 69: /* object_value_list: object_value_field */ #line 326 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2254 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2255 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 70: /* object_value_list: object_value_list object_value_field */ #line 327 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2260 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2261 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 71: /* object_value_field: name COLON input_value */ @@ -2269,7 +2270,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2273 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2274 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 72: /* object_literal_value: LCURLY object_literal_value_list_opt RCURLY */ @@ -2281,25 +2282,25 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2285 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2286 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 73: /* object_literal_value_list_opt: %empty */ #line 350 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2291 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2292 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 75: /* object_literal_value_list: object_literal_value_field */ #line 354 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2297 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2298 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 76: /* object_literal_value_list: object_literal_value_list object_literal_value_field */ #line 355 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2303 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2304 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 77: /* object_literal_value_field: name COLON literal_value */ @@ -2312,25 +2313,25 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2316 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2317 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 78: /* directives_list_opt: %empty */ #line 369 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2322 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2323 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 80: /* directives_list: directive */ #line 373 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2328 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2329 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 81: /* directives_list: directives_list directive */ #line 374 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2334 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2335 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 82: /* directive: DIR_SIGN name arguments_opt */ @@ -2343,7 +2344,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2347 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2348 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 101: /* fragment_spread: ELLIPSIS name_without_on directives_list_opt */ @@ -2356,7 +2357,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2360 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2361 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 102: /* inline_fragment: ELLIPSIS ON type directives_list_opt selection_set */ @@ -2370,7 +2371,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2374 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2375 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 103: /* inline_fragment: ELLIPSIS directives_list_opt selection_set */ @@ -2384,7 +2385,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2388 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2389 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 104: /* fragment_definition: FRAGMENT fragment_name_opt ON type directives_list_opt selection_set */ @@ -2399,25 +2400,25 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2403 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2404 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 105: /* fragment_name_opt: %empty */ #line 453 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qnil; } -#line 2409 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2410 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 106: /* fragment_name_opt: name_without_on */ #line 454 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_entry(yyvsp[0], 3); } -#line 2415 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2416 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 108: /* type: nullable_type BANG */ #line 458 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(NonNullType, 3, rb_funcall(yyvsp[-1], rb_intern("line"), 0), rb_funcall(yyvsp[-1], rb_intern("col"), 0), yyvsp[-1]); } -#line 2421 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2422 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 109: /* nullable_type: name */ @@ -2429,7 +2430,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); rb_ary_entry(yyvsp[0], 3) ); } -#line 2433 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2434 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; case 110: /* nullable_type: LBRACKET type RBRACKET */ @@ -2441,58 +2442,70 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2445 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2446 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 114: /* schema_definition: SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY */ + case 114: /* schema_definition: SCHEMA directives_list_opt operation_type_definition_list_opt */ #line 482 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" - { + { yyval = MAKE_AST_NODE(SchemaDefinition, 6, - rb_ary_entry(yyvsp[-4], 1), - rb_ary_entry(yyvsp[-4], 2), + rb_ary_entry(yyvsp[-2], 1), + rb_ary_entry(yyvsp[-2], 2), // TODO use static strings: - rb_hash_aref(yyvsp[-1], rb_str_new_cstr("query")), - rb_hash_aref(yyvsp[-1], rb_str_new_cstr("mutation")), - rb_hash_aref(yyvsp[-1], rb_str_new_cstr("subscription")), - yyvsp[-3] + rb_hash_aref(yyvsp[0], rb_str_new_cstr("query")), + rb_hash_aref(yyvsp[0], rb_str_new_cstr("mutation")), + rb_hash_aref(yyvsp[0], rb_str_new_cstr("subscription")), + yyvsp[-1] ); } -#line 2461 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2462 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 115: /* operation_type_definition_list: operation_type_definition */ + case 115: /* operation_type_definition_list_opt: %empty */ #line 495 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + { yyval = rb_hash_new(); } +#line 2468 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" + break; + + case 116: /* operation_type_definition_list_opt: LCURLY operation_type_definition_list RCURLY */ +#line 496 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + { yyval = yyvsp[-1]; } +#line 2474 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" + break; + + case 117: /* operation_type_definition_list: operation_type_definition */ +#line 499 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_hash_new(); rb_hash_aset(yyval, rb_ary_entry(yyvsp[0], 0), rb_ary_entry(yyvsp[0], 1)); } -#line 2470 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2483 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 116: /* operation_type_definition_list: operation_type_definition_list operation_type_definition */ -#line 499 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 118: /* operation_type_definition_list: operation_type_definition_list operation_type_definition */ +#line 503 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_hash_aset(yyval, rb_ary_entry(yyvsp[0], 0), rb_ary_entry(yyvsp[0], 1)); } -#line 2478 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2491 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 117: /* operation_type_definition: operation_type COLON name */ -#line 504 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 119: /* operation_type_definition: operation_type COLON name */ +#line 508 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(2, rb_ary_entry(yyvsp[-2], 3), rb_ary_entry(yyvsp[0], 3)); } -#line 2486 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2499 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 125: /* description_opt: %empty */ -#line 519 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 127: /* description_opt: %empty */ +#line 523 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qnil; } -#line 2492 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2505 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 127: /* scalar_type_definition: description_opt SCALAR name directives_list_opt */ -#line 523 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 129: /* scalar_type_definition: description_opt SCALAR name directives_list_opt */ +#line 527 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(ScalarTypeDefinition, 5, rb_ary_entry(yyvsp[-2], 1), @@ -2503,11 +2516,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2507 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2520 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 128: /* object_type_definition: description_opt TYPE_LITERAL name implements_opt directives_list_opt field_definition_list_opt */ -#line 535 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 130: /* object_type_definition: description_opt TYPE_LITERAL name implements_opt directives_list_opt field_definition_list_opt */ +#line 539 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(ObjectTypeDefinition, 7, rb_ary_entry(yyvsp[-4], 1), @@ -2520,35 +2533,35 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2524 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2537 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 129: /* implements_opt: %empty */ -#line 549 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 131: /* implements_opt: %empty */ +#line 553 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2530 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2543 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 130: /* implements_opt: IMPLEMENTS AMP interfaces_list */ -#line 550 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 132: /* implements_opt: IMPLEMENTS AMP interfaces_list */ +#line 554 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[0]; } -#line 2536 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2549 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 131: /* implements_opt: IMPLEMENTS interfaces_list */ -#line 551 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 133: /* implements_opt: IMPLEMENTS interfaces_list */ +#line 555 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[0]; } -#line 2542 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2555 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 132: /* implements_opt: IMPLEMENTS legacy_interfaces_list */ -#line 552 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 134: /* implements_opt: IMPLEMENTS legacy_interfaces_list */ +#line 556 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[0]; } -#line 2548 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2561 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 133: /* interfaces_list: name */ -#line 555 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 135: /* interfaces_list: name */ +#line 559 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { VALUE new_name = MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), @@ -2557,20 +2570,20 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ); yyval = rb_ary_new_from_args(1, new_name); } -#line 2561 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2574 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 134: /* interfaces_list: interfaces_list AMP name */ -#line 563 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 136: /* interfaces_list: interfaces_list AMP name */ +#line 567 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { VALUE new_name = MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3)); rb_ary_push(yyval, new_name); } -#line 2570 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2583 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 135: /* legacy_interfaces_list: name */ -#line 569 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 137: /* legacy_interfaces_list: name */ +#line 573 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { VALUE new_name = MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), @@ -2579,19 +2592,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ); yyval = rb_ary_new_from_args(1, new_name); } -#line 2583 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2596 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 136: /* legacy_interfaces_list: legacy_interfaces_list name */ -#line 577 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 138: /* legacy_interfaces_list: legacy_interfaces_list name */ +#line 581 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3))); } -#line 2591 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2604 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 137: /* input_value_definition: description_opt name COLON type default_value_opt directives_list_opt */ -#line 582 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 139: /* input_value_definition: description_opt name COLON type default_value_opt directives_list_opt */ +#line 586 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(InputValueDefinition, 7, rb_ary_entry(yyvsp[-4], 1), @@ -2604,35 +2617,35 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2608 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2621 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 138: /* input_value_definition_list: input_value_definition */ -#line 596 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 140: /* input_value_definition_list: input_value_definition */ +#line 600 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2614 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2627 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 139: /* input_value_definition_list: input_value_definition_list input_value_definition */ -#line 597 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 141: /* input_value_definition_list: input_value_definition_list input_value_definition */ +#line 601 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2620 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2633 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 140: /* arguments_definitions_opt: %empty */ -#line 600 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 142: /* arguments_definitions_opt: %empty */ +#line 604 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2626 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2639 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 141: /* arguments_definitions_opt: LPAREN input_value_definition_list RPAREN */ -#line 601 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 143: /* arguments_definitions_opt: LPAREN input_value_definition_list RPAREN */ +#line 605 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[-1]; } -#line 2632 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2645 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 142: /* field_definition: description_opt name arguments_definitions_opt COLON type directives_list_opt */ -#line 604 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 144: /* field_definition: description_opt name arguments_definitions_opt COLON type directives_list_opt */ +#line 608 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(FieldDefinition, 7, rb_ary_entry(yyvsp[-4], 1), @@ -2645,41 +2658,41 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2649 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2662 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 143: /* field_definition_list_opt: %empty */ -#line 618 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 145: /* field_definition_list_opt: %empty */ +#line 622 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2655 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2668 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 144: /* field_definition_list_opt: LCURLY field_definition_list RCURLY */ -#line 619 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 146: /* field_definition_list_opt: LCURLY field_definition_list RCURLY */ +#line 623 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = yyvsp[-1]; } -#line 2661 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2674 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 145: /* field_definition_list: %empty */ -#line 622 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 147: /* field_definition_list: %empty */ +#line 626 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = GraphQL_Language_Nodes_NONE; } -#line 2667 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2680 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 146: /* field_definition_list: field_definition */ -#line 623 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 148: /* field_definition_list: field_definition */ +#line 627 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2673 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2686 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 147: /* field_definition_list: field_definition_list field_definition */ -#line 624 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 149: /* field_definition_list: field_definition_list field_definition */ +#line 628 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2679 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2692 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 148: /* interface_type_definition: description_opt INTERFACE name implements_opt directives_list_opt field_definition_list_opt */ -#line 627 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 150: /* interface_type_definition: description_opt INTERFACE name implements_opt directives_list_opt field_definition_list_opt */ +#line 631 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(InterfaceTypeDefinition, 7, rb_ary_entry(yyvsp[-4], 1), @@ -2692,11 +2705,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2696 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2709 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 149: /* union_members: name */ -#line 641 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 151: /* union_members: name */ +#line 645 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { VALUE new_member = MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), @@ -2705,19 +2718,19 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); ); yyval = rb_ary_new_from_args(1, new_member); } -#line 2709 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2722 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 150: /* union_members: union_members PIPE name */ -#line 649 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 152: /* union_members: union_members PIPE name */ +#line 653 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3))); } -#line 2717 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2730 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 151: /* union_type_definition: description_opt UNION name directives_list_opt EQUALS union_members */ -#line 654 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 153: /* union_type_definition: description_opt UNION name directives_list_opt EQUALS union_members */ +#line 658 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(UnionTypeDefinition, 6, rb_ary_entry(yyvsp[-4], 1), @@ -2729,11 +2742,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-2] ); } -#line 2733 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2746 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 152: /* enum_type_definition: description_opt ENUM name directives_list_opt LCURLY enum_value_definitions RCURLY */ -#line 667 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 154: /* enum_type_definition: description_opt ENUM name directives_list_opt LCURLY enum_value_definitions RCURLY */ +#line 671 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(EnumTypeDefinition, 6, rb_ary_entry(yyvsp[-5], 1), @@ -2745,11 +2758,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2749 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2762 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 153: /* enum_value_definition: description_opt enum_name directives_list_opt */ -#line 680 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 155: /* enum_value_definition: description_opt enum_name directives_list_opt */ +#line 684 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(EnumValueDefinition, 5, rb_ary_entry(yyvsp[-1], 1), @@ -2760,23 +2773,23 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2764 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2777 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 154: /* enum_value_definitions: enum_value_definition */ -#line 692 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 156: /* enum_value_definitions: enum_value_definition */ +#line 696 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, yyvsp[0]); } -#line 2770 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2783 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 155: /* enum_value_definitions: enum_value_definitions enum_value_definition */ -#line 693 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 157: /* enum_value_definitions: enum_value_definitions enum_value_definition */ +#line 697 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, yyvsp[0]); } -#line 2776 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2789 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 156: /* input_object_type_definition: description_opt INPUT name directives_list_opt LCURLY input_value_definition_list RCURLY */ -#line 696 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 158: /* input_object_type_definition: description_opt INPUT name directives_list_opt LCURLY input_value_definition_list RCURLY */ +#line 700 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(InputObjectTypeDefinition, 6, rb_ary_entry(yyvsp[-5], 1), @@ -2788,11 +2801,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2792 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2805 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 157: /* directive_definition: description_opt DIRECTIVE DIR_SIGN name arguments_definitions_opt directive_repeatable_opt ON directive_locations */ -#line 709 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 159: /* directive_definition: description_opt DIRECTIVE DIR_SIGN name arguments_definitions_opt directive_repeatable_opt ON directive_locations */ +#line 713 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(DirectiveDefinition, 7, rb_ary_entry(yyvsp[-6], 1), @@ -2805,35 +2818,35 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2809 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2822 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 158: /* directive_repeatable_opt: %empty */ -#line 723 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 160: /* directive_repeatable_opt: %empty */ +#line 727 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qnil; } -#line 2815 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2828 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 159: /* directive_repeatable_opt: REPEATABLE */ -#line 724 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 161: /* directive_repeatable_opt: REPEATABLE */ +#line 728 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = Qtrue; } -#line 2821 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2834 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 160: /* directive_locations: name */ -#line 727 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 162: /* directive_locations: name */ +#line 731 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = rb_ary_new_from_args(1, MAKE_AST_NODE(DirectiveLocation, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3))); } -#line 2827 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2840 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 161: /* directive_locations: directive_locations PIPE name */ -#line 728 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 163: /* directive_locations: directive_locations PIPE name */ +#line 732 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { rb_ary_push(yyval, MAKE_AST_NODE(DirectiveLocation, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3))); } -#line 2833 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2846 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 164: /* schema_extension: EXTEND SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY */ -#line 736 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 166: /* schema_extension: EXTEND SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY */ +#line 740 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(SchemaExtension, 6, rb_ary_entry(yyvsp[-5], 1), @@ -2845,11 +2858,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-3] ); } -#line 2849 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2862 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 165: /* schema_extension: EXTEND SCHEMA directives_list */ -#line 747 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 167: /* schema_extension: EXTEND SCHEMA directives_list */ +#line 751 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(SchemaExtension, 6, rb_ary_entry(yyvsp[-2], 1), @@ -2860,11 +2873,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2864 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2877 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 172: /* scalar_type_extension: EXTEND SCALAR name directives_list */ -#line 766 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 174: /* scalar_type_extension: EXTEND SCALAR name directives_list */ +#line 770 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(ScalarTypeExtension, 4, rb_ary_entry(yyvsp[-3], 1), @@ -2873,11 +2886,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2877 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2890 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 173: /* object_type_extension: EXTEND TYPE_LITERAL name implements_opt directives_list_opt field_definition_list_opt */ -#line 776 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 175: /* object_type_extension: EXTEND TYPE_LITERAL name implements_opt directives_list_opt field_definition_list_opt */ +#line 780 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(ObjectTypeExtension, 6, rb_ary_entry(yyvsp[-5], 1), @@ -2888,11 +2901,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2892 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2905 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 174: /* interface_type_extension: EXTEND INTERFACE name implements_opt directives_list_opt field_definition_list_opt */ -#line 788 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 176: /* interface_type_extension: EXTEND INTERFACE name implements_opt directives_list_opt field_definition_list_opt */ +#line 792 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(InterfaceTypeExtension, 6, rb_ary_entry(yyvsp[-5], 1), @@ -2903,11 +2916,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2907 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2920 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 175: /* union_type_extension: EXTEND UNION name directives_list_opt EQUALS union_members */ -#line 800 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 177: /* union_type_extension: EXTEND UNION name directives_list_opt EQUALS union_members */ +#line 804 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(UnionTypeExtension, 5, rb_ary_entry(yyvsp[-5], 1), @@ -2917,11 +2930,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-2] ); } -#line 2921 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2934 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 176: /* union_type_extension: EXTEND UNION name directives_list */ -#line 809 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 178: /* union_type_extension: EXTEND UNION name directives_list */ +#line 813 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(UnionTypeExtension, 5, rb_ary_entry(yyvsp[-3], 1), @@ -2931,11 +2944,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[0] ); } -#line 2935 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2948 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 177: /* enum_type_extension: EXTEND ENUM name directives_list_opt LCURLY enum_value_definitions RCURLY */ -#line 820 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 179: /* enum_type_extension: EXTEND ENUM name directives_list_opt LCURLY enum_value_definitions RCURLY */ +#line 824 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(EnumTypeExtension, 5, rb_ary_entry(yyvsp[-6], 1), @@ -2945,11 +2958,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2949 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2962 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 178: /* enum_type_extension: EXTEND ENUM name directives_list */ -#line 829 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 180: /* enum_type_extension: EXTEND ENUM name directives_list */ +#line 833 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(EnumTypeExtension, 5, rb_ary_entry(yyvsp[-3], 1), @@ -2959,11 +2972,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); GraphQL_Language_Nodes_NONE ); } -#line 2963 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2976 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 179: /* input_object_type_extension: EXTEND INPUT name directives_list_opt LCURLY input_value_definition_list RCURLY */ -#line 840 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 181: /* input_object_type_extension: EXTEND INPUT name directives_list_opt LCURLY input_value_definition_list RCURLY */ +#line 844 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(InputObjectTypeExtension, 5, rb_ary_entry(yyvsp[-6], 1), @@ -2973,11 +2986,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); yyvsp[-1] ); } -#line 2977 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 2990 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; - case 180: /* input_object_type_extension: EXTEND INPUT name directives_list */ -#line 849 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" + case 182: /* input_object_type_extension: EXTEND INPUT name directives_list */ +#line 853 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" { yyval = MAKE_AST_NODE(InputObjectTypeExtension, 5, rb_ary_entry(yyvsp[-3], 1), @@ -2987,11 +3000,11 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); GraphQL_Language_Nodes_NONE ); } -#line 2991 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 3004 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" break; -#line 2995 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" +#line 3008 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c" default: break; } @@ -3215,7 +3228,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); return yyresult; } -#line 859 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" +#line 863 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y" // Custom functions diff --git a/graphql-c_parser/ext/graphql_c_parser_ext/parser.y b/graphql-c_parser/ext/graphql_c_parser_ext/parser.y index 82f38c2f8c..53d5f043bf 100644 --- a/graphql-c_parser/ext/graphql_c_parser_ext/parser.y +++ b/graphql-c_parser/ext/graphql_c_parser_ext/parser.y @@ -479,18 +479,22 @@ type_system_definition: | directive_definition schema_definition: - SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY { + SCHEMA directives_list_opt operation_type_definition_list_opt { $$ = MAKE_AST_NODE(SchemaDefinition, 6, rb_ary_entry($1, 1), rb_ary_entry($1, 2), // TODO use static strings: - rb_hash_aref($4, rb_str_new_cstr("query")), - rb_hash_aref($4, rb_str_new_cstr("mutation")), - rb_hash_aref($4, rb_str_new_cstr("subscription")), + rb_hash_aref($3, rb_str_new_cstr("query")), + rb_hash_aref($3, rb_str_new_cstr("mutation")), + rb_hash_aref($3, rb_str_new_cstr("subscription")), $2 ); } + operation_type_definition_list_opt: + /* none */ { $$ = rb_hash_new(); } + | LCURLY operation_type_definition_list RCURLY { $$ = $2; } + operation_type_definition_list: operation_type_definition { $$ = rb_hash_new();