@@ -8,7 +8,7 @@ use crate::{
88 value:: { DefaultScalarValue , ScalarValue } ,
99} ;
1010
11- fn parse_document < S > ( s : & str ) -> OwnedDocument < S >
11+ fn parse_document < S > ( s : & str ) -> OwnedDocument < ' _ , S >
1212where
1313 S : ScalarValue ,
1414{
@@ -33,46 +33,44 @@ fn parse_document_error<S: ScalarValue>(s: &str) -> Spanning<ParseError> {
3333fn simple_ast ( ) {
3434 assert_eq ! (
3535 parse_document:: <DefaultScalarValue >(
36- r#"
37- {
36+ r#"{
3837 node(id: 4) {
3938 id
4039 name
4140 }
42- }
43- "#
41+ }"# ,
4442 ) ,
4543 vec![ Definition :: Operation ( Spanning :: start_end(
46- & SourcePosition :: new( 13 , 1 , 12 ) ,
47- & SourcePosition :: new( 124 , 6 , 13 ) ,
44+ & SourcePosition :: new( 0 , 0 , 0 ) ,
45+ & SourcePosition :: new( 111 , 5 , 13 ) ,
4846 Operation {
4947 operation_type: OperationType :: Query ,
5048 name: None ,
5149 variable_definitions: None ,
5250 directives: None ,
5351 selection_set: vec![ Selection :: Field ( Spanning :: start_end(
54- & SourcePosition :: new( 31 , 2 , 16 ) ,
55- & SourcePosition :: new( 110 , 5 , 17 ) ,
52+ & SourcePosition :: new( 18 , 1 , 16 ) ,
53+ & SourcePosition :: new( 97 , 4 , 17 ) ,
5654 Field {
5755 alias: None ,
5856 name: Spanning :: start_end(
59- & SourcePosition :: new( 31 , 2 , 16 ) ,
60- & SourcePosition :: new( 35 , 2 , 20 ) ,
57+ & SourcePosition :: new( 18 , 1 , 16 ) ,
58+ & SourcePosition :: new( 22 , 1 , 20 ) ,
6159 "node" ,
6260 ) ,
6361 arguments: Some ( Spanning :: start_end(
64- & SourcePosition :: new( 35 , 2 , 20 ) ,
65- & SourcePosition :: new( 42 , 2 , 27 ) ,
62+ & SourcePosition :: new( 22 , 1 , 20 ) ,
63+ & SourcePosition :: new( 29 , 1 , 27 ) ,
6664 Arguments {
6765 items: vec![ (
6866 Spanning :: start_end(
69- & SourcePosition :: new( 36 , 2 , 21 ) ,
70- & SourcePosition :: new( 38 , 2 , 23 ) ,
67+ & SourcePosition :: new( 23 , 1 , 21 ) ,
68+ & SourcePosition :: new( 25 , 1 , 23 ) ,
7169 "id" ,
7270 ) ,
7371 Spanning :: start_end(
74- & SourcePosition :: new( 40 , 2 , 25 ) ,
75- & SourcePosition :: new( 41 , 2 , 26 ) ,
72+ & SourcePosition :: new( 27 , 1 , 25 ) ,
73+ & SourcePosition :: new( 28 , 1 , 26 ) ,
7674 graphql_input_value!( 4 ) ,
7775 ) ,
7876 ) ] ,
@@ -81,13 +79,13 @@ fn simple_ast() {
8179 directives: None ,
8280 selection_set: Some ( vec![
8381 Selection :: Field ( Spanning :: start_end(
84- & SourcePosition :: new( 65 , 3 , 20 ) ,
85- & SourcePosition :: new( 67 , 3 , 22 ) ,
82+ & SourcePosition :: new( 52 , 2 , 20 ) ,
83+ & SourcePosition :: new( 54 , 2 , 22 ) ,
8684 Field {
8785 alias: None ,
8886 name: Spanning :: start_end(
89- & SourcePosition :: new( 65 , 3 , 20 ) ,
90- & SourcePosition :: new( 67 , 3 , 22 ) ,
87+ & SourcePosition :: new( 52 , 2 , 20 ) ,
88+ & SourcePosition :: new( 54 , 2 , 22 ) ,
9189 "id" ,
9290 ) ,
9391 arguments: None ,
@@ -96,13 +94,13 @@ fn simple_ast() {
9694 } ,
9795 ) ) ,
9896 Selection :: Field ( Spanning :: start_end(
99- & SourcePosition :: new( 88 , 4 , 20 ) ,
100- & SourcePosition :: new( 92 , 4 , 24 ) ,
97+ & SourcePosition :: new( 75 , 3 , 20 ) ,
98+ & SourcePosition :: new( 79 , 3 , 24 ) ,
10199 Field {
102100 alias: None ,
103101 name: Spanning :: start_end(
104- & SourcePosition :: new( 88 , 4 , 20 ) ,
105- & SourcePosition :: new( 92 , 4 , 24 ) ,
102+ & SourcePosition :: new( 75 , 3 , 20 ) ,
103+ & SourcePosition :: new( 79 , 3 , 24 ) ,
106104 "name" ,
107105 ) ,
108106 arguments: None ,
0 commit comments