mudge/re2

Refactoring wish list

Closed this issue · 0 comments

mudge commented

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)
  • Mark pointers as const where they are unchanged by a function
  • Remove unnecessary casting during pointer arithmetic
  • Remove use of RUBY_METHOD_FUNC to fix deprecation warnings on modern Rubies
  • Explicitly test against C++03
  • Use references where possible (specifically NamedCapturingGroups)
  • Remove using in favour of explicit namespaces
  • Pass cpplint?
  • Document match’s behaviour with patterns without submatches
  • Mark non-recommended parts of API (mostly from the DCI days)
  • Lean on StringPiece’s automatic conversion from char * when looking up submatches by name
  • 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?