support for --cs:partial

This commit is contained in:
Araq
2013-09-24 09:32:49 +02:00
parent c11398ea0d
commit 367abca382
3 changed files with 14 additions and 2 deletions

View File

@@ -11,7 +11,7 @@
import
os, msgs, options, nversion, condsyms, strutils, extccomp, platform, lists,
wordrecg, parseutils, babelcmd
wordrecg, parseutils, babelcmd, idents
proc writeCommandLineUsage*()
@@ -512,6 +512,13 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) =
gListFullPaths = true
of "dynliboverride":
dynlibOverride(switch, arg, pass, info)
of "cs":
expectArg(switch, arg, pass, info)
case arg
of "partial": idents.firstCharIsCS = true
of "none": idents.firstCharIsCS = false
else: LocalError(info, errGenerated,
"'partial' or 'none' expected, but found " & arg)
else:
if strutils.find(switch, '.') >= 0: options.setConfigVar(switch, arg)
else: InvalidCmdLineOption(pass, switch, info)

View File

@@ -24,10 +24,13 @@ type
s*: string
next*: PIdent # for hash-table chaining
h*: THash # hash value of s
var firstCharIsCS*: bool
var buckets*: array[0..4096 * 2 - 1, PIdent]
proc cmpIgnoreStyle(a, b: cstring, blen: int): int =
if firstCharIsCS:
if a[0] != b[0]: return 1
var i = 0
var j = 0
result = 1

View File

@@ -85,4 +85,6 @@ Advanced options:
--parallelBuild=0|1|... perform a parallel build
value = number of processors (0 for auto-detect)
--verbosity:0|1|2|3 set Nimrod's verbosity level (1 is default)
--cs:none|partial set case sensitivity level (default: none);
do not use! this setting affects the whole language
-v, --version show detailed version information