minor updates on manual (#20258)

* minor updates on manual

1. statement -> keyword:

1. re-phase on the explanation of `import except`: maybe the newer version does not export some of the identifiers;

1. "The original module name is then not accessible" is moved up to the previous paragraph, since it is coupled with 
   the previous paragraph, but not the current one.

1. re-phase on the explanation of _Disabling certain messages_.

* Apply suggestions from code review

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Update manual.md

do not use "()".

* Update doc/manual.md

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
This commit is contained in:
Judd 2022-08-28 05:29:41 +08:00 • committed by GitHub
commit 2b56b38235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6499,7 +6499,7 @@ This is best illustrated by an example:
Import statement Import statement
---------------- ----------------
After the `import` statement, a list of module names can follow or a single After the `import` keyword, a list of module names can follow or a single
module name followed by an `except` list to prevent some symbols from being module name followed by an `except` list to prevent some symbols from being
imported: imported:
@ -6512,8 +6512,8 @@ imported:
It is not checked that the `except` list is really exported from the module. It is not checked that the `except` list is really exported from the module.
This feature allows us to compile against an older version of the module that This feature allows us to compile against different versions of the module,
does not export these identifiers. even when one version does not export some of these identifiers.
The `import` statement is only allowed at the top level. The `import` statement is only allowed at the top level.
@ -6548,7 +6548,8 @@ The `include` statement can be used outside the top level, as such:
Module names in imports Module names in imports
----------------------- -----------------------
A module alias can be introduced via the `as` keyword: A module alias can be introduced via the `as` keyword, after which the original module name
is inaccessible:
```nim ```nim
import std/strutils as su, std/sequtils as qu import std/strutils as su, std/sequtils as qu
@ -6556,8 +6557,7 @@ A module alias can be introduced via the `as` keyword:
echo su.format("$1", "lalelu") echo su.format("$1", "lalelu")
``` ```
The original module name is then not accessible. The notations The notations `path/to/module` or `"path/to/module"` can be used to refer to a module
`path/to/module` or `"path/to/module"` can be used to refer to a module
in subdirectories: in subdirectories:
```nim ```nim
@ -6614,7 +6614,7 @@ It is recommended and preferred but not currently enforced that all stdlib modul
From import statement From import statement
--------------------- ---------------------
After the `from` statement, a module name followed by After the `from` keyword, a module name followed by
an `import` to list the symbols one likes to use without explicit an `import` to list the symbols one likes to use without explicit
full qualification: full qualification:
@ -7175,8 +7175,9 @@ Disabling certain messages
-------------------------- --------------------------
Nim generates some warnings and hints ("line too long") that may annoy the Nim generates some warnings and hints ("line too long") that may annoy the
user. A mechanism for disabling certain messages is provided: Each hint user. A mechanism for disabling certain messages is provided: Each hint
and warning message contains a symbol in brackets. This is the message's and warning message is associated with a symbol. This is the message's
identifier that can be used to enable or disable it: identifier, which can be used to enable or disable the message by putting it
in brackets following the pragma:
```Nim ```Nim
{.hint[LineTooLong]: off.} # turn off the hint about too long lines {.hint[LineTooLong]: off.} # turn off the hint about too long lines