Opened 18 years ago
Closed 18 years ago
#38 closed enhancement (fixed)
[PATCH] Better support for multiline expressions
Reported by: | cboos | Owned by: | cmlenz |
---|---|---|---|
Priority: | minor | Milestone: | 0.3 |
Component: | Template processing | Version: | 0.2 |
Keywords: | Cc: |
Description
Since r231, one can write multiline full expressions, i.e.
This complex value: ${... ... ...}
However, this doesn't match well with Python syntax which doesn't tolerate white space in front of an expression (wrong indentation level issue).
As I can't think of any instance where this leading space may actually be expected or valid, I propose to simply left strip the white space on expressions, thereby making multiline expressions even easier and cleaner to write.
This complex value: ${ ... ... # compute the value ...}
Trivial patch:
-
template.py
844 844 for idx, group in enumerate(patterns.pop(0).split(text)): 845 845 if idx % 2: 846 846 try: 847 group = group.lstrip() 847 848 yield EXPR, Expression(group, filename, lineno), \ 848 849 (filename, lineno, offset) 849 850 except SyntaxError, err:
Change History (2)
comment:1 Changed 18 years ago by cmlenz
- Status changed from new to assigned
comment:2 Changed 18 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Applied in [241].
Note: See
TracTickets for help on using
tickets.
Yeah, good idea. Thanks!