Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ than the value passed to :ada:`X`.

Consider a client calling this function:

.. code:: ada prove_button project=Courses.Ada_For_Embedded_C_Dev.SPARK.Contracts_2 switches=Compiler(-gnato23);
:class: ada-expect-prove-error
.. code:: ada no_button gnatprove=14.1.0-1 project=Courses.Ada_For_Embedded_C_Dev.SPARK.Contracts_2 switches=Compiler(-gnato23);
:class: ada-prove, ada-expect-prove-error

with Mid;
with Ada.Text_IO; use Ada.Text_IO;
Expand All @@ -784,7 +784,8 @@ elsewhere.)
Let's change the argument passed to :ada:`Y` in the second call (line 8).
Instead of -1 we will pass -2:

.. code:: ada prove_button project=Courses.Ada_For_Embedded_C_Dev.SPARK.Contracts_3 switches=Compiler(-gnato23);
.. code:: ada no_button gnatprove=14.1.0-1 project=Courses.Ada_For_Embedded_C_Dev.SPARK.Contracts_3 switches=Compiler(-gnato23);
:class: ada-prove

with Mid;
with Ada.Text_IO; use Ada.Text_IO;
Expand Down
21 changes: 7 additions & 14 deletions content/courses/advanced-ada/parts/control_flow/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,7 @@ For example, if we use :ada:`+` as the operator and :ada:`0` an the initial
value, we get the reduction expression: :ada:`0 + 2 + 3 + 4 = 9`. This can be
implemented using an array:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Simple_Reduction_Expression switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Simple_Reduction_Expression switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down Expand Up @@ -989,8 +988,7 @@ a single value |mdash| in this case, an integer value that is stored in

Naturally, we can reduce the array using the :ada:`*` operator:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Simple_Reduction_Expression switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Simple_Reduction_Expression switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down Expand Up @@ -1025,8 +1023,7 @@ which consist of an iterated element association |mdash| for example,
:ada:`[for I in 1 .. 3 => I + 1]`. We can simply *append* the reduction
expression to a value sequence:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Reduction_Expression_Value_Sequences switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Reduction_Expression_Value_Sequences switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down Expand Up @@ -1057,8 +1054,7 @@ In the previous examples, we've used standard operators such as :ada:`+` and
:ada:`*` as the reducer. We can, however, write our own reducers and pass
them to the :ada:`Reduce` attribute. For example:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Custom_Reducer_Procedure switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Custom_Reducer_Procedure switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down Expand Up @@ -1118,8 +1114,7 @@ In the example above, we've implemented the reducer as a procedure. However, we
can also implement it as a function. In this case, the accumulated value is
returned by the function:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Custom_Reducer_Function switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Custom_Reducer_Function switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down Expand Up @@ -1171,8 +1166,7 @@ Other accumulator types
The accumulator type isn't restricted to scalars: in fact, we could use record
types as well. For example:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Reducer_Integer_Accumulator switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Reducer_Integer_Accumulator switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down Expand Up @@ -1225,8 +1219,7 @@ Also, we're not limited to numeric types: we can also create a reducer using
strings as the accumulator type. In fact, we can display the initial value and
the elements of the list by using unbounded strings:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Reducer_String_Accumulator switches=Compiler(-gnatX)
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Control_Flow.Expressions.Reduction_Expressions.Reducer_String_Accumulator switches=Compiler(-gnatX)

with Ada.Text_IO; use Ada.Text_IO;

Expand Down
7 changes: 1 addition & 6 deletions content/courses/advanced-ada/parts/data_types/strings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2017,8 +2017,7 @@ Types that are derived from a tagged type may also inherit the :ada:`Put_Image`
aspect. However, there are a couple of small differences in comparison to
untagged types, as we can see in the following example:

.. code:: ada no_button gnat=12.2.0-1 project=Courses.Advanced_Ada.Data_Types.Strings.Put_Image.Tagged_Put_Image switches=Compiler(-gnat2022);
:class: ada-run
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Strings.Put_Image.Tagged_Put_Image switches=Compiler(-gnat2022);

with Ada.Strings.Text_Buffers;

Expand Down Expand Up @@ -2107,10 +2106,6 @@ code, we see that:
:ada:`Put_Image` aspect (the :ada:`Put_Image_T` procedure) is called and its
information is combined with the information from the type extension;

- The information from the parent's :ada:`Put_Image_T` procedure is
presented in an aggregate syntax |mdash| in this case, this results in
``(Put_Image_T)``.

- For the :ada:`T_Child_1` type, the :ada:`I1` component of the type
extension is displayed by calling a default version of the
:ada:`Put_Image` procedure for that component |mdash|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ two scenarios:

Let's see a complete code example:

.. code:: ada run_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Empty switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Empty switches=Compiler(-gnat2022);
:class: ada-run

package Custom_Container_Aggregates is

Expand Down Expand Up @@ -216,7 +217,8 @@ can confirm this by running this example and seeing the

We can also use a constant for the :ada:`Empty` element instead of a function:

.. code:: ada compile_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Empty_Const switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Empty_Const switches=Compiler(-gnat2022);
:class: ada-compile

package Custom_Container_Aggregates is

Expand Down Expand Up @@ -248,7 +250,8 @@ needed.
In addition to this, we can specify a signed integer parameter |mdash| which
indicates the number of components |mdash| for the :ada:`Empty` function:

.. code:: ada run_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Empty switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Empty switches=Compiler(-gnat2022);
:class: ada-run

package Custom_Container_Aggregates is

Expand Down Expand Up @@ -333,7 +336,8 @@ of these elements: :ada:`Add_Unnamed`, :ada:`New_Indexed` or
:ada:`Assign_Indexed`. In other words, when we specify the :ada:`Add_Named`
element, we can only use the :ada:`Empty` element in the same declaration.

.. code:: ada run_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Named switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Named switches=Compiler(-gnat2022);
:class: ada-run

package Custom_Container_Aggregates is

Expand Down Expand Up @@ -437,7 +441,8 @@ procedure that is called when we have a positional container aggregate.

Let's look at an example:

.. code:: ada run_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Unnamed switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Unnamed switches=Compiler(-gnat2022);
:class: ada-run

package Custom_Container_Aggregates is

Expand Down Expand Up @@ -529,7 +534,8 @@ that, when we specify the :ada:`Assign_Indexed` element, we must also use the

Let's look at an example:

.. code:: ada run_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Indexed switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Indexed switches=Compiler(-gnat2022);
:class: ada-run

package Custom_Container_Aggregates is

Expand Down Expand Up @@ -678,7 +684,8 @@ As mentioned previously, we may specify both :ada:`Add_Named` and
:ada:`Assign_Indexed` elements together in the same aspect declaration. For
example:

.. code:: ada run_button project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Unnamed_Indexed switches=Compiler(-gnat2022);
.. code:: ada no_button gnat=14.2.0-1 project=Courses.Advanced_Ada.Aggregates.Container_Aggregate_Unnamed_Indexed switches=Compiler(-gnat2022);
:class: ada-run

package Custom_Container_Aggregates is

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ Example #3
procedure Adjust is
Cur_Speed : constant Float := Speed;
begin
if abs (Cur_Speed) > 100.0 then
if abs Cur_Speed > 100.0 then
Motor := Motor - 1.0;
end if;
end Adjust;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ variables of the :ada:`Complex` type and initialize them using an aggregate:
Put ("Modulus of ");
Put (X);
Put (" is ");
Put (Float'Image (abs (X)));
Put (Float'Image (abs X));
New_Line;

Put ("Argument of ");
Expand Down
12 changes: 6 additions & 6 deletions frontend/py_modules/code_projects/toolchain.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ selected = /opt/ada/selected
default = /opt/ada/default

[default_version]
gnat = 14.2.0-1
gnatprove = 14.1.0-1
gprbuild = 24.0.0-2
gnat = 15.1.0-2
gnatprove = 15.1.0-1
gprbuild = 25.0.0-1

[toolchains]
gnat = 12.2.0-1 14.2.0-1
gnatprove = 12.1.0-1 14.1.0-1
gprbuild = 22.0.0-1 24.0.0-2
gnat = 12.2.0-1 14.2.0-1 15.1.0-2
gnatprove = 12.1.0-1 14.1.0-1 15.1.0-1
gprbuild = 22.0.0-1 24.0.0-2 25.0.0-1
Loading