This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

backslashify-docs script


Could someone whose got access to a compiler that does *not* support
literal strings split across lines run the below script on **/*.c [Zsh
syntax -- just run it on all .c files that you care to fix] and report
if Guile builds for them.  If the script works reliably enough, it might
be useful to defer add the "\n\" endings to the docstring lines until
later, and just package up the script (or perhaps an equivalent awk
script) and run it if an autoconf test tells us that we need to.

Thanks,
Greg


#!/usr/bin/perl -pwi.bak
BEGIN { $backslashing = 0; }

if (/^SCM_DEFINE/) { $backslashing = 1; next }

if (/^\#define FUNC_NAME/) { $backslashing = 0; next }

if ($backslashing == 1 && m/^\S/) {
  s/$/\\n\\/ unless (m/\"\s*\)\s*$/ || m/\\$/);
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]