diff options
author | Christian Persch <chpe@gnome.org> | 2015-10-07 22:15:05 +0200 |
---|---|---|
committer | Christian Persch <chpe@gnome.org> | 2015-10-07 22:15:05 +0200 |
commit | 1855deb46bda149aa1463e05761e3e7f583eed64 (patch) | |
tree | b6004e7dfdf2773aa3807deccc75bc6b0d158b35 | |
parent | 52c966d30ea4e95165835c3b41a43851679d53c5 (diff) | |
download | vte-1855deb46bda149aa1463e05761e3e7f583eed64.tar.gz |
regex: Add some more debug output
Print out the no-match region.
-rw-r--r-- | src/vte.cc | 40 |
1 files changed, 33 insertions, 7 deletions
@@ -1755,13 +1755,13 @@ vte_terminal_match_check_internal_pcre(VteTerminal *terminal, eblank = rm_so; } - if (sblank > start_blank) { - start_blank = sblank; - } - if (eblank < end_blank) { - end_blank = eblank; - } - } + if (sblank > start_blank) { + start_blank = sblank; + } + if (eblank < end_blank) { + end_blank = eblank; + } + } if (G_UNLIKELY(r < PCRE2_ERROR_PARTIAL)) _vte_debug_print(VTE_DEBUG_REGEX, "Unexpected pcre2_match error code: %d\n", r); @@ -1774,6 +1774,19 @@ vte_terminal_match_check_internal_pcre(VteTerminal *terminal, *start = start_blank; *end = end_blank - 1; + _VTE_DEBUG_IF(VTE_DEBUG_REGEX) { + struct _VteCharAttributes *_sattr, *_eattr; + _sattr = &g_array_index(terminal->pvt->match_attributes, + struct _VteCharAttributes, + start_blank); + _eattr = &g_array_index(terminal->pvt->match_attributes, + struct _VteCharAttributes, + end_blank - 1); + g_printerr("No-match region from %" G_GSIZE_FORMAT "(%ld,%ld) to %" G_GSIZE_FORMAT "(%ld,%ld)\n", + start_blank, _sattr->column, _sattr->row, + end_blank - 1, _eattr->column, _eattr->row); + } + return NULL; } @@ -1909,6 +1922,19 @@ vte_terminal_match_check_internal_gregex(VteTerminal *terminal, *start = start_blank; *end = end_blank - 1; + _VTE_DEBUG_IF(VTE_DEBUG_REGEX) { + struct _VteCharAttributes *_sattr, *_eattr; + _sattr = &g_array_index(terminal->pvt->match_attributes, + struct _VteCharAttributes, + start_blank); + _eattr = &g_array_index(terminal->pvt->match_attributes, + struct _VteCharAttributes, + end_blank - 1); + g_printerr("No-match region from %" G_GSIZE_FORMAT "(%ld,%ld) to %" G_GSIZE_FORMAT "(%ld,%ld)\n", + start_blank, _sattr->column, _sattr->row, + end_blank - 1, _eattr->column, _eattr->row); + } + return NULL; } |