@@ -214,10 +214,10 @@ fn validate_choices_and_order(
214214 // - We hit the next literal keyword
215215 // - We hit the end of bits
216216 // - We've consumed at least one token
217-
217+
218218 let start_index = bit_index;
219219 let next_literal = find_next_literal ( & args[ arg_index + 1 ..] ) ;
220-
220+
221221 // Consume tokens greedily until we hit a known literal
222222 while bit_index < bits. len ( ) {
223223 if let Some ( ref lit) = next_literal {
@@ -227,7 +227,7 @@ fn validate_choices_and_order(
227227 }
228228 bit_index += 1 ;
229229 }
230-
230+
231231 // Must consume at least one token for expression
232232 if bit_index == start_index {
233233 bit_index += 1 ;
@@ -238,24 +238,24 @@ fn validate_choices_and_order(
238238 // 1. Single token with = (e.g., "total=value")
239239 // 2. Multiple tokens with "as" keyword (e.g., "url 'name' as varname")
240240 // For now, consume until we find pattern or reach next literal
241-
241+
242242 let next_literal = find_next_literal ( & args[ arg_index + 1 ..] ) ;
243-
243+
244244 while bit_index < bits. len ( ) {
245245 let token = & bits[ bit_index] ;
246246 bit_index += 1 ;
247-
247+
248248 // If token contains =, we're done with this assignment
249249 if token. contains ( '=' ) {
250250 break ;
251251 }
252-
252+
253253 // If we hit "as", consume one more token (the variable name)
254254 if token == "as" && bit_index < bits. len ( ) {
255255 bit_index += 1 ;
256256 break ;
257257 }
258-
258+
259259 // Stop if we hit next literal
260260 if let Some ( ref lit) = next_literal {
261261 if token == lit {
@@ -319,7 +319,7 @@ mod tests {
319319 // Helper to manually validate arguments without full database setup
320320 fn validate_args_simple ( bits : Vec < String > , args : Vec < TagArg > ) -> Vec < String > {
321321 let mut errors = Vec :: new ( ) ;
322-
322+
323323 let has_varargs = args. iter ( ) . any ( |arg| matches ! ( arg, TagArg :: VarArgs { .. } ) ) ;
324324 let required_count = args. iter ( ) . filter ( |arg| arg. is_required ( ) ) . count ( ) ;
325325
@@ -361,7 +361,7 @@ mod tests {
361361 TagArg :: Expr { .. } => {
362362 let start_index = bit_index;
363363 let next_literal = find_next_literal ( & args[ arg_index + 1 ..] ) ;
364-
364+
365365 while bit_index < bits. len ( ) {
366366 if let Some ( ref lit) = next_literal {
367367 if bits[ bit_index] == * lit {
@@ -370,27 +370,27 @@ mod tests {
370370 }
371371 bit_index += 1 ;
372372 }
373-
373+
374374 if bit_index == start_index {
375375 bit_index += 1 ;
376376 }
377377 }
378378 TagArg :: Assignment { .. } => {
379379 let next_literal = find_next_literal ( & args[ arg_index + 1 ..] ) ;
380-
380+
381381 while bit_index < bits. len ( ) {
382382 let token = & bits[ bit_index] ;
383383 bit_index += 1 ;
384-
384+
385385 if token. contains ( '=' ) {
386386 break ;
387387 }
388-
388+
389389 if token == "as" && bit_index < bits. len ( ) {
390390 bit_index += 1 ;
391391 break ;
392392 }
393-
393+
394394 if let Some ( ref lit) = next_literal {
395395 if token == lit {
396396 break ;
@@ -426,7 +426,7 @@ mod tests {
426426 name: "condition" . into( ) ,
427427 required: true ,
428428 } ] ;
429-
429+
430430 let errors = validate_args_simple ( bits, args) ;
431431 assert ! ( errors. is_empty( ) , "Should not error on expression with multiple tokens: {:?}" , errors) ;
432432 }
@@ -440,7 +440,7 @@ mod tests {
440440 name: "message" . into( ) ,
441441 required: true ,
442442 } ] ;
443-
443+
444444 let errors = validate_args_simple ( bits, args) ;
445445 assert ! ( errors. is_empty( ) , "Should not error on quoted string: {:?}" , errors) ;
446446 }
@@ -472,7 +472,7 @@ mod tests {
472472 required: false ,
473473 } ,
474474 ] ;
475-
475+
476476 let errors = validate_args_simple ( bits, args) ;
477477 assert ! ( errors. is_empty( ) , "Should handle optional literal 'reversed': {:?}" , errors) ;
478478 }
@@ -489,7 +489,7 @@ mod tests {
489489 name: "condition" . into( ) ,
490490 required: true ,
491491 } ] ;
492-
492+
493493 let errors = validate_args_simple ( bits, args) ;
494494 assert ! ( errors. is_empty( ) , "Should handle complex boolean expression: {:?}" , errors) ;
495495 }
@@ -513,7 +513,7 @@ mod tests {
513513 required: false ,
514514 } ,
515515 ] ;
516-
516+
517517 let errors = validate_args_simple ( bits, args) ;
518518 assert ! ( errors. is_empty( ) , "Should handle varargs: {:?}" , errors) ;
519519 }
@@ -526,7 +526,7 @@ mod tests {
526526 name: "bindings" . into( ) ,
527527 required: true ,
528528 } ] ;
529-
529+
530530 let errors = validate_args_simple ( bits, args) ;
531531 assert ! ( errors. is_empty( ) , "Should handle assignment with filter: {:?}" , errors) ;
532532 }
@@ -539,7 +539,7 @@ mod tests {
539539 name: "template" . into( ) ,
540540 required: true ,
541541 } ] ;
542-
542+
543543 let errors = validate_args_simple ( bits, args) ;
544544 assert ! ( errors. is_empty( ) , "Should handle quoted path: {:?}" , errors) ;
545545 }
@@ -558,7 +558,7 @@ mod tests {
558558 required: false ,
559559 } ,
560560 ] ;
561-
561+
562562 let errors = validate_args_simple ( bits, args) ;
563563 assert ! ( errors. is_empty( ) , "Expr should stop before literal keyword: {:?}" , errors) ;
564564 }
0 commit comments