Mercurial > vim
comparison src/regexp_nfa.c @ 4615:5679b8ddd8cc v7.3.1055
updated for version 7.3.1055
Problem: Negated collection does not match newline.
Solution: Handle newline differently. (Hiroshi Shirosaki)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 30 May 2013 11:51:08 +0200 |
parents | 321cfbef9431 |
children | 857f6c53f117 |
comparison
equal
deleted
inserted
replaced
4614:560c247794b8 | 4615:5679b8ddd8cc |
---|---|
1201 TRY_NEG(); | 1201 TRY_NEG(); |
1202 EMIT_GLUE(); | 1202 EMIT_GLUE(); |
1203 } | 1203 } |
1204 mb_ptr_adv(regparse); | 1204 mb_ptr_adv(regparse); |
1205 | 1205 |
1206 if (extra == ADD_NL) /* \_[] also matches \n */ | |
1207 { | |
1208 EMIT(reg_string ? NL : NFA_NEWL); | |
1209 TRY_NEG(); | |
1210 EMIT_GLUE(); | |
1211 } | |
1212 | |
1213 /* skip the trailing ] */ | 1206 /* skip the trailing ] */ |
1214 regparse = endp; | 1207 regparse = endp; |
1215 mb_ptr_adv(regparse); | 1208 mb_ptr_adv(regparse); |
1216 if (negated == TRUE) | 1209 if (negated == TRUE) |
1217 { | 1210 { |
1218 /* Mark end of negated char range */ | 1211 /* Mark end of negated char range */ |
1219 EMIT(NFA_END_NEG_RANGE); | 1212 EMIT(NFA_END_NEG_RANGE); |
1220 EMIT(NFA_CONCAT); | 1213 EMIT(NFA_CONCAT); |
1221 } | 1214 } |
1215 | |
1216 /* \_[] also matches \n but it's not negated */ | |
1217 if (extra == ADD_NL) | |
1218 { | |
1219 EMIT(reg_string ? NL : NFA_NEWL); | |
1220 EMIT(NFA_OR); | |
1221 } | |
1222 | |
1222 return OK; | 1223 return OK; |
1223 } /* if exists closing ] */ | 1224 } /* if exists closing ] */ |
1224 | 1225 |
1225 if (reg_strict) | 1226 if (reg_strict) |
1226 { | 1227 { |