From e1f86f909c90c525eb1cdac657e333b585f5f035 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 12 Jan 2017 02:15:30 -0800 Subject: Man page checker update. * checkman.txr (check-func): Bugfix: neglect to scan .synb sections for two types of headings. Include accessors, methods and structs in the check. (check-cblk): Use @(last) rather than @(until) so closing .cble is consumed. Otherwise the new check for dangling .cble will report false positives. (check-spurious): New pattern function to detect dangling .syne and .cble. (main loop): Include a stand-alone .synb check for the sake of special sections like Update expander. Include check-spurious. --- checkman.txr | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/checkman.txr b/checkman.txr index af6b4056..7797f070 100644 --- a/checkman.txr +++ b/checkman.txr @@ -50,14 +50,18 @@ @(define check-func ()) @ (cases) .coNP Operator/function @(skip) +@ (assert bad ln `no .synb after Operator/function heading`) +@ (check-synb) @ (or) .coNP Operator @@ @op and macro @@ @mac +@ (assert bad ln `no .synb after Operator and macro heading`) +@ (check-synb) @ (or) -.coNP @{type /Function|Operator|Macro/}s@(assert bad ln `bad @{type}s heading`)@(rep :gap 0) @@, @{x /\S+/}@(last :mandatory) @@ @y and @@ @{z /\S+/}@(end) +.coNP @{type /Function|Operator|Macro|Accessor|Method|Structure/}s@(assert bad ln `bad @{type}s heading`)@(rep :gap 0) @@, @{x /\S+/}@(last :mandatory) @@ @y and @@ @{z /\S+/}@(end) @ (assert bad ln `no .synb after @{type}s heading`) @ (check-synb) @ (or) -.coNP @{type /Function|Operator|Macro/}@(assert bad ln `bad @type heading`) @@ @{x /\S+/}@junk +.coNP @{type /Function|Operator|Macro|Accessor|Method|Structure/}@(assert bad ln `bad @type heading`) @@ @{x /\S+/}@junk @ (assert bad ln `extra elements in singular @type heading`) @ (bind junk "") @ (assert bad ln `no .synb after @type heading`) @@ -91,11 +95,19 @@ @ (none) .cblk @ (end) -@ (until :mandatory) +@ (last :mandatory) .cble @ (end) @(end) @;; +@;; Check for various dangling +@;; macros. +@;; +@(define check-spurious ()) +@ {mac /.(cble|syne)/}@(skip) +@ (throw bad ln `dangling @mac`) +@(end) +@;; @;; Main @;; @(bind errors 0) @@ -110,6 +122,10 @@ @ (check-code) @ (or) @ (check-cblk) +@ (or) +@ (check-synb) +@ (or) +@ (check-spurious) @ (end) @ (catch bad (line msg)) @ (do (inc errors) -- cgit v1.2.3