diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-26 07:09:39 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-26 07:09:39 -0700 |
commit | 9caf0b79e79828eed95cd125fe9ec21d7d71f56f (patch) | |
tree | 1175b7879fa5f10c799167ddbdea6b40b31d5067 /checkman.txr | |
parent | b3475e8d5e1f959ebd8030c1d78054a3ca7887ac (diff) | |
download | txr-9caf0b79e79828eed95cd125fe9ec21d7d71f56f.tar.gz txr-9caf0b79e79828eed95cd125fe9ec21d7d71f56f.tar.bz2 txr-9caf0b79e79828eed95cd125fe9ec21d7d71f56f.zip |
Change .codn and .code to fixed arity.
In the manual, the .code and .codn macros are no longer
variadic. They take one an two arguments, respectively.
Multiple arguments have to be quoted now.
This makes it easier to detect errors in usage,
using support in checkman.txr.
Numerous errors were found, in fact.
* checkman.txr (check-code): New pattern function
for doing some checks on .code, codn, cod2 and cod3
macro usage.
* txr.1: code and codn macro are no longer variadic.
All variadic uses fixes with quotes. Numerous
errors discovered and corrected.
Diffstat (limited to 'checkman.txr')
-rw-r--r-- | checkman.txr | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/checkman.txr b/checkman.txr index 98070c8a..c4a13356 100644 --- a/checkman.txr +++ b/checkman.txr @@ -59,6 +59,20 @@ @ (end) @(end) @;; +@;; .code, .codn, .cod2, .cod3 checks +@;; +@(define check-code ()) +@ (cases) +.code "@(assert bad ln `.code needs one argument`)@x"@(eol) +@ (or) +.code @(assert bad ln `.code needs one argument`)@{x /\S+/}@(eol) +@ (or) +.cod3 @(assert bad ln `.cod3 needs three arguments`)@x @y @{z /\S+/}@(eol) +@ (or) +.@{type /codn|cod2/} @(assert bad ln `.@type needs two arguments`)@(cases)"@x"@(or)@{x /\S+/}@(end) @{y /\S+/}@(eol) +@ (end) +@(end) +@;; @;; Main @;; @(bind errors 0) @@ -69,6 +83,8 @@ @ (check-var) @ (or) @ (check-func) +@ (or) +@ (check-code) @ (end) @ (catch bad (line msg)) @ (do (inc errors) |