Fail quickly if re or nre module is attempted to be compiled with js [backport] (#14341)

Fixes https://github.com/nim-lang/Nim/issues/14338 .
This commit is contained in:
Kaushal Modi 2020-05-14 01:27:57 -04:00 • committed by GitHub
commit a2a3fa1039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -6,6 +6,9 @@
# distribution, for details about the copyright. # distribution, for details about the copyright.
# #
when defined(js):
{.error: "This library needs to be compiled with a c-like backend, and depends on PCRE.".}
## What is NRE? ## What is NRE?
## ============ ## ============
## ##

View file

@ -7,6 +7,9 @@
# distribution, for details about the copyright. # distribution, for details about the copyright.
# #
when defined(js):
{.error: "This library needs to be compiled with a c-like backend, and depends on PCRE.".}
## Regular expression support for Nim. ## Regular expression support for Nim.
## ##
## This module is implemented by providing a wrapper around the ## This module is implemented by providing a wrapper around the
@ -678,4 +681,3 @@ when isMainModule:
doAssert replace("bar", re"^", "foo") == "foobar" doAssert replace("bar", re"^", "foo") == "foobar"
doAssert replace("foo", re"", "-") == "-foo" doAssert replace("foo", re"", "-") == "-foo"
doAssert replace("foo", re"$", "bar") == "foobar" doAssert replace("foo", re"$", "bar") == "foobar"