File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ class LineDirective extends PreprocessorDirective, @directive_line {
163163 /** Gets the succeeding `#line` directive in the file, if any. */
164164 LineDirective getSuccLineDirective ( ) {
165165 result =
166- rank [ 1 ] ( LineDirective next |
166+ min ( LineDirective next |
167167 next .getFile ( ) = this .getFile ( ) and
168168 next .getLocation ( ) .getStartLine ( ) > this .getLocation ( ) .getStartLine ( )
169169 |
@@ -216,10 +216,10 @@ class NumericLineDirective extends LineDirective {
216216 int getLine ( ) { directive_line_values ( this , result , _) }
217217
218218 /** Holds if this directive specifies a file name. */
219- predicate hasFileName ( ) { this .getFileName ( ) != "" }
219+ predicate hasFileName ( ) { exists ( this .getFileName ( ) ) }
220220
221- /** Gets the file name of this directive. */
222- string getFileName ( ) { directive_line_values ( this , _, result ) }
221+ /** Gets the file name of this directive, if any . */
222+ string getFileName ( ) { directive_line_values ( this , _, result ) and result != "" }
223223
224224 override string getAPrimaryQlClass ( ) { result = "NumericLineDirective" }
225225}
Original file line number Diff line number Diff line change 44| trivia.cs:25:1:25:38 | #line hidden |
55lines
66| trivia.cs:18:1:18:19 | #line ... | 200 | Special |
7- | trivia.cs:27:1:27:9 | #line ... | 300 | |
7+ | trivia.cs:27:1:27:9 | #line ... | 300 | no file |
88succ
99| trivia.cs:18:1:18:19 | #line ... | trivia.cs:21:1:21:13 | #line default |
1010| trivia.cs:21:1:21:13 | #line default | trivia.cs:25:1:25:38 | #line hidden |
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ query predicate default(DefaultLineDirective line) { any() }
55query predicate hidden ( HiddenLineDirective line ) { any ( ) }
66
77query predicate lines ( NumericLineDirective line , int l , string file ) {
8- line .getLine ( ) = l and line .getFileName ( ) = file
8+ line .getLine ( ) = l and
9+ if line .hasFileName ( ) then line .getFileName ( ) = file else file = "no file"
910}
1011
1112query predicate succ ( LineDirective d , LineDirective succ ) { d .getSuccLineDirective ( ) = succ }
You can’t perform that action at this time.
0 commit comments