introduce --laxstrings switch for backwards compatibility

This commit is contained in:
Araq
2018-04-30 19:50:36 +02:00
parent f74f485bf7
commit 85af8fb74c
3 changed files with 5 additions and 1 deletions

View File

@@ -499,6 +499,7 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
undefSymbol("nimOldNewlines")
else:
localError(info, errOnOrOffExpectedButXFound, arg)
of "laxstrings": processOnOffSwitch({optLaxStrings}, arg, pass, info)
of "checks", "x": processOnOffSwitch(ChecksOptions, arg, pass, info)
of "floatchecks":
processOnOffSwitch({optNaNCheck, optInfCheck}, arg, pass, info)

View File

@@ -37,7 +37,8 @@ type # please make sure we have under 32 options
# evaluation
optPatterns, # en/disable pattern matching
optMemTracker,
optHotCodeReloading
optHotCodeReloading,
optLaxStrings
TOptions* = set[TOption]
TGlobalOption* = enum # **keep binary compatible**

View File

@@ -66,6 +66,8 @@ Advanced options:
--excessiveStackTrace:on|off
stack traces use full file paths
--oldNewlines:on|off turn on|off the old behaviour of "\n"
--laxStrings:on|off when turned on, accessing the zero terminator in
strings is allowed; only for backwards compatibility
--skipCfg do not read the general configuration file
--skipUserCfg do not read the user's configuration file
--skipParentCfg do not read the parent dirs' configuration files