Mercurial > vim
comparison src/regexp.c @ 4682:2f51ee8825db v7.3.1088
updated for version 7.3.1088
Problem: New regexp engine: \@<= and \@<! are not implemented.
Solution: Implement look-behind matching. Fix off-by-one error in old
regexp engine.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 01 Jun 2013 19:54:43 +0200 |
parents | 4d92b873acef |
children | 371cc0c44097 |
comparison
equal
deleted
inserted
replaced
4681:2eb30f341e8d | 4682:2f51ee8825db |
---|---|
5574 * back one character. May go to previous line once. */ | 5574 * back one character. May go to previous line once. */ |
5575 no = OK; | 5575 no = OK; |
5576 limit = OPERAND_MIN(rp->rs_scan); | 5576 limit = OPERAND_MIN(rp->rs_scan); |
5577 if (REG_MULTI) | 5577 if (REG_MULTI) |
5578 { | 5578 { |
5579 if (rp->rs_un.regsave.rs_u.pos.col == 0) | 5579 if (limit > 0 |
5580 && ((rp->rs_un.regsave.rs_u.pos.lnum | |
5581 < behind_pos.rs_u.pos.lnum | |
5582 ? (colnr_T)STRLEN(regline) | |
5583 : behind_pos.rs_u.pos.col) | |
5584 - rp->rs_un.regsave.rs_u.pos.col >= limit)) | |
5585 no = FAIL; | |
5586 else if (rp->rs_un.regsave.rs_u.pos.col == 0) | |
5580 { | 5587 { |
5581 if (rp->rs_un.regsave.rs_u.pos.lnum | 5588 if (rp->rs_un.regsave.rs_u.pos.lnum |
5582 < behind_pos.rs_u.pos.lnum | 5589 < behind_pos.rs_u.pos.lnum |
5583 || reg_getline( | 5590 || reg_getline( |
5584 --rp->rs_un.regsave.rs_u.pos.lnum) | 5591 --rp->rs_un.regsave.rs_u.pos.lnum) |
5599 (*mb_head_off)(regline, regline | 5606 (*mb_head_off)(regline, regline |
5600 + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; | 5607 + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; |
5601 else | 5608 else |
5602 #endif | 5609 #endif |
5603 --rp->rs_un.regsave.rs_u.pos.col; | 5610 --rp->rs_un.regsave.rs_u.pos.col; |
5604 if (limit > 0 | |
5605 && ((rp->rs_un.regsave.rs_u.pos.lnum | |
5606 < behind_pos.rs_u.pos.lnum | |
5607 ? (colnr_T)STRLEN(regline) | |
5608 : behind_pos.rs_u.pos.col) | |
5609 - rp->rs_un.regsave.rs_u.pos.col > limit)) | |
5610 no = FAIL; | |
5611 } | 5611 } |
5612 } | 5612 } |
5613 else | 5613 else |
5614 { | 5614 { |
5615 if (rp->rs_un.regsave.rs_u.ptr == regline) | 5615 if (rp->rs_un.regsave.rs_u.ptr == regline) |