Changeset 377


Ignore:
Timestamp:
Jan 5, 2015, 3:06:57 PM (6 years ago)
Author:
Maxim Reznik
Message:

Add Join_New_Line shortcut

Location:
trunk/compiler/source/compiler
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/compiler/source/compiler/gela-properties-text.adb

    r325 r377  
    110110   end Join;
    111111
     112   -------------------
     113   -- Join_New_Line --
     114   -------------------
     115
     116   function Join_New_Line
     117     (Self  : access Text_Container;
     118      Left  : Text) return Text is
     119   begin
     120      return Self.Join (Left, Self.New_Line);
     121   end Join_New_Line;
     122
    112123   -----------
    113124   -- Value --
  • trunk/compiler/source/compiler/gela-properties-text.ads

    r325 r377  
    3838      Left  : Text;
    3939      Right : Natural) return Text;
     40
     41   function Join_New_Line
     42     (Self  : access Text_Container;
     43      Left  : Text) return Text;
    4044
    4145   function Value
  • trunk/compiler/source/compiler/gela-rule-declarations-subprogram.adb

    r375 r377  
    3939      Result := Engine.Text_Container.Join (Result, ")");
    4040
    41       Result := Engine.Text_Container.Join
    42         (Result, Engine.Text_Container.New_Line);
     41      Result := Engine.Text_Container.Join_New_Line (Result);
    4342
    4443      return Result;
  • trunk/compiler/source/compiler/gela-rule-declarations-subprogram_body.adb

    r376 r377  
    2424      Result := Engine.Text_Container.Literal
    2525        ("%_ada_string = type { i8*, i32, i32 }");
    26       Result := Engine.Text_Container.Join
    27         (Result, Engine.Text_Container.New_Line);
     26      Result := Engine.Text_Container.Join_New_Line (Result);
    2827
    2928      Result := Engine.Text_Container.Join
    3029        (Result, "declare void @llvm.trap() noreturn nounwind");
    3130
    32       Result := Engine.Text_Container.Join
    33         (Result, Engine.Text_Container.New_Line);
     31      Result := Engine.Text_Container.Join_New_Line (Result);
    3432
    3533      Result := Engine.Text_Container.Join
    3634        (Result,
    3735         "declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)");
     36
     37      Result := Engine.Text_Container.Join_New_Line (Result);
    3838
    3939      Result := Engine.Text_Container.Join
     
    4747      Result := Engine.Text_Container.Join (Result, " () {");
    4848
    49       Result := Engine.Text_Container.Join
    50         (Result, Engine.Text_Container.New_Line);
     49      Result := Engine.Text_Container.Join_New_Line (Result);
    5150
    5251      for J in List'Range loop
     
    5756      Result := Engine.Text_Container.Join (Result, " ret void");
    5857
    59       Result := Engine.Text_Container.Join
    60         (Result, Engine.Text_Container.New_Line);
     58      Result := Engine.Text_Container.Join_New_Line (Result);
    6159
    6260      Result := Engine.Text_Container.Join (Result, "}");
  • trunk/compiler/source/compiler/gela-rule-declarations-variable.adb

    r375 r377  
    3434            " i32 0, i32 ");
    3535         Result := Engine.Text_Container.Join (Result, Index);
    36          Result := Engine.Text_Container.Join
    37            (Result, Engine.Text_Container.New_Line);
     36         Result := Engine.Text_Container.Join_New_Line (Result);
    3837         Result := Engine.Text_Container.Join (Result, " store ");
    3938         Result := Engine.Text_Container.Join (Result, Item_Tp);
     
    4443         Result := Engine.Text_Container.Join (Result, "* %");
    4544         Result := Engine.Text_Container.Join (Result, Tmp);
    46          Result := Engine.Text_Container.Join
    47            (Result, Engine.Text_Container.New_Line);
     45         Result := Engine.Text_Container.Join_New_Line (Result);
    4846      end Store;
    4947
     
    6664         Result := Engine.Text_Container.Join
    6765           (Result, Engine.Get (Subtp, Gela.Properties.Length));
    68          Result := Engine.Text_Container.Join
    69            (Result, Engine.Text_Container.New_Line);
     66         Result := Engine.Text_Container.Join_New_Line (Result);
    7067
    7168         Result := Engine.Text_Container.Join (Result, Name);
    7269         Result := Engine.Text_Container.Join
    7370           (Result, " = alloca %_ada_string");
    74          Result := Engine.Text_Container.Join
    75            (Result, Engine.Text_Container.New_Line);
     71         Result := Engine.Text_Container.Join_New_Line (Result);
    7672
    7773         Name := Engine.Text_Container.Join (Name, ".address");
     
    8278      end loop;
    8379
    84       Result := Engine.Text_Container.Join
    85         (Result, Engine.Text_Container.New_Line);
     80      Result := Engine.Text_Container.Join_New_Line (Result);
    8681
    8782      return Result;
  • trunk/compiler/source/compiler/gela-rule-expressions.adb

    r375 r377  
    6161         Result := Engine.Text_Container.Join (Result, "}");
    6262
    63          Result := Engine.Text_Container.Join
    64            (Result, Engine.Text_Container.New_Line);
     63         Result := Engine.Text_Container.Join_New_Line (Result);
    6564
    6665         Result := Engine.Text_Container.Join (Result, "@_str.data");
     
    7473         Result := Engine.Text_Container.Join (Result, """");
    7574
    76          Result := Engine.Text_Container.Join
    77            (Result, Engine.Text_Container.New_Line);
     75         Result := Engine.Text_Container.Join_New_Line (Result);
    7876
    7977         return Result;
  • trunk/compiler/source/compiler/gela-rule-statements-assignment.adb

    r376 r377  
    6161         Result := Engine.Text_Container.Join (Result, ", %");
    6262         Result := Engine.Text_Container.Join (Result, Lower_Value);
    63          Result := Engine.Text_Container.Join
    64            (Result, Engine.Text_Container.New_Line);
     63         Result := Engine.Text_Container.Join_New_Line (Result);
    6564
    6665         Output := Engine.Unique;
     
    7170         Result := Engine.Text_Container.Join (Result, Diff_Value);
    7271         Result := Engine.Text_Container.Join (Result, ", 1");
    73          Result := Engine.Text_Container.Join
    74            (Result, Engine.Text_Container.New_Line);
     72         Result := Engine.Text_Container.Join_New_Line (Result);
    7573      end Write_Length;
    7674
     
    9694         Result := Engine.Text_Container.Join (Result, ", i32 0, i32 ");
    9795         Result := Engine.Text_Container.Join (Result, Index);
    98          Result := Engine.Text_Container.Join
    99            (Result, Engine.Text_Container.New_Line);
     96         Result := Engine.Text_Container.Join_New_Line (Result);
    10097
    10198         Result := Engine.Text_Container.Join (Result, " %");
     
    105102         Result := Engine.Text_Container.Join (Result, " %");
    106103         Result := Engine.Text_Container.Join (Result, Item_Address);
    107          Result := Engine.Text_Container.Join
    108            (Result, Engine.Text_Container.New_Line);
     104         Result := Engine.Text_Container.Join_New_Line (Result);
    109105
    110106         Output := Item_Value;
     
    130126         Result := Engine.Text_Container.Join (Result, ", %");
    131127         Result := Engine.Text_Container.Join (Result, Right);
    132          Result := Engine.Text_Container.Join
    133            (Result, Engine.Text_Container.New_Line);
     128         Result := Engine.Text_Container.Join_New_Line (Result);
    134129
    135130         Result := Engine.Text_Container.Join (Result, " br i1 %");
     
    139134         Result := Engine.Text_Container.Join (Result, ", label %");
    140135         Result := Engine.Text_Container.Join (Result, Success);
    141          Result := Engine.Text_Container.Join
    142            (Result, Engine.Text_Container.New_Line);
     136         Result := Engine.Text_Container.Join_New_Line (Result);
    143137
    144138         Result := Engine.Text_Container.Join (Result, "; label ");
    145139         Result := Engine.Text_Container.Join (Result, Fail);
    146140         Result := Engine.Text_Container.Join (Result, ":");
    147          Result := Engine.Text_Container.Join
    148            (Result, Engine.Text_Container.New_Line);
     141         Result := Engine.Text_Container.Join_New_Line (Result);
    149142
    150143         Result := Engine.Text_Container.Join
    151144           (Result, " call void @llvm.trap() unreachable");
    152          Result := Engine.Text_Container.Join
    153            (Result, Engine.Text_Container.New_Line);
     145         Result := Engine.Text_Container.Join_New_Line (Result);
    154146
    155147         Result := Engine.Text_Container.Join (Result, "; label ");
    156148         Result := Engine.Text_Container.Join (Result, Success);
    157149         Result := Engine.Text_Container.Join (Result, ":");
    158          Result := Engine.Text_Container.Join
    159            (Result, Engine.Text_Container.New_Line);
     150         Result := Engine.Text_Container.Join_New_Line (Result);
    160151      end Write_Check;
    161152
     
    178169         Result := Engine.Text_Container.Join (Result, Length);
    179170         Result := Engine.Text_Container.Join (Result, ", i32 0, i1 0)");
    180          Result := Engine.Text_Container.Join
    181            (Result, Engine.Text_Container.New_Line);
     171         Result := Engine.Text_Container.Join_New_Line (Result);
    182172      end Write_Move;
    183173
     
    204194      Write_Move (Result, Left_Data, Right_Data, Left_Length);
    205195
    206       Result := Engine.Text_Container.Join
    207         (Result, Engine.Text_Container.New_Line);
     196      Result := Engine.Text_Container.Join_New_Line (Result);
    208197
    209198      return Result;
  • trunk/compiler/source/compiler/gela-rule-statements-procedure_call.adb

    r325 r377  
    4646      Result := Engine.Text_Container.Join (Result, ")");
    4747
    48       Result := Engine.Text_Container.Join
    49         (Result, Engine.Text_Container.New_Line);
     48      Result := Engine.Text_Container.Join_New_Line (Result);
    5049
    5150      return Result;
Note: See TracChangeset for help on using the changeset viewer.