This is a workaround for #3182, no forward declarations. You can now do
this:
```nim
async:
proc bar(): Future[T]
proc foo() = await bar()
proc bar() {.async.} = echo(123); await foo()
```
Prior to the change, "nim check" would fail on any file besides the
main nim.nim, because the include paths for the documentation were
not set correctly and this produced various compilation errors.
Since immediate templates are not subjected to the standard sigmatching
algorithm, they will have a number of deficiencies when it comes to generic
params: Type dependencies between the parameters won't be honoured
and the bound generic symbols won't be resolvable within their bodies.
We could try to fix this, but it may be wiser to just deprecate immediate
templates and macros now that we have working untyped parameters.
Disabling the new features is admittedly not the greatest way to handle
this situations as it introduces inconsistency in the language, but at least
it makes the code backwards-compatible with the previous version of the
compiler instead of triggering more serious problems.
Saw in https://github.com/nim-lang/nimforum/issues/41 that there was an
issue in rendering inline images. Traced back through rstgen and found
that it was not counting something like:
`.. image:: http://i.imgur.com/oCem13Y.png` as valid since it contained
a period, and this wasn't in the set of valid characters, so the empty
string is returned by default.
Added a period to the allowable characters, and now renders correctly.
Test case:
```
import rst, rstgen, strtabs
var docConfig: StringTableRef
docConfig = rstgen.defaultConfig()
docConfig["doc.smiley_format"] = "/images/smilieys/$1.png"
proc rstToHtml(content: string): string =
result = rstgen.rstToHtml(content, {roSupportSmilies,roSupportMarkdown},
docConfig)
var a: string = rstToHtml(".. image:: http://i.imgur.com/oCem13Y.png")
echo a
```
type, then converter, then 3 iterators lowest- to highest-level
(also fastest to slowest) including a new intermediate iterator
lines(MemFile, buffer) that is more like readLine(File) in case
that helps anyone port code.
Add doc comments.
Also have toString just use newString+c_memcpy instead of
currently fragile toNimStr which Araq wants a separate PR for.