diff options
author | Joey Payne <jyapayne@gmail.com> | 2016-06-21 15:17:13 -0600 |
---|---|---|
committer | Joey Payne <jyapayne@gmail.com> | 2016-07-01 07:37:49 -0600 |
commit | b1ab82715e1921a0159fce73cc047ee48b9f75bf (patch) | |
tree | 1e461ef3de5ecd3661bff9f65c79a7dc23e39685 /lib/pure | |
parent | e0203a44630d834224879187a44739eaeb122a81 (diff) | |
download | Nim-b1ab82715e1921a0159fce73cc047ee48b9f75bf.tar.gz |
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.
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/htmlparser.nim | 6 | ||||
-rw-r--r-- | lib/pure/pegs.nim | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/htmlparser.nim b/lib/pure/htmlparser.nim index d620e816e..fd58bed25 100644 --- a/lib/pure/htmlparser.nim +++ b/lib/pure/htmlparser.nim @@ -433,7 +433,7 @@ proc htmlTag*(n: XmlNode): HtmlTag = proc htmlTag*(s: string): HtmlTag = ## converts `s` to a ``HtmlTag``. If `s` is no HTML tag, ``tagUnknown`` is ## returned. - let s = if allLower(s): s else: s.toLower + let s = if allLower(s): s else: toLowerAscii(s) result = toHtmlTag(s) proc entityToUtf8*(entity: string): string = @@ -513,13 +513,13 @@ proc parse(x: var XmlParser, errors: var seq[string]): XmlNode = errors.add(errorMsg(x)) next(x) of xmlElementStart: - result = newElement(x.elemName.toLower) + result = newElement(toLowerAscii(x.elemName)) next(x) untilElementEnd(x, result, errors) of xmlElementEnd: errors.add(errorMsg(x, "unexpected ending tag: " & x.elemName)) of xmlElementOpen: - result = newElement(x.elemName.toLower) + result = newElement(toLowerAscii(x.elemName)) next(x) result.attrs = newStringTable() while true: diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index 7e1f50266..5c978a2f8 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -1841,8 +1841,8 @@ when isMainModule: result.add ", " result.add case n: - of 2: c[0].toLower & ": '" & c[1] & "'" - of 1: c[0].toLower & ": ''" + of 2: toLowerAscii(c[0]) & ": '" & c[1] & "'" + of 1: toLowerAscii(c[0]) & ": ''" else: "" assert("Var1=key1;var2=Key2; VAR3". |