diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-02-06 22:26:56 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-02-06 22:26:56 +0000 |
| commit | e929b1531fe79f651e15b329d98380c308c220f7 (patch) | |
| tree | 16e83b0682306a4dc6130e7ce77aaad5391d3f89 /gdb/kakoune.py | |
| parent | dc2c5eaaa43e4a6f88855848cbc0910af8a8256d (diff) | |
Add Regex support in gdb pretty printing
Diffstat (limited to 'gdb/kakoune.py')
| -rw-r--r-- | gdb/kakoune.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/kakoune.py b/gdb/kakoune.py index c3b4b034..699163d2 100644 --- a/gdb/kakoune.py +++ b/gdb/kakoune.py @@ -197,6 +197,15 @@ class Color: else: return self.val["color"] +class Regex: + """Print a Regex""" + + def __init__(self, val): + self.val = val + + def to_string(self): + return "regex%s" % (self.val["m_str"]) + def build_pretty_printer(): pp = gdb.printing.RegexpCollectionPrettyPrinter("kakoune") @@ -215,4 +224,5 @@ def build_pretty_printer(): pp.add_printer('ColumnCount', '^Kakoune::ColumnCount$', ColumnCount) pp.add_printer('ByteCount', '^Kakoune::ByteCount$', ByteCount) pp.add_printer('Color', '^Kakoune::Color$', Color) + pp.add_printer('Regex', '^Kakoune::Regex$', Regex) return pp |
