Skip to content

Support RegExp atomic operators #1018

Description

@frostney

Summary

Implement the Stage 1 TC39 proposal: https://github.com/tc39/proposal-regexp-atomic-operators

Implement current atomic grouping and possessive quantifier syntax, committing the appropriate backtracking alternatives without corrupting captures.

Why

This proposal fits GocciaScript's modern ECMAScript surface and the 0.13.0 proposal roadmap. It should extend the engine's existing architecture rather than arrive as a userland shim.

Current behavior

The RegExp VM backtracks but has no atomic groups or possessive quantifiers.

Expected behavior

Implement current atomic grouping and possessive quantifier syntax, committing the appropriate backtracking alternatives without corrupting captures.

Scope notes

Add explicit Compiler/Program/VM support rather than semantic-changing rewrites. Cover nesting, alternation, captures/backrefs, lookaround, empty matches, catastrophic patterns, diagnostics, and tests. Additive syntax: no flag.

Related bytecode roadmap: #871 and #875. Update the relevant language/built-in documentation and Goccia proposal inventory. Use the proposal repository and its current specification at implementation time; add focused project tests and matching pinned Test262/proposal coverage without regressions.

Acceptance criteria

  • Parser/API surface, descriptors, evaluation order, errors, and observable protocol behavior match the current proposal.
  • Implementation uses the identified shared engine seam without a duplicate compatibility shim.
  • Focused positive, negative, abrupt-completion, and edge-case tests cover the proposal.
  • Relevant project suites, pinned Test262 cases, formatting, and documentation checks pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineTGocciaEngine: language semantics, ECMAScript built-ins, parser, interpreter, bytecode VMnew featureNew feature or requestspec complianceMismatch against official JavaScript/TypeScript specification

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions