Top Prev Next Up Down TEST

No precompilation needed !

ExOmega.adb


001| with Ada.Text_IO;
002| with Y2018.Text.Core; use Y2018.Text.Core;
003| with Y2018.Text.Core.Str; use Y2018.Text.Core.Str;
004| with Y2018.Text.Core.UTF;
005| with Y2018.Text.Jets; use Y2018.Text.Jets;
006| with Y2018.Text.Jets.MatchPack;
007| with Y2018.Text.Jets.PatternPack;
008| procedure ExOmega is
009| __patternvalue : String:="^.*?(O[\w]*).*";
010| __sourcevalue : String:="ExOmega procedure";
011| __m : Y2018.Text.Jets.MatchPack.Match_TY;
012| __jAC: PatternPack.Pattern_AC:=new PatternPack.Pattern;
013| __nextPos : Integer;
014| begin
015| __PatternPack.compileM(jAC,UTF.To21(patternvalue));
016| __if PatternPack.matches(jAC,1,nextPos,UTF.To21(sourcevalue),m) then
017| _____declare
018| ________r:I_A_ARRAY:=MatchPack.getMatch(m);
019| _____begin
020| ________for i in r'First(1) .. r'Last(1) loop
021| ___________Ada.Text_IO.Put_Line (Integer'image(i) & "|" & subIA(sourcevalue,r(i)));
022| ________end loop;
023| _____end;
024| __else
025| _____Ada.Text_IO.Put_Line ("FAIL");
026| __end if;
027| end ExOmega;

Result

Running export LD_LIBRARY_PATH=lib;bin/exomega in TEST directory.


 0|ExOmega procedure
 1|Omega