📄 guile-doc-snarf
字号:
#! /bin/sh# Copyright (C) 2002 Free Software Foundation, Inc.## Written by Sergey Poznyakoff## This is a snarfer for guile version 1.6# # This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2 of the License, or# (at your option) any later version.# # This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# # You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software Foundation,# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. OUTFILE=/dev/ttyDOCFILE=0BASEDIR=`dirname $0`test -n "${CPP+set}" || CPP="gcc -E"test -n "${AWK+set}" || AWK=awktemp=/tmp/snarf.$$trap "rm -f $temp" 0 1 2 15# process arumentswhile [ $# -gt 0 ];do case $1 in -o) OUTFILE=$2; shift 2;; -d) DOCFILE=1; shift;; *) break;; esacdone INFILE=$1; shiftcpp_exit=1snarf_x() { echo "/* source: $INFILE */" ; echo "/* cpp arguments: $@ */" ; $CPP -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@" > ${temp} cpp_exit=$? grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/"}snarf_doc() { $CPP -DSCM_MAGIC_SNARF_DOCS "$@" > ${temp} cpp_exit=$? $AWK 'NF<2 {next}state == 0 && /\^\^ {/ { state = 1; print; next }state == 0 && /\^\^/ { print }state == 1 && /\^\^ }/ { state = 0; print; next }state == 1 { print }state == 0 { next }' $temp |\ tr -d '\n' | tr '^' '\n' |\ awk -f $BASEDIR/guile-doc-snarf.awk > $OUTFILE}case "$DOCFILE" in 0) snarf_x $INFILE "$@" > $OUTFILE;; 1) snarf_doc $INFILE "$@" > $OUTFILE;;esacif [ $cpp_exit -ne 0 ]; then [ "$OUTFILE" != "/dev/tty" ] && rm $OUTFILEfiexit $cpp_exit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -