C++: Autoformat.

This commit is contained in:
Geoffrey White
2021-06-07 11:01:00 +01:00
parent 799e19bdc2
commit 6f05fd4839
3 changed files with 9 additions and 4 deletions

View File

@@ -128,7 +128,9 @@ deprecated library class LocationExpr extends Location, @location_expr { }
* Gets the length of the longest line in file `f`.
*/
pragma[nomagic]
private int maxCols(File f) { result = max(Location l | l.getFile() = f | l.getStartColumn().maximum(l.getEndColumn())) }
private int maxCols(File f) {
result = max(Location l | l.getFile() = f | l.getStartColumn().maximum(l.getEndColumn()))
}
/**
* A C/C++ element that has a location in a file

View File

@@ -4,4 +4,5 @@ from File f, Expr e, Location l, int start, int end
where
e.getLocation() = l and
l.charLoc(f, start, end)
select f.getBaseName(), e.toString(), start, end, concat(Expr e2, Location l2 | e2.getLocation() = l2 and l.subsumes(l2) | e2.toString(), ", ")
select f.getBaseName(), e.toString(), start, end,
concat(Expr e2, Location l2 | e2.getLocation() = l2 and l.subsumes(l2) | e2.toString(), ", ")

View File

@@ -11,8 +11,10 @@ class Link extends Top {
* Gets the length of the longest line in file `f`.
*/
pragma[nomagic]
private int maxCols(File f) { result = max(Location l | l.getFile() = f | l.getStartColumn().maximum(l.getEndColumn())) }
private int maxCols(File f) {
result = max(Location l | l.getFile() = f | l.getStartColumn().maximum(l.getEndColumn()))
}
/**
* Gets the location of an element that has a link-to-definition (in a similar manner to
* `Location.charLoc`)