@@ -820,4 +820,64 @@ describe('inspectTokenScopesHandler - Location Based Tests', () => {
820820 expectToken ( result , 153 , 11 , 14 , 'div' , [ 'source.jac' , 'meta.jsx.html.jac' , 'entity.name.tag.html.jsx.jac' ] ) ;
821821 } ) ;
822822 } ) ;
823+
824+ describe ( 'Walker get_profile with lambda in sort (lines 157-169)' , ( ) => {
825+ test ( 'walker keyword' , ( ) => {
826+ // walker get_profile {
827+ expectToken ( result , 157 , 1 , 7 , 'walker' , [ 'source.jac' , 'storage.type.class.jac' ] ) ;
828+ } ) ;
829+
830+ test ( 'get_profile walker name' , ( ) => {
831+ expectToken ( result , 157 , 8 , 19 , 'get_profile' , [ 'source.jac' , 'entity.name.type.class.jac' ] ) ;
832+ } ) ;
833+
834+ test ( 'can keyword in ability' , ( ) => {
835+ // can run with Root entry {
836+ expectToken ( result , 158 , 5 , 8 , 'can' , [ 'source.jac' , 'storage.type.function.jac' ] ) ;
837+ } ) ;
838+
839+ test ( 'run as ability name' , ( ) => {
840+ expectToken ( result , 158 , 9 , 12 , 'run' , [ 'source.jac' , 'entity.name.function.jac' ] ) ;
841+ } ) ;
842+
843+ test ( 'report keyword before lambda line' , ( ) => {
844+ // report \'ok\';
845+ expectToken ( result , 159 , 9 , 15 , 'report' , [ 'source.jac' , 'keyword.control.flow.jac' ] ) ;
846+ } ) ;
847+
848+ test ( 'ok string literal' , ( ) => {
849+ expectToken ( result , 159 , 17 , 19 , 'ok' , [ 'source.jac' , 'string.quoted.single.jac' ] ) ;
850+ } ) ;
851+
852+ test ( 'lambda keyword inside sort function call' , ( ) => {
853+ // tweets.sort(key=lambda t: s)
854+ expectToken ( result , 160 , 25 , 31 , 'lambda' , [ 'source.jac' , 'storage.type.function.lambda.jac' ] ) ;
855+ } ) ;
856+
857+ test ( 'report keyword after lambda line is correctly tokenized (regression)' , ( ) => {
858+ // Critical regression test: before the lambda end-pattern fix, the lambda scope
859+ // consumed the closing ) of sort(...), leaving function-arguments scope open and
860+ // causing this line to be mis-tokenized.
861+ expectToken ( result , 161 , 9 , 15 , 'report' , [ 'source.jac' , 'keyword.control.flow.jac' ] ) ;
862+ } ) ;
863+
864+ test ( 'not ok string literal after lambda line (regression)' , ( ) => {
865+ expectToken ( result , 161 , 17 , 23 , 'not ok' , [ 'source.jac' , 'string.quoted.single.jac' ] ) ;
866+ } ) ;
867+
868+ test ( 'walker keyword for get_all_profiles' , ( ) => {
869+ // walker:pub get_all_profiles {
870+ expectToken ( result , 165 , 1 , 7 , 'walker' , [ 'source.jac' , 'storage.type.class.jac' ] ) ;
871+ } ) ;
872+
873+ test ( 'pub modifier on walker' , ( ) => {
874+ expectToken ( result , 165 , 8 , 11 , 'pub' , [ 'source.jac' , 'storage.modifier.declaration.jac' ] ) ;
875+ } ) ;
876+
877+ test ( 'report results in get_all_profiles' , ( ) => {
878+ // report results;
879+ expectToken ( result , 167 , 9 , 15 , 'report' , [ 'source.jac' , 'keyword.control.flow.jac' ] ) ;
880+ } ) ;
881+ } ) ;
882+
823883} ) ;
0 commit comments