Skip to content

Commit

Permalink
refactor: improve routing source code, disable UnreachableCode for se…
Browse files Browse the repository at this point in the history
…rver routes
  • Loading branch information
Ethosa committed Dec 21, 2024
1 parent a68ec8d commit d7e5574
Show file tree
Hide file tree
Showing 7 changed files with 666 additions and 591 deletions.
10 changes: 10 additions & 0 deletions src/happyx/private/macro_utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ proc buildHtmlProcedure*(root, body: NimNode, inComponent: bool = false,
cycleVars: var seq[NimNode], parent: NimNode = newEmptyNode()): NimNode


proc enableWarning*(warnName: static[string], enable: static[bool]): NimNode =
newNimNode(nnkPragma).add(newNimNode(nnkExprColonExpr).add(
newNimNode(nnkBracketExpr).add(ident"warning", ident(warnName)),
if enable:
ident"on"
else:
ident"off"
))


proc bracket*(node: varargs[NimNode]): NimNode =
result = newNimNode(nnkBracket)
for i in node:
Expand Down
2 changes: 0 additions & 2 deletions src/happyx/routing/mounting.nim
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ proc findAndReplaceMount*(body: NimNode) =
var mountBody = copy(registeredMounts[$name])
mountBody.findAndReplaceMount()

echo mountBody.toStrLit

var decoratorsOffset = 0

for statement in mountBody:
Expand Down
Loading

0 comments on commit d7e5574

Please sign in to comment.