/* Ċ Ġ* ĠCopyright Ġ 2 0 2 0 ĠThe ĠMath L ing ua ĠAuthors Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttps :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġmath ling ua . frontend . chalk talk . phase 2 . ast . group . clause . exists Unique Ċ Ċ import Ġmath ling ua . frontend . chalk talk . phase 1 . ast . Phase 1 Node Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . DEFAULT _ EXISTS _ UNIQUE _ GROUP Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . DEFAULT _ EXISTS _ UNIQUE _ SECTION Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . DEFAULT _ SU CH _ THAT _ SECTION Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . clause . Clause Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . clause . first Section Matches Name Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . common . Two Part Node Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . group . clause . exists . Such That Section Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . group . clause . exists . validate Such That Section Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . section . ensure NonNull Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . section . identify Sections Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . track Ċ import Ġmath ling ua . frontend . chalk talk . phase 2 . ast . validate Group Ċ import Ġmath ling ua . frontend . support . Mutable Location Tracker Ċ import Ġmath ling ua . frontend . support . ParseError Ċ Ċ data Ġclass ĠEx ists Unique Group ( ĊĠĠĠ Ġval Ġexists Unique Section : ĠEx ists Unique Section , Ġval Ġsuch That Section : ĠSuch That Section Ċ ) Ġ: ĊĠĠĠ ĠTwo Part Node < Exists Unique Section , ĠSuch That Section >( ĊĠĠĠĠĠĠĠ Ġexists Unique Section , Ġsuch That Section , Ġ:: Exists Unique Group ), ĊĠĠĠ ĠClause Ċ Ċ fun Ġis Exists Unique Group ( node : ĠPhase 1 Node ) Ġ= Ġfirst Section Matches Name ( node , Ġ" exists Unique ") Ċ Ċ fun Ġvalidate Exists Unique Group ( ĊĠĠĠ Ġnode : ĠPhase 1 Node , Ġerrors : ĠMutable List < ParseError >, Ġtracker : ĠMutable Location Tracker Ċ ) Ġ= ĊĠĠĠ Ġtrack ( node , Ġtracker ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvalidate Group ( node . resolve (), Ġerrors , Ġ" exists Unique ", ĠDEFAULT _ EXISTS _ UNIQUE _ GROUP ) Ġ{ ĊĠĠĠĠĠĠĠ Ġgroup Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġidentify Sections ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġgroup , Ġerrors , ĠDEFAULT _ EXISTS _ UNIQUE _ GROUP , ĠlistOf (" exists Unique ", Ġ" such That ")) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsections Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEx ists Unique Group ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġexists Unique Section Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġensure NonNull ( sections [" exists Unique "], ĠDEFAULT _ EXISTS _ UNIQUE _ SECTION ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvalidate Exists Unique Section ( it , Ġerrors , Ġtracker ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsuch That Section Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġensure NonNull ( sections [" such That "], ĠDEFAULT _ SU CH _ THAT _ SECTION ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvalidate Such That Section ( it , Ġerrors , Ġtracker ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ