Skip to content

Commit

Permalink
tiny cleanup (nim-lang#17957)
Browse files Browse the repository at this point in the history
* tiny cleanup

* I'm not British
  • Loading branch information
Araq authored and PMunch committed Mar 28, 2022
1 parent 0d883e2 commit 04d4f91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,8 @@ proc isDefined*(conf: ConfigRef; symbol: string): bool =
of "sunos": result = conf.target.targetOS == osSolaris
of "nintendoswitch":
result = conf.target.targetOS == osNintendoSwitch
of "freertos":
of "freertos", "lwip":
result = conf.target.targetOS == osFreeRTOS
of "lwip":
result = conf.target.targetOS in {osFreeRTOS}
of "littleendian": result = CPU[conf.target.targetCPU].endian == platform.littleEndian
of "bigendian": result = CPU[conf.target.targetCPU].endian == platform.bigEndian
of "cpu8": result = CPU[conf.target.targetCPU].bit == 8
Expand Down
20 changes: 10 additions & 10 deletions doc/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ Character literals are enclosed in single quotes `''` and can contain the
same escape sequences as strings - with one exception: the platform
dependent `newline`:idx: (``\p``)
is not allowed as it may be wider than one character (it can be the pair
CR/LF). Here are the valid `escape sequences`:idx: for character
CR/LF). Here are the valid `escape sequences`:idx: for character
literals:

================== ===================================================
Expand Down Expand Up @@ -1843,7 +1843,7 @@ untraced references are *unsafe*. However, for certain low-level operations
(accessing the hardware) untraced references are unavoidable.

Traced references are declared with the **ref** keyword, untraced references
are declared with the **ptr** keyword. In general, a `ptr T` is implicitly
are declared with the **ptr** keyword. In general, a `ptr T` is implicitly
convertible to the `pointer` type.

An empty subscript `[]` notation can be used to de-refer a reference,
Expand Down Expand Up @@ -2255,7 +2255,7 @@ conversions from `string` to `SQL` are allowed:
db.query("SELECT FROM users WHERE name = '$1'".SQL % [username])
Now we have compile-time checking against SQL injection attacks. Since
Now we have compile-time checking against SQL injection attacks. Since
`"".SQL` is transformed to `SQL("")` no new syntax is needed for nice
looking `SQL` string literals. The hypothetical `SQL` type actually
exists in the library as the `SqlQuery type <db_common.html#SqlQuery>`_ of
Expand Down Expand Up @@ -4252,7 +4252,7 @@ Closure iterators and inline iterators have some restrictions:
5. Closure iterators are not supported by the JS backend.

(*) Closure iterators can be co-recursive with a factory proc which results
in similar syntax to a recursive iterator. More details follow.
in similar syntax to a recursive iterator. More details follow.

Iterators that are neither marked `{.closure.}` nor `{.inline.}` explicitly
default to being inline, but this may change in future versions of the
Expand Down Expand Up @@ -4366,12 +4366,12 @@ The call can be made more like an inline iterator with a for loop macro:
echo f
Because of full backend function call aparatus involvment, closure iterator
invocation is typically higher cost than inline iterators. Adornment by
invocation is typically higher cost than inline iterators. Adornment by
a macro wrapper at the call site like this is a possibly useful reminder.

The factory `proc`, as an ordinary procedure, can be recursive. The
The factory `proc`, as an ordinary procedure, can be recursive. The
above macro allows such recursion to look much like a recursive iterator
would. For example:
would. For example:

.. code-block:: nim
proc recCountDown(n: int): iterator(): int =
Expand Down Expand Up @@ -7094,7 +7094,7 @@ Similar to the `importc pragma for C
<#foreign-function-interface-importc-pragma>`_, the
`importcpp` pragma can be used to import `C++`:idx: methods or C++ symbols
in general. The generated code then uses the C++ method calling
syntax: `obj->method(arg)`:cpp:. In combination with the `header` and `emit`
syntax: `obj->method(arg)`:cpp:. In combination with the `header` and `emit`
pragmas this allows *sloppy* interfacing with libraries written in C++:

.. code-block:: Nim
Expand Down Expand Up @@ -7327,7 +7327,7 @@ ImportObjC pragma
-----------------
Similar to the `importc pragma for C
<#foreign-function-interface-importc-pragma>`_, the `importobjc` pragma can
be used to import `Objective C`:idx: methods. The generated code then uses the
be used to import `Objective C`:idx: methods. The generated code then uses the
Objective C method calling syntax: ``[obj method param1: arg]``.
In addition with the `header` and `emit` pragmas this
allows *sloppy* interfacing with libraries written in Objective C:
Expand Down Expand Up @@ -7656,7 +7656,7 @@ Exportc pragma
--------------
The `exportc` pragma provides a means to export a type, a variable, or a
procedure to C. Enums and constants can't be exported. The optional argument
is a string containing the C identifier. If the argument is missing, the C
is a string containing the C identifier. If the argument is missing, the C
name is the Nim identifier *exactly as spelled*:

.. code-block:: Nim
Expand Down

0 comments on commit 04d4f91

Please sign in to comment.