Scopes what parse and compile refuse in the README - #163
Merged
Merged
Conversation
The README's decompile example said parse refuses exactly what compile refuses. It now says parse refuses every source whose scan or grammar fails, and shows compile refusing a numeric literal parse accepts, since the emitter refuses on its own account. The Ast paragraph scopes the round-trip promise to sources compile accepts. The paragraph that said the statement grammar arrives in a later release now names compileProgram, its two located siblings, and the program run that execute and executeValue perform on a source string. Two overlong lines are rewrapped.
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.
Bead: pts-d3ft
What changes
README only (an also-gated path, so the full gate ran).
parserefuses exactly whatcompilerefuses. It now saysparserefuses every source whose scan or grammar fails, with the refusalcompileanswers for that source, and that the converse does not hold:compileruns an emitterparsedoes not, and the emitter refuses a numeric literal the value domain cannot hold and a source its walk counts past the depth limit where the grammar's count stops short. A new executed check in the same block shows a library hold rule with an oversized literal parsing and being refused bycompilewithnumber_out_of_range.Astparagraph scopes the round-trip promise: for a sourcecompileaccepts,decompile(parse(source).ast)keeps answering what the reference answers for that source.compile" no longer says the statement grammar arrives in a later release. It namescompileProgramand its two located siblings besidecompileand its two, and saysexecuteandexecuteValuerun a source string as a statement program whileevaluatecompiles an expression, assrc/index.tsandsrc/compile.tsdo on main.Provenance
Checks
mise exec -- pnpm run gate) green on the committed tree; the README examples run undertest/readme.test.ts.compilerefusal, and making the parsed source ungrammatical; each turnedtest/readme.test.tsred on the example's own thrown check.changelog.d/README.md.Review
Own in-turn review round (gate tier): every new sentence was checked against
src/index.ts(parse's doc comment, which names the two emitter-only refusals) andsrc/compile.tson main, and the oversized-literal behaviour was run before it was written down.