big refactoring: step 1
This commit is contained in:
parent
5494d78e74
commit
773d17cd14
29 changed files with 278 additions and 313 deletions
|
|
@ -13,8 +13,7 @@
|
|||
# does not support strings. Without this the code would
|
||||
# be slow and unreadable.
|
||||
|
||||
import
|
||||
hashes, strutils, idents
|
||||
from strutils import cmpIgnoreStyle
|
||||
|
||||
# Keywords must be kept sorted and within a range
|
||||
|
||||
|
|
@ -180,17 +179,3 @@ proc findStr*(a: openArray[string], s: string): int =
|
|||
if cmpIgnoreStyle(a[i], s) == 0:
|
||||
return i
|
||||
result = - 1
|
||||
|
||||
proc whichKeyword*(id: PIdent): TSpecialWord =
|
||||
if id.id < 0: result = wInvalid
|
||||
else: result = TSpecialWord(id.id)
|
||||
|
||||
proc whichKeyword*(id: string): TSpecialWord =
|
||||
result = whichKeyword(getIdent(id))
|
||||
|
||||
proc initSpecials() =
|
||||
# initialize the keywords:
|
||||
for s in countup(succ(low(specialWords)), high(specialWords)):
|
||||
getIdent(specialWords[s], hashIgnoreStyle(specialWords[s])).id = ord(s)
|
||||
|
||||
initSpecials()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue