@@ -561,18 +561,10 @@ contains |
| 561 | 561 | call next_set%clear() |
| 562 | 562 | |
| 563 | 563 | ! Compute NFA transitions for this character |
| 564 | + ! Note: DFA is case-sensitive. Case-insensitive matching uses NFA path. |
| 564 | 565 | call compute_char_transitions_simple(opt%nfa, opt%dfa%states(dfa_idx)%nfa_states, & |
| 565 | 566 | char(char_code), next_set) |
| 566 | 567 | |
| 567 | | - ! For alphabetic characters, also compute transitions for opposite case |
| 568 | | - if (char_code >= ichar('a') .and. char_code <= ichar('z')) then |
| 569 | | - call compute_char_transitions_simple(opt%nfa, opt%dfa%states(dfa_idx)%nfa_states, & |
| 570 | | - char(char_code - 32), next_set) |
| 571 | | - else if (char_code >= ichar('A') .and. char_code <= ichar('Z')) then |
| 572 | | - call compute_char_transitions_simple(opt%nfa, opt%dfa%states(dfa_idx)%nfa_states, & |
| 573 | | - char(char_code + 32), next_set) |
| 574 | | - end if |
| 575 | | - |
| 576 | 568 | ! Compute epsilon closure of result |
| 577 | 569 | if (.not. next_set%is_empty()) then |
| 578 | 570 | call expand_epsilon_closure_simple(opt, next_set) |
@@ -1033,8 +1025,8 @@ contains |
| 1033 | 1025 | if (opt%nfa%num_states == 0) return |
| 1034 | 1026 | |
| 1035 | 1027 | ! Fast path: use DFA if available (O(n) matching) |
| 1036 | | - ! DFA now supports case-insensitive matching via case-folded transitions |
| 1037 | | - if (opt%use_dfa) then |
| 1028 | + ! DFA is case-sensitive; case-insensitive matching falls through to NFA path |
| 1029 | + if (opt%use_dfa .and. .not. ignore_case) then |
| 1038 | 1030 | res = dfa_search(opt%dfa, text, text_len) |
| 1039 | 1031 | return |
| 1040 | 1032 | end if |