summaryrefslogtreecommitdiff
path: root/module/scripts
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-03-06 17:17:11 -0500
committerMark H Weaver <mhw@netris.org>2014-03-06 17:25:55 -0500
commitc3c3032608c9658c5dc5019d85446b6a1c2f7fcc (patch)
tree692a950dbcc09cb629289fb48248aad89a44976c /module/scripts
parentbf0d59e54de22f0a2e384b0fea2aa039769676fb (diff)
downloadguile-c3c3032608c9658c5dc5019d85446b6a1c2f7fcc.tar.gz
Make snarfing tools more robust to varied C preprocessor behavior.
* libguile/guile-snarf.in (modern_snarf): Rewrite sed script to cope with newlines in the snarfed code segments, or multiple code segments on the same line. * module/scripts/snarf-check-and-output-texi.scm (process-stream): Strip all 'hash' tokens from the stream. (do-command): Remove special cases that handled 'hash' tokens in a few places.
Diffstat (limited to 'module/scripts')
-rw-r--r--module/scripts/snarf-check-and-output-texi.scm15
1 files changed, 2 insertions, 13 deletions
diff --git a/module/scripts/snarf-check-and-output-texi.scm b/module/scripts/snarf-check-and-output-texi.scm
index 6ca07a1f4..82d71f4a9 100644
--- a/module/scripts/snarf-check-and-output-texi.scm
+++ b/module/scripts/snarf-check-and-output-texi.scm
@@ -1,6 +1,6 @@
;;; snarf-check-and-output-texi --- called by the doc snarfer.
-;; Copyright (C) 2001, 2002, 2006, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2006, 2011, 2014 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
@@ -63,7 +63,7 @@
(let loop ((s s))
(cond
((stream-null? s) #t)
- ((eq? 'eol (stream-car s))
+ ((memq (stream-car s) '(eol hash))
(loop (stream-cdr s)))
(else (cons (stream-car s) (stream-cdr s))))))
(port->stream port read)))))
@@ -265,17 +265,6 @@
(set! *file* file)
(set! *line* line))
- ;; newer gccs like to throw around more location markers into the
- ;; preprocessed source; these (hash . hash) bits are what they translate to
- ;; in snarfy terms.
- (('location ('string . file) ('int . line) ('hash . 'hash))
- (set! *file* file)
- (set! *line* line))
-
- (('location ('hash . 'hash) ('string . file) ('int . line) ('hash . 'hash))
- (set! *file* file)
- (set! *line* line))
-
(('arglist rest ...)
(set! *args* (do-arglist rest)))