docs(packages/codegen): correct outdated comments (#27838)

Comments-only change. Correct comments saying the printer does not support `ParenthesizedExpression`. This isn't true - it does!
This commit is contained in:
overlookmotel committed 2026-10-16 18:07:16 +00:00
1 parent 73a47819d6
commit 3de03c1bed
2 files changed
+10 -6

No files matched your search

+5 -3
View File
@@ -19,9 +19,11 @@ import type * as ESTree from "../../../npm/oxc-types/types.d.ts";
// Parse options for the cases which give source rather than an AST.
//
// `preserveParens: false` because this printer deliberately does not support the redundant
// `ParenthesizedExpression` node. `experimentalRawTransfer` is how the printer is meant to be used,
// so the ASTs are the shape it really sees.
// `preserveParens: false`, so every paren in the output is one the printer decided on itself.
// The printer does support `ParenthesizedExpression` nodes - hand-built ASTs below test them,
// and the fixture and conformance suites check both `preserveParens` modes against Rust.
//
// `experimentalRawTransfer` is how the printer is meant to be used, so the ASTs are the shape it really sees.
//
// `experimentalRawTransfer` is not in the published `ParserOptions` type - it is experimental and
// untyped. Declaring the object here rather than inline at the call site keeps TypeScript's excess
+5 -3
View File
@@ -23,9 +23,11 @@ import type * as ESTree from "../../../npm/oxc-types/types.d.ts";
// The inline fixtures below always run.
const CACHE_DIR_PATH = pathJoin(import.meta.dirname, "../../../target");
// `preserveParens: false` because this printer deliberately does not support the redundant
// `ParenthesizedExpression` / `TSParenthesizedType` nodes. `experimentalRawTransfer` is how the
// printer is meant to be used, so the ASTs here are the shape it really sees.
// One `preserveParens` mode is enough for these checks, so `false`. The printer supports
// `ParenthesizedExpression` / `TSParenthesizedType` nodes, and the fixture and conformance suites
// check both modes against Rust.
//
// `experimentalRawTransfer` is how the printer is meant to be used, so the ASTs here are the shape it really sees.
const PARSE_OPTIONS = {
preserveParens: false,
experimentalRawTransfer: true,