Skip to content

Commit

Permalink
complete doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Oct 30, 2023
1 parent 9ca90eb commit 1d7e6f4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions doc/astspec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ on what keywords are present. Let's start with the simplest form.
Concrete syntax:

```nim
import math
import std/math
```

AST:
Expand All @@ -907,7 +907,7 @@ With ``except``, we get ``nnkImportExceptStmt``.
Concrete syntax:

```nim
import math except pow
import std/math except pow
```

AST:
Expand All @@ -916,13 +916,13 @@ AST:
nnkImportExceptStmt(nnkIdent("math"),nnkIdent("pow"))
```

Note that ``import math as m`` does not use a different node; rather,
Note that ``import std/math as m`` does not use a different node; rather,
we use ``nnkImportStmt`` with ``as`` as an infix operator.

Concrete syntax:

```nim
import strutils as su
import std/strutils as su
```

AST:
Expand All @@ -945,7 +945,7 @@ If we use ``from ... import``, the result is different, too.
Concrete syntax:

```nim
from math import pow
from std/math import pow
```

AST:
Expand All @@ -954,7 +954,7 @@ AST:
nnkFromStmt(nnkIdent("math"), nnkIdent("pow"))
```

Using ``from math as m import pow`` works identically to the ``as`` modifier
Using ``from std/math as m import pow`` works identically to the ``as`` modifier
with the ``import`` statement, but wrapped in ``nnkFromStmt``.

Export statement
Expand Down
2 changes: 1 addition & 1 deletion doc/docgen_sample.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## This module is a sample.

import strutils
import std/strutils

proc helloWorld*(times: int) =
## Takes an integer and outputs
Expand Down
2 changes: 1 addition & 1 deletion doc/estp.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Otherwise your program is profiled.

```nim
when compileOption("profiler"):
import nimprof
import std/nimprof
```

After your program has finished the profiler will create a
Expand Down
6 changes: 3 additions & 3 deletions doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ string containing the literal. The callable identifier needs to be declared
with a special ``'`` prefix:

```nim
import strutils
import std/strutils
type u4 = distinct uint8 # a 4-bit unsigned integer aka "nibble"
proc `'u4`(n: string): u4 =
# The leading ' is required.
Expand All @@ -670,7 +670,7 @@ corresponds to this transformation. The transformation naturally handles
the case that additional parameters are passed to the callee:

```nim
import strutils
import std/strutils
type u4 = distinct uint8 # a 4-bit unsigned integer aka "nibble"
proc `'u4`(n: string; moreData: int): u4 =
result = (parseInt(n) and 0x0F).u4
Expand Down Expand Up @@ -5231,7 +5231,7 @@ conservative in its effect analysis:
```nim test = "nim c $1" status = 1
{.push warningAsError[Effect]: on.}
import algorithm
import std/algorithm
type
MyInt = distinct int
Expand Down
2 changes: 1 addition & 1 deletion doc/manual_experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ to be computed dynamically.
```nim
{.experimental: "dynamicBindSym".}
import macros
import std/macros
macro callOp(opName, arg1, arg2): untyped =
result = newCall(bindSym($opName), arg1, arg2)
Expand Down

0 comments on commit 1d7e6f4

Please sign in to comment.