EnumUtils, speed up findStr in compiler (#15777)

* add parseEnumRange
* fix runnable example
* update changelog
* use parseEnumRange in compiler
* reorganise code
* add changelog, make single normalizer argument
This commit is contained in:
cooldome 2020-11-03 15:26:16 +00:00 • committed by GitHub
commit d62f3627aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 89 additions and 68 deletions

View file

@ -331,7 +331,7 @@ proc processDynLib(c: PContext, n: PNode, sym: PSym) =
proc processNote(c: PContext, n: PNode) =
template handleNote(enumVals, notes) =
let x = findStr(enumVals, n[0][1].ident.s, errUnknown)
let x = findStr(enumVals.a, enumVals.b, n[0][1].ident.s, errUnknown)
if x != errUnknown:
nk = TNoteKind(x)
let x = c.semConstBoolExpr(c, n[1])