@@ -73,114 +73,117 @@ test('markdown -> mdast', (t) => {
7373 type : 'Program' ,
7474 start : 0 ,
7575 end : 35 ,
76- loc : { start : { line : 1 , column : 0 } , end : { line : 2 , column : 17 } } ,
7776 body : [
7877 {
7978 type : 'ImportDeclaration' ,
8079 start : 0 ,
8180 end : 17 ,
82- loc : {
83- start : { line : 1 , column : 0 } ,
84- end : { line : 1 , column : 17 }
85- } ,
8681 specifiers : [
8782 {
8883 type : 'ImportDefaultSpecifier' ,
8984 start : 7 ,
9085 end : 8 ,
91- loc : {
92- start : { line : 1 , column : 7 } ,
93- end : { line : 1 , column : 8 }
94- } ,
9586 local : {
9687 type : 'Identifier' ,
9788 start : 7 ,
9889 end : 8 ,
90+ name : 'a' ,
9991 loc : {
100- start : { line : 1 , column : 7 } ,
101- end : { line : 1 , column : 8 }
92+ start : { line : 1 , column : 7 , offset : 7 } ,
93+ end : { line : 1 , column : 8 , offset : 8 }
10294 } ,
103- name : 'a' ,
10495 range : [ 7 , 8 ]
10596 } ,
97+ loc : {
98+ start : { line : 1 , column : 7 , offset : 7 } ,
99+ end : { line : 1 , column : 8 , offset : 8 }
100+ } ,
106101 range : [ 7 , 8 ]
107102 }
108103 ] ,
109104 source : {
110105 type : 'Literal' ,
111106 start : 14 ,
112107 end : 17 ,
113- loc : {
114- start : { line : 1 , column : 14 } ,
115- end : { line : 1 , column : 17 }
116- } ,
117108 value : 'b' ,
118109 raw : '"b"' ,
110+ loc : {
111+ start : { line : 1 , column : 14 , offset : 14 } ,
112+ end : { line : 1 , column : 17 , offset : 17 }
113+ } ,
119114 range : [ 14 , 17 ]
120115 } ,
116+ loc : {
117+ start : { line : 1 , column : 0 , offset : 0 } ,
118+ end : { line : 1 , column : 17 , offset : 17 }
119+ } ,
121120 range : [ 0 , 17 ]
122121 } ,
123122 {
124123 type : 'ExportNamedDeclaration' ,
125124 start : 18 ,
126125 end : 35 ,
127- loc : {
128- start : { line : 2 , column : 0 } ,
129- end : { line : 2 , column : 17 }
130- } ,
131126 declaration : {
132127 type : 'VariableDeclaration' ,
133128 start : 25 ,
134129 end : 35 ,
135- loc : {
136- start : { line : 2 , column : 7 } ,
137- end : { line : 2 , column : 17 }
138- } ,
139130 declarations : [
140131 {
141132 type : 'VariableDeclarator' ,
142133 start : 29 ,
143134 end : 35 ,
144- loc : {
145- start : { line : 2 , column : 11 } ,
146- end : { line : 2 , column : 17 }
147- } ,
148135 id : {
149136 type : 'Identifier' ,
150137 start : 29 ,
151138 end : 30 ,
139+ name : 'c' ,
152140 loc : {
153- start : { line : 2 , column : 11 } ,
154- end : { line : 2 , column : 12 }
141+ start : { line : 2 , column : 11 , offset : 29 } ,
142+ end : { line : 2 , column : 12 , offset : 30 }
155143 } ,
156- name : 'c' ,
157144 range : [ 29 , 30 ]
158145 } ,
159146 init : {
160147 type : 'Literal' ,
161148 start : 33 ,
162149 end : 35 ,
163- loc : {
164- start : { line : 2 , column : 15 } ,
165- end : { line : 2 , column : 17 }
166- } ,
167150 value : '' ,
168151 raw : '""' ,
152+ loc : {
153+ start : { line : 2 , column : 15 , offset : 33 } ,
154+ end : { line : 2 , column : 17 , offset : 35 }
155+ } ,
169156 range : [ 33 , 35 ]
170157 } ,
158+ loc : {
159+ start : { line : 2 , column : 11 , offset : 29 } ,
160+ end : { line : 2 , column : 17 , offset : 35 }
161+ } ,
171162 range : [ 29 , 35 ]
172163 }
173164 ] ,
174165 kind : 'var' ,
166+ loc : {
167+ start : { line : 2 , column : 7 , offset : 25 } ,
168+ end : { line : 2 , column : 17 , offset : 35 }
169+ } ,
175170 range : [ 25 , 35 ]
176171 } ,
177172 specifiers : [ ] ,
178173 source : null ,
174+ loc : {
175+ start : { line : 2 , column : 0 , offset : 18 } ,
176+ end : { line : 2 , column : 17 , offset : 35 }
177+ } ,
179178 range : [ 18 , 35 ]
180179 }
181180 ] ,
182181 sourceType : 'module' ,
183182 comments : [ ] ,
183+ loc : {
184+ start : { line : 1 , column : 0 , offset : 0 } ,
185+ end : { line : 2 , column : 17 , offset : 35 }
186+ } ,
184187 range : [ 0 , 35 ]
185188 }
186189 }
0 commit comments