We do need to fix that.
Actually, I have the fix, but here's the deal, maybe I can just get the OK
from everyone for this.
The deal is that if there are any spaces between your <%end%> and the
<%else%>, then there will be a self.write(" ") between the end of the if and
the start of the else.
Ie, you get this:
if x:
do y
self.write("I am x")
etc...
self.write(" ")
else:
do z...
And of course python doesn't allow that.
The fix is to gobble up any whitespace that comes between 2 psp tokens. The
rule would be that if there are two consecutive PSP tokens with only
whitespace (and/or carriage return?) in between, then the whitepace gets
gobbled and no self.write is put into the servlet. This is not if/else
specific but applies to any pair of psp tokens together.
So the question is, would this cause a problem in writing your psp/html?
Are there any situations where you would need to have a psp token a space or
spaces and another psp token? If so, is it too much of a pain to use the
space code
What's the opinion out there?
Jay
> -----Original Message-----
> From: Luke Opperman [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 14, 2002 5:18 PM
> To: Webware Discuss
> Subject: [Webware-discuss] PSP and if/else
>
>
> Took me a a little trial and error, but I finally got PSP
> (not using braces) to recogize an if/else with the
> following:
>
> <%if x:%>
> some html
> <%end%><%else:%>
> alternate html
> <%end%>
>
> Has there been discussion of making PSP handle if/else (and
> other else) blocks more intelligently (specifically,
> understanding <%else:%> like <%end%>)? Or am I just missing
> something?
>
> Luke
>
> =====
> ------------------
> Reference Counting Garbage Collection:
> Look out philosophy majors, things really DO
> cease to exist when no one is looking at them!
> ------------------
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
>
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>
----------------------------------------------------------------------------
This e-mail and any attachments may be confidential or legally privileged.
If you received this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return
e-mail.
Thank you for your cooperation.
----------------------------------------------------------------------------
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss