From 14b6586e41f7e84dbc847264b3d286838d04e898 Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 23 Apr 2026 17:44:16 +0000 Subject: [PATCH] HS parser: atoms for you/yourself, distinct your-possessive starting at you MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - parse-atom: 'you' and 'yourself' keywords resolve to (ref ) so they look up the let-binding the tell-command installs. - 'your ' no longer aliases 'my ' — it's the possessive over the 'you' binding, mirroring 'its' over 'it'. Unblocks 'you symbol represents the thing being told' and 'can take a class and swap it with another via with' (via you/your in tell handlers). Net: tell 6→7 (was 6/10). --- lib/hyperscript/parser.sx | 6 +++++- shared/static/wasm/sx/hs-parser.sx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/hyperscript/parser.sx b/lib/hyperscript/parser.sx index 91a6cdf7..3fe8e8ad 100644 --- a/lib/hyperscript/parser.sx +++ b/lib/hyperscript/parser.sx @@ -167,10 +167,14 @@ (do (adv!) (list (make-symbol ".") (list (quote event)) "detail"))) - ((and (= typ "keyword") (or (= val "my") (= val "your"))) + ((and (= typ "keyword") (= val "my")) (do (adv!) (parse-poss-tail (list (quote me))))) + ((and (= typ "keyword") (= val "your")) + (do (adv!) (parse-poss-tail (list (quote ref) "you")))) ((and (= typ "keyword") (= val "its")) (do (adv!) (parse-poss-tail (list (quote it))))) + ((and (= typ "keyword") (or (= val "you") (= val "yourself"))) + (do (adv!) (parse-prop-chain (list (quote ref) val)))) ((and (= typ "keyword") (= val "closest")) (do (adv!) (parse-trav (quote closest)))) ((and (= typ "keyword") (= val "next")) diff --git a/shared/static/wasm/sx/hs-parser.sx b/shared/static/wasm/sx/hs-parser.sx index 91a6cdf7..3fe8e8ad 100644 --- a/shared/static/wasm/sx/hs-parser.sx +++ b/shared/static/wasm/sx/hs-parser.sx @@ -167,10 +167,14 @@ (do (adv!) (list (make-symbol ".") (list (quote event)) "detail"))) - ((and (= typ "keyword") (or (= val "my") (= val "your"))) + ((and (= typ "keyword") (= val "my")) (do (adv!) (parse-poss-tail (list (quote me))))) + ((and (= typ "keyword") (= val "your")) + (do (adv!) (parse-poss-tail (list (quote ref) "you")))) ((and (= typ "keyword") (= val "its")) (do (adv!) (parse-poss-tail (list (quote it))))) + ((and (= typ "keyword") (or (= val "you") (= val "yourself"))) + (do (adv!) (parse-prop-chain (list (quote ref) val)))) ((and (= typ "keyword") (= val "closest")) (do (adv!) (parse-trav (quote closest)))) ((and (= typ "keyword") (= val "next"))