Benjamin Saller Bender wrote:
> Today, Jay.Love@... wrote:
> What we have now is fine and can handle any needs. But for complex
> nested blocks, it could get a little messy with <% end %> blocks all
> over, and having to start and stop script blocks to induce the parser
> to recognize the nesting.
> So what we're talking about is how to handle multiple nested blocks
> without having to start a new script block for each level of
> indentation. Really, how best to have the parser recognize the
> indentation already within a block.
> If I understand what you are after (and it is something I was after
> once) you want to extract scoping info from the text and apply it during
> some code generation phase?
Yes, but on a very limited basis, in only one specific circumstance,
> For example you could (as I am sure you know) up the indentation when
> ever you see a colon in python, unless your in a dictionary. You could use
> the properly scoped pass keyword to close out blocks.
That's what we do now. But the colon only matters if it is at the end
of a script block, ie : %>.
> This or some variation of this scheme is all well and good if
> You can make it work and deal with odd ball cases like
> foo = lambda x: x * x
> where the colon doesn't mean indent.
By only noting colons at the end of a block, it's easy to recognize
> You don't mind having to write very specific presentation
> <%for item in items:%>
> <li> &item; </li>
> where indentation really matters.
This is the case. But the syntax to get the item is <%= item %>. It's
inside tags, so maybe that is the answer to your point below.
But, you can always keep it all in a code block, and write to the output
inside your code.
> And your UI people don't mind working in that environment (with
> out any kind of HTML editor which would most likely kill this kind of
Why no HTML editor? Everything is inside tags that the editors should
ignore. (Seriously, enlighten me, as I've never used any HTML specific
> Then there are other issues that may or not play a role in things like the
> ability to include and reuse chunks of code and HTML add different
> indentation levels in different files.
You can include files, wither in raw form that is not parsed for psp, or
as psp code which is parsed and will be indented if it's included inside
a block (At least it should, I haven't tested this.)
> Does my example capture the direction of this effort or am I missing
You're in the ballpark. This is what we're kicking around. But I urge
you to take a look at what we've got and get a better feel.