Skip to content

docs: analysis of regular expressions as a step notation - #103

Open
aslakhellesoy wants to merge 1 commit into
mainfrom
claude/admiring-thompson-wuukpu
Open

aslakhellesoy wants to merge 1 commit into
mainfrom
claude/admiring-thompson-wuukpu

Conversation

@aslakhellesoy

Copy link
Copy Markdown
Contributor

Closes #

What this changes

Adds a comprehensive analysis document (doc/REGULAR-EXPRESSIONS.md) that scopes the work required to make plain regular expressions a first-class step notation in Varar, alongside Cucumber Expressions.

The document:

  • Identifies the problem: Seven ports currently depend on the official cucumber-expressions library, which blocks new ports in languages without that library (Dart, PHP, Swift, Elixir, Zig, etc.). Two ports (Go, Rust) already work around this by wrapping the library in an owned module.
  • Inventories the dependency surface: Maps exactly what each port consumes from the library (core matching, AST for rename/completion, parameter-type registry, snippet generation).
  • Proposes a facade contract: A minimal StepPattern / CompiledPattern interface that any regex engine can satisfy, making regexp support the mandatory floor for new ports.
  • Defines the regexp step semantics: Seven-point contract covering groups-as-arguments, span tracking, substring scanning, ambiguity handling, and portable dialect constraints.
  • Sketches the implementation: Per-port changes to extract the facade, add regexp support, update tree-sitter queries, LSP features (completion, rename, diagnostics), and conformance corpus (four new bundles with regexp examples).
  • Lists open questions: Six decisions needed before code (group values, anchor handling, inner spans, golden shape, rename behavior, snippet defaults).

This is analysis and scoping work, not a decision or implementation. The document is marked "Status: analysis, no decision yet. Written to scope the work before an ADR."

How you verified it

  • I have read and can explain every line of this diff
  • The gates pass locally
  • Commits follow Conventional Commits
    — they generate the changelog and the next version number

Note: This is a documentation-only change (new .md file in doc/). No code changes, no test changes, no golden changes. The document itself is the artifact.

https://claude.ai/code/session_01TnvHhtFBpcnCNQACo2dUWi

…Expressions

Scopes the work to make plain regexps a first-class, corpus-pinned step
notation so a port needs only its host regex engine: inventories every use
of cucumber-expressions across the seven ports, the LSP and the corpora,
proposes the facade contract, the regexp semantics, the parity.json split,
the new bundles and the per-area consequences, and lists the decisions to
settle before an ADR.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TnvHhtFBpcnCNQACo2dUWi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants