Skip to content

bytes/ and string/ regex engines share ~365 lines of byte-identical files #3828

Description

@bobzhang

bytes/internal/regex_engine/ and string/internal/regex_engine/ contain byte-identical copies of: symbolize.mbt (42 lines), compile.mbt (43), using.mbt (49), ast/pattern.mbt (205), ast/using.mbt (13), symbol_map/using.mbt (13) — roughly 365 lines duplicated verbatim that must be kept in sync by hand (translate.mbt and the .mbti files legitimately differ, and drift has already crept in: the string/ copy of translate.mbt used an imperative loop where the bytes/ twin uses a comprehension — realigned in #3821).

Both packages already depend on the shared internal/regex_engine (automata/ + shared_types/), so the identical files look liftable into a shared internal package. This is an architectural consolidation rather than a mechanical dedup — the byte/string engines are parameterized differently at the edges — so filing for design discussion rather than PRing directly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions