Repository navigation
Conversation
Recognize a definite member question separately from ternary questions so member access can shift at its own precedence. Preserve ordinary question handling and the existing public nodes and expression supertypes. Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
This branch has not been deployed
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.
Close #233
var result = x || x?.C;now groups asx || (x?.C). A stateless external question token distinguishes definite member access from a ternary question, allowing member access to shift at its own precedence. It is emitted only after confirming a following dot that does not begin a decimal literal. Whitespace and comments remain separate extras.The token is aliased to the existing
?, preserving public punctuation, fields, node names, and expression supertypes. The ordinary question alternative remains available; element-access/ternary disambiguation is unchanged. No serialized scanner state is added.The corpus covers logical-or binding, explicit parentheses, intervening comments, and
?.5as a ternary consequence. With upstream CLI 0.26.5, all 180 corpus tests and 892 highlight assertions pass; the new test fails on master.npm run lintpasses, repeated generation is identical, andnode-types.jsonis unchanged. Supplemental checks cover 212 parser inputs, 33 lexical boundaries, and 576 incremental/fresh parse comparisons, including all nine supertype queries.Across 10,037 files from the four CI example projects, there are no new parse-error files. The 9,958 unchanged CSTs retain identical supertype captures. The remaining tree differences include member-access regrouping, 62 incidental
nameof(...)pattern corrections, and one recovery change in an already erroneous preprocessor region. The C# SDK confirms all 62nameofoccurrences are constant patterns or constant-value case labels, not declarations, in their complete original files.