Changeset 35049 in project


Ignore:
Timestamp:
01/21/18 19:27:42 (9 months ago)
Author:
kon
Message:

CSI:Help

Location:
release/4/apropos/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/apropos/trunk/apropos.scm

    r34989 r35049  
    2323;; ; {{search|mode pre[fix]|suff[ix]|#t}} : {{#:search-mode #:prefix|#:suffix|#t}}
    2424;; ; {{SEARCH-MODE}} : Either {{#:prefix}}, {{#:suffix}}, or {{#t}} for contains. The default is {{#t}}.
     25
     26(declare
     27  (bound-to-procedure
     28    ##sys#symbol-has-toplevel-binding?
     29    ##sys#qualified-symbol?
     30    ##sys#macro-environment
     31    ##sys#current-environment
     32    ##sys#macro? ) )
    2533
    2634(module apropos
     
    8189  miscmacros)
    8290
    83 (declare  ;yes, i know not module-minded
    84   (bound-to-procedure
    85     ##sys#symbol-has-toplevel-binding?
    86     ##sys#qualified-symbol?
    87     ##sys#macro-environment
    88     ##sys#current-environment
    89     ##sys#macro? ) )
    90 
    9191;;; Support
    9292
     
    136136    (not obj)
    137137    (eq? #:name obj)
    138     (eq? #:mod obj) (eq? #:module obj)
     138    (eq? #:module obj)
    139139    (eq? #:type obj)) )
    140140
     
    988988;;;
    989989
     990(define (interp-sort-arg loc arg)
     991  (case arg
     992    ;
     993    ((n nam name)
     994      #:name )
     995    ;
     996    ((m mod module)
     997      #:module )
     998    ;
     999    ((t typ type)
     1000      #:type )
     1001    ;
     1002    (else
     1003      (if (not arg)
     1004        #f
     1005        (error-sort-key loc "unknown sort key" arg) ) ) ) )
     1006
    9901007;rmvd ", raw, base [#]"
    9911008(define *csi-apropos-help*
    992   ",a PATT ARG...    Apropos of PATT with ARG from mac[ros], qual[ified], ci|c13e, all, sort [name|mod[ule]|type|#f]")
     1009  ;0 ...             2
     1010  ;0 ...             0
     1011  ",a PATT ARG...    Apropos of PATT with ARG from mac, qual, ci, sort [nam|mod|typ|#f] Or ?")
    9931012
    9941013(define (parse-csi-apropos-arguments iargs)
     
    10521071          ;
    10531072          ((sort)
    1054             (addarg #:sort #:type (cut symbol->keyword <>)) )
     1073            (addarg #:sort #:type (cut interp-sort-arg ',a <>)) )
     1074          ;
     1075          ((?)
     1076            (print #<<EOS
     1077macros                                include macro bound symbols
     1078qualified                             include "qualified" symbols
     1079ci | case-insensitive                 pattern has no capitals
     1080sort [name | module | type | #f]      order items
     1081all                                   ci qual mac
     1082krl                                   all sort mod
     1083base                                  for number valued pattern
     1084raw                                   no symbol interpretation
     1085
     1086Note The 'sort' order argument is optional only when the last argument.
     1087EOS
     1088            )
     1089            (loop '() '()) )
    10551090          ;
    10561091          (else
     
    10661101              (string-trim-both (read-line))
    10671102              read-file))))
    1068         ;will not dump the symbol-table unless explicit ; '(: (* any))
     1103        ;NOTE will not dump the symbol-table unless explicit ; use '(: (* any))
    10691104        (unless (null? args)
    10701105          (apply apropos args) ) ) )
  • release/4/apropos/trunk/apropos.setup

    r34947 r35049  
    99  (exit 1) )
    1010
    11 (setup-shared-extension-module 'apropos (extension-version "2.6.2")
     11(setup-shared-extension-module 'apropos (extension-version "2.6.3")
    1212  #:types? #t
    1313  #:inline? #t
  • release/4/apropos/trunk/tests/run.scm

    r34862 r35049  
     1
     2(define EGG-NAME "apropos")
    13
    24;chicken-install invokes as "<csi> -s run.scm <eggnam> <eggdir>"
    3 
    4 (define *this-egg-name* "apropos")
    55
    66(use files)
     
    1111(define *args* (argv))
    1212
    13 (define (test-name #!optional (eggnam *this-egg-name*))
     13(define (test-name #!optional (eggnam EGG-NAME))
    1414  (string-append eggnam "-test") )
    1515
    16 (define (this-egg-name #!optional (def *this-egg-name*))
     16(define (egg-name #!optional (def EGG-NAME))
    1717  (cond
    1818    ((<= 4 (length *args*))
     
    2525;;;
    2626
    27 (set! *this-egg-name* (this-egg-name))
     27(set! EGG-NAME (egg-name))
    2828
    29 (define (run-test #!optional (eggnam *this-egg-name*) (cscopts *csc-options*))
     29(define (run-test #!optional (eggnam EGG-NAME) (cscopts *csc-options*))
    3030  (let ((tstnam (test-name eggnam)))
    3131    (print "*** csi ***")
     
    3636    (system (make-pathname (cond-expand (unix "./") (else #f)) tstnam)) ) )
    3737
     38(define (run-tests eggnams #!optional (cscopts *csc-options*))
     39  (for-each (cut run-test <> cscopts) eggnams) )
     40
    3841;;;
    3942
Note: See TracChangeset for help on using the changeset viewer.