* Parse a (top-level) lua script * @param filename - the full path to the script * @param content - the content of the script * @param cache - cache
(filename, content, cache)
| 277 | * @param cache - cache |
| 278 | */ |
| 279 | async parseScript(filename, content, cache) { |
| 280 | const { name, numberOfKeys } = splitFilename(filename); |
| 281 | const meta = cache ? cache.get(name) : undefined; |
| 282 | if (meta && meta.content === content) { |
| 283 | return meta; |
| 284 | } |
| 285 | const fileInfo = { |
| 286 | path: filename, |
| 287 | token: getPathHash(filename), |
| 288 | content, |
| 289 | name, |
| 290 | numberOfKeys, |
| 291 | includes: [] |
| 292 | }; |
| 293 | |
| 294 | await this.resolveDependencies(fileInfo, cache); |
| 295 | return fileInfo; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Construct the final version of a file by interpolating its includes in dependency order. |
no test coverage detected