mirror of
https://github.com/codex-storage/nim-json-rpc.git
synced 2025-02-23 16:38:22 +00:00
Don't call multiRemove macro directly from macro
This commit is contained in:
parent
95a261fa7c
commit
5eb0a8f947
@ -119,13 +119,16 @@ macro multiRemove(s: string, values: varargs[string]): string =
|
||||
body.add multiReplaceCall
|
||||
result = newBlockStmt(body)
|
||||
|
||||
proc makeProcName(s: string): string =
|
||||
s.multiRemove(".", "/")
|
||||
|
||||
macro on*(server: var RpcServer, path: string, body: untyped): untyped =
|
||||
result = newStmtList()
|
||||
let
|
||||
parameters = body.findChild(it.kind == nnkFormalParams)
|
||||
paramsIdent = ident"params"
|
||||
pathStr = $path
|
||||
procName = ident(pathStr.multiRemove(".", "/"))
|
||||
procName = ident(pathStr.makeProcName)
|
||||
var
|
||||
setup = setupParams(parameters, paramsIdent)
|
||||
procBody: NimNode
|
||||
|
Loading…
x
Reference in New Issue
Block a user