Ruby bindings to RE2, a "fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python".
Following the recent releases of the gem, there are a few things I’d like to clean up/investigate to improve maintainability without changing functionality:
[ ] Remove duplicated logic to look up submatches by index
[ ] Remove duplicated logic to look up submatches by name
[ ] Replace macros (most likely with functions)
[x] Mark pointers as const where they are unchanged by a function
[x] Remove unnecessary casting during pointer arithmetic
[ ] Remove use of RUBY_METHOD_FUNC to fix deprecation warnings on modern Rubies
[ ] Explicitly test against C++03
[x] Use references where possible (specifically NamedCapturingGroups)
[x] Remove using in favour of explicit namespaces
[ ] Pass cpplint?
[x] Document match’s behaviour with patterns without submatches
[ ] Mark non-recommended parts of API (mostly from the DCI days)
[x] Lean on StringPiece’s automatic conversion from char * when looking up submatches by name
[x] Mark all functions as file static
[ ] Ensure there’s test coverage around features that behave differently across Ruby and re2 versions (e.g. things affected by encoding or bytes vs characters)
[ ] Document commitment to backward compatibility?
Following the recent releases of the gem, there are a few things I’d like to clean up/investigate to improve maintainability without changing functionality:
const
where they are unchanged by a functionRUBY_METHOD_FUNC
to fix deprecation warnings on modern RubiesNamedCapturingGroups
)using
in favour of explicit namespacesStringPiece
’s automatic conversion fromchar *
when looking up submatches by namestatic