-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTODO
135 lines (87 loc) · 2.7 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
TODO
====
- Document CustomBlockDefinition and CustomFunctionDefinition.
Cleanup
-------
Change all use of Exception to ezcTemplateInternalException.
Remove all use of 'elements' in the parsers, use only 'children' not
both.
Minor features
--------------
Maybe support automatic string concat for constant strings::
"abc\n"
"def\n"
becomes::
"abc\n" . "def\n"
Tests
-----
Unit tests
----------
- ezcTemplateConfiguration
* addExtension - needs to check if $customClass does actually exists
+ test for it
Parsing
-------
Make sure case-checking is done for all elements, even blocks.
{Foreach} is not allowed.
Nodes
-----
Make sure the 'if' works in the same way in TST as in AST. That means
'if' has two children, the first is the normal body while the second
is the next else/elseif.
Generator
---------
The AstToPhp should not write the open/close markers ( <?php ?> ),
instead they should be part of the node tree (Created by TST2AST
visitor).
Syntax errors
-------------
Caching
-------
- Check {custom_block}
Version number
--------------
Do we need a version number?
To differentiate between other template engines, we rely on the path and template extension.
Newer versions of this template engine should be compatible with the older templates.
Function typehints
------------------
A few functions (like: array_count() ) have specified what type the method will return.
The type is TYPE_VALUE, TYPE_ARRAY, or both. If not specified it assumes that the return type is both,
which of course is true, but allows less type checking.
Future ideas
============
XML output
----------
Provide XML output (also input?) of TST/AST trees, this could provide
useful for advanced language tools.
Error messages
--------------
Some of the error message could be improved to make them clearer. Also
catching the errors in more correct places would help a lot.
Take a look at other languages like ADA/Pascal to get some ideas on
how to give good feedback.
Special syntax
--------------
Add support for parse-time constants like __LINE__ and __FILE__
(similar to PHP).
Debugging
---------
Add a 'debug' context which dumps the variable with var_export() or
something similar.
Importing objects
-----------------
Think about an {import} statement which can be used to import objects
etc. into template:
{import site}
{$site->title}
{import site as $siteData}
{import Math}
{$Math->rand( 5 )}
The importer could be implemented by the application to provide common
data without sending them (via include) all the time.
Method calls
------------
Think about how to do method calls, the class must be known and the
function must be allowed in the template language. Allowing any method
to be called could be fatal.