use more .} (#18542)

This commit is contained in:
flywind 2021-07-20 20:12:15 +08:00 • committed by GitHub
commit dbf8d0b894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View file

@ -15,7 +15,7 @@
at runtime. Use ``ref object`` with inheritance rather than ``object`` with at runtime. Use ``ref object`` with inheritance rather than ``object`` with
inheritance to prevent this issue. inheritance to prevent this issue.
- The ``not nil`` type annotation now has to be enabled explicitly - The ``not nil`` type annotation now has to be enabled explicitly
via ``{.experimental: "notnil"}`` as we are still not pleased with how this via ``{.experimental: "notnil".}`` as we are still not pleased with how this
feature works with Nim's containers. feature works with Nim's containers.
- The parser now warns about inconsistent spacing around binary operators as - The parser now warns about inconsistent spacing around binary operators as
these can easily be confused with unary operators. This warning will likely these can easily be confused with unary operators. This warning will likely

View file

@ -474,13 +474,13 @@ Not nil annotation
================== ==================
**Note:** This is an experimental feature. It can be enabled with **Note:** This is an experimental feature. It can be enabled with
`{.experimental: "notnil"}`. `{.experimental: "notnil".}`.
All types for which `nil` is a valid value can be annotated with the All types for which `nil` is a valid value can be annotated with the
`not nil` annotation to exclude `nil` as a valid value: `not nil` annotation to exclude `nil` as a valid value:
.. code-block:: nim .. code-block:: nim
{.experimental: "notnil"} {.experimental: "notnil".}
type type
PObject = ref TObj not nil PObject = ref TObj not nil

View file

@ -334,7 +334,7 @@ type
si_status*: cint ## Exit value or signal. si_status*: cint ## Exit value or signal.
si_band*: int ## Band event for SIGPOLL. si_band*: int ## Band event for SIGPOLL.
si_value*: SigVal ## Signal value. si_value*: SigVal ## Signal value.
pad {.importc: "_pad"}: array[128 - 56, uint8] pad {.importc: "_pad".}: array[128 - 56, uint8]
Nl_item* {.importc: "nl_item", header: "<nl_types.h>".} = cint Nl_item* {.importc: "nl_item", header: "<nl_types.h>".} = cint
Nl_catd* {.importc: "nl_catd", header: "<nl_types.h>".} = pointer Nl_catd* {.importc: "nl_catd", header: "<nl_types.h>".} = pointer

View file

@ -536,7 +536,7 @@ include "system/arithmetics"
include "system/comparisons" include "system/comparisons"
const const
appType* {.magic: "AppType"}: string = "" appType* {.magic: "AppType".}: string = ""
## A string that describes the application type. Possible values: ## A string that describes the application type. Possible values:
## `"console"`, `"gui"`, `"lib"`. ## `"console"`, `"gui"`, `"lib"`.
@ -1101,15 +1101,15 @@ const
## True only when accessed in the main module. This works thanks to ## True only when accessed in the main module. This works thanks to
## compiler magic. It is useful to embed testing code in a module. ## compiler magic. It is useful to embed testing code in a module.
CompileDate* {.magic: "CompileDate"}: string = "0000-00-00" CompileDate* {.magic: "CompileDate".}: string = "0000-00-00"
## The date (in UTC) of compilation as a string of the form ## The date (in UTC) of compilation as a string of the form
## `YYYY-MM-DD`. This works thanks to compiler magic. ## `YYYY-MM-DD`. This works thanks to compiler magic.
CompileTime* {.magic: "CompileTime"}: string = "00:00:00" CompileTime* {.magic: "CompileTime".}: string = "00:00:00"
## The time (in UTC) of compilation as a string of the form ## The time (in UTC) of compilation as a string of the form
## `HH:MM:SS`. This works thanks to compiler magic. ## `HH:MM:SS`. This works thanks to compiler magic.
cpuEndian* {.magic: "CpuEndian"}: Endianness = littleEndian cpuEndian* {.magic: "CpuEndian".}: Endianness = littleEndian
## The endianness of the target CPU. This is a valuable piece of ## The endianness of the target CPU. This is a valuable piece of
## information for low-level code only. This works thanks to compiler ## information for low-level code only. This works thanks to compiler
## magic. ## magic.

View file

@ -1143,7 +1143,7 @@ proc setFileTime*(hFile: Handle, lpCreationTime: LPFILETIME,
type type
# https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid_identifier_authority # https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid_identifier_authority
SID_IDENTIFIER_AUTHORITY* {.importc, header: "<windows.h>".} = object SID_IDENTIFIER_AUTHORITY* {.importc, header: "<windows.h>".} = object
value* {.importc: "Value"}: array[6, BYTE] value* {.importc: "Value".}: array[6, BYTE]
# https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid # https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid
SID* {.importc, header: "<windows.h>".} = object SID* {.importc, header: "<windows.h>".} = object
Revision: BYTE Revision: BYTE