mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
Fix code review findings in 'endregion' directives
This commit is contained in:
@@ -240,11 +240,11 @@ class RegionDirective extends PreprocessorDirective, @directive_region {
|
||||
}
|
||||
|
||||
/**
|
||||
* A `#endregion` directive.
|
||||
* An `#endregion` directive.
|
||||
*/
|
||||
class EndRegionDirective extends PreprocessorDirective, @directive_endregion {
|
||||
/** Gets the opening `#region` directive. */
|
||||
RegionDirective getStart() { regions(result, this) }
|
||||
RegionDirective getStart() { result.getEnd() = this }
|
||||
|
||||
override string toString() { result = "#endregion" }
|
||||
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
regionDirectives
|
||||
| trivia.cs:36:9:36:22 | #region ... | fields | trivia.cs:41:9:41:18 | #endregion |
|
||||
| trivia.cs:38:9:38:22 | #region ... | nested | trivia.cs:40:9:40:18 | #endregion |
|
||||
endregions
|
||||
| trivia.cs:40:9:40:18 | #endregion | trivia.cs:38:9:38:22 | #region ... |
|
||||
| trivia.cs:41:9:41:18 | #endregion | trivia.cs:36:9:36:22 | #region ... |
|
||||
|
||||
@@ -4,5 +4,3 @@ query predicate regionDirectives(RegionDirective d, string name, EndRegionDirect
|
||||
d.getName() = name and
|
||||
d.getEnd() = end
|
||||
}
|
||||
|
||||
query predicate endregions(EndRegionDirective d, RegionDirective start) { d.getStart() = start }
|
||||
|
||||
Reference in New Issue
Block a user