Skip to content

@-refs: unify divergent at-token-re regex (chat.clj vs view/blocks.clj) #12

Description

@ssjoleary

Follow-up from PR #4 review (Standards axis).

at-token-re is duplicated with a subtle divergence:

  • src/eca_cli/chat.clj:108#"(?:^|\s)@(\S+)" (non-capturing lead group)
  • src/eca_cli/view/blocks.clj:23#"(^|\s)@(\S+)" (capturing lead group)

Both parse the same @path token grammar (send-time context matching vs render-time styling), but the group shapes differ, so the meaning of each capture group is not the same across the two sites. Not a bug today, but the copies will drift when a third use site lands.

Per Clojure Craft "wait for the third occurrence before extracting" this was deliberately left duplicated. When the third site appears, extract one shared @-token regex with a single documented capture-group contract that both namespaces consume.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions