feat: read a keyword after a spread's ... and runs of postfix ! - #255
Conversation
A keyword counted as an operator only when the character before it was not a word character or `.`, so a spread's `...` made `new`, `await` or `typeof` right after it look like a property: `<div ...new Attrs() b/>` gave the spread `...new` plus attributes `Attrs()` and `b`. A keyword that starts the expression is now whole. A trailing `!` was postfix only directly after a word, `)` or `]`, so `x!!`, `"s"!` and `` `s`! `` still read as a prefix `!` and swallowed the next attribute or line. The look-behind now steps over a run of `!` and accepts a closing quote or backtick as the operand's end. A spaced `x !` and a `!` after `}` stay prefix: after `}` it can follow a block. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 228b30f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dpiercey-ws-marko-invariants-jcdpv7-parserfixes-types #255 +/- ##
======================================================================================
Coverage 99.89% 99.89%
======================================================================================
Files 35 35
Lines 4695 4711 +16
Branches 907 912 +5
======================================================================================
+ Hits 4690 4706 +16
Misses 4 4
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. WalkthroughThe parser now recognizes keyword operators immediately after spread syntax. It also handles repeated TypeScript non-null assertions and assertions after string or template literals. Keyword lookbehind receives expression metadata so it can accept a keyword at the expression start. New fixtures cover spread expressions and assertion cases. A minor changeset documents these parsing updates. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The parser changes address the documented expression forms, and the available fixtures cover them. No material merge-blocking issue is established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
A keyword operator right after a spread's
...was read as a property, so<div ...new Attrs() b/>split into the spread...newand an attributeAttrs(); a keyword that starts the expression is now whole. Runs of non-null assertions (x!!) and ones after a string or template literal ("s"!,`s`!) now end an unenclosed value likex!does. A spacedx !and a!after}stay prefix, since after}it can follow a block.🤖 Generated with Claude Code