ReviewOS

home-lang/home

Port Rollup v4 parseAst snapshot corpus

#296
Closed chris opened this 10 days ago ·
10 days ago

Track the contiguous Bun corpus blocker at js/third_party/rollup-v4/rollup-v4.test.ts (position 4049).

Required parity:

  • resolve the Rollup v4 rollup/parseAst entry point;
  • parse the copied module declaration into the ESTree-compatible Program / VariableDeclaration / VariableDeclarator / Identifier / Literal shape with exact source offsets and raw literal data;
  • preserve Bun snapshot comparison behavior;
  • expose causal, position-aware parse diagnostics without embedding the submitted source in error messages or stacks;
  • add the copied case and its error contract to the permanent third-party suite.
10 days ago

Implemented and pushed in https://github.com/home-lang/home/commit/4381b2b5e.

Coverage now includes:

  • the Rollup v4 rollup/parseAst entry point, with sync and async APIs;
  • ESTree-compatible Program, VariableDeclaration, VariableDeclarator, Identifier, and Literal nodes;
  • exact source offsets, declaration kind, raw literal spelling/value, and module source type required by the copied snapshot;
  • RollupParseError failures with stable PARSE_ERROR, rollup.parseAst, source position, retained SyntaxError cause, and an explicit operation frame without embedding submitted source.

Verification:

  • focused position 4049: 1 file, 1 passed, 0 failed/todo/unsupported/allowed-empty;
  • positions 4048–4049: 2 files, 4 passed, 0 failed/todo/unsupported/allowed-empty;
  • permanent gRPC error-stack, SQL adapter-contract, and 32-case third-party diagnostic suites all pass.

Sign in to comment on this issue.