Thanks for your response; sorry I'm late getting back.
Steve Wampler wrote:
> Thomas Crone wrote:
>
>> Is there a way I can modify the &subject and &pos of the Line ?
>> environment while I'm in the tag ? environment?
>
>
> There's no easy way to do this. Scanning environments are isolated
> from each other.
>
> ...
>
> Can you provide some specifics on what you're trying to do that
> makes this action desirable? Maybe there's another approach.
I am adapting a program from the Icon website, chkhtml.icn (that
checked an HTML file) to remove unnecessary tags. This started when
I tried to print a web site, got garbage, and looked at the html
source (written by MS Office :-) ). It has lots of stuff like:
<font size=...><font size=...><font size=...></font></font></font>
nested, equivalent tags, often with no content inside them.
The original program had a Line ? { } environment, looking at a
line from the html file. When it found a "<" it did a
tag := tab(find(">")) with mods for multi-line tags, etc;
then went to a tag ? { } environment to get any "/", then tag
name, etc. So I was in the tag ? environment when I found the </font>
with no content, and wanted to delete the <font size=...></font>
from the input line.
Instead I made a GetTag procedure that found the ">", and returned
an endFlag, TagName, and Attributes back to the Line ? environment.
When does Icon go back from an "inner" environment to the outer?
I presume at least at the end of the "block" the inner serch started in?
For example,
Line ? {
...
{
tag ? {
...
}
# are there any cases where we would be back to Line ? here?
}
# here we would be definitely back to the Line ? environment?
}


|