From aff60c7709aec6b7e086ab51530b5c1f41f67938 Mon Sep 17 00:00:00 2001 From: thindil Date: Tue, 6 Feb 2024 05:06:29 +0000 Subject: [PATCH] refactor: added pragmas to several procedures FossilOrigin-Name: 99bbdfd99a7afb0793d666e6bfd102955c3e42af017e664397be237f13e9550c --- src/types.nim | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/types.nim b/src/types.nim index c6de6cfd..8c2ddfe8 100644 --- a/src/types.nim +++ b/src/types.nim @@ -29,6 +29,7 @@ import std/[paths, tables] # External modules imports import norm/[model, pragmas] +import contracts type HelpEntry* {.tableName: "help".} = ref object of Model @@ -141,18 +142,22 @@ type varType*: VariableValType description*: string -proc `$`*(path: Path): string = +proc `$`*(path: Path): string {.sideEffect, raises: [], tags: [], + contractual.} = ## Convert Path type to string. ## ## * path - the path variable which will be converted to string ## ## The parameter path converted to a string - return path.string + body: + return path.string -proc len*(path: Path): Natural = +proc len*(path: Path): Natural {.sideEffect, raises: [], tags: [], + contractual.} = ## Get the length of the path variable ## ## * path - the path variable which length will be count ## ## The lenght of the parameter path - return ($path).len + body: + return ($path).len