(ast, hasExtends)
| 189 | } |
| 190 | |
| 191 | function checkExtendPosition(ast, hasExtends) { |
| 192 | var legitExtendsReached = false; |
| 193 | walk(ast, function(node) { |
| 194 | if (node.type === 'Extends') { |
| 195 | if (hasExtends && !legitExtendsReached) { |
| 196 | legitExtendsReached = true; |
| 197 | } else { |
| 198 | error( |
| 199 | 'EXTENDS_NOT_FIRST', |
| 200 | 'Declaration of template inheritance ("extends") should be the first thing in the file. There can only be one extends statement per file.', |
| 201 | node |
| 202 | ); |
| 203 | } |
| 204 | } |
| 205 | }); |
| 206 | } |