Commit f2f55652 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ fix for statementblocks that only contain other statementblocks...

+ fix for statementblocks that only contain other statementblocks (checkLocalDefinitionsComeFirstAll)
parent 413868a9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -713,7 +713,13 @@ class CodeStyleValidator extends AbstractDeclarativeValidator {

		if (function !== null) {
			if (function.statement !== null && function.statement.defOrStatementList !== null) {
				var last = function.statement.defOrStatementList.defOrStatement.filter[it instanceof FunctionBodyDef].toList.last
				//TODO: last not available?
				var defs = function.statement.defOrStatementList.defOrStatement.filter[it instanceof FunctionBodyDef].toList
				if (defs.isEmpty) {
					//TODO: handle nested definitions?
					return;
				}
				var last = defs.last
				var statements = function.statement.defOrStatementList.defOrStatement.filter[it instanceof FunctionStatement].toList
				if (!statements.isEmpty) {
					var firstStatement = statements.first