summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2020-06-23 06:22:07 -0300
committerGitHub <noreply@github.com>2020-06-23 11:22:07 +0200
commitc3459c7b148cd00d85b01ddae74782648a5d4e37 (patch)
tree8d96ff466a5143642f63bd170939c274ca446c00
parent79ed8e79efa49f49e1c522ea803d0317e05f0462 (diff)
downloadNim-c3459c7b148cd00d85b01ddae74782648a5d4e37.tar.gz
Deprecate oldNewlines, clean out deprecated code from oldNewlines (#14763)
-rw-r--r--changelog.md1
-rw-r--r--compiler/commands.nim10
-rw-r--r--compiler/lexer.nim7
-rw-r--r--doc/advopt.txt1
4 files changed, 2 insertions, 17 deletions
diff --git a/changelog.md b/changelog.md
index 9d1454dcb..d2cf0b811 100644
--- a/changelog.md
+++ b/changelog.md
@@ -218,5 +218,6 @@ proc mydiv(a, b): int {.raises: [].} =
 - `nim doc` now outputs under `$projectPath/htmldocs` when `--outdir` is unspecified (with or without `--project`);
   passing `--project` now automatically generates an index and enables search.
   See [docgen](docgen.html#introduction-quick-start) for details.
+- Deprecated `--oldNewlines` and its Deprecated code cleaned out.
 
 ## Tool changes
diff --git a/compiler/commands.nim b/compiler/commands.nim
index c945a633a..6dccbcd00 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -582,16 +582,6 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
     else:
       undefSymbol(conf.symbols, "hotcodereloading")
       undefSymbol(conf.symbols, "useNimRtl")
-  of "oldnewlines":
-    case arg.normalize
-    of "", "on":
-      conf.oldNewlines = true
-      defineSymbol(conf.symbols, "nimOldNewlines")
-    of "off":
-      conf.oldNewlines = false
-      undefSymbol(conf.symbols, "nimOldNewlines")
-    else:
-      localError(conf, info, errOnOrOffExpectedButXFound % arg)
   of "laxstrings": processOnOffSwitch(conf, {optLaxStrings}, arg, pass, info)
   of "nilseqs": processOnOffSwitch(conf, {optNilSeqs}, arg, pass, info)
   of "oldast": processOnOffSwitch(conf, {optOldAst}, arg, pass, info)
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index bd71a6ad5..f9679adee 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -684,12 +684,7 @@ proc getEscapedChar(L: var TLexer, tok: var TToken) =
   inc(L.bufpos)               # skip '\'
   case L.buf[L.bufpos]
   of 'n', 'N':
-    if L.config.oldNewlines:
-      if tok.tokType == tkCharLit:
-        lexMessage(L, errGenerated, "\\n not allowed in character literal")
-      tok.literal.add(L.config.target.tnl)
-    else:
-      tok.literal.add('\L')
+    tok.literal.add('\L')
     inc(L.bufpos)
   of 'p', 'P':
     if tok.tokType == tkCharLit:
diff --git a/doc/advopt.txt b/doc/advopt.txt
index e522973cd..b2aa82d2b 100644
--- a/doc/advopt.txt
+++ b/doc/advopt.txt
@@ -101,7 +101,6 @@ Advanced options:
   --excessiveStackTrace:on|off
                             stack traces use full file paths
   --stackTraceMsgs:on|off   enable user defined stack frame msgs via `setFrameMsg`
-  --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
   --nilseqs:on|off          allow 'nil' for strings/seqs for