summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorGravatar Sam Atman2025-05-13 12:15:18 -0400
committerGravatar Sam Atman2025-05-15 15:31:16 -0400
commit49843d6dc6cde85fe670085b809d41db314ec47d (patch)
treebb36ee23debffab23c8066b5e8aee0a2b1b35ae1 /codegen
parentRewrite, passes WordBreakTest (diff)
downloadzg-49843d6dc6cde85fe670085b809d41db314ec47d.tar.gz
zg-49843d6dc6cde85fe670085b809d41db314ec47d.tar.xz
zg-49843d6dc6cde85fe670085b809d41db314ec47d.zip
Add wordAtCursor
This is not actually the way to do it, and can break on some crafted strings. The way to actually do it: implement a reverse word search iterator, then do next() to find a word break, prev() to find a _valid_ word start, then next() again to find the valid end of said word. Maybe 2+, 2-, 1+ actually. I can probably write a test to see if the cursor spot is ambiguous, and apply an extra round if so. Need to mull the rules over before making any rash moves.
Diffstat (limited to 'codegen')
0 files changed, 0 insertions, 0 deletions