From e1e069dd6c4e3439ee568686a2aed0a58bd771b0 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Thu, 17 Dec 2020 06:41:05 -0600 Subject: use hexchar in stdlib (#16290) --- nimsuggest/sexp.nim | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'nimsuggest') diff --git a/nimsuggest/sexp.nim b/nimsuggest/sexp.nim index a4368a558..cee538b6e 100644 --- a/nimsuggest/sexp.nim +++ b/nimsuggest/sexp.nim @@ -12,6 +12,8 @@ import hashes, strutils, lexbase, streams, unicode, macros +import std/private/decode_helpers + type SexpEventKind* = enum ## enumeration of all events that may occur when parsing sexpError, ## an error occurred during parsing @@ -113,14 +115,6 @@ proc errorMsgExpected*(my: SexpParser, e: string): string = ## other error messages result = "($1, $2) Error: $3" % [$getLine(my), $getColumn(my), e & " expected"] -proc handleHexChar(c: char, x: var int): bool = - result = true # Success - case c - of '0'..'9': x = (x shl 4) or (ord(c) - ord('0')) - of 'a'..'f': x = (x shl 4) or (ord(c) - ord('a') + 10) - of 'A'..'F': x = (x shl 4) or (ord(c) - ord('A') + 10) - else: result = false # error - proc parseString(my: var SexpParser): TTokKind = result = tkString var pos = my.bufpos + 1 -- cgit 1.4.1-2-gfad0