diff --git a/src/vcard/vcard3.nim b/src/vcard/vcard3.nim index 12d3571..29751bb 100644 --- a/src/vcard/vcard3.nim +++ b/src/vcard/vcard3.nim @@ -661,7 +661,7 @@ macro genPropertyAccessors( of vpcAtMostOne: let funcDef = genAstOpt({kDirtyTemplate}, funcName, typeName): func funcName*(vc3: VCard3): Option[typeName] = - result = findFirst[typeName](vc3.content) + result = findFirst[typeName, VC3_Property](vc3.content) funcDef[6].insert(0, newCommentStmtNode( "Return the single " & $pn & " property (if present).")) result.add(funcDef) @@ -670,7 +670,7 @@ macro genPropertyAccessors( of vpcExactlyOne: let funcDef = genAstOpt({kDirtyTemplate}, funcName, pn, typeName): func funcName*(vc3: VCard3): typeName = - let props = findAll[typeName](vc3.content) + let props = findAll[typeName, VC3_Property](vc3.content) if props.len != 1: raise newException(ValueError, "VCard should have exactly one $# property, but $# were found" % @@ -683,7 +683,7 @@ macro genPropertyAccessors( of vpcAtLeastOne, vpcAny: let funcDef = genAstOpt({kDirtyTemplate}, funcName, typeName): func funcName*(vc3: VCard3): seq[typeName] = - result = findAll[typeName](vc3.content) + result = findAll[typeName, VC3_Property](vc3.content) funcDef[6].insert(0, newCommentStmtNode( "Return all instances of the " & $pn & " property.")) result.add(funcDef) @@ -693,7 +693,7 @@ genPropertyAccessors(propertyCardMap.pairs.toSeq --> func version*(vc3: VCard3): VC3_Version = ## Return the VERSION property. - let found = findFirst[VC3_Version](vc3.content) + let found = findFirst[VC3_Version, VC3_Property](vc3.content) if found.isSome: return found.get else: return VC3_Version( propertyId: vc3.content.len + 1, @@ -701,7 +701,7 @@ func version*(vc3: VCard3): VC3_Version = name: "VERSION", value: "3.0") -func xTypes*(vc3: VCard3): seq[VC3_XType] = findAll[VC3_XType](vc3.content) +func xTypes*(vc3: VCard3): seq[VC3_XType] = findAll[VC3_XType, VC3_Property](vc3.content) ## Return all extended properties (starting with `x-`). # Setters diff --git a/src/vcard/vcard4.nim b/src/vcard/vcard4.nim index 88c9ddb..cb3046c 100644 --- a/src/vcard/vcard4.nim +++ b/src/vcard/vcard4.nim @@ -842,7 +842,7 @@ macro genPropAccessors( of vpcAtLeastOne, vpcAny: let funcDef = genAstOpt({kDirtyTemplate}, funcName, typeName): func funcName*(vc4: VCard4): seq[typeName] = - result = findAll[typeName](vc4.content) + result = findAll[typeName, VC4_Property](vc4.content) result.add(funcDef) macro genNameAccessors(propNames: static[seq[VC4_PropertyName]]): untyped = diff --git a/tests/tlexer.nim b/tests/tlexer.nim index 9b321e1..3ae3e60 100644 --- a/tests/tlexer.nim +++ b/tests/tlexer.nim @@ -1,5 +1,5 @@ import unittest -import ./vcard/private/lexer +import vcard/private/lexer suite "vcard/private/lexer": test "private lexer tests": diff --git a/tests/tvcard3.nim b/tests/tvcard3.nim index 79c6905..9d59d49 100644 --- a/tests/tvcard3.nim +++ b/tests/tvcard3.nim @@ -1,7 +1,8 @@ -import options, unittest, zero_functional +import std/[options, strutils, times, unittest] +import zero_functional -import ./vcard -import ./vcard/vcard3 +import vcard +import vcard/vcard3 suite "vcard/vcard3": diff --git a/tests/tvcard4.nim b/tests/tvcard4.nim index 12464a2..17d572f 100644 --- a/tests/tvcard4.nim +++ b/tests/tvcard4.nim @@ -1,8 +1,8 @@ import std/[options, strutils, tables, unittest] import zero_functional -import ./vcard -import ./vcard/vcard4 +import vcard +import vcard/vcard4 suite "vcard/vcard4":