From 4927dfe244e57d9065c57c835727f6f2a0796e0d Mon Sep 17 00:00:00 2001 From: George Lemon Date: Fri, 22 Mar 2024 19:55:58 +0200 Subject: [PATCH] add comments Signed-off-by: George Lemon --- src/tim.nim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tim.nim b/src/tim.nim index 06f6fc1..c858942 100755 --- a/src/tim.nim +++ b/src/tim.nim @@ -25,6 +25,8 @@ const const localStorage* = CacheSeq"LocalStorage" macro initCommonStorage*(x: untyped) = + ## Initializes a common localStorage that can be + ## shared between controllers if x.kind == nnkStmtList: add localStorage, x[0] elif x.kind == nnkTableConstr: @@ -32,12 +34,12 @@ macro initCommonStorage*(x: untyped) = else: error("Invalid common storage initializer. Use `{}`, or `do` block") template `&*`*(n: untyped): untyped = + ## Compile-time localStorage initializer + ## that helps reusing shareable data. + ## + ## Once merged it calls `%*` macro from `std/json` + ## for converting NimNode to JsonNode macro toLocalStorage(x: untyped): untyped = - ## Compile-time localStorage initializer - ## that helps reusing shareable data. - ## - ## Once merged it calls `%*` macro from `std/json` - ## for converting NimNode to JsonNode if x.kind in {nnkTableConstr, nnkCurly}: var shareLocalNode: NimNode if localStorage.len > 0: