C#: Autoformat follow-up changes

This commit is contained in:
Tom Hvitved
2019-01-02 13:50:38 +01:00
parent daa45322b1
commit f187e7444c
10 changed files with 29 additions and 36 deletions

View File

@@ -16,6 +16,6 @@ where
c.isSourceDeclaration() and
n = count(Stmt s |
s.getEnclosingCallable() = c and
s != c.getAChild()
) // we do not count the top-level block
s != c.getAChild() // we do not count the top-level block
)
select c, n order by n desc

View File

@@ -14,8 +14,8 @@ import csharp
/**
* The parent of a statement, excluding some common cases that don't really make
* sense for nesting depth. An example is: "if (...) { } else if (...) { }: we don't
* consider the second if nested. Blocks are also skipped
* sense for nesting depth. An example is: "if (...) { } else if (...) { }: we don't
* consider the second if nested. Blocks are also skipped
*/
predicate realParent(Stmt inner, Stmt outer) {
if skipParent(inner) then realParent(inner.getParent(), outer) else outer = inner.getParent()
@@ -23,7 +23,7 @@ predicate realParent(Stmt inner, Stmt outer) {
predicate skipParent(Stmt s) {
exists(Stmt parent | parent = s.getParent() |
(s instanceof IfStmt and (parent.(IfStmt)).getElse() = s)
s instanceof IfStmt and parent.(IfStmt).getElse() = s
or
parent instanceof BlockStmt
)