|
8 | 8 | import std/[macros, macrocache, streams, lexbase,
|
9 | 9 | strutils, sequtils, re, tables, os, with, options]
|
10 | 10 |
|
11 |
| -import ./meta, ./tokens, ./ast, ./logging, |
12 |
| - ./std, ./package/manager |
| 11 | +import ./meta, ./tokens, ./ast, ./logging, ./std |
| 12 | +# import ./package/manager |
13 | 13 |
|
14 | 14 | import pkg/kapsis/cli
|
15 | 15 | import pkg/importer
|
@@ -1117,20 +1117,21 @@ prefixHandle pImport:
|
1117 | 1117 | p.engine.parseModule(p.curr.value, std(p.curr.value)[1])
|
1118 | 1118 | p.tree.modules[p.curr.value].src = p.curr.value
|
1119 | 1119 | elif p.curr.value.startsWith("pkg/"):
|
1120 |
| - if likely(p.engine.packager.hasPackage(p.curr.value[4..^1].split("/")[0])): |
1121 |
| - # var moduleAst: Ast |
1122 |
| - # if likely(p.engine.packager.flagNoCache == false): |
1123 |
| - # moduleAst = p.engine.packager.getCachedModule(p.curr.value) |
1124 |
| - # if moduleAst != nil: |
1125 |
| - # p.tree.modules[p.curr.value] = moduleAst |
1126 |
| - # else: |
1127 |
| - let moduleCode = p.engine.packager.loadModule(p.curr.value) |
1128 |
| - let moduleAst = p.engine.parseModule(p.curr.value, SourceCode(moduleCode)) |
1129 |
| - p.tree.modules[p.curr.value] = moduleAst |
1130 |
| - # if p.engine.packager.flagNoCache == false: |
1131 |
| - # p.engine.packager.cacheModule(p.curr.value, moduleAst) |
1132 |
| - else: |
1133 |
| - errorWithArgs(importError, p.curr, [p.curr.value.addFileExt(".timl")]) |
| 1120 | + discard # todo |
| 1121 | + # if likely(p.engine.packager.hasPackage(p.curr.value[4..^1].split("/")[0])): |
| 1122 | + # # var moduleAst: Ast |
| 1123 | + # # if likely(p.engine.packager.flagNoCache == false): |
| 1124 | + # # moduleAst = p.engine.packager.getCachedModule(p.curr.value) |
| 1125 | + # # if moduleAst != nil: |
| 1126 | + # # p.tree.modules[p.curr.value] = moduleAst |
| 1127 | + # # else: |
| 1128 | + # let moduleCode = p.engine.packager.loadModule(p.curr.value) |
| 1129 | + # let moduleAst = p.engine.parseModule(p.curr.value, SourceCode(moduleCode)) |
| 1130 | + # p.tree.modules[p.curr.value] = moduleAst |
| 1131 | + # # if p.engine.packager.flagNoCache == false: |
| 1132 | + # # p.engine.packager.cacheModule(p.curr.value, moduleAst) |
| 1133 | + # else: |
| 1134 | + # errorWithArgs(importError, p.curr, [p.curr.value.addFileExt(".timl")]) |
1134 | 1135 | else:
|
1135 | 1136 | let path =
|
1136 | 1137 | (if not isAbsolute(p.curr.value):
|
@@ -1896,13 +1897,13 @@ proc parseSnippet*(id, code: string,
|
1896 | 1897 | logger: Logger(filePath: id),
|
1897 | 1898 | engine: TimEngine(
|
1898 | 1899 | `type`: TimEngineRuntime.runtimePassAndExit,
|
1899 |
| - packager: Packager( |
1900 |
| - flagNoCache: noCache, |
1901 |
| - flagRecache: reCache |
1902 |
| - ) |
| 1900 | + # packager: Packager( |
| 1901 | + # flagNoCache: noCache, |
| 1902 | + # flagRecache: reCache |
| 1903 | + # ) |
1903 | 1904 | ),
|
1904 | 1905 | )
|
1905 |
| - p.engine.packager.loadPackages() |
| 1906 | + # p.engine.packager.loadPackages() |
1906 | 1907 | p.curr = p.lex.getToken()
|
1907 | 1908 | p.next = p.lex.getToken()
|
1908 | 1909 | initModuleSystem()
|
@@ -1931,9 +1932,9 @@ proc parseSnippet*(snippetPath: string): Parser {.gcsafe.} =
|
1931 | 1932 | logger: Logger(filePath: snippetPath),
|
1932 | 1933 | engine: TimEngine(
|
1933 | 1934 | `type`: TimEngineRuntime.runtimePassAndExit,
|
1934 |
| - packager: Packager( |
1935 |
| - flagNoCache: true |
1936 |
| - ) |
| 1935 | + # packager: Packager( |
| 1936 | + # flagNoCache: true |
| 1937 | + # ) |
1937 | 1938 | ),
|
1938 | 1939 | )
|
1939 | 1940 | p.curr = p.lex.getToken()
|
|
0 commit comments