package Ġorg . lex em . ang mar . analyzer . nodes . functional . expressions . macros Ċ Ċ import Ġorg . junit . jupiter . api .* Ċ import Ġorg . lex em . ang mar .* Ċ import Ġorg . lex em . ang mar . analyzer .* Ċ import Ġorg . lex em . ang mar . analyzer . data . primitives .* Ċ import Ġorg . lex em . ang mar . parser . functional . expressions . macros .* Ċ import Ġorg . lex em . ang mar . parser . functional . expressions . modifiers .* Ċ import Ġorg . lex em . ang mar . utils .* Ċ Ċ internal Ġclass ĠMacro Back track Analyzer Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` test Ġback tracking Ġmacro Ġwithout Ġthe Ġdata `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtext Ġ= ĠMacro Back track Node . macro Name ĊĠĠĠĠĠĠĠ Ġval Ġanalyzer Ġ= ĠTestUtils . create Analyzer From ( text , Ġparser Function Ġ= ĠMacro Back track Node . Companion :: parse ) ĊĠĠĠĠĠĠĠ ĠTestUtils . process And Check Empty ( analyzer , Ġstatus Ġ= ĠLex em Analyzer . Process Status . Backward , Ġbig Node Count Ġ= Ġ 0 ) ĊĊĠĠĠĠĠĠĠ ĠTestUtils . check Empty Stack And Context ( analyzer ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` test Ġback tracking Ġmacro Ġwith Ġarguments `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpositional Ġ= ĠL xm Integer . Num 1 0 ĊĠĠĠĠĠĠĠ Ġval Ġnamed Key Ġ= Ġ" xx " ĊĠĠĠĠĠĠĠ Ġval Ġnamed Value Ġ= ĠL xm Logic . True ĊĠĠĠĠĠĠĠ Ġval Ġtext Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"${ Macro Back track Node . macro Name }${ Function Call Node . start Token }$ positional ${ Function Call Node . argument Separator }$ named Key ${ Function Call Named Argument Node . relational Token }$ named Value ${ Function Call Node . end Token }" ĊĠĠĠĠĠĠĠ Ġval Ġanalyzer Ġ= ĠTestUtils . create Analyzer From ( text , Ġparser Function Ġ= ĠMacro Back track Node . Companion :: parse ) ĊĠĠĠĠĠĠĠ ĠTestUtils . process And Check Empty ( analyzer , Ġstatus Ġ= ĠLex em Analyzer . Process Status . Backward , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Back tracking Data Ġ= Ġtrue , Ġbig Node Count Ġ= Ġ 0 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġback tracking Data Ġ= Ġanalyzer . back tracking Data !! ĊĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( 1 , Ġback tracking Data . positional . size , Ġ" The Ġnumber Ġof Ġpositional Ġarguments Ġis Ġincorrect ") ĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( 2 , Ġback tracking Data . named . size , Ġ" The Ġnumber Ġof Ġnamed Ġarguments Ġis Ġincorrect ") ĊĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( positional , Ġback tracking Data . positional [ 0 ], Ġ" The Ġpositional Ġargument [ 0 ] Ġis Ġincorrect ") ĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( named Value , Ġback tracking Data . named [ named Key ], ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" The Ġnamed Ġargument [$ named Key ] Ġis Ġincorrect ") ĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( L xm Nil , Ġback tracking Data . named [ Analyzer Common s . Identifiers . This ], ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" The Ġnamed Ġargument [ ${ Analyzer Common s . Identifiers . This }] Ġis Ġincorrect ") ĊĊĠĠĠĠĠĠĠ ĠTestUtils . check Empty Stack And Context ( analyzer ) ĊĠĠĠ Ġ} Ċ } Ċ