agentleFS
wado-langwado-lang/wado/package-re/AGENTS.md

wado / package-re

AGENTS.md120 starsChanged 14 days agoMITView on GitHub

Re is linear-time regular expressions in ECMA-262's syntax. WEP: Re holds the design and why. The rules come from the specification, vendor/ecma262/spec.html: the chapter RegExp (Regular Expression) Objects, read as the u flag reads it. Annex B does not apply. A rule in the code cites the production or the section it follows. vendor/test262 is the conformance corpus, read as data. No engine's source is read, whatever its license. Node's RegExp may be run as a black-box oracle. \p{…} takes…

The file

Files
AGENTS.md

Re Development Guide

Re is linear-time regular expressions in ECMA-262's syntax. WEP: Re holds the design and why.

Sources

The rules come from the specification, vendor/ecma262/spec.html: the chapter RegExp (Regular Expression) Objects, read as the u flag reads it. Annex B does not apply. A rule in the code cites the production or the section it follows.

vendor/test262 is the conformance corpus, read as data. No engine's source is read, whatever its license. Node's RegExp may be run as a black-box oracle.

\p{…} takes what core:icu knows, at its Unicode version. Where that differs from ECMA-262's tables or from an engine, core:icu is right.

Layout

  • src/ast.wado — the tree a pattern parses to.
  • src/parse.wado — the parser, rex's syntax included, PatternError, and validate_ecma262_syntax.
  • src/charset.wado — code point sets, and what each named set holds.
  • src/utf8.wado — a code point range as the UTF-8 byte sequences encoding it.
  • src/program.wado — the tree compiled to Pike VM instructions over bytes.
  • src/pike.wado — the Pike VM.
  • src/regex.wado — Regex, its searches, replace and split.
  • src/template.wado — the tags re and rex, and PatternPart.

Tests

A test writes a pattern as a raw string, #"\d+"#, so that it reads as the pattern it is. A cooked one needs a reason, such as a newline ending a rex comment. A program uses re and rex, whose templates are raw already.

Running tests

wado test package-re

tests/generated/ holds what the oracles answered, committed so that CI needs neither:

  • mise run oracle-re asks Node's RegExp about each case in tests/oracle/cases.json and tests/generated/test262.json.
  • mise run test262-re reads test262's parse-phase negative tests, and runs test262's RegExp tests in Node to collect the patterns and inputs they use into tests/generated/test262.json. It then runs oracle-re.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.