fortrangoingonforty/fortsh / 2fa4e73

Browse files

revert Phase 3 delegation — expansion module needs parity fixes for sparse arrays, length ops, delete-all before re-enabling [skip-pty]

Authored by espadonne
SHA
2fa4e737c6235d6de5c10e9de9ecafeaf64da6c0
Parents
c69e9de
Tree
cd70908

1 changed file

StatusFile+-
M src/parsing/parser.f90 5 14
src/parsing/parser.f90modified
@@ -1276,7 +1276,7 @@ contains
12761276
   end function
12771277
 
12781278
   subroutine expand_variables(token, expanded, shell, was_quoted_in)
1279
-    use expansion, only: expand_braces, arithmetic_expansion_shell, process_param_expansion
1279
+    use expansion, only: expand_braces, arithmetic_expansion_shell
12801280
     character(len=*), intent(in) :: token
12811281
     character(len=:), allocatable, intent(out) :: expanded
12821282
     type(shell_state_t), intent(inout) :: shell
@@ -1644,7 +1644,7 @@ contains
16441644
           var_name = working_token(var_start:i-2)
16451645
 
16461646
           ! Process parameter expansion
1647
-          call process_param_expansion(var_name, var_value, shell)
1647
+          call process_parameter_expansion(var_name, var_value, shell)
16481648
           if (allocated(var_value) .and. len(var_value) > 0) then
16491649
             call ensure_result_cap(j + len_trim(var_value))
16501650
             result(j:j+len_trim(var_value)-1) = trim(var_value)
@@ -2541,18 +2541,9 @@ contains
25412541
     end do
25422542
   end function
25432543
 
2544
-  ! Delegate to expansion module's canonical implementation (issue #12 consolidation)
2544
+  ! Canonical implementation — expansion module's process_param_expansion is being
2545
+  ! brought to feature parity (issue #12). Delegation deferred until all edge cases pass.
25452546
   recursive subroutine process_parameter_expansion(param_expr, result_value, shell)
2546
-    use expansion, only: process_param_expansion
2547
-    character(len=*), intent(in) :: param_expr
2548
-    character(len=:), allocatable, intent(out) :: result_value
2549
-    type(shell_state_t), intent(inout) :: shell
2550
-    call process_param_expansion(param_expr, result_value, shell)
2551
-  end subroutine
2552
-
2553
-  ! Original implementation preserved below for reference during validation.
2554
-  ! TODO: Remove after confirming all tests pass with delegation.
2555
-  subroutine process_parameter_expansion_old(param_expr, result_value, shell)
25562547
     use variables, only: get_array_element, get_array_all_elements, get_array_size, &
25572548
                          is_associative_array, get_assoc_array_value, get_assoc_array_keys, &
25582549
                          set_shell_variable, is_shell_variable_set, check_nounset, &
@@ -3613,7 +3604,7 @@ contains
36133604
         end if
36143605
       end if
36153606
     end if
3616
-  end subroutine process_parameter_expansion_old
3607
+  end subroutine
36173608
 
36183609
   subroutine process_tilde_expansion(token, pos, result, result_pos, shell)
36193610
     character(len=*), intent(in) :: token