Skip to content

Commit f8fffc2

Browse files
committed
add comments, rename vm to dynloader
Signed-off-by: George Lemon <[email protected]>
1 parent 354c2f9 commit f8fffc2

File tree

8 files changed

+47
-39
lines changed

8 files changed

+47
-39
lines changed

src/tim/app/astCmd.nim

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
import std/os
28
import pkg/flatty
39
import pkg/kapsis/[cli, runtime]

src/tim/app/jitCmd.nim

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
import std/[osproc, os]
28
import pkg/flatty
39
import pkg/kapsis/[runtime, cli]
410

511
import ../engine/[parser, ast]
612
import ../engine/compilers/nimc
7-
import ../server/vm
13+
import ../server/dynloader
814

915
proc binCommand*(v: Values) =
1016
## Execute Just-in-Time compilation of the specifie

src/tim/app/liveCmd.nim

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
import std/[os, strutils]
28
import pkg/nyml
39
import pkg/kapsis/[cli, runtime]

src/tim/app/reprCmd.nim

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
import std/[os, strutils]
28
import pkg/flatty
39
import pkg/kapsis/[cli, runtime]

src/tim/app/srcCmd.nim

+7-34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
import std/[os, strutils]
28
import pkg/kapsis/[cli, runtime]
39
import ../engine/parser
@@ -41,37 +47,4 @@ proc srcCommand*(v: Values) =
4147
for err in p.logger.errors:
4248
display(err)
4349
displayInfo p.logger.filePath
44-
quit(1)
45-
46-
47-
# import std/critbits
48-
49-
# type
50-
# ViewHandle* = proc(): string
51-
# LayoutHandle* = proc(viewHtml: string): string
52-
# ViewsTree* = CritBitTree[ViewHandle]
53-
# LayoutsTree* = CritBitTree[LayoutHandle]
54-
55-
# proc getIndex(): string =
56-
# result = "view html"
57-
58-
# var views = ViewsTree()
59-
# views["index"] = getIndex
60-
61-
# proc getBaseLayout(viewHtml: string): string =
62-
# result = "start layout"
63-
# add result, viewHtml
64-
# add result, "end layout"
65-
66-
# var layouts = LayoutsTree()
67-
# layouts["base"] = getBaseLayout
68-
69-
# template render*(viewName: string, layoutName = "base"): untyped =
70-
# if likely(views.hasKey(viewName)):
71-
# let viewHtml = views[viewName]()
72-
# if likely(layouts.hasKey(layoutName)):
73-
# layouts[layoutName](viewHtml)
74-
# else: ""
75-
# else: ""
76-
77-
# echo render("index")
50+
quit(1)

src/tim/server/app.nim

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
import std/[os, strutils, sequtils, json, critbits]
28
import pkg/[zmq, watchout, jsony]
39
import pkg/kapsis/[cli]
@@ -208,4 +214,4 @@ proc run*(engine: var TimEngine, config: TimConfig) =
208214
discard existsOrCreateDir(config.output / "layouts")
209215
discard existsOrCreateDir(config.output / "partials")
210216
display("Tim Engine is running Source-to-Source")
211-
engine.precompile(config, newJObject())
217+
engine.precompile(config, newJObject())

src/tim/server/config.nim

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# A super fast template engine for cool kids
2+
#
3+
# (c) 2024 George Lemon | LGPL-v3 License
4+
# Made by Humans from OpenPeeps
5+
# https://github.com/openpeeps/tim
6+
17
from std/net import Port, `$`
28
export `$`
39

src/tim/server/vm.nim renamed to src/tim/server/dynloader.nim

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# A super fast template engine for cool kids
22
#
3-
# (c) 2023 George Lemon | LGPL License
3+
# (c) 2024 George Lemon | LGPL-v3 License
44
# Made by Humans from OpenPeeps
55
# https://github.com/openpeeps/tim
66

7-
## This module implements a high-performance Just-in-Time
87
import std/[tables, dynlib, json]
98
type
109
DynamicTemplate = object
@@ -17,7 +16,7 @@ type
1716

1817
when defined macosx:
1918
const ext = ".dylib"
20-
elif windows:
19+
elif defined windows:
2120
const ext = ".dll"
2221
else:
2322
const ext = ".so"

0 commit comments

Comments
 (0)