Summary
###########################################################################
File: stripunb.icn
Subject: Procedures to strip unbalanced material
Author: Richard L. Goerwitz
Date: May 2, 2001
###########################################################################
This file is in the public domain.
###########################################################################
Version: 1.7
###########################################################################
This routine strips material from a line which is unbalanced with
respect to the characters defined in arguments 1 and 2 (unbalanced
being defined as bal() defines it, except that characters preceded
by a backslash are counted as regular characters, and are not taken
into account by the balancing algorithm).
One little bit of weirdness I added in is a table argument. Put
simply, if you call stripunb() as follows,
stripunb('<','>',s,&null,&null,t)
and if t is a table having the form,
key: "bold" value: outstr("\e[2m", "\e1m")
key: "underline" value: outstr("\e[4m", "\e1m")
etc.
then every instance of "<bold>" in string s will be mapped to
"\e2m," and every instance of "</bold>" will be mapped to "\e[1m."
Values in table t must be records of type output(on, off). When
"</>" is encountered, stripunb will output the .off value for the
preceding .on string encountered.
###########################################################################
Links: scan
###########################################################################
Procedures:
stripunb
Global variables:
last_k, off, on, outstr
Links:
scan.icn
This file is part of the (main) package.
Source code.
stripunb(c1, c2, s, i, j, t)
last_k
off
on
outstr
This page produced by UniDoc on 2021/04/15 @ 23:59:54.