@@ -208,21 +208,40 @@ class HiddenLineDirective extends LineDirective {
208
208
override string getAPrimaryQlClass ( ) { result = "HiddenLineDirective" }
209
209
}
210
210
211
+ abstract private class NumericOrSpanLineDirective extends LineDirective {
212
+ /** Gets the referenced file of this directive. */
213
+ File getReferencedFile ( ) { directive_line_file ( this , result ) }
214
+ }
215
+
211
216
/**
212
- * A numeric `#line` directive, such as `#line 200 file`
217
+ * A numeric `#line` directive, such as `#line 200 file`.
213
218
*/
214
- class NumericLineDirective extends LineDirective {
219
+ class NumericLineDirective extends NumericOrSpanLineDirective {
215
220
NumericLineDirective ( ) { directive_lines ( this , 2 ) }
216
221
217
222
/** Gets the line number of this directive. */
218
223
int getLine ( ) { directive_line_value ( this , result ) }
219
224
220
- /** Gets the referenced file of this directive. */
221
- File getReferencedFile ( ) { directive_line_file ( this , result ) }
222
-
223
225
override string getAPrimaryQlClass ( ) { result = "NumericLineDirective" }
224
226
}
225
227
228
+ /**
229
+ * A line span `#line` directive, such as `#line (1, 1) - (3, 10) 5 file`.
230
+ */
231
+ class SpanLineDirective extends NumericOrSpanLineDirective {
232
+ SpanLineDirective ( ) { directive_lines ( this , 3 ) }
233
+
234
+ /** Gets the offset of this directive. */
235
+ int getOffset ( ) { directive_line_offset ( this , result ) }
236
+
237
+ /** Gets the span of this directive. */
238
+ predicate span ( int startLine , int startColumn , int endLine , int endColumn ) {
239
+ directive_line_span ( this , startLine , startColumn , endLine , endColumn )
240
+ }
241
+
242
+ override string getAPrimaryQlClass ( ) { result = "SpanLineDirective" }
243
+ }
244
+
226
245
/**
227
246
* A `#region` directive.
228
247
*/
0 commit comments