]> ocean-lang.org Git - ocean/commitdiff
oceani: don't add extra indent for Declare and Assign
authorNeilBrown <neil@brown.name>
Mon, 6 Dec 2021 06:37:09 +0000 (17:37 +1100)
committerNeilBrown <neil@brown.name>
Wed, 8 Dec 2021 04:56:59 +0000 (15:56 +1100)
when printing a declaration or assignment we indent the whole statement,
but NOT the individual parts.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani.mdc

index 5dee6d24c06ed4d99130e7569b16c7ee508a94b6..2398fb3bb87b4f8c04c1ddb49f67baa64ce64071 100644 (file)
@@ -4293,9 +4293,9 @@ it is declared, and error will be raised as the name is created as
 
        case Assign:
                do_indent(indent, "");
 
        case Assign:
                do_indent(indent, "");
-               print_exec(b->left, indent, bracket);
+               print_exec(b->left, -1, bracket);
                printf(" = ");
                printf(" = ");
-               print_exec(b->right, indent, bracket);
+               print_exec(b->right, -1, bracket);
                if (indent >= 0)
                        printf("\n");
                break;
                if (indent >= 0)
                        printf("\n");
                break;
@@ -4304,7 +4304,7 @@ it is declared, and error will be raised as the name is created as
                {
                struct variable *v = cast(var, b->left)->var;
                do_indent(indent, "");
                {
                struct variable *v = cast(var, b->left)->var;
                do_indent(indent, "");
-               print_exec(b->left, indent, bracket);
+               print_exec(b->left, -1, bracket);
                if (cast(var, b->left)->var->constant) {
                        printf("::");
                        if (v->explicit_type) {
                if (cast(var, b->left)->var->constant) {
                        printf("::");
                        if (v->explicit_type) {
@@ -4320,7 +4320,7 @@ it is declared, and error will be raised as the name is created as
                }
                if (b->right) {
                        printf("= ");
                }
                if (b->right) {
                        printf("= ");
-                       print_exec(b->right, indent, bracket);
+                       print_exec(b->right, -1, bracket);
                }
                if (indent >= 0)
                        printf("\n");
                }
                if (indent >= 0)
                        printf("\n");