Make the multisym splitter tiebreak the right way
This commit is contained in:
parent
cb8dc29bed
commit
1eb4a770dd
@ -161,7 +161,7 @@ a user-written file.
|
||||
;; for example, if I'm searching for "foo.bar.baz", my immediate priority is to find foo,
|
||||
;; and the stack has ["baz" "bar"]. "bar" is at the "top"/"end" of the stack as the next key to search.
|
||||
(if (sym? symbol)
|
||||
(let [split (utils.multi-sym-split symbol (if ?byte (+ 1 (- ?byte symbol.bytestart))))
|
||||
(let [split (utils.multi-sym-split symbol (if ?byte (- ?byte symbol.bytestart)))
|
||||
stack (stack-add-split! [] split)]
|
||||
|
||||
(case (docs.get-global-metadata (. split 1))
|
||||
|
||||
@ -178,9 +178,8 @@
|
||||
(check "(local a {:b {:c =={:d #\"hi\"}==}})
|
||||
(a.b.|c.d)")
|
||||
|
||||
;; TODO fix the multisym splitter
|
||||
; (check "(local a {:b {:c =={:d #\"hi\"}==}})
|
||||
; (a.b.c|.d)"))
|
||||
(check "(local a {:b {:c =={:d #\"hi\"}==}})
|
||||
(a.b.c|.d)")
|
||||
|
||||
|
||||
|
||||
|
||||
@ -91,8 +91,7 @@ new message handler `msgh`.")
|
||||
(fn test-multisym []
|
||||
(check "(local x {:foo 10}) x.foo|" "```fnl\n10\n```")
|
||||
(check "(local x {:foo 10}) x.|foo" "```fnl\n10\n```")
|
||||
;; TODO make it pick the other side of the multisym
|
||||
;; (check "(local x {:foo 10}) x|.foo" "```fnl\n{:foo 10}\n```")
|
||||
(check "(local x {:foo 10}) x|.foo" "```fnl\n{:foo 10}\n```")
|
||||
(check "(local x {:foo 10}) |x.foo" "```fnl\n{:foo 10}\n```")
|
||||
(check "(local x {:foo \"hello\"}) x.foo|" "```fnl\n:hello\n```")
|
||||
|
||||
|
||||
@ -35,8 +35,7 @@
|
||||
(check "(fn x| []) ==x==")
|
||||
(check "(fn x [])| x")
|
||||
(check "(let [x nil] ==|x.y== ==x.z==)")
|
||||
;; TODO decide this the other way
|
||||
;; (check "(let [x nil] ==x|.y== ==x.z==)")
|
||||
(check "(let [x nil] ==x|.y== ==x.z==)")
|
||||
(check "(let [x nil] x.|y x.z)")
|
||||
(check "(let [x nil] x.y| x.z)")
|
||||
(check "(let [x| 10]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user