318 |
((eof-object? current-token) |
((eof-object? current-token) |
319 |
(syntax-error "Expected string-list but found " current-token)) |
(syntax-error "Expected string-list but found " current-token)) |
320 |
((eq? (car current-token) 'string) |
((eq? (car current-token) 'string) |
321 |
(list (cdr current-token))) |
(list 'string-list (cdr current-token))) |
322 |
((not (eq? (car current-token) 'delimiter)) |
((not (eq? (car current-token) 'delimiter)) |
323 |
(syntax-error "Expected string-list but found " (car current-token))) |
(syntax-error "Expected string-list but found " (car current-token))) |
324 |
((char=? (cdr current-token) #\[) |
((char=? (cdr current-token) #\[) |
876 |
(define output #f) |
(define output #f) |
877 |
|
|
878 |
(define (sieve-usage) |
(define (sieve-usage) |
879 |
(display "usage: sieve.scm --file FILENAME [--output FILENAME]") |
(display "usage: sieve.scm [OPTIONS]\n") |
880 |
(newline) |
(display "GNU sieve.scm -- compile a Sieve program into Scheme code\n") |
881 |
|
(display "Options are:\n") |
882 |
|
(display " -f, --file FILENAME Set input file name\n") |
883 |
|
(display " -o, --output FILENAME Set output file name\n") |
884 |
|
(display " -L, --lib-dir DIRNAME Set sieve library directory name\n") |
885 |
|
(display " -d, --debug LEVEL Set debugging level\n") |
886 |
(exit 0)) |
(exit 0)) |
887 |
|
|
888 |
(define (sieve-expand-filename name) |
(define (sieve-expand-filename name) |
912 |
(value #t)) |
(value #t)) |
913 |
(output (single-char #\o) |
(output (single-char #\o) |
914 |
(value #t)) |
(value #t)) |
915 |
|
(debug (single-char #\d) |
916 |
|
(value #t)) |
917 |
|
(lib-dir (single-char #\L) |
918 |
|
(value #t)) |
919 |
(help (single-char #\h)))) |
(help (single-char #\h)))) |
920 |
|
|
921 |
(define program-name (car (command-line))) |
(define program-name (car (command-line))) |
925 |
(cond |
(cond |
926 |
((pair? x) |
((pair? x) |
927 |
(case (car x) |
(case (car x) |
928 |
|
((debug) |
929 |
|
(set! sieve-debug (string->number (cdr x)))) |
930 |
((file) |
((file) |
931 |
(set! filename (cdr x))) |
(set! filename (cdr x))) |
932 |
|
((lib-dir) |
933 |
|
(set! sieve-libdir (cdr x))) |
934 |
((output) |
((output) |
935 |
(set! output (cdr x))) |
(set! output (cdr x))) |
936 |
((help) |
((help) |