diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-03-17 17:04:59 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-03-17 17:04:59 +0100 |
commit | b376b24e6d475d90e3c8267e8340b13ec7a43121 (patch) | |
tree | 0c346d2a45b3f710e08dbc099a1ec796609ff8a0 | |
parent | c0ae618dc5e53e03d56a36dc4495e8f59579cefc (diff) | |
download | sciteco-b376b24e6d475d90e3c8267e8340b13ec7a43121.tar.gz |
fixed ^EG pattern match character: use QRegSpecMachine to parse register specifications
* allows full Q-Reg syntax
-rw-r--r-- | src/search.cpp | 7 | ||||
-rw-r--r-- | src/search.h | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/search.cpp b/src/search.cpp index 525cb2a..de16b4f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -217,10 +217,10 @@ StateSearch::class2regexp(MatchState &state, const gchar *&pattern, break; case STATE_ANYQ: - /* FIXME: Q-Register spec might get more complicated */ - reg = QRegisters::globals[g_ascii_toupper(*pattern)]; + reg = qreg_machine.input(*pattern); if (!reg) - return NULL; + break; + qreg_machine.reset(); temp = reg->get_string(); temp2 = g_regex_escape_string(temp, -1); @@ -427,6 +427,7 @@ StateSearch::process(const gchar *str, /* NOTE: pattern2regexp() modifies str pointer */ re_pattern = pattern2regexp(str); + qreg_machine.reset(); #ifdef DEBUG g_printf("REGEXP: %s\n", re_pattern); #endif diff --git a/src/search.h b/src/search.h index 4506d7c..f5fd29e 100644 --- a/src/search.h +++ b/src/search.h @@ -23,6 +23,7 @@ #include "sciteco.h" #include "parser.h" #include "ring.h" +#include "qregisters.h" /* * "S" command state and base class for all other search/replace commands @@ -40,6 +41,8 @@ protected: Buffer *from_buffer, *to_buffer; } parameters; + QRegSpecMachine qreg_machine; + enum MatchState { STATE_START, STATE_NOT, |