docs(compilers/openapi): document the lowerer and the senses of lowering - #93
Merged
Merged
Conversation
The lowerer struct comment described the struct's mechanics but not what a lowerer is or why it is named for "lowering". Expand it to explain that lowering is the compiler-standard translation of a source-shaped OpenAPI document into the spec-agnostic IR, and to disambiguate the two senses the word carries here: this faithful, lossless source-to-IR pass, versus the lossy, target-shaped lowering that emitter refiners perform late. Doc-only; no behavior change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
lowererstruct comment explained the struct's mechanics (the interningtable, diagnostics, and depth counter it threads) but never said what a lowerer
is or why it is named for "lowering". This expands the doc comment to:
OpenAPI document into Morphic's spec-agnostic IR, with each
lower*method onestep of that descent; and
lossless source-to-IR pass, versus the lossy, target-shaped "lowered late" of
invariant docs: add repo and commit/PR conventions to CLAUDE.md #2 that emitter refiners perform downstream — so the name does not
read as if the compiler is flattening anything.
Documentation only; no behavior change.
Test plan
gofmt -l,go build ./..., andgo vet ./...clean. No code paths touched.