comparison gcc/ada/libgnat/a-coorse.adb @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
4 -- -- 4 -- --
5 -- A D A . C O N T A I N E R S . O R D E R E D _ S E T S -- 5 -- A D A . C O N T A I N E R S . O R D E R E D _ S E T S --
6 -- -- 6 -- --
7 -- B o d y -- 7 -- B o d y --
8 -- -- 8 -- --
9 -- Copyright (C) 2004-2017, Free Software Foundation, Inc. -- 9 -- Copyright (C) 2004-2018, Free Software Foundation, Inc. --
10 -- -- 10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under -- 11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- -- 12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- 13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
478 begin 478 begin
479 if Checks and then Position.Node = null then 479 if Checks and then Position.Node = null then
480 raise Constraint_Error with "Position cursor equals No_Element"; 480 raise Constraint_Error with "Position cursor equals No_Element";
481 end if; 481 end if;
482 482
483 if Checks
484 and then (Left (Position.Node) = Position.Node
485 or else
486 Right (Position.Node) = Position.Node)
487 then
488 raise Program_Error with "dangling cursor";
489 end if;
490
483 pragma Assert (Vet (Position.Container.Tree, Position.Node), 491 pragma Assert (Vet (Position.Container.Tree, Position.Node),
484 "bad cursor in Element"); 492 "bad cursor in Element");
485 493
486 return Position.Node.Element; 494 return Position.Node.Element;
487 end Element; 495 end Element;