Browse Source

Added body, more indent functions

master
Macoy Madson 2 months ago
parent
commit
ad037d0fe4
2 changed files with 10 additions and 0 deletions
  1. +2
    -0
      doc/ToolsIntegration.org
  2. +8
    -0
      runtime/CHelpers.cake

+ 2
- 0
doc/ToolsIntegration.org View File

@ -36,6 +36,8 @@ The number represents how many arguments are expected to the function.
;; Macros
(put 'each-in-range 'lisp-indent-function 2)
(put 'each-in-array 'lisp-indent-function 2)
(put 'each-char-in-string 'lisp-indent-function 2)
(put 'each-char-in-string-const 'lisp-indent-function 2)
(put 'c-for 'lisp-indent-function 3)
(put 'run-process-sequential-or 'lisp-indent-function 1)


+ 8
- 0
runtime/CHelpers.cake View File

@ -2,6 +2,14 @@
(import &comptime-only "ComptimeHelpers.cake")
;; Unlike scope, this does not create a scope, which is useful when you don't want a scope but do
;; want multiple statements
;; Like Lisp's progn but without a name that doesn't make sense in C
(defmacro body (&rest statements any)
(tokenize-push output
(token-splice-rest statements tokens))
(return true))
;; This should evaluate its argument, but I'm just hacking it in right now anyways
(defmacro array-size (array-token symbol)
(tokenize-push output (/ (sizeof (token-splice array-token))


Loading…
Cancel
Save