diff options
author | Araq <rumpf_a@web.de> | 2012-12-07 17:20:51 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-12-07 17:20:51 +0100 |
commit | 1dc362dcd4e4752fce4d81800d965da8381790c8 (patch) | |
tree | b564b553a424672e937be48daa1107241293cb69 /compiler/commands.nim | |
parent | 05b05be9f8554adc3081b71eb378940cb75428fd (diff) | |
download | Nim-1dc362dcd4e4752fce4d81800d965da8381790c8.tar.gz |
compiler support for babel
Diffstat (limited to 'compiler/commands.nim')
-rwxr-xr-x | compiler/commands.nim | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim index ad5f2b7e7..4a72e25f3 100755 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -11,7 +11,7 @@ import os, msgs, options, nversion, condsyms, strutils, extccomp, platform, lists, - wordrecg, parseutils + wordrecg, parseutils, babelcmd proc writeCommandLineUsage*() @@ -193,19 +193,6 @@ proc processPath(path: string): string = "projectname", options.gProjectName, "projectpath", options.gProjectPath]) -proc addPath(path: string, info: TLineInfo) = - if not contains(options.searchPaths, path): - lists.PrependStr(options.searchPaths, path) - -proc addPathRec(dir: string, info: TLineInfo) = - var pos = dir.len-1 - if dir[pos] in {DirSep, AltSep}: inc(pos) - for k,p in os.walkDir(dir): - if k == pcDir and p[pos] != '.': - if not contains(options.searchPaths, p): - #Message(info, hintPath, p) - lists.PrependStr(options.searchPaths, p) - proc track(arg: string, info: TLineInfo) = var a = arg.split(',') if a.len != 3: LocalError(info, errTokenExpected, "FILE,LINE,COLUMN") @@ -225,11 +212,15 @@ proc processSwitch(switch, arg: string, pass: TCmdlinePass, info: TLineInfo) = of "path", "p": expectArg(switch, arg, pass, info) addPath(processPath(arg), info) - of "shallowpath": + of "babelpath": + if pass in {passCmd2, passPP}: + expectArg(switch, arg, pass, info) + let path = processPath(arg) + babelpath(path, info) + of "excludepath": expectArg(switch, arg, pass, info) - var path = processPath(arg) - addPathRec(path, info) - addPath(path, info) + let path = processPath(arg) + lists.ExcludeStr(options.searchPaths, path) of "nimcache": expectArg(switch, arg, pass, info) options.nimcacheDir = processPath(arg) |