Something went wrong. Try again.
A Zig library that reads git repositories without running git, with log, show and diff output byte-identical to git's.
Something went wrong. Try again.
7.5 kB · 289 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351procedure Foo isprocedure Foo;function Bar return Integer ispackage body Baz ispackage Baz istask body T isprotected body P is procedure Foo is procedure Foo is procedure XPROCEDURE FOO ISpRoCeDuRe XProcedure Fooprocedurexprocedureprocedure xprocedure foofunctionpackagepackage bodytasktask protected task type T isprotected type P isentry E when True istype T is recordseparate (Foo) procedure Bar isoverriding procedure Foo isprocedure Foo is -- comment-- procedure Foo isprocedure Foofunction XprocedureFooprocedureFooprocedureFooprocedure Foo
procedure Fooprocedure Foo(X : Integer) isfunction "+" (L, R : T) return T isprocedure Foo is new Bar;package Foo is new Gen (X);package Foo renames Bar;procedure Foo is separate;procedure X is separateprocedure X is separate xprocedure X is separate procedure X is separate(procedure X is separatexprocedure X is separateprocedure X is separateprocedure X IS SEPARATEprocedure X is separate;procedure X is newerprocedure X is new_xprocedure X isnewprocedure X is newprocedure X is newprocedure X is newprocedure X IS NEWprocedure X iS newprocedure X xis newprocedure X.is newprocedure X;is newprocedure X 1is newprocedure X is new;procedure X is new(procedure X is new1procedure X is new procedure X is new procedure X isnewprocedure X isnewprocedure Xis newprocedure X renamesprocedure X renamesYprocedure X xrenames Yprocedure X RENAMES Yprocedure X Renamesprocedure renamesprocedure X renames;procedure X(renames)procedure X.renamesprocedure X renames_procedure X renamesprocedure X renamesprocedure X renames procedure X renames procedure Xrenamesprocedure Xrenamesprocedure X renamesprocedure X renamesxprocedure X renames
procedure Xprocedure X is newéprocedure X é is newprocedure X renames Y is new Zprocedure is
end Foo;with Ada.Text_IO; begin g protected bodybegin protected renamesx end entrybegin task nullbody type Ada.Text_IOis PACKAG%E SUBTYPE PROCEDUREPACKAGE TASK SEPARATELYISfunction xfunction Ada.Text_IO procedure task renamesxrenames generic renamesx procedure protected notwith isnew begin FUNCTION END ;BODYBODY PACKAGED protectedis separate; use body not ; type is is -\- comment new procedure fUNctiOnoveRriding new usenew (X : Integer)null task record generic function "+" ; protected task bodytype; is_newBar_Bazrecordrenamesxwithis|_ne functiorecord>n recordrenames task bodyfunction renamesx "+" typenews procedurerecord separately isnewnot proceduresprotected type is separate separate return Xendnot Taskfunctionpackaged bodyendprotected bodyAda.Text_IOseparately return procedures package body separatelyoverridingX isnewnews body package notwith is -- comment PACKAGE BOisDY NEW protected typegenerc PROTECTED TYPEPROCESpackagwithe task type:= packageis entry use taskuse protected function protected bodybegin subtypeuse generic (X : Integer)task body renames use package body;ne ws null prote task bodyproceduresreturn package "+"X type task typesEpA rASpAckAge package separately Foo ; end package bodytype packaged begin procedure protec?ted body subtype renames;package isnew bar_baz not FoOx retURN PackageD package new is_new procedurerecords task body protectedtaskbegin xfunction end -- comment task typ'erecord Foo ^renames T1protected with X news ; ; functionrenames subtype function null renames function (X : Integer) package protected type piis_new function is_new procedure task typeprocedure := separately function tAsK FuNction SeParaTe Task package body is newnot abstract packaged protected overriding declare fproceduresunctionpaisnewckage Bar_Bazuserenotcord subtype new entry separatetyperenames "+"is_newprotected type function Bar_Baz:= protectednew end FUNCTION SUBTYPE (X : INTEGER) task body (X : renamesxInteger)procedure renames xfunction ; ;abstract bodyFoo entryis_newprocedures null rtasketurn en PROCEDURE ISTYPE BEGIN prot pAckAGE use is dEclARERenameSrenameSXiS nEwRenamEs ADA.TexT_IO pAcKAGe boDY task / TASK TYPE := FOO D package body isnew renadeclaremesx usenew FoOiSNEWgENErICwIth NOtISNEw protected body-- comment protected "+" with X ispackage newsePArAteAda.text_IO new ReNamEs iS_nEw -- coMMt packaged begin xfunctiontASk body paCKAGeD overrIDing prOCedurE renaMes isneWpAcKaGe new is new is new is f ta protected abstract entryrecord tas k returnfunction procedure Bar_Baz newsis separate +function is separateis separate is new iswithBar_Baz protected bodytask` is separatepackagei is separates subtype isfunctionis package body procedure is new procedurenotisnew tAsK→ boDy X PAckagedIs_NeW protected bodyrenames Xxf packtypeage separateis task body xfunctionentry renames is entry begin-- comment "+" "+" begin task Foois separate Xrecord isnewurnody{-- comment pack TaskIS_neWxfUNcTIon abstrACT %sEparaTe beGiN is NeW returnprocedures renamesx function renamesx protected type abstract function:=returnuse task typewith renamesx entrywithprocedurestaskprocedure record ;null begin ta sk task body is package$ body:=(X : Integer) proceckarenamesxge news task Ada.Text_IO-- comment procedure ;generic separately null overriding is new renames procedurenotseparate PROCEDU%RE"+" RETURN body protectedprotected ada.text_io procedures typetask body ; ENtR task typepackaged renamesx separate protected bodyabstrpackagedact xfunction is_new task "+" use package task body renames (X : In!teger) task type DECLare is sEgeNeriCparaTEproceduresprocedure Foo beginprotectedretprocedureurn-- commenttask body body xfunction abstract separatenull procedure procedure function renamesx not body task is separate use PRocedUrE -- COMMent end boDypRocedure taskfunction declare task type function is separate task entry type renames returnseparately generic ada.text_io :=protected body separately is separate use (x : integer) abstract sub typeend type TASK BODY ABSTRD PROCEDUREreturnprotected typeis separatenot news typeBar_ is_new prOtecTed TYpe renaMeSusE witH rECOrd nOTNEW endoverriding FUNCTION NEWSprocedure packaged procedures "+" Ada.Text_IO null null prote+cted "+" protected typenew is :={declare ]package body := news nullprocedures begin overriding protected typereturn procedures Foo T1 new procedureisnew -- comment not "+" unction xnewtask type task entry -- commseparateentrenames task useendprocedurewith packaged entryAda.T is new paCkaGE "+"separaTet1 newprocedures protected bodyp(rotected prote cted abstractisnewnot protected typefunctionsubtypetask type declare subtypeprocedure package begin procedures use Foonews Fooprotected renames overriding Bar_Baz subtype record protected renames newsnew abstract procedures renames task body T1 endBar_Baz not subtype news task type "+"Ada .Text_IO X "+" use renamesprocedureis_new