diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 263f6aa..2899269 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -1,3 +1,4 @@ See @../.cursor/rules/base.mdc for information on your desired behavior. See @../.cursor/rules/best-practices.mdc for our best practices (snapshot we own and evolve). See @../.cursor/rules/conventions-index.mdc for the index of on-demand convention rules (read before writing or reviewing code). +See @../.cursor/rules/learnings-index.mdc for this repo's learnings index (read the pointed skill before working in an entry's territory). diff --git a/.cursor/rules/learnings-index.mdc b/.cursor/rules/learnings-index.mdc new file mode 100644 index 0000000..42215f1 --- /dev/null +++ b/.cursor/rules/learnings-index.mdc @@ -0,0 +1,54 @@ +--- +description: Always-on index of this repo's learnings — lessons distilled from reviews, builds, and scans. Read the pointed skill before working in an entry's territory. +alwaysApply: true +--- + +# Learnings index + +One line per learning: `[domain/slug]`, the trigger sentence, the skill +pointer. The line buys awareness; the pointed skill carries the rule, a +wrong/right pair, and the origin — read it before working in that entry's +territory. Detail skills live in `.cursor/skills/learnings//` +(architecture digests in `.cursor/skills/architecture//`); gem and +org skills are pointed at wherever their channel installs them. + +Capture and curation go through the capture-learning skill (IDE sessions) +or ai-flow's `/learn` (GitHub comments) — both land as draft PRs; human +merge is the gate. Soft cap ~50 entries: at the cap, an addition must +propose a retirement, a consolidation, or a glob-scoped sub-index split. + +## testing + +- [testing/rspock-bare-assertions] In rspock `transform!`-ed test classes, + bare `Then`/`Expect` statements are assertions; outside a transformed + class they silently assert nothing. + → .agents/skills/gem-rspock--rspock/ (ships in the rspock gem; linked by + `dev up` / `dev install-deps`) + +## process + +- [process/ai-flow-gitlink-exclusion] Commit sweeps (`git add -A`) must + exclude nested-checkout gitlinks such as `.ai-flow`. + → .cursor/skills/learnings/ai-flow-gitlink-exclusion/ + +## architecture + +- [architecture/command-dispatch] Global builtins (cd, plan, cred, + knowledge) dispatch before the dev.yml gate; project commands are + yaml-declared and run through Runner. + → .cursor/skills/architecture/command-dispatch/ +- [architecture/module-map] What owns what: src/dev is the typed CLI core; + each `lib/dev/` is one feature whose Accessor is its only CLI + surface. → .cursor/skills/architecture/module-map/ +- [architecture/hook-points] `dev up` / `install-deps` / `dev plan` double + as the idempotent hygiene hooks (skill links, knowledge sync): never + raise, never block on the network. + → .cursor/skills/architecture/hook-points/ + +## org tier + +Org-wide invariants and knowledge live in the configured org knowledge +repo (`knowledge_repo:`), not here: dev renders the always-on slice into +the generated `.cursor/rules/org-invariants.mdc` and links the on-demand +corpus into `~/.cursor/skills/`. A lesson about how we build software — +not about this repo — belongs there. diff --git a/.cursor/skills/architecture/command-dispatch/SKILL.md b/.cursor/skills/architecture/command-dispatch/SKILL.md new file mode 100644 index 0000000..b3434a0 --- /dev/null +++ b/.cursor/skills/architecture/command-dispatch/SKILL.md @@ -0,0 +1,35 @@ +--- +name: command-dispatch +description: >- + MUST be used when adding a dev command or changing how bin/dev routes + argv — global builtins vs project (dev.yml) commands. +--- + +# dev command dispatch: two classes of command + +`bin/dev` (sh shim → Ruby) puts `src/` and `lib/` on the load path, then +routes argv through two layers: + +1. **Global builtins** — `Dev::GlobalDispatch` + (`src/dev/global_dispatch.rb`) runs first, before any dev.yml lookup, + so `cd`, `plan`, `cred`, and `knowledge` work from any directory. Each + owns host- or workspace-global state, never project config. +2. **Project commands** — everything else builds `Dev::Runner` + (`src/dev/runner.rb`), which requires a dev.yml in the cwd's ancestry + (`DevYamlNotFoundError` at the CLI boundary) and runs the + yaml-declared command, plus project builtins like `up` / + `install-deps`. + +The seams: + +- A new global command joins `GlobalDispatch::GLOBAL_COMMANDS` and gets a + feature module under `lib/dev//` whose `Accessor` is its only CLI + surface (usage, arg parsing, clean failures) — see `Cd::Accessor`, + `Plan::Accessor`, `Knowledge::Accessor`. +- Project commands are declared in each repo's dev.yml, never hardcoded + in dev's core. +- Workspace-global commands resolve their root as nearest dev.yml, else + nearest `.git`, else cwd (`GlobalDispatch#workspace_root`). + +origin: seeded by the dev#58 architecture pass +date: 2026-07-25 diff --git a/.cursor/skills/architecture/hook-points/SKILL.md b/.cursor/skills/architecture/hook-points/SKILL.md new file mode 100644 index 0000000..59d7f8a --- /dev/null +++ b/.cursor/skills/architecture/hook-points/SKILL.md @@ -0,0 +1,30 @@ +--- +name: hook-points +description: >- + MUST be used when adding side-work (links, syncs, renders) to dev up, + dev install-deps, or dev plan — the rules hygiene rides by. +--- + +# dev hook points: hygiene rides, never blocks + +`dev up` / `dev install-deps` (`Runner#install_locked_deps`) and every +`dev plan` invocation (`Plan::Accessor#run`) double as the refresh points +for agent-facing hygiene: shipped-skill links, gem-skill links, the org +knowledge TTL fetch, and the org-invariants render. There is no separate +setup step by design — riding existing commands is what keeps the +artifacts fresh without asking anything of the user. + +Anything added to a hook point must obey both rules: + +- **Hygiene must not block correctness.** The hook paths never raise — + failures warn on stderr and the carrying command proceeds (see + `GemSkillLinker#link_all`, `Knowledge::Synchronizer#sync`, + `SkillInstaller#install`). +- **No network on the hot path.** Remote refreshes are TTL-gated and + async (`Knowledge::Cache#refresh_async`); the synchronous work is + idempotent, content-compared, millisecond-scale symlink and render + checks. Blocking network belongs only behind an explicit command + (`dev knowledge sync`). + +origin: seeded by the dev#58 architecture pass +date: 2026-07-25 diff --git a/.cursor/skills/architecture/module-map/SKILL.md b/.cursor/skills/architecture/module-map/SKILL.md new file mode 100644 index 0000000..dd4f6ef --- /dev/null +++ b/.cursor/skills/architecture/module-map/SKILL.md @@ -0,0 +1,36 @@ +--- +name: module-map +description: >- + MUST be used when deciding where new dev code lives or which module owns + a concern — the ownership map of src/ and lib/. +--- + +# dev module map + +- **`src/dev/`** — the typed (Sorbet) CLI core: Runner, command + parser/registry, dev.yml config parsing, CLI UI, GlobalDispatch. Owns + dispatch and execution, no feature logic. +- **`lib/dev/cd/`** — checkout jumping: RepoDiscovery walks the workspace + root, Matcher ranks, ShellHook owns the RC function (a child process + cannot cd its parent shell). +- **`lib/dev/plan/`** — Cursor plans ⇄ GitHub issues sync (the issue is + canonical; a stored merge base guards against clobbering remote edits). +- **`lib/dev/deps/`** — dependency management. Layering is canonical in + `.cursor/rules/separation-of-concerns.mdc`: Repository resolves, + Integration installs, Lockfile serializes, the orchestrator + coordinates — one class, one layer. +- **`lib/dev/knowledge/`** — org knowledge distribution: Cache (TTL git + clone), Synchronizer (orchestration), InvariantsRenderer (the generated + org-invariants.mdc). +- **`lib/dev/skill_installer.rb`** — the one symlink mechanism behind all + three skill channels (shipped, org, gem); the gem channel's lockfile + scan is `lib/dev/deps/gem_skill_linker.rb`. +- **`lib/dev/credentials.rb`** (+ `credential_accessor.rb`) — XDG-scoped + credential storage behind `dev cred`. +- **`lib/shadowenv_*.rb`** — per-toolchain env provisioning written into + `.shadowenv.d/` by project setup. +- **`share/cursor-skills/`** — skills dev ships user-globally (ai-flow, + capture-learning). + +origin: seeded by the dev#58 architecture pass +date: 2026-07-25 diff --git a/.cursor/skills/learnings/ai-flow-gitlink-exclusion/SKILL.md b/.cursor/skills/learnings/ai-flow-gitlink-exclusion/SKILL.md new file mode 100644 index 0000000..4edc6e3 --- /dev/null +++ b/.cursor/skills/learnings/ai-flow-gitlink-exclusion/SKILL.md @@ -0,0 +1,33 @@ +--- +name: ai-flow-gitlink-exclusion +description: >- + MUST be used when committing swept changes (git add -A / git add .) in a + worktree that may contain nested checkouts, e.g. an .ai-flow directory. +--- + +# Exclude .ai-flow gitlinks from commit sweeps + +A nested checkout inside the worktree (such as an `.ai-flow` runner +checkout) is a gitlink to git: a sweep stages it as a bare mode-160000 +entry — a broken submodule pointer with no `.gitmodules` — and the commit +ships it silently. Stage explicitly, or exclude known nested-checkout +directories from the sweep. + +Wrong: + +```sh +git add -A && git commit -m "iterate on PR feedback" +# the commit now carries: .ai-flow (mode 160000) +``` + +Right: + +```sh +git add -A -- ':!.ai-flow' +# and check `git status --porcelain` — never stage an unexpected +# 160000 entry +``` + +learned-from: d3mlabs/dev#35 (stray `.ai-flow` gitlink committed by the +iteration job; removed by hand in 0631a2b) +date: 2026-07-25 diff --git a/Gemfile b/Gemfile index e020b16..616fa64 100644 --- a/Gemfile +++ b/Gemfile @@ -5,8 +5,9 @@ source "https://rubygems.org" # Runtime deps (cli-ui, sorbet-runtime) come from the gemspec. gemspec -# RSpock (from RubyGems) for test_helper and rspock-style tests -gem "rspock", "~> 2.3" +# RSpock (from RubyGems) for test_helper and rspock-style tests; 3.0 also +# ships the rspock agent skill the learnings index points at. +gem "rspock", "~> 3.0" # Test (dev repo's own tests) gem "minitest" diff --git a/Gemfile.lock b/Gemfile.lock index c974bb8..ed12e0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,10 +10,10 @@ GEM specs: ansi (1.5.0) ast (2.4.3) - ast_transform (2.1.4) - parser (>= 3.0) + ast_transform (3.0.0) + parser (>= 3.3) prism (>= 1.5) - unparser (>= 0.6) + unparser (>= 0.8) benchmark (0.5.0) builder (3.3.0) byebug (13.0.0) @@ -35,11 +35,11 @@ GEM builder minitest (>= 5.0) ruby-progressbar - mocha (3.0.2) + mocha (3.1.0) ruby2_keywords (>= 0.0.5) netrc (0.11.0) parallel (1.27.0) - parser (3.3.10.2) + parser (3.3.12.0) ast (~> 2.4.1) racc prism (1.9.0) @@ -65,12 +65,10 @@ GEM io-console (~> 0.5) require-hooks (0.2.3) rexml (3.4.4) - rspock (2.5.0) - ast_transform (~> 2.0) + rspock (3.0.0) + ast_transform (~> 3.0) minitest (~> 5.0) mocha (>= 1.0) - parser (>= 3.0) - unparser (>= 0.6) rubocop (1.88.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -129,7 +127,7 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.2.0) - unparser (0.8.2) + unparser (0.9.0) diff-lcs (>= 1.6, < 3) parser (>= 3.3.0) prism (>= 1.5.1) @@ -151,7 +149,7 @@ DEPENDENCIES pry-byebug (~> 3.11) rake rbs (~> 4.0.0.dev.5) - rspock (~> 2.3) + rspock (~> 3.0) rubocop-shopify (~> 3.0) simplecov (~> 0.22) sorbet @@ -160,7 +158,7 @@ DEPENDENCIES CHECKSUMS ansi (1.5.0) sha256=5408253274e33d9d27d4a98c46d2998266fd51cba58a7eb9d08f50e57ed23592 ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 - ast_transform (2.1.4) sha256=3414a65911cf583a32af3ebf643e29033e135a817c1286548a7452cf49e71ac8 + ast_transform (3.0.0) sha256=b437f0ac9fbb107312a6e8fab15f37c29e366c32c95def964de4dc49158fed0d benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d @@ -178,10 +176,10 @@ CHECKSUMS method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5 minitest (5.27.0) sha256=2d3b17f8a36fe7801c1adcffdbc38233b938eb0b4966e97a6739055a45fa77d5 minitest-reporters (1.7.1) sha256=5060413a0c95b8c32fe73e0606f3631c173a884d7900e50013e15094eb50562c - mocha (3.0.2) sha256=3d8029531d8b71bff5ae07040758f77fdf578174189ffda1bef7749a59e92df8 + mocha (3.1.0) sha256=75f42d69ebfb1f10b32489dff8f8431d37a418120ecdfc07afe3bc183d4e1d56 netrc (0.11.0) sha256=de1ce33da8c99ab1d97871726cba75151113f117146becbe45aa85cb3dabee3f parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130 - parser (3.3.10.2) sha256=6f60c84aa4bdcedb6d1a2434b738fe8a8136807b6adc8f7f53b97da9bc4e9357 + parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828 prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e pry-byebug (3.12.0) sha256=594e094ae8a8390a7ad4c7b36ae36e13304ed02664c67417d108dc5f7213d1b7 @@ -194,7 +192,7 @@ CHECKSUMS reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835 require-hooks (0.2.3) sha256=224be5b4be0fd2a47cb73286c500da366704a54ec195b6627366380c950efac8 rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 - rspock (2.5.0) sha256=5bac4d22eab6f10a04523d9d5368f451b4c261c51cab092d8a8e868318f9b348 + rspock (3.0.0) sha256=279095618eb3f154a6770829a1b8537d65bb22a41555f5d89a727aeb19d0bb1e rubocop (1.88.2) sha256=8def251c90cd955feb4daa3edc0ab56893250c4ce90ef81e6c80c03f9a939bbf rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db rubocop-shopify (3.0.1) sha256=4adffa6313294bd9da2b0896ae44c5eb8e419336b2413de20c38b7691a7e6774 @@ -215,7 +213,7 @@ CHECKSUMS tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f - unparser (0.8.2) sha256=654af48a6cfa25baf145563e01f40c60ca7d5c7520ff506912d0bb2f1240fd00 + unparser (0.9.0) sha256=4331f174a73a23b69250b13d47da3794ed1449711ee0f9ed8947dc020ba76067 yard (0.9.38) sha256=721fb82afb10532aa49860655f6cc2eaa7130889df291b052e1e6b268283010f yard-sorbet (0.9.0) sha256=03d1aa461b9e9c82b886919a13aa3e09fcf4d1852239d2967ed97e92723ffe21 diff --git a/README.md b/README.md index b41fb9e..6929881 100644 --- a/README.md +++ b/README.md @@ -373,6 +373,10 @@ dev distributes agent-facing skills (Cursor-style `SKILL.md` directories) over t - **Gem-shipped skills.** A gem's skill is part of what installing that dependency means, so `dev up` / `dev install-deps` finish by scanning the resolved (lockfile-matched) gem set for `skills/*/SKILL.md` and linking each project-scoped as `.agents/skills/gem---` (gitignored; an agent-neutral dir, so the mechanism isn't Cursor-locked). Links for gems that leave the lock are pruned on the next install — a skill-set change rides the same staleness story as any dependency change. - **Org knowledge** (opt-in). With `knowledge_repo: /` in `~/.config/dev/config.yml` (or `DEV_KNOWLEDGE_REPO`), dev keeps a machine-local cache of the org knowledge repo under `~/.local/share/dev/knowledge`, refreshed on a TTL (`knowledge_ttl:` seconds, default 900). The fetch is async and rides the user's `gh` auth; no dev command ever blocks on the network for knowledge — offline serves the cache. From the cache, dev links the repo's `skills/*` user-globally into `~/.cursor/skills/` and renders the index's `## Invariants (always-on)` section into the current project as `.cursor/rules/org-invariants.mdc` — generated, content-compared, and never committed (a participating repo's only footprint is one `.gitignore` line), so drift from the canonical repo is structurally impossible. Machines without the setting simply have no org sync: dev is public and ships only the mechanism, never the content. `dev knowledge sync` forces a refresh; `dev knowledge status` reports cache age. +### Repo learnings + +Alongside the distributed channels, a repo can carry **committed learnings** — lessons distilled from review feedback, builds, and scans — as an always-on index (`.cursor/rules/learnings-index.mdc`, one `[domain/slug]` line + trigger sentence per learning) pointing at on-demand detail skills (`.cursor/skills/learnings//SKILL.md`; architecture digests under `.cursor/skills/architecture//`). Committed files need no distribution step: every checkout — IDE, runner, worktree — has them by construction. The index defines its own format in its preamble; this repo's copy is the reference. Capture goes through the `capture-learning` skill (shipped in `share/cursor-skills/`, so it is available in every IDE session) or ai-flow's `/learn` command on GitHub surfaces — both stage learnings as draft PRs, and human merge is the curation gate. + ## Build container & caching model For repos that declare a `build.container`, dev builds and runs commands inside a content-addressed Docker image, backed by host-side caches it owns end to end. The guiding principle throughout is **content-addressing**: an artifact's identity is a hash of its inputs, so distinct versions coexist instead of overwriting, and identical inputs are never rebuilt. diff --git a/share/cursor-skills/capture-learning/SKILL.md b/share/cursor-skills/capture-learning/SKILL.md new file mode 100644 index 0000000..81ae4eb --- /dev/null +++ b/share/cursor-skills/capture-learning/SKILL.md @@ -0,0 +1,96 @@ +--- +name: capture-learning +description: >- + Capture, revise, promote, or retire learnings — lessons distilled from + feedback and stored as an index line plus a detail skill. Use when the + user says "remember this" / "make this a learning", asks to scan one or + more repos for learnings, to promote a learning org-wide, or to retire + one — or when you notice being corrected for the same thing twice. +--- + +# capture-learning: distill lessons into indexed learnings + +A learning is one unit materialized two ways: an index line in the repo's +`.cursor/rules/learnings-index.mdc` (always-on awareness, ~15 tokens per +session) and a detail skill at `.cursor/skills/learnings//SKILL.md` +(loaded on demand). This skill is the local-session twin of ai-flow's +`/learn` command — same rubrics, same output shape — for every form: +dictated, sweep, scan, promote, revise, retire. + +## Distillation rubric (what qualifies) + +Only lessons that generalize beyond the immediate diff or session become +learnings. Three kinds, one format: + +- **coding practices** — style/API corrections that will recur, +- **architecture knowledge** — constraints and shapes of the system + ("X must never call Y directly", "this subsystem owns that lifecycle"), +- **process rules** — e.g. "gitlink dirs must be excluded from sweeps". + +Diff-local fixes (typos, renames, one-off bugs) are not learnings. + +Before drafting, dedup: search the repo's learnings index and the org +tier (skills under `~/.cursor/skills/`, the generated +`.cursor/rules/org-invariants.mdc`) for an equivalent or conflicting +entry. Revising an existing learning always beats adding a duplicate, and +the same lesson already captured in a *different* repo is a promotion +signal — draft the promotion, not a third copy. + +## Scope rubric (where it lands) + +Ask: is this about *this repo's* code, or about *how we build software*? +Repo-specific lessons land in the current repo's index and skills. +Repo-agnostic lessons target the org knowledge repo (a PR there; the +merge is the rollout). Borderline calls default to repo-local — later +promotion is cheap, demoting a wrongly-global rule is confusing. + +## Format + +Index line, grouped into a `## ` section of the index: + +```markdown +- [domain/slug] One-sentence trigger. → .cursor/skills/learnings// +``` + +Detail skill, hard cap ~40 lines: frontmatter `name` matching its folder +and an imperative `description` ("MUST be used when …"); the rule in two +sentences; one wrong/right pair; a `learned-from:` origin link; a +`date:`. Architecture digests follow the same shape under +`.cursor/skills/architecture//`. + +Caps: the index is soft-capped at ~50 entries — at the cap, propose a +retirement, a consolidation, or a glob-scoped sub-index split alongside +any addition. A learning outgrowing 40 lines graduates to a full skill +owned by the thing it documents (the rspock gem skill is the archetype). + +## Forms + +- **Dictated** ("remember this: …") — the human already distilled the + lesson; format it, dedup, apply the scope rubric. No sweep. +- **Sweep** — distill a surface's feedback (a reviewed PR, an issue + discussion, this session's corrections): what generalizes becomes a + learning; the rest was already absorbed. +- **Scan** ("scan this repo / these checkouts for learnings") — survey + the named checkouts' code and docs, draft per-repo; dedup makes + re-scans cheap (unchanged areas draft nothing). Scans also seed or + refresh the architecture section. +- **Promote ``** — move the detail skill to the org knowledge repo + and drop the repo entry (the org tier now carries it); origin links + ride along. +- **Revise / retire** — when evidence contradicts or stales an existing + learning, stage an edit or removal, never a contradictory sibling. The + index must be able to shrink or it becomes noise. + +## Output shape (the human gate) + +Learnings merge through review, never silently: + +- **In Cursor plan mode:** stage the proposals as sections of the plan + document — index line, skill body, target tier per learning — and + iterate conversationally ("drop 3, merge 2 into 5, that's org-wide"); + switching to agent mode applies the agreed set. Preferred for scans. +- **Otherwise:** write the files and open a draft PR on a dedicated + branch (`ai/learn-`), the body embedding the motivating + evidence and a `learned-from: ` marker line. Never mix + learnings into an unrelated code PR — separate PRs give independent + merge and revert outcomes. diff --git a/sorbet/rbi/gems/ast_transform@2.1.4.rbi b/sorbet/rbi/gems/ast_transform@2.1.4.rbi deleted file mode 100644 index 04c9339..0000000 --- a/sorbet/rbi/gems/ast_transform@2.1.4.rbi +++ /dev/null @@ -1,135 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `ast_transform` gem. -# Please instead update this file by running `bin/tapioca gem ast_transform`. - -module ASTTransform - class << self - def acronym(acronym); end - def acronyms; end - def install; end - def output_path; end - def output_path=(path); end - end -end - -class ASTTransform::AbstractTransformation < ::Parser::AST::Processor - include ::ASTTransform::TransformationHelper - include ::ASTTransform::TransformationHelper::Methods - extend ::ASTTransform::TransformationHelper::Methods - - def process(node); end - def run(node); end - - private - - def process_node(node); end -end - -ASTTransform::DEFAULT_OUTPUT_PATH = T.let(T.unsafe(nil), String) - -module ASTTransform::InstructionSequence - class << self - def source_to_transformed_iseq(source, source_path); end - def using_bootsnap_compilation?; end - def write(string, pathname); end - def write_pathname(file_path); end - end -end - -module ASTTransform::InstructionSequence::BootsnapMixin - def input_to_storage(source, source_path); end -end - -module ASTTransform::InstructionSequence::Mixin - def load_iseq(source_path); end -end - -module ASTTransform::MixinUtils - class << self - def try_super(target, method_sym, *args, &block); end - end -end - -class ASTTransform::SourceMap - def initialize(source_file_path, transformed_file_path, source_ranges_ast, transformed_ranges_ast); end - - def line(line_number); end - def line_count; end - def source_file_path; end - def source_map; end - def transformed_file_path; end - - private - - def approximate_dig_last_valid_node(node, indexes, depth = T.unsafe(nil)); end - def build_source_map; end - def dig_last_valid_node(node, indexes); end - def dig_last_valid_node_index(node, indexes); end - def dig_node(node, indexes); end - def extract_source_map_data(node, indexes); end - def search_node(node, queried_node); end - def search_range(node, max_range = T.unsafe(nil)); end - def source_line(line_number); end - - class << self - def for_file_path(file_path); end - def register_source_map(source_map); end - - private - - def source_maps; end - end -end - -class ASTTransform::Transformation < ::ASTTransform::AbstractTransformation - private - - def extract_transformation(node); end - def extract_transformations(node); end - def next_child(node, index); end - def previous_child(node, index); end - def process_node(node); end - def process_node_helper(node, previous_node); end - def require_path(const_name); end - def require_transformation(node); end - def transform_node?(node); end - def transformable_node?(node); end - def try_const_get(const_name); end -end - -ASTTransform::Transformation::TRANSFORM_AST = T.let(T.unsafe(nil), Parser::AST::Node) - -module ASTTransform::TransformationHelper - include ::ASTTransform::TransformationHelper::Methods - - mixes_in_class_methods ::ASTTransform::TransformationHelper::Methods - - class << self - def included(base); end - end -end - -module ASTTransform::TransformationHelper::Methods - def s(type, *children, **properties); end -end - -class ASTTransform::Transformer - def initialize(*transformations, builder: T.unsafe(nil)); end - - def build_ast(source, file_path: T.unsafe(nil)); end - def build_ast_from_file(file_path); end - def transform(source); end - def transform_ast(ast); end - def transform_file(file_path, transformed_file_path); end - def transform_file_source(source, file_path, transformed_file_path); end - - private - - def create_buffer(source, file_path); end - def parser; end - def register_source_map(source_file_path, transformed_file_path, transformed_ast, transformed_source); end -end - -ASTTransform::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/ast_transform@3.0.0.rbi b/sorbet/rbi/gems/ast_transform@3.0.0.rbi new file mode 100644 index 0000000..f1d2f1a --- /dev/null +++ b/sorbet/rbi/gems/ast_transform@3.0.0.rbi @@ -0,0 +1,910 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ast_transform` gem. +# Please instead update this file by running `bin/tapioca gem ast_transform`. + + +# source://ast_transform//lib/ast_transform/version.rb#3 +module ASTTransform + class << self + # source://ast_transform//lib/ast_transform.rb#16 + def acronym(acronym); end + + # source://ast_transform//lib/ast_transform.rb#12 + def acronyms; end + + # source://ast_transform//lib/ast_transform.rb#21 + def install; end + + # source://ast_transform//lib/ast_transform.rb#35 + def output_path; end + + # Sets the attribute output_path + # + # @param value the value to set the attribute output_path to. + # + # source://ast_transform//lib/ast_transform.rb#33 + def output_path=(_arg0); end + end +end + +# source://ast_transform//lib/ast_transform/abstract_transformation.rb#6 +class ASTTransform::AbstractTransformation < ::Parser::AST::Processor + include ::ASTTransform::TransformationHelper + include ::ASTTransform::TransformationHelper::Methods + extend ::ASTTransform::TransformationHelper::Methods + + # Thunks are framework-owned IR: descend into the body so passes that don't know about thunks still process the + # wrapped statements. Without this, Processor's handler_missing default would pass the node through opaquely, + # hiding the body from every later transformation. The token (first child) is not a node and passes through + # untouched. + # + # source://ast_transform//lib/ast_transform/abstract_transformation.rb#30 + def on_ast_thunk(node); end + + # Used internally by Parser::AST::Processor to process each node. DO NOT OVERRIDE. + # + # source://ast_transform//lib/ast_transform/abstract_transformation.rb#20 + def process(node); end + + # Runs this transformation on +node+. + # Note: If you want to add one-time checks to the transformation, override this, then call super. + # + # @param node [Parser::AST::Node] The node to be transformed. + # @return [Parser::AST::Node] The transformed node. + # + # source://ast_transform//lib/ast_transform/abstract_transformation.rb#15 + def run(node); end + + private + + # Processes the given +node+. + # Note: If you want to do processing on each node, override this. + # + # @param node [Parser::AST::Node] The node to be transformed. + # @return [Parser::AST::Node] The transformed node. + # + # source://ast_transform//lib/ast_transform/abstract_transformation.rb#42 + def process_node(node); end +end + +# source://ast_transform//lib/ast_transform.rb#9 +ASTTransform::DEFAULT_OUTPUT_PATH = T.let(T.unsafe(nil), String) + +# source://ast_transform//lib/ast_transform/instruction_sequence.rb#4 +module ASTTransform::InstructionSequence + class << self + # source://ast_transform//lib/ast_transform/instruction_sequence.rb#13 + def source_to_transformed_iseq(source, source_path); end + + # @return [Boolean] + # + # source://ast_transform//lib/ast_transform/instruction_sequence.rb#6 + def using_bootsnap_compilation?; end + + # source://ast_transform//lib/ast_transform/instruction_sequence.rb#29 + def write(string, pathname); end + + # source://ast_transform//lib/ast_transform/instruction_sequence.rb#23 + def write_pathname(file_path); end + end +end + +# source://ast_transform//lib/ast_transform/instruction_sequence/bootsnap_mixin.rb#9 +module ASTTransform::InstructionSequence::BootsnapMixin + # source://ast_transform//lib/ast_transform/instruction_sequence/bootsnap_mixin.rb#10 + def input_to_storage(source, source_path); end +end + +# source://ast_transform//lib/ast_transform/instruction_sequence/mixin.rb#10 +module ASTTransform::InstructionSequence::Mixin + # source://ast_transform//lib/ast_transform/instruction_sequence/mixin.rb#11 + def load_iseq(source_path); end +end + +# Extends the default Prism parser builder to distinguish keyword arguments from hash literals in the AST. +# +# The upstream builder always emits :hash nodes for both `foo(bar: 1)` and `foo({ bar: 1 })`. Unparser uses the +# node type to decide whether to emit braces: :hash gets `{}`, :kwargs does not. Since Ruby 3.0+ treats these as +# semantically different (strict keyword/positional separation), we need the AST to preserve the distinction. +# +# NOTE: parsed nodes deliberately stay plain Parser::AST::Node. Custom node classes exist only for registered +# custom types (see ASTTransform::Node), which are IR and never reach Unparser: AST::Node#eql? compares class, and +# Unparser verifies dynamic-string emission by re-parsing and comparing eql? against the freshly parsed +# (plain-class) node — custom-class nodes of standard types would fail that verification. +# +# source://ast_transform//lib/ast_transform/kwargs_builder.rb#16 +class ASTTransform::KwargsBuilder < ::Prism::Translation::Parser::Builder + # source://ast_transform//lib/ast_transform/kwargs_builder.rb#17 + def associate(begin_t, pairs, end_t); end +end + +# Line-addressed output: text is placed at absolute line numbers, top to bottom, and the cursor never rewinds. +# When a placement's target line is already behind the cursor, the text is packed (`; `) onto the current line +# instead — Ruby lets statements share a physical line, so alignment degrades locally and the next placement +# whose target is still ahead re-anchors. Knows nothing about Ruby structure or ASTs; callers decide WHAT goes +# on WHICH line, the layout owns the pad-or-pack mechanics. +# +# source://ast_transform//lib/ast_transform/layout.rb#9 +class ASTTransform::Layout + # @return [Layout] a new instance of Layout + # + # source://ast_transform//lib/ast_transform/layout.rb#10 + def initialize; end + + # The line number currently being written; the next fresh line would be +cursor + 1+. + # + # source://ast_transform//lib/ast_transform/layout.rb#15 + def cursor; end + + # Appends +text+ to the current line with a `; ` separator. The last line is never blank here: padding blanks + # are only created inside +place+, which immediately overwrites the padded line. + # + # source://ast_transform//lib/ast_transform/layout.rb#45 + def pack(text); end + + # Places +text+ at +target_line+ when the cursor hasn't passed it; otherwise packs onto the current line. + # Multi-line text advances the cursor by its height. When opening a fresh line, the first line is indented to + # +column+ — cosmetic only (leading whitespace is never significant in emitted code), but it keeps the artifact + # visually close to the source. Packed text ignores the column, as do continuation lines (they keep their own + # relative indentation). + # + # source://ast_transform//lib/ast_transform/layout.rb#24 + def place(target_line, text, column: T.unsafe(nil)); end + + # Appends +text+ on a new line unconditionally — for text that must never be `;`-packed after a statement + # (e.g. keywords). + # + # source://ast_transform//lib/ast_transform/layout.rb#39 + def place_on_fresh_line(text); end + + # @return [String] the laid-out text, with a trailing newline. + # + # source://ast_transform//lib/ast_transform/layout.rb#54 + def to_source; end + + private + + # source://ast_transform//lib/ast_transform/layout.rb#60 + def indented(text, column); end +end + +# Emits a transformed AST as text in which every loc-carrying statement occupies its original source line, so that +# backtraces, breakpoints and debugger display are correct by construction — CRuby derives line numbers from +# physical text position, so placement is our line table. +# +# Placement policy over statement sequences: +# +# 1. Statement has loc: target its source line — the Layout pads to reach it, or packs (`; `) when the cursor has +# already passed it. A user statement packing means the transform moved it — the alignment auditor's concern, +# not a runtime failure. +# 2. No loc: pack onto the current line — synthetic code has no source-line truth to preserve. +# +# The emitter owns the Ruby knowledge: walking statement structure, deciding which line each node targets, and +# that keywords can never be `;`-packed. The pad-or-pack mechanics live in Layout; statement-to-text rendering +# (and its isolation workarounds) in StatementRenderer — both created per emission, so the emitter itself is +# stateless and an instance is a reusable collaborator. +# +# Thunk nodes are lowered (ThunkLowering) before layout; the emitter's postcondition is that no custom node type +# (ast_* markers or types registered on ASTTransform::Node) crosses the unparse boundary — they are IR between +# stages that understand them. +# +# source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#28 +class ASTTransform::LineAlignedEmitter + # @param thunk_lowering [ThunkLowering] the lowering run ahead of emission. + # @return [LineAlignedEmitter] a new instance of LineAlignedEmitter + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#45 + def initialize(thunk_lowering: T.unsafe(nil)); end + + # @param ast [Parser::AST::Node] transformed AST + # @param source_path [String] original file path (for error messages) + # @raise [ThunkLowering::PlacementError] if a thunk cannot be textually placed + # @raise [UnloweredNodeTypeError] if a custom node type survived to emission + # @return [String] transformed source, line-aligned + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#54 + def emit(ast, source_path); end + + private + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#212 + def assert_no_custom_types(node, source_path); end + + # @return [Boolean] + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#139 + def block_assignment?(node); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#196 + def closer_column(node); end + + # The line the container's `end`/`}` occupies in the source, when known. + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#191 + def closer_line(node); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#182 + def container_body(node); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#153 + def container_delimiters(node, renderer); end + + # Emits a container body that may be a bare :ensure/:rescue node (their begin/end context comes from the + # surrounding def/block/kwbegin, so the keywords must be emitted inline, aligned like statements). + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#80 + def emit_body(body, layout, renderer); end + + # Renders a container's opener and closer from the node with its body emptied, then recurses into the body so + # nested statements align. + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#146 + def emit_container(node, layout, renderer); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#88 + def emit_ensure(node, layout, renderer); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#106 + def emit_resbody(node, layout, renderer); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#95 + def emit_rescue(node, layout, renderer); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#70 + def emit_statement(node, layout, renderer); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#66 + def emit_statements(statements, layout, renderer); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#167 + def empty_container(node); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#130 + def keyword_column(node); end + + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#125 + def keyword_line(node); end + + # Keywords (rescue/ensure/else) cannot be `;`-packed after a statement; when their line is taken they go on a + # fresh line instead. + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#117 + def place_keyword(layout, target_line, keyword, column: T.unsafe(nil)); end + + # @return [Boolean] + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#135 + def recursive_container?(node); end + + # Loc-less :begin nodes in statement position (e.g. a lowered thunk in a single-statement container body, carried + # with its placement) are grouping, not structure: flatten them so each inner statement is laid out independently. + # + # source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#203 + def statements_of(body); end +end + +# Assignments whose value is a block (e.g. the lowered thunk proc) recurse into the block so its body statements +# align. +# +# source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#41 +ASTTransform::LineAlignedEmitter::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) + +# source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#42 +ASTTransform::LineAlignedEmitter::BLOCK_VALUE_TYPES = T.let(T.unsafe(nil), Array) + +# source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#36 +ASTTransform::LineAlignedEmitter::BODY_INDEXES = T.let(T.unsafe(nil), Hash) + +# Containers the emitter recurses into so nested statements align; every other node renders as an Unparser blob +# at its head line. +# +# source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#35 +ASTTransform::LineAlignedEmitter::RECURSIVE_CONTAINER_TYPES = T.let(T.unsafe(nil), Array) + +# Raised as the emitter's postcondition when a custom node type (ast_* markers or types registered on +# ASTTransform::Node) reaches the unparse boundary instead of being lowered by the stage that understands it. +# +# source://ast_transform//lib/ast_transform/line_aligned_emitter.rb#31 +class ASTTransform::LineAlignedEmitter::UnloweredNodeTypeError < ::StandardError; end + +# source://ast_transform//lib/ast_transform/instruction_sequence/mixin_utils.rb#4 +module ASTTransform::MixinUtils + class << self + # source://ast_transform//lib/ast_transform/instruction_sequence/mixin_utils.rb#6 + def try_super(target, method_sym, *args, &block); end + end +end + +# Base class for custom IR nodes. Transform authors subclass it and register a custom node type to get type-routed +# construction from +s+ with domain accessors: +# +# class InteractionNode < ASTTransform::Node +# register :rspock_interaction +# +# def cardinality = children[0] +# end +# +# s(:rspock_interaction, ...) # => InteractionNode +# +# Custom node *types* are IR between stages that understand them and must be lowered before emission (the emitter +# enforces this). Standard-typed nodes deliberately stay plain Parser::AST::Node everywhere — parsed and +s+-built +# alike: AST::Node#eql? compares class, and Unparser verifies dynamic-string emission by re-parsing and +# eql?-comparing, so a custom class on a standard type breaks emission. +# +# source://ast_transform//lib/ast_transform/node.rb#21 +class ASTTransform::Node < ::Parser::AST::Node + class << self + # Builds a node of +type+: registered types construct their custom class, everything else a plain + # Parser::AST::Node. + # + # @param children [Array] child nodes / literals + # @param properties [Hash] node properties (e.g. location:) + # @param type [Symbol] node type + # @return [Parser::AST::Node] + # + # source://ast_transform//lib/ast_transform/node.rb#38 + def build(type, children, properties = T.unsafe(nil)); end + + # Registers +self+ as the class to construct for +type+ nodes. + # + # @param type [Symbol] the custom node type routed to this class + # @return [void] + # + # source://ast_transform//lib/ast_transform/node.rb#27 + def register(type); end + + # source://ast_transform//lib/ast_transform/node.rb#43 + def registry; end + end +end + +# Renders individual statements to text via Unparser, working around the two consequences of unparsing them in +# isolation (line-aligned emission places each statement independently, so each is ripped out of its context): +# +# * Isolation loses the surrounding scope's local variables, making Unparser re-parse identifiers as method calls +# and fail its dstr round-trip verification — so a renderer is built once per tree with every local bound +# anywhere in it, and feeds Unparser that set on each render. +# * Unparser normalizes some single-line constructs into multi-line form, which would push following statements +# off their lines — so renders taller than their source are compressed back to one line when safely possible. +# +# Immutable: configured with the tree's locals at construction, no per-render state. +# +# source://ast_transform//lib/ast_transform/statement_renderer.rb#16 +class ASTTransform::StatementRenderer + # @param local_variables [Set] every local bound in the tree the statements come from. + # @return [StatementRenderer] a new instance of StatementRenderer + # + # source://ast_transform//lib/ast_transform/statement_renderer.rb#40 + def initialize(local_variables:); end + + # Renders +node+ no taller than its source when safely possible. Unparser normalizes some single-line + # constructs into multi-line form (e.g. modifier-if into if/end); when the render is taller than the + # statement's source, compress it back to one line — verified by re-parse so a statement that cannot be safely + # single-lined (e.g. containing a heredoc) falls back to its multi-line render. + # + # source://ast_transform//lib/ast_transform/statement_renderer.rb#54 + def aligned_render(node); end + + # @param node [Parser::AST::Node] the statement to render. + # @return [String] Unparser's render, informed of the tree's locals. + # + # source://ast_transform//lib/ast_transform/statement_renderer.rb#46 + def unparse(node); end + + private + + # source://ast_transform//lib/ast_transform/statement_renderer.rb#67 + def compress_to_single_line(render); end + + class << self + # Builds a renderer for statements of +node+'s tree, holding every local bound anywhere in it — an + # over-approximation that is safe because the set only informs Unparser's re-parse verification, never the + # rendered text. + # + # source://ast_transform//lib/ast_transform/statement_renderer.rb#24 + def for_tree(node); end + + private + + # source://ast_transform//lib/ast_transform/statement_renderer.rb#30 + def collect_local_variables(node, names = T.unsafe(nil)); end + end +end + +# Node types that bind a local variable name: assignments plus every method/block parameter flavor. +# +# source://ast_transform//lib/ast_transform/statement_renderer.rb#18 +ASTTransform::StatementRenderer::LOCAL_BINDING_TYPES = T.let(T.unsafe(nil), Array) + +# The reordering primitive: an eagerly built wrapper node, spliced wherever the wrapped statements must EXECUTE — +# statement position or composed inside an expression (e.g. an assert_raises block body). Its body keeps its own +# source locations, and the lowering derives the wrapper's textual placement from them (see ThunkLowering), so the +# statements still emit on their original lines even though execution waits. +# +# Children are +[id, *body_statements]+ and the invariants are enforced here in +initialize+, which every +# construction path shares — +s+ routing, the +thunk+ helper, and Processor rebuilds (+updated+ re-initializes). +# Build thunks with +TransformationHelper#thunk+; reuse the same node to execute one body from several points +# (multiplexing). +# +# Runtime semantics are near-transparent (proc lowering): +return+ still returns from the enclosing method, and +# locals the body assigns stay method-scope. See ThunkLowering for the full contract. +# +# source://ast_transform//lib/ast_transform/thunk.rb#18 +class ASTTransform::Thunk < ::ASTTransform::Node + # @raise [ArgumentError] + # @return [Thunk] a new instance of Thunk + # + # source://ast_transform//lib/ast_transform/thunk.rb#28 + def initialize(type, children, properties = T.unsafe(nil)); end + + # Retrieves the Thunk's body. + # + # @note Same as the +Parser::AST::Node#children+ + # @return [Array] The nodes forming the body of the Thunk. + # + # source://ast_transform//lib/ast_transform/thunk.rb#53 + def body; end + + # Retrieves the Thunk's id. + # + # @return [ASTTransform::Thunk::Id] The Id. + # + # source://ast_transform//lib/ast_transform/thunk.rb#47 + def id; end +end + +# The identity of a Thunk across transformation passes: Processor and Node#updated rebuilds create new node +# objects, so node identity does not survive — but children DO (carried by reference through every rebuild). Every +# rebuild of a thunk therefore carries this same id object, and the lowering groups occurrences by its object +# identity: one proc, one call per occurrence. Minted internally by the +thunk+ helper, never handled by authors. +# No behavior — a named class over a bare Object.new only for self-documenting AST dumps and greppability. +# +# source://ast_transform//lib/ast_transform/thunk.rb#26 +class ASTTransform::Thunk::Id; end + +# Lowers Thunk nodes into plain Ruby ahead of emission. Each unique thunk (grouped by id identity) becomes a +# hidden proc; each occurrence becomes the proc's call: +# +# thunk placed at the execution point +# => x = x; __ast_thunk___ = proc { body } (at the body's source lines) +# ... +# __ast_thunk___.call (at the occurrence) +# +# Placement is inferred, not authored: the proc's text is inserted into the statement sequence enclosing the +# occurrence, positioned among its siblings by the body's first source line — the lines the author removed the +# statements from. A loc-less body has no textual home and packs immediately before its call. Placements never +# escape a scope boundary (def/class/module bodies absorb their own), because the hidden lvar must share the call's +# method activation; they DO escape block literals, which close over the defining scope. +# +# The closure is a non-lambda proc on purpose: `return` inside a proc returns from the method where the proc was +# defined, and placement and execution always share one method activation, so a thunked `return` keeps its original +# meaning. Jump keywords whose owner lies outside the body keep Ruby's native behavior (`break`/`retry` fail loudly, +# `next`/`redo` silently alter flow) — what a transform chooses to thunk is the transform author's call. +# +# The `x = x` pre-declarations cover every local the body assigns at method scope. A local first assigned inside a +# block literal is block-local, so without a textual method-scope assignment before the proc, thunked assignments +# would be invisible to the statements that read them after the execution point. Self-assignment registers the name +# (nil until the thunk runs — exactly what an unexecuted assignment yields) without clobbering an already-assigned +# value. +# +# Stateless: the thunks encountered during one lowering are tracked in a Registry created at +lower+ entry, so an +# instance is a reusable collaborator. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#35 +class ASTTransform::ThunkLowering + include ::ASTTransform::TransformationHelper + include ::ASTTransform::TransformationHelper::Methods + extend ::ASTTransform::TransformationHelper::Methods + + # @param node [Parser::AST::Node] tree possibly containing Thunk nodes + # @raise [PlacementError] when a thunk body's source lines fall after its execution point, or occurrences of + # one thunk diverge + # @return [Parser::AST::Node] tree with thunks lowered to plain Ruby + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#93 + def lower(node); end + + private + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#194 + def body_first_line(body); end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#183 + def call_node(id, registry); end + + # The proc's text must precede its call: a placement whose body lines fall at or after the executing statement + # (or any statement after it) cannot be laid out — the assignment would complete after the call. + # + # @raise [PlacementError] + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#200 + def check_placement_precedes_execution!(placement, executing_statement, following_statements); end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#214 + def insertion_index(statements, placement); end + + # Lowers a node standing in statement-body position (a container's body or the root), absorbing any placements + # that arise within it. + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#101 + def lower_body(node, registry); end + + # Lowers a node in expression position. Returns the lowered node and the placements that must be inserted into + # the enclosing statement sequence. + # + # @return [Array(Parser::AST::Node, Array)] + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#132 + def lower_expression(node, registry); end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#150 + def lower_generic(node, registry); end + + # Lowers a statement sequence, inserting each placement among the statements by the body's source line. + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#113 + def lower_sequence(node, registry); end + + # An occurrence of a thunk: the first occurrence of its id yields the placement; every occurrence yields the + # call. + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#169 + def lower_thunk(node, registry); end + + # Locals the thunk body assigns at method scope, in first-assignment order (covers masgn/op_asgn targets — they + # all carry :lvasgn nodes). + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#229 + def method_scope_assignments(node, names = T.unsafe(nil)); end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#187 + def placement_statements(name, lowered_body, registry); end +end + +# Block literals: locals first assigned inside them are block-local (the same lexical rule the pre-declarations +# exist to work around), but their callee/arguments evaluate at method scope and are still descended. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#225 +ASTTransform::ThunkLowering::BLOCK_TYPES = T.let(T.unsafe(nil), Array) + +# Node types opening a new local-variable scope: assignments inside them were invisible to the method scope in +# the original source too, so they get no pre-declaration. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#222 +ASTTransform::ThunkLowering::NEW_SCOPE_TYPES = T.let(T.unsafe(nil), Array) + +# A pending proc definition: +line+ is the body's first source line (nil for fully synthetic bodies), +# +statements+ the pre-declarations plus the proc assignment. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 +class ASTTransform::ThunkLowering::Placement < ::Struct + # Returns the value of attribute line + # + # @return [Object] the current value of line + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def line; end + + # Sets the attribute line + # + # @param value [Object] the value to set the attribute line to. + # @return [Object] the newly set value + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def line=(_); end + + # Returns the value of attribute statements + # + # @return [Object] the current value of statements + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def statements; end + + # Sets the attribute statements + # + # @param value [Object] the value to set the attribute statements to. + # @return [Object] the newly set value + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def statements=(_); end + + class << self + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def [](*_arg0); end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def inspect; end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def keyword_init?; end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def members; end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#40 + def new(*_arg0); end + end +end + +# Raised when a thunk cannot be placed: its body's source lines fall after the execution point (the hidden +# proc's text IS its assignment, so a call can never textually precede the body), or two occurrences of the +# same thunk carry diverging bodies. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#45 +class ASTTransform::ThunkLowering::PlacementError < ::StandardError; end + +# The thunks encountered during one lowering, keyed by identity: allocates each thunk's hidden lvar name +# on first occurrence and verifies later occurrences carry the same body. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#49 +class ASTTransform::ThunkLowering::Registry + # @return [Registry] a new instance of Registry + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#50 + def initialize; end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#78 + def hidden_names; end + + # @return [Boolean] + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#55 + def known?(id); end + + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#67 + def name_for(id); end + + # @return [Symbol] the hidden lvar name allocated for +id+. + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#60 + def register(id, body); end + + # @raise [PlacementError] + # + # source://ast_transform//lib/ast_transform/thunk_lowering.rb#71 + def verify_same_body!(id, body); end +end + +# Scope-opening containers: the hidden lvar cannot be referenced across these boundaries, so placements arising +# inside must land inside. +# +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#87 +ASTTransform::ThunkLowering::SCOPE_BODY_INDEXES = T.let(T.unsafe(nil), Hash) + +# source://ast_transform//lib/ast_transform/thunk_lowering.rb#84 +ASTTransform::ThunkLowering::SEQUENCE_TYPES = T.let(T.unsafe(nil), Array) + +# source://ast_transform//lib/ast_transform/transformation.rb#9 +class ASTTransform::Transformation < ::ASTTransform::AbstractTransformation + private + + # source://ast_transform//lib/ast_transform/transformation.rb#70 + def extract_transformation(node); end + + # source://ast_transform//lib/ast_transform/transformation.rb#64 + def extract_transformations(node); end + + # source://ast_transform//lib/ast_transform/transformation.rb#39 + def next_child(node, index); end + + # source://ast_transform//lib/ast_transform/transformation.rb#35 + def previous_child(node, index); end + + # source://ast_transform//lib/ast_transform/transformation.rb#14 + def process_node(node); end + + # source://ast_transform//lib/ast_transform/transformation.rb#43 + def process_node_helper(node, previous_node); end + + # source://ast_transform//lib/ast_transform/transformation.rb#95 + def require_path(const_name); end + + # source://ast_transform//lib/ast_transform/transformation.rb#82 + def require_transformation(node); end + + # @return [Boolean] + # + # source://ast_transform//lib/ast_transform/transformation.rb#52 + def transform_node?(node); end + + # @return [Boolean] + # + # source://ast_transform//lib/ast_transform/transformation.rb#58 + def transformable_node?(node); end + + # source://ast_transform//lib/ast_transform/transformation.rb#109 + def try_const_get(const_name); end +end + +# source://ast_transform//lib/ast_transform/transformation.rb#10 +ASTTransform::Transformation::TRANSFORM_AST = T.let(T.unsafe(nil), Parser::AST::Node) + +# The transform-authoring layer. Three shapes: +# +# - Constructors (+s+, +s_at+): type + children in, fresh node out. +# - The sequence combinator (+run_after+): sequence in, sequence out — the paved road for execution reordering. +# - The low-level reordering primitive (+thunk+): statements in, Thunk node out — for execution points inside +# expressions. +# +# The contract these helpers serve: textual order is source order. The emitter places every loc-carrying statement +# at its source line; when execution order must differ from textual order, authors express it as a thunk instead of +# moving text. +# +# source://ast_transform//lib/ast_transform/transformation_helper.rb#18 +module ASTTransform::TransformationHelper + include ::ASTTransform::TransformationHelper::Methods + + mixes_in_class_methods ::ASTTransform::TransformationHelper::Methods + + class << self + # @private + # + # source://ast_transform//lib/ast_transform/transformation_helper.rb#23 + def included(base); end + end +end + +# source://ast_transform//lib/ast_transform/transformation_helper.rb#29 +module ASTTransform::TransformationHelper::Methods + # The paved road for execution reordering in flat statement sequences. Named for the constraint, not the + # mechanism — with text pinned to source lines the only physical lever is delaying execution, so "run X after + # Y" is the constraint an author states. Returns a NEW sequence in which the +run+ statements are removed and a + # thunk wrapping them is inserted immediately after +after+. + # + # All membership checks are by identity (equal?), never ==: node equality ignores location, so two textually + # identical statements on different lines compare == and value matching could splice the wrong one. + # + # @param after [Parser::AST::Node] element of +statements+ (by identity, not inside +run+) the +run+ statements + # execute after + # @param run [Array] contiguous run of elements of +statements+ (by identity) whose + # execution must wait + # @param statements [Array] the sequence being composed + # @raise [ArgumentError] if +run+ is not a contiguous identity-run of +statements+, or +after+ is not an + # element (or is inside +run+) + # @return [Array] new sequence with the thunk placed + # + # source://ast_transform//lib/ast_transform/transformation_helper.rb#95 + def run_after(statements, run:, after:); end + + # Builds a loc-less node. The emitter packs loc-less nodes onto the current output line — the correct default + # for synthetic code, which has no source-line truth to preserve. + # + # @param children [Array] child nodes / literals + # @param properties [Hash] node properties (e.g. location:) + # @param type [Symbol] node type + # @return [ASTTransform::Node] node routed to its registered class + # + # source://ast_transform//lib/ast_transform/transformation_helper.rb#37 + def s(type, *children, **properties); end + + # Builds a fresh node anchored to another node's source location. Use when composing a replacement tree whose + # root isn't derived from the node it replaces (otherwise prefer +anchor.updated(...)+). The attached map is a + # clean expression-only Source::Map over +anchor.loc.expression+ — no stale typed sub-ranges (selector etc.). + # Anchor inheritance is shallow; children keep or lack their own locs. + # + # @param anchor [Parser::AST::Node] node whose line this code replaces + # @param children [Array] child nodes / literals + # @param type [Symbol] node type + # @raise [MissingLocationError] if anchor has no expression location + # @return [ASTTransform::Node] node carrying anchor's expression range + # + # source://ast_transform//lib/ast_transform/transformation_helper.rb#51 + def s_at(anchor, type, *children); end + + # The low-level reordering primitive. Thunking is the one reordering lever: text never moves and execution can + # only move later, so "hoist A above B" is expressed as "run B after A". Returns a single Thunk node: splice it + # where the statements must RUN — statement position or composed inside an expression, e.g. as an assert_raises + # block body. The wrapped statements keep their own locs, and the lowering derives the hidden proc's textual + # placement from them, so the body still emits on its source lines even though execution waits. Reuse the same + # node to execute one body from several points. + # + # Semantics are near-transparent (see ThunkLowering): +return+ still returns from the enclosing method + # (non-lambda proc), and locals the wrapped statements assign stay method-scope (pre-declared before the proc). + # Jump keywords whose owner lies outside the wrapped statements keep Ruby's native behavior — +break+/+retry+ + # fail loudly at the jump's own source line, +next+/+redo+ silently end or restart the thunk body. Weigh that + # when choosing what your surface thunks. + # + # Prefer +run_after+ when the execution point sits in the same statement sequence as the statements. + # + # @param statements [Array] statements to wrap + # @return [ASTTransform::Thunk] the thunk node + # + # source://ast_transform//lib/ast_transform/transformation_helper.rb#75 + def thunk(*statements); end + + private + + # The range +members+ occupies in +sequence+, or nil unless members is a non-empty contiguous identity-run in + # order. + # + # source://ast_transform//lib/ast_transform/transformation_helper.rb#114 + def contiguous_identity_range(sequence, members); end +end + +# Raised by authoring helpers (e.g. +s_at+) when a node that must carry a source location does not have one. +# +# source://ast_transform//lib/ast_transform/transformation_helper.rb#20 +class ASTTransform::TransformationHelper::MissingLocationError < ::StandardError; end + +# source://ast_transform//lib/ast_transform/transformer.rb#10 +class ASTTransform::Transformer + # Constructs a new Transformer instance. + # + # @param emitter [ASTTransform::LineAlignedEmitter] The emitter rendering transformed ASTs back to source. + # @param transformations [Array] The transformations to be run. + # @return [Transformer] a new instance of Transformer + # + # source://ast_transform//lib/ast_transform/transformer.rb#15 + def initialize(*transformations, emitter: T.unsafe(nil)); end + + # Builds the AST for the given +source+. + # + # @param file_path [String] The file_path. This is important for source mapping in backtraces. + # @param source [String] The input source code. + # @return [Parser::AST::Node] The AST. + # + # source://ast_transform//lib/ast_transform/transformer.rb#26 + def build_ast(source, file_path: T.unsafe(nil)); end + + # Builds the AST for the given +file_path+. + # + # @param file_path [String] The input file path. + # @return [Parser::AST::Node] The AST. + # + # source://ast_transform//lib/ast_transform/transformer.rb#36 + def build_ast_from_file(file_path); end + + # Transforms the given +source+. + # + # @param source [String] The input source code to be transformed. + # @return [String] The transformed code, line-aligned (see #transform_file_source). + # + # source://ast_transform//lib/ast_transform/transformer.rb#46 + def transform(source); end + + # Transforms the given +ast+. + # + # @param ast [Parser::AST::Node] The input AST to be transformed. + # @return [Parser::AST::Node] The transformed AST. + # + # source://ast_transform//lib/ast_transform/transformer.rb#87 + def transform_ast(ast); end + + # Transforms the give +file_path+. + # + # backtrace and breakpoint line numbers) is derived from this file's source locations. + # + # @param file_path [String] The input file to be transformed. Statement placement (and therefore + # @param transformed_file_path [String] The file path to the transformed file. + # @return [String] The transformed code. + # + # source://ast_transform//lib/ast_transform/transformer.rb#59 + def transform_file(file_path, transformed_file_path); end + + # Transforms the given +source+ in +file_path+. + # + # therefore backtrace and breakpoint line numbers) is derived from the source locations parsed + # under this path. + # location is emitted at its original source line. + # + # @param file_path [String] The file path for the input +source+. Statement placement (and + # @param source [String] The input source code to be transformed. + # @param transformed_file_path [String] The file path the transformed file will be written to. + # @return [String] The transformed code, line-aligned: every statement carrying a source + # + # source://ast_transform//lib/ast_transform/transformer.rb#74 + def transform_file_source(source, file_path, _transformed_file_path); end + + private + + # source://ast_transform//lib/ast_transform/transformer.rb#95 + def create_buffer(source, file_path); end + + # source://ast_transform//lib/ast_transform/transformer.rb#102 + def parser; end +end + +# source://ast_transform//lib/ast_transform/version.rb#4 +ASTTransform::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/mocha@3.0.2.rbi b/sorbet/rbi/gems/mocha@3.1.0.rbi similarity index 100% rename from sorbet/rbi/gems/mocha@3.0.2.rbi rename to sorbet/rbi/gems/mocha@3.1.0.rbi diff --git a/sorbet/rbi/gems/parser@3.3.10.2.rbi b/sorbet/rbi/gems/parser@3.3.12.0.rbi similarity index 100% rename from sorbet/rbi/gems/parser@3.3.10.2.rbi rename to sorbet/rbi/gems/parser@3.3.12.0.rbi diff --git a/sorbet/rbi/gems/rspock@2.5.0.rbi b/sorbet/rbi/gems/rspock@3.0.0.rbi similarity index 69% rename from sorbet/rbi/gems/rspock@2.5.0.rbi rename to sorbet/rbi/gems/rspock@3.0.0.rbi index d62f86c..982de87 100644 --- a/sorbet/rbi/gems/rspock@2.5.0.rbi +++ b/sorbet/rbi/gems/rspock@3.0.0.rbi @@ -13,38 +13,38 @@ module RSpock; end # source://rspock//lib/rspock/ast/node.rb#5 module RSpock::AST; end -# source://rspock//lib/rspock/ast/node.rb#104 -class RSpock::AST::BinaryStatementNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#107 +# source://rspock//lib/rspock/ast/node.rb#95 +class RSpock::AST::BinaryStatementNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#98 def lhs; end - # source://rspock//lib/rspock/ast/node.rb#108 + # source://rspock//lib/rspock/ast/node.rb#99 def operator; end - # source://rspock//lib/rspock/ast/node.rb#109 + # source://rspock//lib/rspock/ast/node.rb#100 def rhs; end end -# source://rspock//lib/rspock/ast/node.rb#27 -class RSpock::AST::BodyNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#18 +class RSpock::AST::BodyNode < ::ASTTransform::Node; end -# source://rspock//lib/rspock/ast/node.rb#54 -class RSpock::AST::CleanupNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#45 +class RSpock::AST::CleanupNode < ::ASTTransform::Node; end -# source://rspock//lib/rspock/ast/node.rb#31 -class RSpock::AST::DefNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#35 +# source://rspock//lib/rspock/ast/node.rb#22 +class RSpock::AST::DefNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#26 def args; end - # source://rspock//lib/rspock/ast/node.rb#34 + # source://rspock//lib/rspock/ast/node.rb#25 def method_call; end end -# source://rspock//lib/rspock/ast/node.rb#50 -class RSpock::AST::ExpectNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#41 +class RSpock::AST::ExpectNode < ::ASTTransform::Node; end -# source://rspock//lib/rspock/ast/node.rb#38 -class RSpock::AST::GivenNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#29 +class RSpock::AST::GivenNode < ::ASTTransform::Node; end # source://rspock//lib/rspock/ast/header_nodes_transformation.rb#6 class RSpock::AST::HeaderNodesTransformation < ::ASTTransform::AbstractTransformation @@ -67,27 +67,27 @@ class RSpock::AST::HeaderNodesTransformation < ::ASTTransform::AbstractTransform def header_node?(node); end end -# source://rspock//lib/rspock/ast/node.rb#92 -class RSpock::AST::InteractionNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#99 +# source://rspock//lib/rspock/ast/node.rb#83 +class RSpock::AST::InteractionNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#90 def args; end - # source://rspock//lib/rspock/ast/node.rb#101 + # source://rspock//lib/rspock/ast/node.rb#92 def block_pass; end - # source://rspock//lib/rspock/ast/node.rb#95 + # source://rspock//lib/rspock/ast/node.rb#86 def cardinality; end - # source://rspock//lib/rspock/ast/node.rb#98 + # source://rspock//lib/rspock/ast/node.rb#89 def message; end - # source://rspock//lib/rspock/ast/node.rb#97 + # source://rspock//lib/rspock/ast/node.rb#88 def message_sym; end - # source://rspock//lib/rspock/ast/node.rb#100 + # source://rspock//lib/rspock/ast/node.rb#91 def outcome; end - # source://rspock//lib/rspock/ast/node.rb#96 + # source://rspock//lib/rspock/ast/node.rb#87 def receiver; end end @@ -132,79 +132,39 @@ class RSpock::AST::InteractionToMochaMockTransformation < ::ASTTransform::Abstra # @return [Boolean] # - # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#108 + # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#110 def any_matcher_node?(node); end - # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#89 + # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#91 def build_block_capture_setup(expects_node, receiver, message); end - # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#44 + # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#46 def build_cardinality(result, cardinality); end - # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#75 + # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#77 def build_erange(result, min_node, max_node); end - # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#61 + # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#63 def build_irange(result, min_node, max_node); end - # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#104 + # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#106 def chain_call(receiver_node, method_name, *arg_nodes); end end # source://rspock//lib/rspock/ast/interaction_to_mocha_mock_transformation.rb#18 RSpock::AST::InteractionToMochaMockTransformation::OUTCOME_METHODS = T.let(T.unsafe(nil), Hash) -# source://rspock//lib/rspock/ast/method_call_to_lvar_transformation.rb#6 -class RSpock::AST::MethodCallToLVarTransformation < ::ASTTransform::AbstractTransformation - # @return [MethodCallToLVarTransformation] a new instance of MethodCallToLVarTransformation - # - # source://rspock//lib/rspock/ast/method_call_to_lvar_transformation.rb#7 - def initialize(*method_symbols); end - - # @return [Boolean] - # - # source://rspock//lib/rspock/ast/method_call_to_lvar_transformation.rb#19 - def method_call_node?(node); end - - # source://rspock//lib/rspock/ast/method_call_to_lvar_transformation.rb#13 - def on_send(node); end -end - -# source://rspock//lib/rspock/ast/node.rb#6 -class RSpock::AST::Node < ::Parser::AST::Node - class << self - # source://rspock//lib/rspock/ast/node.rb#13 - def build(type, *children); end - - # source://rspock//lib/rspock/ast/node.rb#9 - def register(type); end - end -end - -# source://rspock//lib/rspock/ast/node.rb#7 -RSpock::AST::Node::REGISTRY = T.let(T.unsafe(nil), Hash) - -# source://rspock//lib/rspock/ast/node.rb#119 -module RSpock::AST::NodeBuilder - include ::ASTTransform::TransformationHelper - include ::ASTTransform::TransformationHelper::Methods - extend ::ASTTransform::TransformationHelper::Methods - - # source://rspock//lib/rspock/ast/node.rb#122 - def s(type, *children); end -end - -# source://rspock//lib/rspock/ast/node.rb#73 -class RSpock::AST::OutcomeNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#64 +class RSpock::AST::OutcomeNode < ::ASTTransform::Node; end -# source://rspock//lib/rspock/ast/parser/block.rb#6 +# source://rspock//lib/rspock/ast/parser/block.rb#7 module RSpock::AST::Parser; end -# source://rspock//lib/rspock/ast/parser/block.rb#9 +# source://rspock//lib/rspock/ast/parser/block.rb#10 class RSpock::AST::Parser::Block include ::ASTTransform::TransformationHelper include ::ASTTransform::TransformationHelper::Methods - include ::RSpock::AST::NodeBuilder + extend ::ASTTransform::TransformationHelper::Methods # Constructs a new Block. # @@ -212,73 +172,73 @@ class RSpock::AST::Parser::Block # @param type [Symbol] The Block type. # @return [Block] a new instance of Block # - # source://rspock//lib/rspock/ast/parser/block.rb#16 + # source://rspock//lib/rspock/ast/parser/block.rb#17 def initialize(type, node); end # Adds the given +child_node+ to this Block. # # @param child_node [Parser::AST::Node] The node to be added. # - # source://rspock//lib/rspock/ast/parser/block.rb#27 + # source://rspock//lib/rspock/ast/parser/block.rb#28 def <<(child_node); end # Whether this block can be the last block in a test method. # # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/block.rb#44 + # source://rspock//lib/rspock/ast/parser/block.rb#45 def can_end?; end # Whether this block can be the first block in a test method. # # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/block.rb#39 + # source://rspock//lib/rspock/ast/parser/block.rb#40 def can_start?; end # Retrieves the duped array of children AST nodes for this Block. # # @return [Array] The children nodes. # - # source://rspock//lib/rspock/ast/parser/block.rb#58 + # source://rspock//lib/rspock/ast/parser/block.rb#59 def children; end # Returns the value of attribute node. # - # source://rspock//lib/rspock/ast/parser/block.rb#22 + # source://rspock//lib/rspock/ast/parser/block.rb#23 def node; end # Retrieves the Parser::Source::Range for this Block. # # @return [Parser::Source::Range] The range. # - # source://rspock//lib/rspock/ast/parser/block.rb#34 + # source://rspock//lib/rspock/ast/parser/block.rb#35 def range; end # Retrieves the error message for succession errors. # # @return [String] The error message. # - # source://rspock//lib/rspock/ast/parser/block.rb#82 + # source://rspock//lib/rspock/ast/parser/block.rb#83 def succession_error_msg; end # Retrieves the valid successors for this Block. # # @return [Array] This Block's successors. # - # source://rspock//lib/rspock/ast/parser/block.rb#51 + # source://rspock//lib/rspock/ast/parser/block.rb#52 def successors; end # Converts this Block into an RSpock node. # # @return [Parser::AST::Node] A node with type :rspock_. # - # source://rspock//lib/rspock/ast/parser/block.rb#65 + # source://rspock//lib/rspock/ast/parser/block.rb#66 def to_rspock_node; end # Returns the value of attribute type. # - # source://rspock//lib/rspock/ast/parser/block.rb#22 + # source://rspock//lib/rspock/ast/parser/block.rb#23 def type; end # Checks whether or not the given +block+ is a valid successor for this Block. @@ -286,11 +246,11 @@ class RSpock::AST::Parser::Block # @param block [Block] The candidate successor. # @return [Boolean] True if the given block is a valid successor, false otherwise. # - # source://rspock//lib/rspock/ast/parser/block.rb#75 + # source://rspock//lib/rspock/ast/parser/block.rb#76 def valid_successor?(block); end end -# source://rspock//lib/rspock/ast/parser/block.rb#7 +# source://rspock//lib/rspock/ast/parser/block.rb#8 class RSpock::AST::Parser::BlockError < ::StandardError; end # source://rspock//lib/rspock/ast/parser/cleanup_block.rb#7 @@ -362,49 +322,49 @@ end # [4] outcome - nil if no >>, otherwise s(:rspock_stub_returns, value) or s(:rspock_stub_raises, *args) # [5] block_pass - nil if no &, otherwise s(:block_pass, ...) # -# source://rspock//lib/rspock/ast/parser/interaction_parser.rb#19 +# source://rspock//lib/rspock/ast/parser/interaction_parser.rb#20 class RSpock::AST::Parser::InteractionParser include ::ASTTransform::TransformationHelper include ::ASTTransform::TransformationHelper::Methods - include ::RSpock::AST::NodeBuilder + extend ::ASTTransform::TransformationHelper::Methods # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#26 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#27 def interaction_node?(node); end - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#34 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#35 def parse(node); end private - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#64 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#71 def parse_outcome(node); end - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#102 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#109 def parse_rhs(node); end # @raise [InteractionError] # - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#132 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#139 def raise_cardinality_error(node, msg_prefix: T.unsafe(nil), msg_suffix: T.unsafe(nil)); end - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#128 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#135 def range(node); end # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#60 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#67 def return_value_node?(node); end - # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#72 + # source://rspock//lib/rspock/ast/parser/interaction_parser.rb#79 def validate_cardinality(node); end end -# source://rspock//lib/rspock/ast/parser/interaction_parser.rb#24 +# source://rspock//lib/rspock/ast/parser/interaction_parser.rb#25 RSpock::AST::Parser::InteractionParser::ALLOWED_CARDINALITY_NODES = T.let(T.unsafe(nil), Array) -# source://rspock//lib/rspock/ast/parser/interaction_parser.rb#22 +# source://rspock//lib/rspock/ast/parser/interaction_parser.rb#23 class RSpock::AST::Parser::InteractionParser::InteractionError < ::RuntimeError; end # Classifies raw Ruby AST statements into RSpock node types for Then/Expect blocks. @@ -413,56 +373,64 @@ class RSpock::AST::Parser::InteractionParser::InteractionError < ::RuntimeError; # - Binary operators (==, !=, =~, etc.) become :rspock_binary_statement nodes. # - Everything else becomes :rspock_statement nodes with the original source text captured. # -# source://rspock//lib/rspock/ast/parser/statement_parser.rb#12 +# source://rspock//lib/rspock/ast/parser/statement_parser.rb#13 class RSpock::AST::Parser::StatementParser include ::ASTTransform::TransformationHelper include ::ASTTransform::TransformationHelper::Methods - include ::RSpock::AST::NodeBuilder + extend ::ASTTransform::TransformationHelper::Methods - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#18 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#19 def parse(node); end private # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#36 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#37 def assigned_raises?(node); end # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#54 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#55 def assignment?(node); end # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#58 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#59 def binary_statement?(node); end - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#64 + # RSpock IR nodes are anchored at the statement they classify, so the assertions they lower into are + # emitted at the statement's source line. + # + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#67 def build_binary_statement(node); end - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#43 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#44 def build_raises(node); end - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#68 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#71 def build_statement(node); end # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#32 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#33 def direct_raises?(node); end # @return [Boolean] # - # source://rspock//lib/rspock/ast/parser/statement_parser.rb#28 + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#29 def raises_condition?(node); end + + # s_at that tolerates loc-less anchors (unit tests build synthetic ASTs). + # + # source://rspock//lib/rspock/ast/parser/statement_parser.rb#77 + def s_anchored(anchor, type, *children); end end -# source://rspock//lib/rspock/ast/parser/statement_parser.rb#16 +# source://rspock//lib/rspock/ast/parser/statement_parser.rb#17 RSpock::AST::Parser::StatementParser::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) -# source://rspock//lib/rspock/ast/parser/statement_parser.rb#15 +# source://rspock//lib/rspock/ast/parser/statement_parser.rb#16 RSpock::AST::Parser::StatementParser::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) # Parses a Ruby test method AST node into a self-contained RSpock AST. @@ -473,41 +441,41 @@ RSpock::AST::Parser::StatementParser::BINARY_OPERATORS = T.let(T.unsafe(nil), Ar # s(:rspock_body, s(:rspock_given, ...), s(:rspock_when, ...), ...), # s(:rspock_where, ...)) # optional # -# source://rspock//lib/rspock/ast/parser/test_method_parser.rb#14 +# source://rspock//lib/rspock/ast/parser/test_method_parser.rb#15 class RSpock::AST::Parser::TestMethodParser include ::ASTTransform::TransformationHelper include ::ASTTransform::TransformationHelper::Methods - include ::RSpock::AST::NodeBuilder + extend ::ASTTransform::TransformationHelper::Methods # @return [TestMethodParser] a new instance of TestMethodParser # - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#17 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#18 def initialize(block_registry, strict: T.unsafe(nil)); end # Parses a Ruby test method AST into an RSpock AST (TestNode). # Returns nil when non-strict and no RSpock blocks are found. # - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#24 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#25 def parse(node); end private - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#87 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#89 def build_rspock_ast(node, blocks); end - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#56 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#57 def parse_block(node); end - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#38 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#39 def parse_blocks(node); end - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#81 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#83 def test_method_nodes(node); end - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#71 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#72 def validate_blocks(blocks, node); end - # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#62 + # source://rspock//lib/rspock/ast/parser/test_method_parser.rb#63 def validate_succession(blocks, new_block); end end @@ -600,24 +568,24 @@ end # source://rspock//lib/rspock/ast/parser/where_block.rb#8 class RSpock::AST::Parser::WhereBlock::MalformedError < ::StandardError; end -# source://rspock//lib/rspock/ast/node.rb#84 -class RSpock::AST::RaisesNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#89 +# source://rspock//lib/rspock/ast/node.rb#75 +class RSpock::AST::RaisesNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#80 def capture_name; end - # source://rspock//lib/rspock/ast/node.rb#88 + # source://rspock//lib/rspock/ast/node.rb#79 def capture_var; end - # source://rspock//lib/rspock/ast/node.rb#87 + # source://rspock//lib/rspock/ast/node.rb#78 def exception_class; end end -# source://rspock//lib/rspock/ast/node.rb#112 -class RSpock::AST::StatementNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#115 +# source://rspock//lib/rspock/ast/node.rb#103 +class RSpock::AST::StatementNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#106 def expression; end - # source://rspock//lib/rspock/ast/node.rb#116 + # source://rspock//lib/rspock/ast/node.rb#107 def source; end end @@ -626,149 +594,250 @@ end # Binary statements dispatch to specialized assertions (assert_equal, assert_match, assert_operator). # General statements use assert_equal(true/false, expr, source_message) with negation detection. # -# source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#10 +# source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#11 class RSpock::AST::StatementToAssertionTransformation include ::ASTTransform::TransformationHelper include ::ASTTransform::TransformationHelper::Methods - include ::RSpock::AST::NodeBuilder + extend ::ASTTransform::TransformationHelper::Methods - # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#22 + # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#23 def run(node); end private # @return [Boolean] # - # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#63 + # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#64 def negated?(node); end - # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#35 + # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#36 def transform_binary_statement(node); end - # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#49 + # source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#50 def transform_statement(node); end end -# source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#13 +# source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#14 RSpock::AST::StatementToAssertionTransformation::BINARY_DISPATCH = T.let(T.unsafe(nil), Hash) -# source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#20 +# source://rspock//lib/rspock/ast/statement_to_assertion_transformation.rb#21 RSpock::AST::StatementToAssertionTransformation::OPERATOR_ASSERTIONS = T.let(T.unsafe(nil), Array) -# source://rspock//lib/rspock/ast/node.rb#80 +# source://rspock//lib/rspock/ast/node.rb#71 class RSpock::AST::StubRaisesNode < ::RSpock::AST::OutcomeNode; end -# source://rspock//lib/rspock/ast/node.rb#76 +# source://rspock//lib/rspock/ast/node.rb#67 class RSpock::AST::StubReturnsNode < ::RSpock::AST::OutcomeNode; end -# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#7 +# Appends the data row's index and source line to a Where-driven test's name. The values arrive through +# internal block parameters on the row iterator (see TestMethodTransformation#build_where_args) and surface in +# the test NAME only: the name is what makes identical data rows unique and what the -n selector matches to +# isolate a row. They are deliberately not exposed as test-scope variables. +# +# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#11 class RSpock::AST::TestMethodDefTransformation < ::ASTTransform::AbstractTransformation - # source://rspock//lib/rspock/ast/test_method_def_transformation.rb#29 + # source://rspock//lib/rspock/ast/test_method_def_transformation.rb#30 def on_dstr(node); end - # source://rspock//lib/rspock/ast/test_method_def_transformation.rb#24 + # source://rspock//lib/rspock/ast/test_method_def_transformation.rb#25 def on_str(node); end - # source://rspock//lib/rspock/ast/test_method_def_transformation.rb#18 + # source://rspock//lib/rspock/ast/test_method_def_transformation.rb#19 def run(node); end end -# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#11 -RSpock::AST::TestMethodDefTransformation::LINE_NUMBER_AST = T.let(T.unsafe(nil), Parser::AST::Node) - -# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#16 +# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#17 RSpock::AST::TestMethodDefTransformation::LINE_NUMBER_STR_AST = T.let(T.unsafe(nil), Parser::AST::Node) -# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#14 -RSpock::AST::TestMethodDefTransformation::SPACE_STR_AST = T.let(T.unsafe(nil), Parser::AST::Node) +# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#12 +RSpock::AST::TestMethodDefTransformation::ROW_INDEX_ARG = T.let(T.unsafe(nil), Symbol) -# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#8 -RSpock::AST::TestMethodDefTransformation::TEST_INDEX_AST = T.let(T.unsafe(nil), Parser::AST::Node) +# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#15 +RSpock::AST::TestMethodDefTransformation::ROW_INDEX_AST = T.let(T.unsafe(nil), Parser::AST::Node) + +# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#13 +RSpock::AST::TestMethodDefTransformation::ROW_LINE_ARG = T.let(T.unsafe(nil), Symbol) + +# source://rspock//lib/rspock/ast/test_method_def_transformation.rb#16 +RSpock::AST::TestMethodDefTransformation::ROW_LINE_AST = T.let(T.unsafe(nil), Parser::AST::Node) -# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#6 +# dstr counterpart of TestMethodDefTransformation: appends the row index and source line interpolations to an +# already-interpolated test name. +# +# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#8 class RSpock::AST::TestMethodDstrTransformation < ::ASTTransform::AbstractTransformation - # source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#17 + # source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#15 def on_dstr(node); end end -# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#10 -RSpock::AST::TestMethodDstrTransformation::LINE_NUMBER_AST = T.let(T.unsafe(nil), Parser::AST::Node) - -# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#15 +# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#13 RSpock::AST::TestMethodDstrTransformation::LINE_NUMBER_STR_AST = T.let(T.unsafe(nil), Parser::AST::Node) -# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#13 -RSpock::AST::TestMethodDstrTransformation::SPACE_STR_AST = T.let(T.unsafe(nil), Parser::AST::Node) +# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#9 +RSpock::AST::TestMethodDstrTransformation::ROW_INDEX_AST = T.let(T.unsafe(nil), Parser::AST::Node) + +# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#10 +RSpock::AST::TestMethodDstrTransformation::ROW_LINE_AST = T.let(T.unsafe(nil), Parser::AST::Node) -# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#7 -RSpock::AST::TestMethodDstrTransformation::TEST_INDEX_AST = T.let(T.unsafe(nil), Parser::AST::Node) +# source://rspock//lib/rspock/ast/test_method_dstr_transformation.rb#12 +RSpock::AST::TestMethodDstrTransformation::SPACE_STR_AST = T.let(T.unsafe(nil), Parser::AST::Node) -# source://rspock//lib/rspock/ast/test_method_transformation.rb#14 +# source://rspock//lib/rspock/ast/test_method_transformation.rb#13 class RSpock::AST::TestMethodTransformation < ::ASTTransform::AbstractTransformation # @return [TestMethodTransformation] a new instance of TestMethodTransformation # - # source://rspock//lib/rspock/ast/test_method_transformation.rb#15 + # source://rspock//lib/rspock/ast/test_method_transformation.rb#14 def initialize(block_registry, strict: T.unsafe(nil)); end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#20 + # source://rspock//lib/rspock/ast/test_method_transformation.rb#19 def run(node); end private - # source://rspock//lib/rspock/ast/test_method_transformation.rb#164 - def build_assert_raises(when_node, raises_node); end + # Re-anchors +node+ at +anchor+'s source location so emission places it on the anchor's line. + # No-op for anchors without locations. + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#194 + def anchored_at(anchor, node); end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#146 + def build_assert_raises(raises_node, body); end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#132 + def build_raises_body(source_order, when_statements, interaction_setups, raises_node); end # --- Build final Ruby AST --- # - # source://rspock//lib/rspock/ast/test_method_transformation.rb#95 - def build_ruby_ast(method_call, method_args, body_node, where, hoisted_setups); end + # source://rspock//lib/rspock/ast/test_method_transformation.rb#202 + def build_ruby_ast(method_call, method_args, body_node, where); end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#118 - def build_test_body(body_node, hoisted_setups); end + # --- Test body assembly --- + # + # Statements are assembled in SOURCE order so line-aligned emission keeps each one on its own line. + # Execution-order requirements that source order cannot express (interaction setups in Then must run before the + # When body they observe) are carried by ast-transform's thunk facility (run_after / thunk) instead of by + # textual hoisting. + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#42 + def build_test_body(body_node); end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#198 + # source://rspock//lib/rspock/ast/test_method_transformation.rb#248 def build_where_args(header); end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#192 + # source://rspock//lib/rspock/ast/test_method_transformation.rb#241 def build_where_data_row(row); end # --- Where block helpers --- # - # source://rspock//lib/rspock/ast/test_method_transformation.rb#182 + # Each data row carries its source line as a trailing element, surfaced in the generated test NAME only + # (uniqueness for identical rows + the -n selector target) through internal block parameters. There is no + # user-facing runtime variable: isolate a row by running its generated test by name, then break normally. + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#231 def build_where_iterator(data_rows); end - # --- Raises condition helpers --- + # source://rspock//lib/rspock/ast/test_method_transformation.rb#160 + def find_raises(block_node); end + + # @raise [ArgumentError] + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#183 + def insert_after(statements, anchor, insertion); end + + # @return [Array(Array, Array)] Mocha setup statements, identity assertions # - # source://rspock//lib/rspock/ast/test_method_transformation.rb#157 - def find_raises_in_next_then(blocks, current_index); end + # source://rspock//lib/rspock/ast/test_method_transformation.rb#106 + def lower_interaction(interaction, index); end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#28 + # Reorders execution (not text) where required: + # - interactions without raises: run the When body after the last interaction setup (run_after — the paved + # road). + # - raises without interactions: the When body inlines directly into assert_raises; no thunk needed. + # - raises with interactions: the When body is thunked into the assert_raises block inserted after the last + # setup; the lowering re-emits the body at its own source lines. + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#122 + def order_execution(source_order, when_statements, interaction_setups, raises_node); end + + # --- Identity-based sequence edits (non-thunk counterparts of run_after) --- + # + # @raise [ArgumentError] + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#174 + def replace_run(statements, run, replacement); end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#166 + def statements_of_type(blocks, sections, type); end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#27 def transform(rspock_ast); end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#79 - def transform_expect_block(expect_node); end + # Then/Expect children become plain Ruby in place: interactions lower to Mocha setups anchored at the + # interaction's own source line (plus an identity assertion for &block forwarding), statements become + # assertions at their own lines. + # + # Within the section, ALL setups come before all assertions: the thunked When body executes right after the + # last setup, and every assertion (identity or otherwise) observes the When body's effects, so none may + # precede that point. Setups keep source order and their anchors, so alignment holds; assertions after them + # are either synthetic (identity assertions, loc-less, pack anywhere) or textually below the interactions in + # the common case. + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#83 + def transform_assertion_block(block_node); end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#65 + def transform_block(block_node); end +end + +class RSpock::AST::TestMethodTransformation::Section < ::Data + # Returns the value of attribute interaction_setups + # + # @return [Object] the current value of interaction_setups + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#63 + def interaction_setups; end + + # Returns the value of attribute statements + # + # @return [Object] the current value of statements + # + # source://rspock//lib/rspock/ast/test_method_transformation.rb#63 + def statements; end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#84 - def transform_statement_or_passthrough(child); end + class << self + # source://rspock//lib/rspock/ast/test_method_transformation.rb#63 + def [](*_arg0); end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#63 + def inspect; end - # source://rspock//lib/rspock/ast/test_method_transformation.rb#50 - def transform_then_block(then_node, hoisted_setups); end + # source://rspock//lib/rspock/ast/test_method_transformation.rb#63 + def members; end + + # source://rspock//lib/rspock/ast/test_method_transformation.rb#63 + def new(*_arg0); end + end end -# source://rspock//lib/rspock/ast/node.rb#19 -class RSpock::AST::TestNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#23 +# RSpock's intermediate representation: custom node types registered on ASTTransform::Node, so +# +s(:rspock_*, ...)+ constructs these classes with their domain accessors. They exist only between the parser +# and TestMethodTransformation — the transformation lowers every one of them to plain Ruby nodes before +# emission. +# +# source://rspock//lib/rspock/ast/node.rb#10 +class RSpock::AST::TestNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#14 def body_node; end - # source://rspock//lib/rspock/ast/node.rb#22 + # source://rspock//lib/rspock/ast/node.rb#13 def def_node; end - # source://rspock//lib/rspock/ast/node.rb#24 + # source://rspock//lib/rspock/ast/node.rb#15 def where_node; end end -# source://rspock//lib/rspock/ast/node.rb#46 -class RSpock::AST::ThenNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#37 +class RSpock::AST::ThenNode < ::ASTTransform::Node; end # source://rspock//lib/rspock/ast/transformation.rb#13 class RSpock::AST::Transformation < ::ASTTransform::AbstractTransformation @@ -777,7 +846,7 @@ class RSpock::AST::Transformation < ::ASTTransform::AbstractTransformation # source://rspock//lib/rspock/ast/transformation.rb#23 def initialize(block_registry: T.unsafe(nil), strict: T.unsafe(nil)); end - # source://rspock//lib/rspock/ast/transformation.rb#84 + # source://rspock//lib/rspock/ast/transformation.rb#83 def on_block(node); end # source://rspock//lib/rspock/ast/transformation.rb#50 @@ -791,9 +860,6 @@ class RSpock::AST::Transformation < ::ASTTransform::AbstractTransformation # source://rspock//lib/rspock/ast/transformation.rb#78 def process_rspock(node); end - - # source://rspock//lib/rspock/ast/transformation.rb#95 - def source_map_rescue_wrapper(node); end end # source://rspock//lib/rspock/ast/transformation.rb#14 @@ -802,53 +868,18 @@ RSpock::AST::Transformation::DEFAULT_BLOCK_REGISTRY = T.let(T.unsafe(nil), Hash) # source://rspock//lib/rspock/ast/transformation.rb#32 RSpock::AST::Transformation::EXTEND_RSPOCK_DECLARATIVE = T.let(T.unsafe(nil), Parser::AST::Node) -# source://rspock//lib/rspock/ast/node.rb#42 -class RSpock::AST::WhenNode < ::RSpock::AST::Node; end +# source://rspock//lib/rspock/ast/node.rb#33 +class RSpock::AST::WhenNode < ::ASTTransform::Node; end -# source://rspock//lib/rspock/ast/node.rb#58 -class RSpock::AST::WhereNode < ::RSpock::AST::Node - # source://rspock//lib/rspock/ast/node.rb#66 +# source://rspock//lib/rspock/ast/node.rb#49 +class RSpock::AST::WhereNode < ::ASTTransform::Node + # source://rspock//lib/rspock/ast/node.rb#57 def data_rows; end - # source://rspock//lib/rspock/ast/node.rb#61 + # source://rspock//lib/rspock/ast/node.rb#52 def header; end end -# source://rspock//lib/rspock/backtrace_filter.rb#5 -class RSpock::BacktraceFilter - # Constructs a new BacktraceFilter instance. - # - # @param source_map_provider [::ASTTransform::SourceMap] The source map provider to be used. - # @return [BacktraceFilter] a new instance of BacktraceFilter - # - # source://rspock//lib/rspock/backtrace_filter.rb#9 - def initialize(source_map_provider: T.unsafe(nil)); end - - # Filters the backtrace of the given +exception+ and applies the filtered backtrace to the exception. - # - # @param exception [Exception] The exception to be filtered. - # @return [void] - # - # source://rspock//lib/rspock/backtrace_filter.rb#18 - def filter_exception(exception); end - - # Filters the given location. - # - # @param location [String] A location string. - # @return [String] The filtered location. - # - # source://rspock//lib/rspock/backtrace_filter.rb#27 - def filter_string(location); end - - private - - # source://rspock//lib/rspock/backtrace_filter.rb#45 - def location_builder(location); end - - # source://rspock//lib/rspock/backtrace_filter.rb#41 - def source_mapped_backtrace(e); end -end - # source://rspock//lib/rspock/declarative.rb#4 module RSpock::Declarative # source://rspock//lib/rspock/declarative.rb#5 diff --git a/sorbet/rbi/gems/unparser@0.8.2.rbi b/sorbet/rbi/gems/unparser@0.9.0.rbi similarity index 78% rename from sorbet/rbi/gems/unparser@0.8.2.rbi rename to sorbet/rbi/gems/unparser@0.9.0.rbi index cc566f8..539fd47 100644 --- a/sorbet/rbi/gems/unparser@0.8.2.rbi +++ b/sorbet/rbi/gems/unparser@0.9.0.rbi @@ -15,7 +15,7 @@ module Unparser # @param source [String] # @return [Parser::Source::Buffer] # - # source://unparser//lib/unparser.rb#259 + # source://unparser//lib/unparser.rb#258 def buffer(source, identification = T.unsafe(nil)); end # Parse string into AST @@ -23,7 +23,7 @@ module Unparser # @param source [String] # @return [Parser::AST::Node, nil] # - # source://unparser//lib/unparser.rb#206 + # source://unparser//lib/unparser.rb#205 def parse(source); end # Parse source with ast details @@ -33,7 +33,7 @@ module Unparser # @param source [String] # @return [AST] # - # source://unparser//lib/unparser.rb#228 + # source://unparser//lib/unparser.rb#227 def parse_ast(source, static_local_variables: T.unsafe(nil)); end # Parse string into either syntax error or AST @@ -41,7 +41,7 @@ module Unparser # @param source [String] # @return [Either] # - # source://unparser//lib/unparser.rb#215 + # source://unparser//lib/unparser.rb#214 def parse_ast_either(source); end # Parser instance that produces AST unparser understands @@ -51,7 +51,7 @@ module Unparser # @api private # @return [Parser::Base] # - # source://unparser//lib/unparser.rb#246 + # source://unparser//lib/unparser.rb#245 def parser; end # Unparse an AST (and, optionally, comments) into a string @@ -59,15 +59,15 @@ module Unparser # mutant:disable # # @api public - # @param node [Parser::AST::Node, nil] # @param comments [Array] # @param explicit_encoding [Encoding, nil] + # @param node [Parser::AST::Node, nil] # @param static_local_variables [Set] # @raise InvalidNodeError # if the node passed is invalid # @return [String] # - # source://unparser//lib/unparser.rb#109 + # source://unparser//lib/unparser.rb#108 def unparse(node, comments: T.unsafe(nil), explicit_encoding: T.unsafe(nil), static_local_variables: T.unsafe(nil)); end # Unparse an AST @@ -80,7 +80,7 @@ module Unparser # if the node passed is valid but unparser cannot unparse it # @return [String] # - # source://unparser//lib/unparser.rb#139 + # source://unparser//lib/unparser.rb#138 def unparse_ast(ast); end # Unparse AST either @@ -88,16 +88,16 @@ module Unparser # @param ast [AST] # @return [Either] # - # source://unparser//lib/unparser.rb#163 + # source://unparser//lib/unparser.rb#162 def unparse_ast_either(ast); end # Unparse with validation # - # @param node [Parser::AST::Node, nil] # @param comments [Array] + # @param node [Parser::AST::Node, nil] # @return [Either] # - # source://unparser//lib/unparser.rb#190 + # source://unparser//lib/unparser.rb#189 def unparse_validate(node, comments: T.unsafe(nil)); end # Unparse AST either @@ -107,7 +107,7 @@ module Unparser # @param ast [AST] # @return [Either] # - # source://unparser//lib/unparser.rb#174 + # source://unparser//lib/unparser.rb#173 def unparse_validate_ast_either(ast:); end end end @@ -117,22 +117,23 @@ end # source://unparser//lib/unparser/ast.rb#5 class Unparser::AST include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/ast.rb#6 def comments; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/ast.rb#6 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/ast.rb#6 def node; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/ast.rb#6 def static_local_variables; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/ast.rb#6 def anima; end # mutant:disable @@ -193,28 +194,44 @@ Unparser::AST::CLOSE_NODES = T.let(T.unsafe(nil), Array) # source://unparser//lib/unparser/ast.rb#92 class Unparser::AST::Enumerator include ::Enumerable - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods + # @return [Enumerator] a new instance of Enumerator + # + # source://unparser//lib/unparser/ast.rb#97 + def initialize(node, controller); end + + # Returns the value of attribute controller. + # + # source://unparser//lib/unparser/ast.rb#95 + def controller; end + # Return each node # # @api private # @return [Enumerator] if no block given # @return [self] otherwise # - # source://unparser//lib/unparser/ast.rb#105 + # source://unparser//lib/unparser/ast.rb#112 def each(&_arg0); end + # Returns the value of attribute node. + # + # source://unparser//lib/unparser/ast.rb#95 + def node; end + # Return nodes selected by type # # @api private # @param type [Symbol] # @return [Enumerable] # - # source://unparser//lib/unparser/ast.rb#129 + # source://unparser//lib/unparser/ast.rb#136 def type(type); end # Return nodes selected by types @@ -223,31 +240,8 @@ class Unparser::AST::Enumerator # @param types [Enumerable] # @return [Enumerable] # - # source://unparser//lib/unparser/ast.rb#117 + # source://unparser//lib/unparser/ast.rb#124 def types(types); end - - class << self - private - - # Return frozne set of objects - # - # @api private - # @param enumerable [Enumerable] - # @return [Set] - # - # source://unparser//lib/unparser/ast.rb#141 - def set(enumerable); end - - # Return nodes of type - # - # @api private - # @param node [Parser::AST::Node] - # @param type [Symbol] - # @return [Enumerable] # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/anima.rb#59 def attribute_names(&block); end # Return names @@ -753,11 +765,11 @@ class Unparser::Anima < ::Module # Initialize instance # - # @param object [Object] # @param attribute_hash [Hash] + # @param object [Object] # @return [self] # - # source://unparser//lib/unparser/anima.rb#73 + # source://unparser//lib/unparser/anima.rb#71 def initialize_instance(object, attribute_hash); end # Return new anima with attributes removed @@ -774,12 +786,12 @@ class Unparser::Anima < ::Module # Fail unless keys in +attribute_hash+ matches #attribute_names # - # @param klass [Class] the class being initialized # @param attribute_hash [Hash] the attributes to initialize +object+ with + # @param klass [Class] the class being initialized # @raise [Error] # @return [undefined] # - # source://unparser//lib/unparser/anima.rb#175 + # source://unparser//lib/unparser/anima.rb#173 def assert_known_attributes(klass, attribute_hash); end # Infect the instance with anima @@ -789,7 +801,7 @@ class Unparser::Anima < ::Module # @param scope [Class, Module] # @return [undefined] # - # source://unparser//lib/unparser/anima.rb#139 + # source://unparser//lib/unparser/anima.rb#137 def included(descendant); end # Return new instance @@ -797,7 +809,7 @@ class Unparser::Anima < ::Module # @param attributes [Enumerable] # @return [Anima] # - # source://unparser//lib/unparser/anima.rb#191 + # source://unparser//lib/unparser/anima.rb#189 def new(attributes); end end @@ -805,7 +817,8 @@ end # # source://unparser//lib/unparser/anima/attribute.rb#6 class Unparser::Anima::Attribute - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods @@ -836,8 +849,8 @@ class Unparser::Anima::Attribute # Load attribute # - # @param object [Object] # @param attributes [Hash] + # @param object [Object] # @return [self] # # source://unparser//lib/unparser/anima/attribute.rb#33 @@ -880,7 +893,7 @@ Unparser::Anima::Error::FORMAT = T.let(T.unsafe(nil), String) # Static instance methods for anima infected classes # -# source://unparser//lib/unparser/anima.rb#82 +# source://unparser//lib/unparser/anima.rb#80 module Unparser::Anima::InstanceMethods # Initialize an anima infected object # @@ -888,7 +901,7 @@ module Unparser::Anima::InstanceMethods # @param attributes [#to_h] a hash that matches anima defined attributes # @return [undefined] # - # source://unparser//lib/unparser/anima.rb#91 + # source://unparser//lib/unparser/anima.rb#89 def initialize(attributes); end # Return a hash representation of an anima infected object @@ -898,7 +911,7 @@ module Unparser::Anima::InstanceMethods # anima.to_h # => { :foo => : bar } # @return [Hash] # - # source://unparser//lib/unparser/anima.rb#104 + # source://unparser//lib/unparser/anima.rb#102 def to_h; end # Return updated instance @@ -916,7 +929,7 @@ module Unparser::Anima::InstanceMethods # @param attributes [Hash] # @return [Anima] # - # source://unparser//lib/unparser/anima.rb#125 + # source://unparser//lib/unparser/anima.rb#123 def with(attributes); end end @@ -1039,13 +1052,13 @@ Unparser::Buffer::INDENT_SPACE = T.let(T.unsafe(nil), String) # source://unparser//lib/unparser/buffer.rb#8 Unparser::Buffer::NL = T.let(T.unsafe(nil), String) -# source://unparser//lib/unparser.rb#35 +# source://unparser//lib/unparser.rb#34 class Unparser::Builder < ::Prism::Translation::Parser::Builder # mutant:disable # # @return [Builder] a new instance of Builder # - # source://unparser//lib/unparser.rb#39 + # source://unparser//lib/unparser.rb#38 def initialize; end end @@ -1061,7 +1074,7 @@ class Unparser::CLI # @param arguments [Array] # @return [undefined] # - # source://unparser//lib/unparser/cli.rb#78 + # source://unparser//lib/unparser/cli.rb#92 def initialize(arguments); end # Add options @@ -1072,7 +1085,7 @@ class Unparser::CLI # @param builder [OptionParser] # @return [undefined] # - # source://unparser//lib/unparser/cli.rb#108 + # source://unparser//lib/unparser/cli.rb#122 def add_options(builder); end # Return exit status @@ -1082,31 +1095,31 @@ class Unparser::CLI # @api private # @return [Integer] # - # source://unparser//lib/unparser/cli.rb#142 + # source://unparser//lib/unparser/cli.rb#156 def exit_status; end private # mutant:disable # - # source://unparser//lib/unparser/cli.rb#177 + # source://unparser//lib/unparser/cli.rb#191 def effective_targets; end # mutant:disable # # @return [Boolean] # - # source://unparser//lib/unparser/cli.rb#170 + # source://unparser//lib/unparser/cli.rb#184 def ignore_original_syntax_error?(validation); end # mutant:disable # - # source://unparser//lib/unparser/cli.rb#154 + # source://unparser//lib/unparser/cli.rb#168 def process_target(target); end # mutant:disable # - # source://unparser//lib/unparser/cli.rb#193 + # source://unparser//lib/unparser/cli.rb#207 def targets(file_name); end class << self @@ -1118,7 +1131,7 @@ class Unparser::CLI # @param arguments [Array] # @return [Integer] the exit status # - # source://unparser//lib/unparser/cli.rb#66 + # source://unparser//lib/unparser/cli.rb#80 def run(*_arg0); end end end @@ -1135,7 +1148,7 @@ class Unparser::CLI::Target extend ::Unparser::AbstractType::AbstractMethodDeclarations class << self - # source://unparser//lib/unparser/abstract_type.rb#36 + # source://unparser//lib/unparser/cli.rb#13 def new(*args, &block); end end end @@ -1144,41 +1157,63 @@ end # # source://unparser//lib/unparser/cli.rb#16 class Unparser::CLI::Target::Path < ::Unparser::CLI::Target - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods + + # @return [Path] a new instance of Path + # + # source://unparser//lib/unparser/cli.rb#22 + def initialize(path); end # Literal for this target # # @return [Validation] # - # source://unparser//lib/unparser/cli.rb#29 + # source://unparser//lib/unparser/cli.rb#37 def literal_validation; end + # Returns the value of attribute path. + # + # source://unparser//lib/unparser/cli.rb#19 + def path; end + # Validation for this target # # @return [Validation] # - # source://unparser//lib/unparser/cli.rb#22 + # source://unparser//lib/unparser/cli.rb#30 def validation; end end # String target # -# source://unparser//lib/unparser/cli.rb#35 +# source://unparser//lib/unparser/cli.rb#43 class Unparser::CLI::Target::String - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods + + # @return [String] a new instance of String + # + # source://unparser//lib/unparser/cli.rb#48 + def initialize(string); end # Literal for this target # # @return [Validation] # - # source://unparser//lib/unparser/cli.rb#48 + # source://unparser//lib/unparser/cli.rb#62 def literal_validation; end + # Returns the value of attribute string. + # + # source://unparser//lib/unparser/cli.rb#46 + def string; end + # Validation for this target # # @return [Validation] # - # source://unparser//lib/unparser/cli.rb#41 + # source://unparser//lib/unparser/cli.rb#55 def validation; end end @@ -1186,28 +1221,39 @@ end # # source://unparser//lib/unparser/color.rb#5 class Unparser::Color - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods + # @return [Color] a new instance of Color + # + # source://unparser//lib/unparser/color.rb#10 + def initialize(code); end + + # Returns the value of attribute code. + # + # source://unparser//lib/unparser/color.rb#8 + def code; end + # Format text with color # # @param text [String] # @return [String] # - # source://unparser//lib/unparser/color.rb#13 + # source://unparser//lib/unparser/color.rb#19 def format(text); end end -# source://unparser//lib/unparser/color.rb#41 +# source://unparser//lib/unparser/color.rb#47 Unparser::Color::GREEN = T.let(T.unsafe(nil), Unparser::Color) -# source://unparser//lib/unparser/color.rb#17 +# source://unparser//lib/unparser/color.rb#23 Unparser::Color::NONE = T.let(T.unsafe(nil), T.untyped) -# source://unparser//lib/unparser/color.rb#40 +# source://unparser//lib/unparser/color.rb#46 Unparser::Color::RED = T.let(T.unsafe(nil), Unparser::Color) # Holds the comments that remain to be emitted @@ -1300,89 +1346,6 @@ class Unparser::Comments end end -# A mixin to define a composition -# -# Original code before vendoring and reduction from: https://github.com/mbj/concord. -# -# source://unparser//lib/unparser/concord.rb#7 -class Unparser::Concord < ::Module - include ::Unparser::Equalizer::Methods - include ::Unparser::Adamantium - include ::Unparser::Adamantium::InstanceMethods - extend ::Unparser::Adamantium::ModuleMethods - extend ::Unparser::Adamantium::ClassMethods - - # Initialize object - # - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#30 - def initialize(*names); end - - # Return names - # - # @api private - # @return [Enumerable] - # - # source://unparser//lib/unparser/concord.rb#19 - def names; end - - private - - # Define equalizer - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#48 - def define_equalizer; end - - # Define initialize method - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#72 - def define_initialize; end - - # Define readers - # - # @api private - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#58 - def define_readers; end - - # Return instance variable names - # - # @api private - # @return [String] - # - # source://unparser//lib/unparser/concord.rb#92 - def instance_variable_names; end -end - -# The maximum number of objects the hosting class is composed of -# -# source://unparser//lib/unparser/concord.rb#11 -Unparser::Concord::MAX_NR_OF_OBJECTS = T.let(T.unsafe(nil), Integer) - -# Mixin for public attribute readers -# -# source://unparser//lib/unparser/concord.rb#97 -class Unparser::Concord::Public < ::Unparser::Concord - # Hook called when module is included - # - # @api private - # @param descendant [Class, Module] - # @return [undefined] - # - # source://unparser//lib/unparser/concord.rb#107 - def included(descendant); end -end - # All unparser constants maybe included in other libraries. # # source://unparser//lib/unparser/constants.rb#5 @@ -1552,18 +1515,24 @@ end # # source://unparser//lib/unparser/diff.rb#5 class Unparser::Diff - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods + # @return [Diff] a new instance of Diff + # + # source://unparser//lib/unparser/diff.rb#10 + def initialize(old, new); end + # Colorized unified source diff between old and new # # @return [String] if there is a diff # @return [nil] otherwise # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/diff.rb#40 def colorized_diff(&block); end # Unified source diff between old and new @@ -1571,36 +1540,46 @@ class Unparser::Diff # @return [String] if there is exactly one diff # @return [nil] otherwise # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/diff.rb#26 def diff(&block); end + # Returns the value of attribute new. + # + # source://unparser//lib/unparser/diff.rb#8 + def new; end + + # Returns the value of attribute old. + # + # source://unparser//lib/unparser/diff.rb#8 + def old; end + private - # source://unparser//lib/unparser/diff.rb#62 + # source://unparser//lib/unparser/diff.rb#69 def diffs; end - # source://unparser//lib/unparser/diff.rb#66 + # source://unparser//lib/unparser/diff.rb#73 def hunks; end - # source://unparser//lib/unparser/diff.rb#81 + # source://unparser//lib/unparser/diff.rb#88 def max_length; end - # source://unparser//lib/unparser/diff.rb#72 + # source://unparser//lib/unparser/diff.rb#79 def minimized_hunk; end class << self # Build new object from source strings # - # @param old [String] # @param new [String] + # @param old [String] # @return [Diff] # - # source://unparser//lib/unparser/diff.rb#46 + # source://unparser//lib/unparser/diff.rb#53 def build(old, new); end private - # source://unparser//lib/unparser/diff.rb#85 + # source://unparser//lib/unparser/diff.rb#92 def colorize_line(line); end # Break up source into lines @@ -1608,24 +1587,24 @@ class Unparser::Diff # @param source [String] # @return [Array] # - # source://unparser//lib/unparser/diff.rb#55 + # source://unparser//lib/unparser/diff.rb#62 def lines(source); end end end -# source://unparser//lib/unparser/diff.rb#8 +# source://unparser//lib/unparser/diff.rb#15 Unparser::Diff::ADDITION = T.let(T.unsafe(nil), String) -# source://unparser//lib/unparser/diff.rb#9 +# source://unparser//lib/unparser/diff.rb#16 Unparser::Diff::DELETION = T.let(T.unsafe(nil), String) -# source://unparser//lib/unparser/diff.rb#10 +# source://unparser//lib/unparser/diff.rb#17 Unparser::Diff::NEWLINE = T.let(T.unsafe(nil), String) -# source://unparser//lib/unparser.rb#74 +# source://unparser//lib/unparser.rb#73 Unparser::EMPTY_ARRAY = T.let(T.unsafe(nil), Array) -# source://unparser//lib/unparser.rb#73 +# source://unparser//lib/unparser.rb#72 Unparser::EMPTY_STRING = T.let(T.unsafe(nil), String) # RequireBLock @@ -1633,93 +1612,104 @@ Unparser::EMPTY_STRING = T.let(T.unsafe(nil), String) # source://unparser//lib/unparser/either.rb#21 class Unparser::Either include ::Unparser::RequireBlock - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods + # @return [Either] a new instance of Either + # + # source://unparser//lib/unparser/either.rb#26 + def initialize(value); end + # Test for left constructor # # @return [Boolean] # - # source://unparser//lib/unparser/either.rb#42 + # source://unparser//lib/unparser/either.rb#44 def left?; end # Test for right constructor # # @return [Boolean] # - # source://unparser//lib/unparser/either.rb#49 + # source://unparser//lib/unparser/either.rb#51 def right?; end + # Returns the value of attribute value. + # + # source://unparser//lib/unparser/either.rb#24 + def value; end + class << self # Execute block and wrap error in left # # @param exception [Class] # @return [Either] # - # source://unparser//lib/unparser/either.rb#33 + # source://unparser//lib/unparser/either.rb#35 def wrap_error(*exceptions); end end end -# source://unparser//lib/unparser/either.rb#53 +# source://unparser//lib/unparser/either.rb#55 class Unparser::Either::Left < ::Unparser::Either # Evaluate applicative block # # @return [Either::Left] # - # source://unparser//lib/unparser/either.rb#64 + # source://unparser//lib/unparser/either.rb#66 def bind(&_arg0); end # Evaluate left side of branch # - # @param left [#call] # @param _right [#call] + # @param left [#call] # - # source://unparser//lib/unparser/either.rb#98 + # source://unparser//lib/unparser/either.rb#100 def either(left, _right); end # Evaluate functor block # # @return [Either::Left] # - # source://unparser//lib/unparser/either.rb#57 + # source://unparser//lib/unparser/either.rb#59 def fmap(&_arg0); end # Unwrap value from left # # @return [Object] # - # source://unparser//lib/unparser/either.rb#71 + # source://unparser//lib/unparser/either.rb#73 def from_left; end # Unwrap value from right # # @return [Object] # - # source://unparser//lib/unparser/either.rb#79 + # source://unparser//lib/unparser/either.rb#81 def from_right; end # Map over left value # # @return [Either::Right] # - # source://unparser//lib/unparser/either.rb#90 + # source://unparser//lib/unparser/either.rb#92 def lmap; end end # Left # -# source://unparser//lib/unparser/either.rb#103 +# source://unparser//lib/unparser/either.rb#105 class Unparser::Either::Right < ::Unparser::Either # Evaluate applicative block # # @return [Either] # @yield [value] # - # source://unparser//lib/unparser/either.rb#114 + # source://unparser//lib/unparser/either.rb#116 def bind; end # Evaluate right side of branch @@ -1727,35 +1717,35 @@ class Unparser::Either::Right < ::Unparser::Either # @param _left [#call] # @param right [#call] # - # source://unparser//lib/unparser/either.rb#148 + # source://unparser//lib/unparser/either.rb#150 def either(_left, right); end # Evaluate functor block # # @return [Either::Right] # - # source://unparser//lib/unparser/either.rb#107 + # source://unparser//lib/unparser/either.rb#109 def fmap; end # Unwrap value from left # # @return [Object] # - # source://unparser//lib/unparser/either.rb#122 + # source://unparser//lib/unparser/either.rb#124 def from_left; end # Unwrap value from right # # @return [Object] # - # source://unparser//lib/unparser/either.rb#133 + # source://unparser//lib/unparser/either.rb#135 def from_right; end # Map over left value # # @return [Either::Right] # - # source://unparser//lib/unparser/either.rb#140 + # source://unparser//lib/unparser/either.rb#142 def lmap(&_arg0); end end @@ -1770,16 +1760,17 @@ class Unparser::Emitter include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::AbstractType::AbstractMethodDeclarations extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/emitter.rb#10 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/emitter.rb#10 def comments; end # Dispatch node write as statement @@ -1787,19 +1778,19 @@ class Unparser::Emitter # @api private # @return [undefined] # - # source://unparser//lib/unparser/abstract_type.rb#114 + # source://unparser//lib/unparser/emitter.rb#93 def dispatch(*_arg0); end # source://unparser//lib/unparser/emitter.rb#59 def emit_mlhs; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/emitter.rb#10 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/emitter.rb#10 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/emitter.rb#10 def node; end # LocalVariableRoot @@ -1808,7 +1799,7 @@ class Unparser::Emitter def node_type; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/emitter.rb#10 def anima; end # Return emitter @@ -1820,7 +1811,7 @@ class Unparser::Emitter # source://unparser//lib/unparser/emitter.rb#70 def emitter(buffer:, explicit_encoding:, comments:, node:, local_variable_scope:); end - # source://unparser//lib/unparser/abstract_type.rb#36 + # source://unparser//lib/unparser/emitter.rb#9 def new(*args, &block); end private @@ -1845,13 +1836,13 @@ class Unparser::Emitter::Alias < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/alias.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/alias.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/alias.rb#10 def source; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/alias.rb#10 def target; end end @@ -1873,10 +1864,10 @@ class Unparser::Emitter::Args < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/args.rb#30 def emit_shadowargs; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/args.rb#37 def normal_arguments(&block); end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/args.rb#42 def shadowargs(&block); end end @@ -1889,10 +1880,10 @@ class Unparser::Emitter::Argument < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#91 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#87 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#87 def remaining_children; end end @@ -1905,7 +1896,7 @@ class Unparser::Emitter::Array < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/array.rb#11 def dispatch; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/array.rb#17 def emitters(&block); end end @@ -1923,7 +1914,7 @@ end # # source://unparser//lib/unparser/emitter/assignment.rb#7 class Unparser::Emitter::Assignment < ::Unparser::Emitter - # source://unparser//lib/unparser/abstract_type.rb#114 + # source://unparser//lib/unparser/emitter/assignment.rb#48 def emit_left(*_arg0); end # source://unparser//lib/unparser/emitter/assignment.rb#10 @@ -1940,7 +1931,7 @@ class Unparser::Emitter::Assignment < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/assignment.rb#21 def emit_right; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/assignment.rb#43 def right_emitter(&block); end end @@ -1953,19 +1944,19 @@ Unparser::Emitter::Assignment::BINARY_OPERATOR = T.let(T.unsafe(nil), Array) class Unparser::Emitter::Assignment::Constant < ::Unparser::Emitter::Assignment private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/assignment.rb#70 def base; end # source://unparser//lib/unparser/emitter/assignment.rb#74 def emit_left; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/assignment.rb#70 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/assignment.rb#70 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/assignment.rb#70 def right; end end @@ -1978,13 +1969,13 @@ class Unparser::Emitter::Assignment::Variable < ::Unparser::Emitter::Assignment # source://unparser//lib/unparser/emitter/assignment.rb#59 def emit_left; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/assignment.rb#55 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/assignment.rb#55 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/assignment.rb#55 def right; end end @@ -1994,13 +1985,13 @@ end class Unparser::Emitter::Begin < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/begin.rb#9 def body; end # source://unparser//lib/unparser/emitter/begin.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/begin.rb#9 def remaining_children; end end @@ -2013,7 +2004,7 @@ class Unparser::Emitter::Binary < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/binary.rb#11 def dispatch; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/binary.rb#15 def writer(&block); end end @@ -2026,13 +2017,13 @@ class Unparser::Emitter::BinaryAssign < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/op_assign.rb#19 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/op_assign.rb#8 def expression; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/op_assign.rb#8 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/op_assign.rb#8 def target; end end @@ -2045,10 +2036,10 @@ Unparser::Emitter::BinaryAssign::MAP = T.let(T.unsafe(nil), Hash) class Unparser::Emitter::Block < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/block.rb#10 def arguments; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/block.rb#10 def body; end # source://unparser//lib/unparser/emitter/block.rb#14 @@ -2090,13 +2081,13 @@ class Unparser::Emitter::Block < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/block.rb#74 def numblock?; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/block.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/block.rb#10 def target; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/block.rb#43 def target_writer(&block); end # source://unparser//lib/unparser/emitter/block.rb#35 @@ -2115,10 +2106,10 @@ class Unparser::Emitter::BlockPass < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#130 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#126 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#126 def remaining_children; end end @@ -2143,7 +2134,7 @@ end class Unparser::Emitter::Case < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/case.rb#9 def condition; end # source://unparser//lib/unparser/emitter/case.rb#14 @@ -2158,10 +2149,10 @@ class Unparser::Emitter::Case < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/case.rb#30 def emit_whens; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/case.rb#9 def remaining_children; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/case.rb#10 def whens(&block); end end @@ -2171,13 +2162,13 @@ end class Unparser::Emitter::CaseGuard < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/case_guard.rb#15 def condition; end # source://unparser//lib/unparser/emitter/case_guard.rb#19 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/case_guard.rb#15 def remaining_children; end end @@ -2199,13 +2190,13 @@ class Unparser::Emitter::CaseMatch < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/case_match.rb#30 def emit_else_branch; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/case_match.rb#12 def patterns(&block); end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/case_match.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/case_match.rb#10 def target; end end @@ -2215,12 +2206,12 @@ end class Unparser::Emitter::Class < ::Unparser::Emitter include ::Unparser::Emitter::LocalVariableRoot - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/class.rb#7 def local_variable_scope(&block); end private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/class.rb#11 def body; end # source://unparser//lib/unparser/emitter/class.rb#15 @@ -2229,13 +2220,13 @@ class Unparser::Emitter::Class < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/class.rb#23 def emit_superclass; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/class.rb#11 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/class.rb#11 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/class.rb#11 def superclass; end end @@ -2251,13 +2242,13 @@ class Unparser::Emitter::Const < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/variable.rb#33 def emit_scope; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/variable.rb#24 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/variable.rb#24 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/variable.rb#24 def scope; end end @@ -2267,16 +2258,16 @@ end class Unparser::Emitter::ConstPattern < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/const_pattern.rb#10 def const; end # source://unparser//lib/unparser/emitter/const_pattern.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/const_pattern.rb#10 def pattern; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/const_pattern.rb#10 def remaining_children; end end @@ -2289,7 +2280,7 @@ class Unparser::Emitter::DStr < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/dstr.rb#12 def dispatch; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/dstr.rb#16 def dstr_writer(&block); end end @@ -2315,12 +2306,12 @@ end class Unparser::Emitter::Def < ::Unparser::Emitter include ::Unparser::Emitter::LocalVariableRoot - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/def.rb#7 def local_variable_scope(&block); end private - # source://unparser//lib/unparser/abstract_type.rb#114 + # source://unparser//lib/unparser/emitter/def.rb#14 def body(*_arg0); end # source://unparser//lib/unparser/emitter/def.rb#17 @@ -2329,7 +2320,7 @@ class Unparser::Emitter::Def < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/def.rb#25 def emit_arguments; end - # source://unparser//lib/unparser/abstract_type.rb#114 + # source://unparser//lib/unparser/emitter/def.rb#11 def emit_name(*_arg0); end end @@ -2339,19 +2330,19 @@ end class Unparser::Emitter::Def::Instance < ::Unparser::Emitter::Def private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#37 def arguments; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#37 def body; end # source://unparser//lib/unparser/emitter/def.rb#41 def emit_name; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#37 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/def.rb#37 def remaining_children; end end @@ -2361,22 +2352,22 @@ end class Unparser::Emitter::Def::Singleton < ::Unparser::Emitter::Def private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#52 def arguments; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#52 def body; end # source://unparser//lib/unparser/emitter/def.rb#56 def emit_name; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#52 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/def.rb#52 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/def.rb#52 def subject; end # @return [Boolean] @@ -2394,10 +2385,10 @@ class Unparser::Emitter::Defined < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/defined.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/defined.rb#9 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/defined.rb#9 def subject; end end @@ -2433,13 +2424,13 @@ class Unparser::Emitter::FlipFlop < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/flipflop.rb#27 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/flipflop.rb#23 def left; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/flipflop.rb#23 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/flipflop.rb#23 def right; end end @@ -2458,10 +2449,10 @@ class Unparser::Emitter::Float < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/float.rb#16 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/float.rb#9 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/float.rb#9 def value; end end @@ -2493,13 +2484,13 @@ Unparser::Emitter::FlowModifier::MAP = T.let(T.unsafe(nil), Hash) class Unparser::Emitter::For < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/for.rb#9 def assignment; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/for.rb#9 def body; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/for.rb#9 def condition; end # source://unparser//lib/unparser/emitter/for.rb#13 @@ -2508,7 +2499,7 @@ class Unparser::Emitter::For < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/for.rb#20 def emit_condition; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/for.rb#9 def remaining_children; end end @@ -2521,10 +2512,10 @@ class Unparser::Emitter::ForwardArg < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#20 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#16 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#16 def remaining_children; end end @@ -2578,13 +2569,13 @@ end class Unparser::Emitter::Hookexe < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/hookexe.rb#15 def body; end # source://unparser//lib/unparser/emitter/hookexe.rb#19 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/hookexe.rb#15 def remaining_children; end end @@ -2600,13 +2591,13 @@ class Unparser::Emitter::If < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/if.rb#9 def condition; end # source://unparser//lib/unparser/emitter/if.rb#21 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/if.rb#9 def else_branch; end # source://unparser//lib/unparser/emitter/if.rb#59 @@ -2624,7 +2615,7 @@ class Unparser::Emitter::If < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/if.rb#37 def emit_postcondition; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/if.rb#9 def if_branch; end # source://unparser//lib/unparser/emitter/if.rb#55 @@ -2635,7 +2626,7 @@ class Unparser::Emitter::If < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/if.rb#29 def postcondition?; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/if.rb#9 def remaining_children; end # @return [Boolean] @@ -2653,13 +2644,13 @@ class Unparser::Emitter::InMatch < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/in_match.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/in_match.rb#10 def pattern; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/in_match.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/in_match.rb#10 def target; end end @@ -2669,7 +2660,7 @@ end class Unparser::Emitter::InPattern < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/in_pattern.rb#10 def branch; end # source://unparser//lib/unparser/emitter/in_pattern.rb#14 @@ -2678,16 +2669,16 @@ class Unparser::Emitter::InPattern < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/in_pattern.rb#35 def dispatch_target(target); end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/in_pattern.rb#10 def else_branch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/in_pattern.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/in_pattern.rb#10 def target; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/in_pattern.rb#10 def unless_guard; end end @@ -2733,7 +2724,7 @@ class Unparser::Emitter::Index::Reference < ::Unparser::Emitter::Index # source://unparser//lib/unparser/emitter/index.rb#26 def emit_operation; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/index.rb#20 def indices(&block); end end @@ -2759,13 +2750,13 @@ class Unparser::Emitter::KeywordOptional < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#48 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#44 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#44 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#44 def value; end end @@ -2778,10 +2769,10 @@ class Unparser::Emitter::KwSplat < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/splat.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/splat.rb#9 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/splat.rb#9 def subject; end end @@ -2794,10 +2785,10 @@ class Unparser::Emitter::Kwarg < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#63 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#59 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#59 def remaining_children; end end @@ -2845,13 +2836,13 @@ class Unparser::Emitter::MASGN < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/masgn.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/masgn.rb#9 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/masgn.rb#9 def source; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/masgn.rb#9 def target; end end @@ -2891,10 +2882,10 @@ class Unparser::Emitter::Match::CurrentLine < ::Unparser::Emitter::Match # source://unparser//lib/unparser/emitter/match.rb#32 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match.rb#28 def regexp; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match.rb#28 def remaining_children; end end @@ -2907,13 +2898,13 @@ class Unparser::Emitter::Match::Lvasgn < ::Unparser::Emitter::Match # source://unparser//lib/unparser/emitter/match.rb#16 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match.rb#12 def lvasgn; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match.rb#12 def regexp; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match.rb#12 def remaining_children; end end @@ -2926,13 +2917,13 @@ class Unparser::Emitter::MatchAlt < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/match_alt.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_alt.rb#10 def left; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match_alt.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_alt.rb#10 def right; end end @@ -2945,13 +2936,13 @@ class Unparser::Emitter::MatchAs < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/match_as.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_as.rb#10 def left; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match_as.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_as.rb#10 def right; end end @@ -2964,13 +2955,13 @@ class Unparser::Emitter::MatchPattern < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/match_pattern.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_pattern.rb#10 def pattern; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match_pattern.rb#10 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_pattern.rb#10 def target; end end @@ -2981,13 +2972,13 @@ class Unparser::Emitter::MatchPatternP < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/match_pattern_p.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_pattern_p.rb#9 def pattern; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match_pattern_p.rb#9 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_pattern_p.rb#9 def target; end end @@ -3009,10 +3000,10 @@ class Unparser::Emitter::MatchRest < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/match_rest.rb#28 def emit_match_var; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_rest.rb#9 def match_var; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match_rest.rb#9 def remaining_children; end end @@ -3025,10 +3016,10 @@ class Unparser::Emitter::MatchVar < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/match_var.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/match_var.rb#10 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/match_var.rb#10 def remaining_children; end end @@ -3038,21 +3029,21 @@ end class Unparser::Emitter::Module < ::Unparser::Emitter include ::Unparser::Emitter::LocalVariableRoot - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/module.rb#7 def local_variable_scope(&block); end private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/module.rb#11 def body; end # source://unparser//lib/unparser/emitter/module.rb#15 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/module.rb#11 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/module.rb#11 def remaining_children; end end @@ -3068,10 +3059,10 @@ class Unparser::Emitter::NthRef < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/variable.rb#50 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/variable.rb#46 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/variable.rb#46 def remaining_children; end end @@ -3090,16 +3081,16 @@ class Unparser::Emitter::OpAssign < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/op_assign.rb#41 def emit_operator; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/op_assign.rb#31 def operator; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/op_assign.rb#31 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/op_assign.rb#31 def target; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/op_assign.rb#31 def value; end end @@ -3112,13 +3103,13 @@ class Unparser::Emitter::Optarg < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#34 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#30 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#30 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#30 def value; end end @@ -3149,16 +3140,16 @@ class Unparser::Emitter::Pair < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/pair.rb#47 def implicit_value_send?; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/pair.rb#13 def key; end # source://unparser//lib/unparser/emitter/pair.rb#39 def key_value; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/pair.rb#13 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/pair.rb#13 def value; end end @@ -3174,10 +3165,10 @@ class Unparser::Emitter::Pin < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/pin.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/pin.rb#9 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/pin.rb#9 def target; end end @@ -3187,16 +3178,16 @@ end class Unparser::Emitter::Post < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/repetition.rb#8 def body; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/repetition.rb#8 def condition; end # source://unparser//lib/unparser/emitter/repetition.rb#19 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/repetition.rb#8 def remaining_children; end end @@ -3209,76 +3200,67 @@ Unparser::Emitter::Post::MAP = T.let(T.unsafe(nil), Hash) class Unparser::Emitter::Primitive < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/primitive.rb#8 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/primitive.rb#8 def value; end end # Emitter for complex literals # -# source://unparser//lib/unparser/emitter/primitive.rb#37 +# source://unparser//lib/unparser/emitter/primitive.rb#22 class Unparser::Emitter::Primitive::Complex < ::Unparser::Emitter::Primitive private - # source://unparser//lib/unparser/emitter/primitive.rb#52 + # source://unparser//lib/unparser/emitter/primitive.rb#37 def dispatch; end - # source://unparser//lib/unparser/emitter/primitive.rb#57 + # source://unparser//lib/unparser/emitter/primitive.rb#42 def emit_imaginary; end - # source://unparser//lib/unparser/emitter/primitive.rb#61 + # source://unparser//lib/unparser/emitter/primitive.rb#46 def imaginary_node; end end -# source://unparser//lib/unparser/emitter/primitive.rb#43 +# source://unparser//lib/unparser/emitter/primitive.rb#28 Unparser::Emitter::Primitive::Complex::MAP = T.let(T.unsafe(nil), Hash) -# source://unparser//lib/unparser/emitter/primitive.rb#41 +# source://unparser//lib/unparser/emitter/primitive.rb#26 Unparser::Emitter::Primitive::Complex::RATIONAL_FORMAT = T.let(T.unsafe(nil), String) # Emiter for numeric literals # -# source://unparser//lib/unparser/emitter/primitive.rb#93 +# source://unparser//lib/unparser/emitter/primitive.rb#78 class Unparser::Emitter::Primitive::Numeric < ::Unparser::Emitter::Primitive private - # source://unparser//lib/unparser/emitter/primitive.rb#99 + # source://unparser//lib/unparser/emitter/primitive.rb#84 def dispatch; end end # Emitter for rational literals # -# source://unparser//lib/unparser/emitter/primitive.rb#69 +# source://unparser//lib/unparser/emitter/primitive.rb#54 class Unparser::Emitter::Primitive::Rational < ::Unparser::Emitter::Primitive private - # source://unparser//lib/unparser/emitter/primitive.rb#78 + # source://unparser//lib/unparser/emitter/primitive.rb#63 def dispatch; end - # source://unparser//lib/unparser/emitter/primitive.rb#86 + # source://unparser//lib/unparser/emitter/primitive.rb#71 def write_rational(value); end end -# source://unparser//lib/unparser/emitter/primitive.rb#73 +# source://unparser//lib/unparser/emitter/primitive.rb#58 Unparser::Emitter::Primitive::Rational::RATIONAL_FORMAT = T.let(T.unsafe(nil), String) # source://unparser//lib/unparser/emitter/primitive.rb#10 class Unparser::Emitter::Primitive::Symbol < ::Unparser::Emitter::Primitive private - # mutant:disable - # - # source://unparser//lib/unparser/emitter/primitive.rb#17 + # source://unparser//lib/unparser/emitter/primitive.rb#16 def dispatch; end - - # mutant:disable - # - # @return [Boolean] - # - # source://unparser//lib/unparser/emitter/primitive.rb#26 - def inspect_breaks_parsing?; end end # Progarg emitter @@ -3313,16 +3295,16 @@ class Unparser::Emitter::Range < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/range.rb#23 def begin_node; end # source://unparser//lib/unparser/emitter/range.rb#27 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/range.rb#23 def end_node; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/range.rb#23 def remaining_children; end # source://unparser//lib/unparser/emitter/range.rb#33 @@ -3347,7 +3329,7 @@ class Unparser::Emitter::Regexp < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/regexp.rb#12 def dispatch; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/regexp.rb#16 def writer(&block); end end @@ -3357,10 +3339,10 @@ end class Unparser::Emitter::Repetition < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/repetition.rb#35 def body; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/repetition.rb#35 def condition; end # source://unparser//lib/unparser/emitter/repetition.rb#39 @@ -3380,7 +3362,7 @@ class Unparser::Emitter::Repetition < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/repetition.rb#47 def postcontrol?; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/repetition.rb#35 def remaining_children; end end @@ -3406,10 +3388,10 @@ class Unparser::Emitter::Restarg < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/argument.rb#77 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/argument.rb#73 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/argument.rb#73 def remaining_children; end end @@ -3428,16 +3410,16 @@ Unparser::Emitter::Root::END_NL = T.let(T.unsafe(nil), Array) class Unparser::Emitter::SClass < ::Unparser::Emitter private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/class.rb#36 def body; end # source://unparser//lib/unparser/emitter/class.rb#40 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/class.rb#36 def object; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/class.rb#36 def remaining_children; end end @@ -3453,7 +3435,7 @@ class Unparser::Emitter::Send < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/send.rb#15 def dispatch; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/send.rb#19 def writer(&block); end end @@ -3482,13 +3464,13 @@ class Unparser::Emitter::Splat < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/splat.rb#32 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/splat.rb#23 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/splat.rb#23 def subject; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/splat.rb#37 def subject_emitter(&block); end end @@ -3501,10 +3483,10 @@ class Unparser::Emitter::String < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/string.rb#13 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/string.rb#7 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/string.rb#7 def value; end # source://unparser//lib/unparser/emitter/string.rb#21 @@ -3540,10 +3522,10 @@ class Unparser::Emitter::Variable < ::Unparser::Emitter # source://unparser//lib/unparser/emitter/variable.rb#14 def dispatch; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/emitter/variable.rb#10 def name; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/emitter/variable.rb#10 def remaining_children; end end @@ -3553,7 +3535,7 @@ end class Unparser::Emitter::When < ::Unparser::Emitter private - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/emitter/case.rb#47 def captures(&block); end # source://unparser//lib/unparser/emitter/case.rb#51 @@ -3611,63 +3593,125 @@ end # Original code before vendoring and reduction from: https://github.com/dkubb/equalizer. # # source://unparser//lib/unparser/equalizer.rb#7 -class Unparser::Equalizer < ::Module - # Initialize an Equalizer with the given keys +module Unparser::Equalizer + class << self + # Creates a module providing equality methods based on the given attributes + # + # @api public + # @param inspect [Boolean] whether to override #inspect and #pretty_print + # @param keys [Array] attribute names to use for equality + # @raise [ArgumentError] if keys is empty or contains non-Symbols + # @return [Module] a module to include in your class + # + # source://unparser//lib/unparser/equalizer.rb#16 + def new(*keys, inspect: T.unsafe(nil)); end + + private + + # Builds the module with equality methods for the given keys + # + # @api private + # @param inspect [Boolean] whether to include inspect methods + # @param keys [Array] attribute names (frozen) + # @return [Module] the configured module + # + # source://unparser//lib/unparser/equalizer.rb#119 + def build_module(keys, inspect:); end + end +end + +# Instance methods for inspect and pretty print output +# +# @api private +# +# source://unparser//lib/unparser/equalizer.rb#85 +module Unparser::Equalizer::InspectMethods + # String representation showing only equalizer attributes # - # Will use the keys with which it is initialized to define #cmp?, - # #hash, and #inspect + # @api private + # @return [String] inspect output # + # source://unparser//lib/unparser/equalizer.rb#89 + def inspect; end + + # Pretty print output using PP's object formatting # # @api private - # @param keys [Array] - # @return [undefined] + # @param q [PP] pretty printer + # @return [void] # - # source://unparser//lib/unparser/equalizer.rb#20 - def initialize(*keys); end - - private + # source://unparser//lib/unparser/equalizer.rb#100 + def pretty_print(pretty_printer); end - # source://unparser//lib/unparser/equalizer.rb#39 - def define_cmp_method; end - - # source://unparser//lib/unparser/equalizer.rb#49 - def define_hash_method; end - - # source://unparser//lib/unparser/equalizer.rb#56 - def define_inspect_method; end - - # source://unparser//lib/unparser/equalizer.rb#33 - def define_methods; end - - # source://unparser//lib/unparser/equalizer.rb#29 - def included(descendant); end + # Instance variables to display in pretty print output + # + # @api private + # @return [Array] instance variable names + # + # source://unparser//lib/unparser/equalizer.rb#107 + def pretty_print_instance_variables; end end -# The comparison methods +# Instance methods mixed into classes that include an Equalizer module +# +# @api private # -# source://unparser//lib/unparser/equalizer.rb#66 -module Unparser::Equalizer::Methods - # Compare the object with other object for equivalency +# source://unparser//lib/unparser/equalizer.rb#23 +module Unparser::Equalizer::InstanceMethods + # Equality comparison allowing subclasses # - # @api public - # @example - # object == other # => true or false - # @param other [Object] the other object to compare with - # @return [Boolean] + # @api private + # @param other [Object] object to compare + # @return [Boolean] true if other is_a? same class with equal attributes # - # source://unparser//lib/unparser/equalizer.rb#93 + # source://unparser//lib/unparser/equalizer.rb#28 def ==(other); end - # Compare the object with other object for equality + # Array deconstruction for pattern matching # - # @api public - # @example - # object.eql?(other) # => true or false - # @param other [Object] the other object to compare with - # @return [Boolean] + # @api private + # @return [Array] attribute values in order # - # source://unparser//lib/unparser/equalizer.rb#78 + # source://unparser//lib/unparser/equalizer.rb#52 + def deconstruct; end + + # Hash deconstruction for pattern matching + # + # @api private + # @param requested [Array, nil] keys to include, or nil for all + # @return [Hash{Symbol => Object}] requested attribute key-value pairs + # + # source://unparser//lib/unparser/equalizer.rb#60 + def deconstruct_keys(requested); end + + # Strict equality requiring exact class match + # + # @api private + # @param other [Object] object to compare + # @return [Boolean] true if other is exact same class with eql? attributes + # + # source://unparser//lib/unparser/equalizer.rb#37 def eql?(other); end + + # Hash code based on class and attribute values + # + # @api private + # @return [Integer] hash code + # + # source://unparser//lib/unparser/equalizer.rb#45 + def hash; end + + private + + # Compare all attributes using the given comparator + # + # @api private + # @param comparator [Symbol] method to use for comparison + # @param other [Object] object to compare against + # @return [Boolean] true if all attributes match + # + # source://unparser//lib/unparser/equalizer.rb#74 + def cmp?(comparator, other); end end # source://unparser//lib/unparser/generation.rb#5 @@ -3784,16 +3828,16 @@ Unparser::Generation::EXTRA_NL = T.let(T.unsafe(nil), Array) # Error raised when unparser encounters an invalid AST # -# source://unparser//lib/unparser.rb#79 +# source://unparser//lib/unparser.rb#78 class Unparser::InvalidNodeError < ::RuntimeError # @return [InvalidNodeError] a new instance of InvalidNodeError # - # source://unparser//lib/unparser.rb#82 + # source://unparser//lib/unparser.rb#81 def initialize(message, node); end # Returns the value of attribute node. # - # source://unparser//lib/unparser.rb#80 + # source://unparser//lib/unparser.rb#79 def node; end end @@ -3804,7 +3848,7 @@ module Unparser::NodeDetails private - # source://unparser//lib/unparser/node_details.rb#18 + # source://unparser//lib/unparser/node_details.rb#24 def children; end class << self @@ -3820,14 +3864,18 @@ class Unparser::NodeDetails::Send include ::Unparser::NodeHelpers include ::Unparser::Constants include ::Unparser::NodeDetails - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/node_details/send.rb#6 + def initialize(node); end + + # source://unparser//lib/unparser/node_details/send.rb#54 def arguments(&block); end # @return [Boolean] @@ -3837,7 +3885,7 @@ class Unparser::NodeDetails::Send # @return [Boolean] # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/node_details/send.rb#49 def assignment?(&block); end # @return [Boolean] @@ -3850,13 +3898,16 @@ class Unparser::NodeDetails::Send # source://unparser//lib/unparser/node_details/send.rb#21 def binary_syntax_allowed?; end + # source://unparser//lib/unparser/node_details/send.rb#6 + def node; end + # source://unparser//lib/unparser/node_details/send.rb#41 def non_assignment_selector; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/node_details/send.rb#13 def receiver; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/node_details/send.rb#13 def selector; end # @return [Boolean] @@ -3869,12 +3920,12 @@ class Unparser::NodeDetails::Send # source://unparser//lib/unparser/node_details/send.rb#29 def selector_unary_operator?; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/node_details/send.rb#59 def string_selector(&block); end private - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/node_details/send.rb#13 def remaining_children; end end @@ -3889,8 +3940,8 @@ module Unparser::NodeHelpers # Helper for building nodes # # @api private - # @param type [Symbol] # @param children [Array] + # @param type [Symbol] # @return [Parser::AST::Node] # # source://unparser//lib/unparser/node_helpers.rb#26 @@ -3914,8 +3965,8 @@ module Unparser::NodeHelpers # Helper for building nodes # # @api private - # @param type [Symbol] # @param children [Parser::AST::Node] + # @param type [Symbol] # @return [Parser::AST::Node] # # source://unparser//lib/unparser/node_helpers.rb#14 @@ -4038,12 +4089,12 @@ module Unparser::NodeHelpers def n_xstr?(node); end end -# source://unparser//lib/unparser.rb#62 +# source://unparser//lib/unparser.rb#61 class Unparser::PARSER_CLASS < ::Prism::Translation::Parser40 - # source://unparser//lib/unparser.rb#63 + # source://unparser//lib/unparser.rb#62 def declare_local_variable(local_variable); end - # source://unparser//lib/unparser.rb#67 + # source://unparser//lib/unparser.rb#66 def prism_options; end end @@ -4065,7 +4116,7 @@ class Unparser::UnknownNodeError < ::ArgumentError; end # Error raised when unparser encounders AST it cannot generate source for that would parse to the same AST. # -# source://unparser//lib/unparser.rb#90 +# source://unparser//lib/unparser.rb#89 class Unparser::UnsupportedNodeError < ::RuntimeError; end # Original code before vendoring and reduction from: https://github.com/mbj/mutant/blob/main/lib/mutant/util.rb @@ -4093,22 +4144,23 @@ class Unparser::Util::SizeError < ::IndexError; end # source://unparser//lib/unparser/validation.rb#5 class Unparser::Validation include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#6 def generated_node; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#6 def generated_source; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#6 def identification; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#6 def original_ast; end # mutant:disable @@ -4116,7 +4168,7 @@ class Unparser::Validation # source://unparser//lib/unparser/validation.rb#56 def original_node; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#6 def original_source; end # Return error report @@ -4126,7 +4178,7 @@ class Unparser::Validation # @api private # @return [String] # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/validation.rb#42 def report(&block); end # Test if source could be unparsed successfully @@ -4157,7 +4209,7 @@ class Unparser::Validation def report_exception(phase_exception); end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/validation.rb#6 def anima; end # Create validator from ast @@ -4239,16 +4291,17 @@ end # source://unparser//lib/unparser/validation.rb#14 class Unparser::Validation::PhaseException include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#15 def exception; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/validation.rb#15 def phase; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/validation.rb#15 def anima; end end end @@ -4288,27 +4341,28 @@ class Unparser::Writer::Array include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/array.rb#6 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/array.rb#6 def comments; end # source://unparser//lib/unparser/writer/array.rb#16 def emit_compact; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/array.rb#6 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/array.rb#6 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/array.rb#6 def node; end private @@ -4317,7 +4371,7 @@ class Unparser::Writer::Array def array_elements_generic_type; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/array.rb#6 def anima; end end end @@ -4333,15 +4387,16 @@ class Unparser::Writer::Binary include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/binary.rb#6 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/binary.rb#6 def comments; end # source://unparser//lib/unparser/writer/binary.rb#54 @@ -4350,13 +4405,13 @@ class Unparser::Writer::Binary # source://unparser//lib/unparser/writer/binary.rb#46 def emit_operator; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/binary.rb#6 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/binary.rb#6 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/binary.rb#6 def node; end # source://unparser//lib/unparser/writer/binary.rb#50 @@ -4373,26 +4428,26 @@ class Unparser::Writer::Binary # source://unparser//lib/unparser/writer/binary.rb#84 def keyword_symbol; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/binary.rb#8 def left; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/binary.rb#92 def left_emitter(&block); end # source://unparser//lib/unparser/writer/binary.rb#88 def operator_symbol; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/writer/binary.rb#8 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/binary.rb#8 def right; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/binary.rb#97 def right_emitter(&block); end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/binary.rb#6 def anima; end end end @@ -4423,15 +4478,16 @@ class Unparser::Writer::DynamicString include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#6 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#6 def comments; end # The raise below is not reachable if unparser is correctly implemented @@ -4447,13 +4503,13 @@ class Unparser::Writer::DynamicString # source://unparser//lib/unparser/writer/dynamic_string.rb#28 def dispatch; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#6 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#6 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#6 def node; end private @@ -4463,10 +4519,10 @@ class Unparser::Writer::DynamicString # source://unparser//lib/unparser/writer/dynamic_string.rb#65 def each_segments(array); end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/dynamic_string.rb#92 def heredoc_body(&block); end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/dynamic_string.rb#108 def heredoc_source(&block); end # source://unparser//lib/unparser/writer/dynamic_string.rb#56 @@ -4474,7 +4530,7 @@ class Unparser::Writer::DynamicString # @return [Boolean] # - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/dynamic_string.rb#51 def round_trips_heredoc?(&block); end # source://unparser//lib/unparser/writer/dynamic_string.rb#77 @@ -4484,7 +4540,7 @@ class Unparser::Writer::DynamicString def write_heredoc; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/dynamic_string.rb#6 def anima; end end end @@ -4515,27 +4571,28 @@ class Unparser::Writer::DynamicString::Heredoc include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#114 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#114 def comments; end # source://unparser//lib/unparser/writer/dynamic_string.rb#116 def emit; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#114 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#114 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#114 def node; end private @@ -4553,7 +4610,7 @@ class Unparser::Writer::DynamicString::Heredoc def escape_dynamic(string); end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/dynamic_string.rb#114 def anima; end end end @@ -4568,30 +4625,31 @@ class Unparser::Writer::DynamicString::Segmented include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#149 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#149 def comments; end # source://unparser//lib/unparser/writer/dynamic_string.rb#153 def dispatch; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#149 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#149 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#149 def node; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/dynamic_string.rb#151 def segments; end private @@ -4606,7 +4664,7 @@ class Unparser::Writer::DynamicString::Segmented def visit_str(children, child, index); end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/dynamic_string.rb#149 def anima; end end end @@ -4621,32 +4679,33 @@ class Unparser::Writer::Regexp include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#7 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#7 def comments; end # source://unparser//lib/unparser/writer/regexp.rb#16 def dispatch; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#7 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#7 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#7 def node; end private - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/regexp.rb#14 def body(&block); end # mutant:disable @@ -4660,7 +4719,7 @@ class Unparser::Writer::Regexp def render_with_delimiter(token_close:, token_open:); end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/regexp.rb#7 def anima; end end end @@ -4676,38 +4735,39 @@ class Unparser::Writer::Regexp::Effective include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#36 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#36 def comments; end # source://unparser//lib/unparser/writer/regexp.rb#42 def dispatch; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#36 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#36 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#36 def node; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#38 def token_close; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/regexp.rb#38 def token_open; end private - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/regexp.rb#40 def body(&block); end # source://unparser//lib/unparser/writer/regexp.rb#53 @@ -4720,7 +4780,7 @@ class Unparser::Writer::Regexp::Effective def write_regular(string); end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/regexp.rb#36 def anima; end end end @@ -4733,17 +4793,18 @@ class Unparser::Writer::Resbody include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods include ::Unparser::Adamantium include ::Unparser::Adamantium::InstanceMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/resbody.rb#7 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/resbody.rb#7 def comments; end # source://unparser//lib/unparser/writer/resbody.rb#16 @@ -4752,21 +4813,21 @@ class Unparser::Writer::Resbody # source://unparser//lib/unparser/writer/resbody.rb#26 def emit_regular; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/resbody.rb#7 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/resbody.rb#7 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/resbody.rb#7 def node; end private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/resbody.rb#14 def assignment; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/resbody.rb#14 def body; end # source://unparser//lib/unparser/writer/resbody.rb#42 @@ -4775,10 +4836,10 @@ class Unparser::Writer::Resbody # source://unparser//lib/unparser/writer/resbody.rb#35 def emit_exception; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/resbody.rb#14 def exception; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/writer/resbody.rb#14 def remaining_children; end # source://unparser//lib/unparser/writer/resbody.rb#65 @@ -4788,7 +4849,7 @@ class Unparser::Writer::Resbody def write_send_assignment; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/resbody.rb#7 def anima; end end end @@ -4804,15 +4865,16 @@ class Unparser::Writer::Rescue include ::Unparser::Generation include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/rescue.rb#6 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/rescue.rb#6 def comments; end # source://unparser//lib/unparser/writer/rescue.rb#23 @@ -4821,18 +4883,18 @@ class Unparser::Writer::Rescue # source://unparser//lib/unparser/writer/rescue.rb#12 def emit_regular; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/rescue.rb#6 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/rescue.rb#6 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/rescue.rb#6 def node; end private - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/rescue.rb#8 def body; end # source://unparser//lib/unparser/writer/rescue.rb#30 @@ -4841,17 +4903,17 @@ class Unparser::Writer::Rescue # source://unparser//lib/unparser/writer/rescue.rb#34 def emit_rescue_body(node); end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/writer/rescue.rb#8 def remaining_children; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/rescue.rb#10 def rescue_bodies(&block); end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/rescue.rb#8 def rescue_body; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/rescue.rb#6 def anima; end end end @@ -4867,15 +4929,16 @@ class Unparser::Writer::Send include ::Unparser::Adamantium::InstanceMethods include ::Unparser::Writer include ::Unparser::Anima::InstanceMethods - include ::Unparser::Equalizer::Methods + include ::Unparser::Equalizer::InstanceMethods + include ::Unparser::Equalizer::InspectMethods extend ::Unparser::Adamantium::ModuleMethods extend ::Unparser::Adamantium::ClassMethods extend ::Unparser::DSL - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/send.rb#7 def buffer; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/send.rb#7 def comments; end # source://unparser//lib/unparser/writer/send.rb#21 @@ -4887,13 +4950,13 @@ class Unparser::Writer::Send # source://unparser//lib/unparser/writer/send.rb#29 def emit_selector; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/send.rb#7 def explicit_encoding; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/send.rb#7 def local_variable_scope; end - # source://unparser//lib/unparser/anima.rb#157 + # source://unparser//lib/unparser/writer/send.rb#7 def node; end private @@ -4906,10 +4969,10 @@ class Unparser::Writer::Send # source://unparser//lib/unparser/writer/send.rb#76 def avoid_clash?; end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/send.rb#95 def details(&block); end - # source://unparser//lib/unparser/adamantium/method_builder.rb#87 + # source://unparser//lib/unparser/writer/send.rb#35 def effective_writer(&block); end # source://unparser//lib/unparser/writer/send.rb#40 @@ -4937,13 +5000,13 @@ class Unparser::Writer::Send # source://unparser//lib/unparser/writer/send.rb#84 def parses_as_constant?; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/send.rb#19 def receiver; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/writer/send.rb#19 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/send.rb#19 def selector; end # @return [Boolean] @@ -4952,7 +5015,7 @@ class Unparser::Writer::Send def write_as_attribute_assignment?; end class << self - # source://unparser//lib/unparser/anima.rb#147 + # source://unparser//lib/unparser/writer/send.rb#7 def anima; end end end @@ -4975,16 +5038,16 @@ class Unparser::Writer::Send::AttributeAssignment < ::Unparser::Writer::Send # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#29 def emit_receiver; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#8 def first_argument; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#8 def receiver; end - # source://unparser//lib/unparser/dsl.rb#11 + # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#8 def remaining_children; end - # source://unparser//lib/unparser/dsl.rb#18 + # source://unparser//lib/unparser/writer/send/attribute_assignment.rb#8 def selector; end end diff --git a/test/dev/learnings_index_test.rb b/test/dev/learnings_index_test.rb new file mode 100644 index 0000000..0882415 --- /dev/null +++ b/test/dev/learnings_index_test.rb @@ -0,0 +1,54 @@ +# typed: false +# frozen_string_literal: true + +require "test_helper" +require "pathname" + +# Content lint for the committed learnings corpus: the always-on index +# (.cursor/rules/learnings-index.mdc) and the detail skills it points at +# must stay consistent with the format the index defines — pointers +# resolve, skill names match their folders, detail skills stay within the +# line cap. +transform!(RSpock::AST::Transformation) +class Dev::LearningsIndexTest < Minitest::Test + REPO_ROOT = Pathname(DEV_ROOT) + INDEX_FILE = REPO_ROOT / ".cursor" / "rules" / "learnings-index.mdc" + SKILLS_ROOT = REPO_ROOT / ".cursor" / "skills" + + # The format's hard cap for detail skills; a learning outgrowing it + # graduates to a full skill instead of growing further. + DETAIL_SKILL_LINE_CAP = 40 + + test "the learnings index is an always-on rule" do + Expect "the frontmatter marks the rule alwaysApply" + INDEX_FILE.read.include?("alwaysApply: true") + end + + test "every repo-local index pointer resolves to a committed detail skill" do + Given "the .cursor/skills pointers in the index (channel-installed pointers are gitignored links, invisible in a fresh checkout)" + pointers = INDEX_FILE.read.scan(%r{→ (\.cursor/skills/[\w\-/]+)}).flatten + + Expect "each pointer names a committed SKILL.md" + !pointers.empty? + pointers.all? { |pointer| (REPO_ROOT / pointer / "SKILL.md").file? } + end + + test "every committed detail skill is indexed" do + Given "the committed detail skill directories and the index body" + skill_dirs = SKILLS_ROOT.glob("*/*/SKILL.md").map(&:dirname) + index = INDEX_FILE.read + + Expect "each skill directory appears as an index pointer" + !skill_dirs.empty? + skill_dirs.all? { |dir| index.include?("#{dir.relative_path_from(REPO_ROOT)}/") } + end + + test "detail skills name their folder and stay within the line cap" do + Given "the committed detail skills" + skill_files = SKILLS_ROOT.glob("*/*/SKILL.md") + + Expect "each frontmatter name matches its folder, and each stays within the cap" + skill_files.all? { |file| file.read.include?("name: #{file.dirname.basename}") } + skill_files.all? { |file| file.readlines.size <= DETAIL_SKILL_LINE_CAP } + end +end