From: Jerome St-Louis Date: Mon, 8 Jul 2013 07:57:26 +0000 (-0400) Subject: compiler/libec2: Indentation, empty statements fixes X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=feb5c24c58a3a5e6b1645ddfa664749508c6dd60 compiler/libec2: Indentation, empty statements fixes --- diff --git a/compiler/libec2/src/declarators.ec b/compiler/libec2/src/declarators.ec index 66a3284..29a69fd 100644 --- a/compiler/libec2/src/declarators.ec +++ b/compiler/libec2/src/declarators.ec @@ -86,6 +86,7 @@ public class TypeNameList : ASTList } else { + // Error Recovery if(list) list.Add({}); popAmbiguity(a); diff --git a/compiler/libec2/src/specifiers.ec b/compiler/libec2/src/specifiers.ec index 1ba0f38..f9087b9 100644 --- a/compiler/libec2/src/specifiers.ec +++ b/compiler/libec2/src/specifiers.ec @@ -149,10 +149,13 @@ public class SpecClass : ASTSpecifier } if(definitions) { - PrintLn("\n{"); + PrintLn(""); + printIndent(); + PrintLn("{"); indent++; definitions.print(); indent--; + printIndent(); Print("}"); } } diff --git a/compiler/libec2/src/statements.ec b/compiler/libec2/src/statements.ec index f330202..93d19f2 100644 --- a/compiler/libec2/src/statements.ec +++ b/compiler/libec2/src/statements.ec @@ -96,6 +96,11 @@ public: default: return StmtExpression::parse(); } } + + void print() + { + PrintLn(";"); + } }; public class StmtExpression : ASTStatement @@ -165,7 +170,7 @@ public class StmtCompound : ASTStatement { if(s._class == class(StmtCase)) indent = caseIndent; - if(s._class != class(StmtLabeled)) + if(s._class != class(StmtLabeled) && s._class != class(StmtCompound)) printIndent(); s.print(); if(s._class == class(StmtExpression))