@@ -105,7 +105,7 @@ impl SourceLoc for PythonCode {
105105 let start = init ( node, stats, is_func_space, is_unit) ;
106106
107107 match node. kind_id ( ) . into ( ) {
108- Comment | String | DQUOTE | DQUOTE2 | ExpressionStatement | Block => { }
108+ Comment | String | DQUOTE | DQUOTE2 | ExpressionStatement | Block | Module => { }
109109 _ => {
110110 stats. lines . insert ( start) ;
111111 }
@@ -120,7 +120,7 @@ impl SourceLoc for MozjsCode {
120120 let start = init ( node, stats, is_func_space, is_unit) ;
121121
122122 match node. kind_id ( ) . into ( ) {
123- Comment | String | DQUOTE | ExpressionStatement | StatementBlock => { }
123+ Comment | String | DQUOTE | ExpressionStatement | StatementBlock | Program => { }
124124 _ => {
125125 stats. lines . insert ( start) ;
126126 }
@@ -135,7 +135,7 @@ impl SourceLoc for JavascriptCode {
135135 let start = init ( node, stats, is_func_space, is_unit) ;
136136
137137 match node. kind_id ( ) . into ( ) {
138- Comment | String | DQUOTE | ExpressionStatement | StatementBlock => { }
138+ Comment | String | DQUOTE | ExpressionStatement | StatementBlock | Program => { }
139139 _ => {
140140 stats. lines . insert ( start) ;
141141 }
@@ -150,7 +150,7 @@ impl SourceLoc for TypescriptCode {
150150 let start = init ( node, stats, is_func_space, is_unit) ;
151151
152152 match node. kind_id ( ) . into ( ) {
153- Comment | String | DQUOTE | ExpressionStatement | StatementBlock => { }
153+ Comment | String | DQUOTE | ExpressionStatement | StatementBlock | Program => { }
154154 _ => {
155155 stats. lines . insert ( start) ;
156156 }
@@ -165,7 +165,7 @@ impl SourceLoc for TsxCode {
165165 let start = init ( node, stats, is_func_space, is_unit) ;
166166
167167 match node. kind_id ( ) . into ( ) {
168- Comment | String | DQUOTE | ExpressionStatement | StatementBlock => { }
168+ Comment | String | DQUOTE | ExpressionStatement | StatementBlock | Program => { }
169169 _ => {
170170 stats. lines . insert ( start) ;
171171 }
0 commit comments