Damon Courtney wrote:

>>I'm thinking about redoing the parser to take into account situations
>>like this:
>>
>>----
>><some html>
>>
>><?
>>puts {<? blah blah blah?>}
>>?>
>>----
>>
>>Which currently cause problems with the parser.  Thoughts?  Maybe at
>>the same time, I can make it accept <?dtcl as well as <?, also...
>     Hrmmm...  Couldn't we just check to see if we're already in a block
> of code?  


I suppose a counter would be the easiest way to do it - when started it 
is 0, on evert "<?rivet" it is incremented by 1, on every "?>" it is 
decremented if the counter is >0.

However, I suppose a problem would be with XML stuff like this:
<?rivet
puts "<?xml version=\"1.0\" encoding=\"$encoding\"?>"
?>

The only way around this would be to:
1/ learn to write ?\> - which could be a PITA
2/ write the <? stack and trace which <? were connected with rivet and 
which were not. In this case the stack would be {1 0} - which means that 
the first <? started a script, however the second one didn't.

It will work with the above example. However, the following is a big 
problem:

<?rivet
proc php_end {} {
     puts "?>"
}
proc php_begin {} {
     puts "<?php "
}

php_begin
puts "echo('test')"
php_end
?>

> I like the idea of specifying some kind of specific rivet tag,
> but I think doing <?rivet is a bad idea.  I mean, I guess it works.  NWS
> had its own tag which looked more like a real HTML tag.  They were just:
> 
> <nws>

 > [...]

> Etc...


I don't like the idea of using tags - the same reason David mentioned.

--
WK



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to