raises annotations for some generated procs
This commit is contained in:
parent
501f94ad61
commit
d8ca3daf3a
|
@ -334,7 +334,8 @@ proc genCustomSerializationForField(Format, field,
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
type Reader = ReaderType(`Format`)
|
type Reader = ReaderType(`Format`)
|
||||||
proc readFieldIMPL*(F: type FieldTag[`RecordType`, `fieldName`, auto],
|
proc readFieldIMPL*(F: type FieldTag[`RecordType`, `fieldName`, auto],
|
||||||
`readerSym`: var Reader): `FieldType` =
|
`readerSym`: var Reader): `FieldType`
|
||||||
|
{.raises: [IOError, SerializationError, Defect].} =
|
||||||
`readBody`
|
`readBody`
|
||||||
|
|
||||||
if writeBody != nil:
|
if writeBody != nil:
|
||||||
|
@ -343,7 +344,8 @@ proc genCustomSerializationForField(Format, field,
|
||||||
proc writeFieldIMPL*(`writerSym`: var Writer,
|
proc writeFieldIMPL*(`writerSym`: var Writer,
|
||||||
F: type FieldTag[`RecordType`, `fieldName`, auto],
|
F: type FieldTag[`RecordType`, `fieldName`, auto],
|
||||||
`valueSym`: auto,
|
`valueSym`: auto,
|
||||||
`holderSym`: `RecordType`) =
|
`holderSym`: `RecordType`)
|
||||||
|
{.raises: [IOError, SerializationError, Defect].} =
|
||||||
`writeBody`
|
`writeBody`
|
||||||
|
|
||||||
proc genCustomSerializationForType(Format, typ: NimNode,
|
proc genCustomSerializationForType(Format, typ: NimNode,
|
||||||
|
@ -353,13 +355,15 @@ proc genCustomSerializationForType(Format, typ: NimNode,
|
||||||
if readBody != nil:
|
if readBody != nil:
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
type Reader = ReaderType(`Format`)
|
type Reader = ReaderType(`Format`)
|
||||||
proc readValue*(`readerSym`: var Reader, T: type `typ`): `typ` =
|
proc readValue*(`readerSym`: var Reader, T: type `typ`): `typ`
|
||||||
|
{.raises: [IOError, SerializationError, Defect].} =
|
||||||
`readBody`
|
`readBody`
|
||||||
|
|
||||||
if writeBody != nil:
|
if writeBody != nil:
|
||||||
result.add quote do:
|
result.add quote do:
|
||||||
type Writer = WriterType(`Format`)
|
type Writer = WriterType(`Format`)
|
||||||
proc writeValue*(`writerSym`: var Writer, `valueSym`: `typ`) =
|
proc writeValue*(`writerSym`: var Writer, `valueSym`: `typ`)
|
||||||
|
{.raises: [IOError, SerializationError, Defect].} =
|
||||||
`writeBody`
|
`writeBody`
|
||||||
|
|
||||||
macro useCustomSerialization*(Format: typed, field: untyped, body: untyped): untyped =
|
macro useCustomSerialization*(Format: typed, field: untyped, body: untyped): untyped =
|
||||||
|
|
Loading…
Reference in New Issue