@@ -673,6 +673,57 @@ describe('break', () => {
673673 ) ;
674674 } ) ;
675675
676+ test . concurrent ( 'break corresponding to each is not allowed in the target' , async ( ) => {
677+ await assert . rejects (
678+ ( ) => exe ( '#l: each let i, eval { break #l } {}' ) ,
679+ new AiScriptSyntaxError ( 'break corresponding to each is not allowed in the target' , { line : 1 , column : 24 } ) ,
680+ ) ;
681+ } ) ;
682+
683+ test . concurrent ( 'break corresponding to for is not allowed in the count' , async ( ) => {
684+ await assert . rejects (
685+ ( ) => exe ( '#l: for eval { break #l } {}' ) ,
686+ new AiScriptSyntaxError ( 'break corresponding to for is not allowed in the count' , { line : 1 , column : 16 } ) ,
687+ ) ;
688+ } ) ;
689+
690+ describe ( 'break corresponding to for is not allowed in the range' , ( ) => {
691+ test . concurrent ( 'from' , async ( ) => {
692+ await assert . rejects (
693+ ( ) => exe ( '#l: for let i = eval { break #l }, 0 {}' ) ,
694+ new AiScriptSyntaxError ( 'break corresponding to for is not allowed in the range' , { line : 1 , column : 24 } ) ,
695+ ) ;
696+ } ) ;
697+
698+ test . concurrent ( 'to' , async ( ) => {
699+ await assert . rejects (
700+ ( ) => exe ( '#l: for let i = 0, eval { break #l } {}' ) ,
701+ new AiScriptSyntaxError ( 'break corresponding to for is not allowed in the range' , { line : 1 , column : 27 } ) ,
702+ ) ;
703+ } ) ;
704+ } ) ;
705+
706+ test . concurrent ( 'break corresponding to if is not allowed in the condition' , async ( ) => {
707+ await assert . rejects (
708+ ( ) => exe ( '#l: if eval { break #l } {}' ) ,
709+ new AiScriptSyntaxError ( 'break corresponding to if is not allowed in the condition' , { line : 1 , column : 15 } ) ,
710+ ) ;
711+ } ) ;
712+
713+ test . concurrent ( 'break corresponding to match is not allowed in the target' , async ( ) => {
714+ await assert . rejects (
715+ ( ) => exe ( '#l: match eval { break #l } {}' ) ,
716+ new AiScriptSyntaxError ( 'break corresponding to match is not allowed in the target' , { line : 1 , column : 18 } ) ,
717+ ) ;
718+ } ) ;
719+
720+ test . concurrent ( 'break corresponding to match is not allowed in the pattern' , async ( ) => {
721+ await assert . rejects (
722+ ( ) => exe ( '#l: match 0 { case eval { break #l } => 1 }' ) ,
723+ new AiScriptSyntaxError ( 'break corresponding to match is not allowed in the pattern' , { line : 1 , column : 27 } ) ,
724+ ) ;
725+ } ) ;
726+
676727 describe ( 'labeled each' , ( ) => {
677728 test . concurrent ( 'inner each' , async ( ) => {
678729 const res = await exe ( `
0 commit comments