Browse Source

Reformat Dictionary.cake

windows-imgui
Macoy Madson 1 year ago
parent
commit
5fd7654c9a
  1. 11
      src/Dictionary.cake
  2. 1
      tools/gamelib.el

11
src/Dictionary.cake

@ -64,7 +64,7 @@
(return true))
(defmacro each-key-in-strdict (strdict any index-iterator-name symbol
key-name symbol &rest body any)
key-name symbol &rest body any)
(tokenize-push output
(c-for
(var (token-splice index-iterator-name) size_t 0)
@ -138,7 +138,7 @@
;; (dict (* <your Key Value type>) &return <your value type>)
(defmacro each-key-in-dict (dict any index-iterator-name symbol
key-name symbol key-type symbol &rest body any)
key-name symbol key-type symbol &rest body any)
(tokenize-push output
(c-for
(var (token-splice index-iterator-name) size_t 0)
@ -164,8 +164,8 @@
(return true))
(defmacro each-item-addr-in-dict (dict any index-name symbol
item-name symbol ptr-to-item-type any
&rest body any)
item-name symbol ptr-to-item-type any
&rest body any)
(tokenize-push output
(each-in-dict (token-splice dict) (token-splice index-name)
(var (token-splice item-name ptr-to-item-type)
@ -532,9 +532,6 @@
(each-in-range 10 i
(var my-entry dict-entry (array i (* i 42.f)))
(dict-set-struct (field baseline dictionary) my-entry))
;; (dynarray-set-length (field baseline items) 10)
;; (each-item-addr-in-dynarray (field baseline items) i data (* array-data)
;; (set (path data > value) (type-cast i float)))
(unless (introspect-test-struct my-dict--metadata (addr baseline)
"TestDictionarySerialize.cakedata")

1
tools/gamelib.el

@ -2,6 +2,7 @@
(defun gamelib-cakelisp-mode ()
(put 'each-in-strdict 'lisp-indent-function 2)
(put 'each-item-addr-in-strdict 'lisp-indent-function 4)
(put 'each-item-in-dict 'lisp-indent-function 4)
(put 'each-in-dynarray 'lisp-indent-function 2)
(put 'each-in-dynarray-reverse 'lisp-indent-function 2)

Loading…
Cancel
Save