Fixed strictFuncs support for std/pegs (#18951)

* Fixed `strictFuncs` support for `std/pegs`

Enabled `std/pegs` in the `strictFuncs` import test.

Fixes #18057
Fixes #16892
See #18111

* Rebased from `devel`

* Conditionally compile `std/pegs` in `koch`

This is for supporting `csources` bootstrap.

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
This commit is contained in:
quantimnot 2021-10-07 06:16:58 -04:00 • committed by GitHub
commit 19774a72e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 151 additions and 142 deletions

View file

@ -1,6 +1,9 @@
## Part of 'koch' responsible for the documentation generation.
import os, strutils, osproc, sets, pathnorm, pegs, sequtils
import os, strutils, osproc, sets, pathnorm, sequtils
# XXX: Remove this feature check once the csources supports it.
when defined(nimHasCastPragmaBlocks):
import std/pegs
from std/private/globs import nativeToUnixPath, walkDirRecFilter, PathEntry
import "../compiler/nimpaths"
@ -338,7 +341,9 @@ proc buildDocs*(args: string, localOnly = false, localOutDir = "") =
if not localOnly:
buildDocsDir(args, webUploadOutput / NimVersion)
let gaFilter = peg"@( y'--doc.googleAnalytics:' @(\s / $) )"
args = args.replace(gaFilter)
# XXX: Remove this feature check once the csources supports it.
when defined(nimHasCastPragmaBlocks):
let gaFilter = peg"@( y'--doc.googleAnalytics:' @(\s / $) )"
args = args.replace(gaFilter)
buildDocsDir(args, localOutDir)