Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.TokenTransformManager.js |
— | — | @@ -62,25 +62,7 @@ |
63 | 63 | }; |
64 | 64 | |
65 | 65 | |
66 | | - |
67 | 66 | /** |
68 | | - * Map a rank to a phase. |
69 | | - * |
70 | | - * XXX: Might not be needed anymore, as phases are now subclassed and |
71 | | - * registrations are separated. |
72 | | - */ |
73 | | -TokenTransformManager.prototype._rankToPhase = function ( rank ) { |
74 | | - if ( rank < 0 || rank > 3 ) { |
75 | | - throw "TransformManager error: Invalid transformation rank " + rank; |
76 | | - } |
77 | | - if ( rank <= 2 ) { |
78 | | - return 2; |
79 | | - } else { |
80 | | - return 3; |
81 | | - } |
82 | | -}; |
83 | | - |
84 | | -/** |
85 | 67 | * Add a transform registration. |
86 | 68 | * |
87 | 69 | * @method |
— | — | @@ -151,8 +133,6 @@ |
152 | 134 | * fully processed). The token type change case still needs to be covered |
153 | 135 | * though. |
154 | 136 | */ |
155 | | -TokenTransformManager.prototype._setTokenRank = function ( token ) { |
156 | | -}; |
157 | 137 | TokenTransformManager.prototype._resetTokenRank = function ( res, transformer ) { |
158 | 138 | if ( res.token ) { |
159 | 139 | // reset rank after type or name change |
Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -126,6 +126,9 @@ |
127 | 127 | /* |
128 | 128 | * Annotate a token stream with list items with appropriate list tokens |
129 | 129 | * |
| 130 | + * XXX: Move this to a token handler in phase sync23! That way we can |
| 131 | + * support list items from templates too. |
| 132 | + * |
130 | 133 | * @static |
131 | 134 | * @method |
132 | 135 | * @param {[tokens]} Token stream with li tokens |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.js |
— | — | @@ -135,6 +135,9 @@ |
136 | 136 | * Token stream transformations to register by type and per phase. The |
137 | 137 | * possible ranks for individual transformation registrations are [0,1) |
138 | 138 | * (excluding 1.0) for sync01, [1,2) for async12 and [2,3) for sync23. |
| 139 | + * |
| 140 | + * Should perhaps be moved to mediawiki.parser.environment.js, so that all |
| 141 | + * configuration can be found in a single place. |
139 | 142 | */ |
140 | 143 | ParserPipeline.prototype._transformers = { |
141 | 144 | 'text/wiki': { |
— | — | @@ -143,14 +146,26 @@ |
144 | 147 | [ |
145 | 148 | IncludeOnly, |
146 | 149 | NoInclude |
| 150 | + // Insert TokenCollectors for extensions here (don't expand |
| 151 | + // templates in extension contents); wrap collected tokens in |
| 152 | + // special extension token. |
| 153 | + /* Extension1, */ |
| 154 | + /* Extension2, */ |
147 | 155 | ], |
148 | | - // Asynchronous out-of-order per input |
| 156 | + /* |
| 157 | + * Asynchronous out-of-order per input. Output of transforms is *not* |
| 158 | + * processed by other async transforms. Transforms are expected to |
| 159 | + * apply any additional async transformations themselves. |
| 160 | + */ |
149 | 161 | async12: |
150 | 162 | [ |
151 | | - // Insert TokenCollector for extensions here (don't expand |
152 | | - // templates in extension contents) |
153 | 163 | TemplateHandler, |
154 | | - AttributeExpander // After templates to avoid expanding unused branches |
| 164 | + // Expand attributes after templates to avoid expanding unused branches |
| 165 | + // XXX: Should we support further processing after attribute |
| 166 | + // expansion? |
| 167 | + AttributeExpander |
| 168 | + /* ExtensionHandler1, */ |
| 169 | + /* ExtensionHandler2, */ |
155 | 170 | ], |
156 | 171 | // Synchronous in-order on fully expanded token stream (including |
157 | 172 | // expanded templates etc). |
— | — | @@ -159,6 +174,7 @@ |
160 | 175 | QuoteTransformer, |
161 | 176 | PostExpandParagraphHandler, |
162 | 177 | /* Cite, */ |
| 178 | + /* ListHandler, */ |
163 | 179 | Sanitizer |
164 | 180 | ] |
165 | 181 | } |