Fix modules that import both strutils and unicode
This is only an issue when a proc in both modules that is named the same is used, such as toLower or toUpper for strings.
This commit is contained in:
parent
e0203a4463
commit
b1ab82715e
2 changed files with 5 additions and 5 deletions
|
|
@ -433,7 +433,7 @@ proc htmlTag*(n: XmlNode): HtmlTag =
|
||||||
proc htmlTag*(s: string): HtmlTag =
|
proc htmlTag*(s: string): HtmlTag =
|
||||||
## converts `s` to a ``HtmlTag``. If `s` is no HTML tag, ``tagUnknown`` is
|
## converts `s` to a ``HtmlTag``. If `s` is no HTML tag, ``tagUnknown`` is
|
||||||
## returned.
|
## returned.
|
||||||
let s = if allLower(s): s else: s.toLower
|
let s = if allLower(s): s else: toLowerAscii(s)
|
||||||
result = toHtmlTag(s)
|
result = toHtmlTag(s)
|
||||||
|
|
||||||
proc entityToUtf8*(entity: string): string =
|
proc entityToUtf8*(entity: string): string =
|
||||||
|
|
@ -513,13 +513,13 @@ proc parse(x: var XmlParser, errors: var seq[string]): XmlNode =
|
||||||
errors.add(errorMsg(x))
|
errors.add(errorMsg(x))
|
||||||
next(x)
|
next(x)
|
||||||
of xmlElementStart:
|
of xmlElementStart:
|
||||||
result = newElement(x.elemName.toLower)
|
result = newElement(toLowerAscii(x.elemName))
|
||||||
next(x)
|
next(x)
|
||||||
untilElementEnd(x, result, errors)
|
untilElementEnd(x, result, errors)
|
||||||
of xmlElementEnd:
|
of xmlElementEnd:
|
||||||
errors.add(errorMsg(x, "unexpected ending tag: " & x.elemName))
|
errors.add(errorMsg(x, "unexpected ending tag: " & x.elemName))
|
||||||
of xmlElementOpen:
|
of xmlElementOpen:
|
||||||
result = newElement(x.elemName.toLower)
|
result = newElement(toLowerAscii(x.elemName))
|
||||||
next(x)
|
next(x)
|
||||||
result.attrs = newStringTable()
|
result.attrs = newStringTable()
|
||||||
while true:
|
while true:
|
||||||
|
|
|
||||||
|
|
@ -1841,8 +1841,8 @@ when isMainModule:
|
||||||
result.add ", "
|
result.add ", "
|
||||||
|
|
||||||
result.add case n:
|
result.add case n:
|
||||||
of 2: c[0].toLower & ": '" & c[1] & "'"
|
of 2: toLowerAscii(c[0]) & ": '" & c[1] & "'"
|
||||||
of 1: c[0].toLower & ": ''"
|
of 1: toLowerAscii(c[0]) & ": ''"
|
||||||
else: ""
|
else: ""
|
||||||
|
|
||||||
assert("Var1=key1;var2=Key2; VAR3".
|
assert("Var1=key1;var2=Key2; VAR3".
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue