Also add a notice that the linked list stuff in the compiler should be (one day) removed.
This commit is contained in:
Clay Sweetser 2014-07-29 21:13:21 -04:00
commit 1b6abccba2
2 changed files with 14 additions and 6 deletions

View file

@ -290,9 +290,15 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
options.gNoBabelPath = true options.gNoBabelPath = true
of "excludepath": of "excludepath":
expectArg(switch, arg, pass, info) expectArg(switch, arg, pass, info)
let path = processPath(arg) let
lists.excludeStr(options.searchPaths, path) path = processPath(arg)
lists.excludeStr(options.lazyPaths, path) strippedPath = removeTrailingDirSep(path)
echo repr(options.searchPaths)
lists.excludePath(options.searchPaths, path)
lists.excludePath(options.lazyPaths, path)
lists.excludePath(options.searchPaths, strippedPath)
lists.excludePath(options.lazyPaths, strippedPath)
echo repr(options.searchPaths)
of "nimcache": of "nimcache":
expectArg(switch, arg, pass, info) expectArg(switch, arg, pass, info)
options.nimcacheDir = processPath(arg) options.nimcacheDir = processPath(arg)

View file

@ -8,7 +8,8 @@
# #
# This module implements a generic doubled linked list. # This module implements a generic doubled linked list.
# TODO Remove this and replace it with something sensible
import os
type type
PListEntry* = ref TListEntry PListEntry* = ref TListEntry
TListEntry* = object of TObject TListEntry* = object of TObject
@ -103,11 +104,12 @@ proc bringToFront*(list: var TLinkedList, entry: PListEntry) =
entry.next = list.head entry.next = list.head
list.head = entry list.head = entry
proc excludeStr*(list: var TLinkedList, data: string) = proc excludePath*(list: var TLinkedList, data: string) =
var it = list.head var it = list.head
while it != nil: while it != nil:
let nxt = it.next let nxt = it.next
if PStrEntry(it).data == data: remove(list, it) if cmpPaths(PStrEntry(it).data, data) == 0:
remove(list, it)
it = nxt it = nxt
proc find*(list: TLinkedList, fn: TCompareProc, closure: pointer): PListEntry = proc find*(list: TLinkedList, fn: TCompareProc, closure: pointer): PListEntry =