refactoring complete: explicit ident cache

This commit is contained in:
Araq 2016-10-31 19:47:20 +01:00
commit 29db0d8585
16 changed files with 94 additions and 93 deletions

View file

@ -112,9 +112,6 @@ proc getIdent*(self: IdentCache; identifier: string): PIdent =
proc getIdent*(self: IdentCache; identifier: string, h: Hash): PIdent =
result = getIdent(cstring(identifier), len(identifier), h)
proc identEq*(self: IdentCache; id: PIdent, name: string): bool =
result = id.id == getIdent(name).id
proc newIdentCache*(): IdentCache =
if legacy.isNil:
result = IdentCache()
@ -135,4 +132,6 @@ proc whichKeyword*(id: PIdent): TSpecialWord =
proc getIdent*(identifier: string): PIdent =
## for backwards compatibility.
if legacy.isNil:
discard newIdentCache()
legacy.getIdent identifier