summary refs log tree commit diff stats
path: root/compiler/parser.nim
Commit message (Collapse)AuthorAgeFilesLines
* nimpretty: fixes #11616Araq2019-07-181-6/+27
|
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+1
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-3/+3
| | | | --styleCheck:error
* nimpretty: nimpretty now understands splitting newlinesAraq2019-07-041-4/+13
|
* [bugfix] fix #11469, new rules for a newline in nimpretty (#11512)Miran2019-06-261-0/+2
| | | | | * [bugfix] fix #11469, new rules for a newline in nimpretty * concatenate two lines if they have the same indentation level
* [bugfix] nimpretty: fixes #11468Araq2019-06-131-2/+6
|
* nimpretty: smart tabs support, fixes #9399 [bugfix]Andreas Rumpf2019-06-101-21/+34
|
* nimpretty: fixes #10295Araq2019-06-071-0/+2
|
* revert parser stmtListExpr (#11007)cooldome2019-04-171-19/+9
| | | | | | | | | | | | | | | | | * Revert "Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)" This reverts commit 862897dc0f122e374c0e4d44770ffcd8825e51e3. * redo fix for #4035 * render stmtlistExpr using semicolon * Revert "render stmtlistExpr using semicolon" This reverts commit cafb78b8d5b125b5f6ba94248377a1433b3138cb. * revert test
* relax warning about inconsistent spacing (#10968)Miran2019-04-051-1/+1
| | | | | | Now the warning is raised only in the cases when there is an inconsistency in the style (spacing vs no spacing): * if a> b --> warning * if a > b --> no warning
* fixes #10896 (#10903)Andreas Rumpf2019-03-251-1/+3
|
* fixes #10861 (#10877)cooldome2019-03-211-2/+3
|
* REVERT "optPar"Andrii Riabushenko2019-03-211-3/+2
| | | | This reverts commit 5f1a59216bb79684a5c708978cded1c5d5140574.
* optParAndrii Riabushenko2019-03-211-2/+3
|
* Support for stmtListExpr in parser after major keywords. Scaled down ↵cooldome2019-03-181-10/+21
| | | | | | | version. (#10852) * Support for stmtListExpr in parser after major keywords * fixes #4035
* fixes #10838 (#10841)cooldome2019-03-181-0/+2
| | | | | | * fixes #10838 * reject func in types instead * trigger tests
* Tuple unpacking now works for `for` vars (#10152)Neelesh Chandola2019-02-231-15/+24
| | | | | | | | * Tuple unpacking now works for `for` vars * Give error if length of tuple vars != length of tuple * Fix error message showing wrong tuple length * unpacking now works now for mutable items * Update changelog
* gc: destructors is beginning to work (#10483)Andreas Rumpf2019-01-291-26/+22
| | | | | | | | | | | | | | | | * kochdocs.nim: code cleanup * docgen: nicer indentation * parser.nim: code cleanup * fixes #10458 * make tests green again * make =destroy mixins * gc:destructors: produced C code is almost working * --gc:destructors simple program compiles (but leaks memory) * gc:destructors make examples compile in C++ mode * destructors: string implementation bugfixes * strs.nim: minor code cleanup * destructors: builtin seqs are beginning to work * remove debugging helpers
* Correct lineinfo for accent quoted symbols in proc definition (#10399)alaviss2019-01-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * compiler/parser: preserve lineinfo for accent quoted symbols Previously the lineinfo for symbol $$$ in this example is: proc `$$$` ^ After this commit: proc `$$$` ^ * compiler/semstmts: correct lineinfo for accent quoted idents Previously nimsuggest would highlight this as: proc `$$$` ^~~ After this commit: proc `$$$` ^~~ * nimsuggest/tests: add a test for accent quoted proc Disabled by default
* Deprecate gc v2 (#10151)Neelesh Chandola2019-01-011-2/+2
| | | | | | * Deprecate gc v2 * warnDeprecated now has custom messages
* Deprecated pragma is now supported on enum fields (#10113)Neelesh Chandola2018-12-301-11/+21
| | | | | | * {.deprecated.} pragma is now supported for enum fields * Add tests * Simplify code
* Pragma syntax is now consistent (#9993)Neelesh Chandola2018-12-271-3/+34
| | | | | | | | | | * Give deprecation warning when type pragmas do not follow the type name * pragma before generic parameter list in type definition is now deprecated * Update changelog * Fix bug where deprecated warning was being shown even though no generic param list was present * Fix bug * Use errGenerated * Best attempt at writing the grammar
* much simpler implementation of constant tuple declarationsAndreas Rumpf2018-12-191-37/+17
|
* Const tuple unpacking (#9964)Neelesh Chandola2018-12-191-9/+31
| | | | | | | | | | * tuple unpacking is now supported for consts * Move nkConstTuple to the end of TNodeKind * Add nnkConstTuple in macros.nim * Fix Formatting
* nimpretty: explicit --indent option; fixes #9502; refs #9510 [backport]Andreas Rumpf2018-11-111-1/+1
|
* er... 'a not b' is an infix callAndreas Rumpf2018-11-081-1/+1
|
* fixes parsing regressions; binary 'not' for 'not nil' must stayAndreas Rumpf2018-11-081-2/+17
|
* fixes #9633Andreas Rumpf2018-11-081-5/+8
|
* parser/grammar sync; fixes #9608 [backport]Andreas Rumpf2018-11-071-1/+1
|
* compiler cleanup: flag tfOldSchoolExprStmt is goneAraq2018-11-061-2/+0
|
* removed the undocumented #? strongSpaces parsing modeAraq2018-11-061-11/+7
|
* Maps `out` keyword to an nnkIdent. Fixes #6011. (#9536)Dominik Picheta2018-10-291-2/+1
|
* nimpretty: add #!nimpretty on/off directivesAndreas Rumpf2018-10-161-2/+2
|
* nimpretty: fixes #8626Andreas Rumpf2018-10-161-0/+2
|
* Add checks for except: body blocks (#9191)Dheepak Krishnamurthy2018-10-091-1/+0
|
* parser.nim: minor code style fixAndreas Rumpf2018-09-161-1/+1
|
* Merge branch 'devel' into araq-better-docgenAraq2018-09-141-18/+21
|\
| * fixes merge conflictsAndreas Rumpf2018-09-111-157/+234
| |\
| * | steps to get for loops as expressionsAndreas Rumpf2018-02-281-18/+21
| | |
* | | compiler refactoring; use typesafe path handing; docgen: render symbols ↵Andreas Rumpf2018-09-071-3/+4
| |/ |/| | | | | between modules
* | Renderer bug fixes (#8804)cooldome2018-09-071-35/+0
| | | | | | | | | | | | Fixes #8763: render bug: pure enums not handled correctly Fixes #8762: render bug: binary operators called with quotes rendered incorrectly FIxes #8761: render bug: inversion of operator priorities
* | Cosmetic: fix typo on TRIPLESTR_LIT (#8663)Iván Montes2018-08-211-1/+1
| |
* | WIP: disallow 'nil' for strings and seqsAndreas Rumpf2018-08-131-1/+2
| |
* | Render bug: if expression with statement list expression as condition (#8375)cooldome2018-07-211-0/+1
| | | | | | | | * Fixes #8348
* | Merge branch 'devel' into typedesc-reformsAndreas Rumpf2018-06-261-3/+25
|\ \
| * | nimpretty improvementsAndreas Rumpf2018-06-191-1/+1
| | |
| * | nimpretty: fixes pragma renderingAndreas Rumpf2018-06-171-1/+1
| | |
| * | nimpretty: more featuresAndreas Rumpf2018-06-161-2/+24
| | |
* | | Implement the `is` operator for the new static and typedesc type classesZahary Karadjov2018-06-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This also makes the first baby steps towards a sound treatment of higher-order kinds (type type int). Adds test cases showcasing the new features. * Also fixes breakage after the rebase
* | | A minimal patch enabling the new typedesc and static types syntaxZahary Karadjov2018-06-161-26/+37
|/ /
an> UA-48159761-1 """ template withDir(dir, body) = let old = getCurrentDir() try: setCurrentDir(dir) body finally: setCurrentdir(old) proc tryExec(cmd: string): bool = echo(cmd) result = execShellCmd(cmd) == 0 proc safeRemove(filename: string) = if existsFile(filename): removeFile(filename) proc overwriteFile(source, dest: string) = safeRemove(dest) moveFile(source, dest) proc copyExe(source, dest: string) = safeRemove(dest) copyFile(dest=dest, source=source) inclFilePermissions(dest, {fpUserExec}) const compileNimInst = "tools/niminst/niminst" proc csource(args: string) = nimexec(("cc $1 -r $3 --var:version=$2 --var:mingw=none csource " & "--main:compiler/nim.nim compiler/installer.ini $1") % [args, VersionAsString, compileNimInst]) proc bundleNimbleSrc(latest: bool) = ## bunldeNimbleSrc() bundles a specific Nimble commit with the tarball. We ## always bundle the latest official release. if not dirExists("dist/nimble/.git"): exec("git clone https://github.com/nim-lang/nimble.git dist/nimble") if not latest: withDir("dist/nimble"): exec("git checkout -f stable") exec("git pull") proc bundleNimbleExe(latest: bool) = bundleNimbleSrc(latest) # now compile Nimble and copy it to $nim/bin for the installer.ini # to pick it up: nimexec("c -d:release --nilseqs:on dist/nimble/src/nimble.nim") copyExe("dist/nimble/src/nimble".exe, "bin/nimble".exe) proc buildNimble(latest: bool) = # old installations created nim/nimblepkg/*.nim files. We remove these # here so that it cannot cause problems (nimble bug #306): if dirExists("bin/nimblepkg"): removeDir("bin/nimblepkg") # if koch is used for a tar.xz, build the dist/nimble we shipped # with the tarball: var installDir = "dist/nimble" if not latest and dirExists(installDir) and not dirExists("dist/nimble/.git"): discard "don't do the git dance" else: if not dirExists("dist/nimble/.git"): if dirExists(installDir): var id = 0 while dirExists("dist/nimble" & $id): inc id installDir = "dist/nimble" & $id exec("git clone https://github.com/nim-lang/nimble.git " & installDir) withDir(installDir): if latest: exec("git checkout -f master") else: exec("git checkout -f stable") exec("git pull") nimexec("c --noNimblePath -p:compiler --nilseqs:on -d:release " & installDir / "src/nimble.nim") copyExe(installDir / "src/nimble".exe, "bin/nimble".exe) proc bundleNimsuggest(buildExe: bool) = if buildExe: nimexec("c --noNimblePath -d:release -p:compiler nimsuggest/nimsuggest.nim") copyExe("nimsuggest/nimsuggest".exe, "bin/nimsuggest".exe) removeFile("nimsuggest/nimsuggest".exe) proc buildVccTool() = nimexec("c -o:bin/vccexe.exe tools/vccenv/vccexe") proc bundleWinTools() = nimexec("c tools/finish.nim") copyExe("tools/finish".exe, "finish".exe) removeFile("tools/finish".exe) buildVccTool() nimexec("c -o:bin/nimgrab.exe -d:ssl tools/nimgrab.nim") nimexec("c -o:bin/nimgrep.exe tools/nimgrep.nim") when false: # not yet a tool worth including nimexec(r"c --cc:vcc --app:gui -o:bin\downloader.exe -d:ssl --noNimblePath " & r"--path:..\ui tools\downloader.nim") proc zip(latest: bool; args: string) = bundleNimbleExe(latest) bundleNimsuggest(true) bundleWinTools() nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" % [VersionAsString, compileNimInst]) exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" % ["tools/niminst/niminst".exe, VersionAsString]) proc ensureCleanGit() = let (outp, status) = osproc.execCmdEx("git diff") if outp.len != 0: quit "Not a clean git repository; 'git diff' not empty!" if status != 0: quit "Not a clean git repository; 'git diff' returned non-zero!" proc xz(latest: bool; args: string) = ensureCleanGit() bundleNimbleSrc(latest) bundleNimsuggest(false) nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" % [VersionAsString, compileNimInst]) exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" % ["tools" / "niminst" / "niminst".exe, VersionAsString]) proc buildTool(toolname, args: string) = nimexec("cc $# $#" % [args, toolname]) copyFile(dest="bin" / splitFile(toolname).name.exe, source=toolname.exe) proc buildTools(latest: bool) = nimexec "c --noNimblePath -p:compiler -d:release -o:" & ("bin/nimsuggest".exe) & " nimsuggest/nimsuggest.nim" nimexec "c -d:release -o:" & ("bin/nimgrep".exe) & " tools/nimgrep.nim" when defined(windows): buildVccTool() nimexec "c -o:" & ("bin/nimpretty".exe) & " nimpretty/nimpretty.nim" buildNimble(latest) proc nsis(latest: bool; args: string) = bundleNimbleExe(latest) bundleNimsuggest(true) bundleWinTools() # make sure we have generated the niminst executables: buildTool("tools/niminst/niminst", args) #buildTool("tools/nimgrep", args) # produce 'nim_debug.exe': #exec "nim c compiler" / "nim.nim" #copyExe("compiler/nim".exe, "bin/nim_debug".exe) exec(("tools" / "niminst" / "niminst --var:version=$# --var:mingw=mingw$#" & " nsis compiler/installer.ini") % [VersionAsString, $(sizeof(pointer)*8)]) proc geninstall(args="") = nimexec("cc -r $# --var:version=$# --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini $#" % [compileNimInst, VersionAsString, args]) proc install(args: string) = geninstall() exec("sh ./install.sh $#" % args) when false: proc web(args: string) = nimexec("js tools/dochack/dochack.nim") nimexec("cc -r tools/nimweb.nim $# web/website.ini --putenv:nimversion=$#" % [args, VersionAsString]) proc website(args: string) = nimexec("cc -r tools/nimweb.nim $# --website web/website.ini --putenv:nimversion=$#" % [args, VersionAsString]) proc pdf(args="") = exec("$# cc -r tools/nimweb.nim $# --pdf web/website.ini --putenv:nimversion=$#" % [findNim(), args, VersionAsString], additionalPATH=findNim().splitFile.dir) # -------------- boot --------------------------------------------------------- proc findStartNim: string = # we try several things before giving up: # * bin/nim # * $PATH/nim # If these fail, we try to build nim with the "build.(sh|bat)" script. var nim = "nim".exe result = "bin" / nim if existsFile(result): return for dir in split(getEnv("PATH"), PathSep): if existsFile(dir / nim): return dir / nim when defined(Posix): const buildScript = "build.sh" if existsFile(buildScript): if tryExec("./" & buildScript): return "bin" / nim else: const buildScript = "build.bat" if existsFile(buildScript): if tryExec(buildScript): return "bin" / nim echo("Found no nim compiler and every attempt to build one failed!") quit("FAILURE") proc thVersion(i: int): string = result = ("compiler" / "nim" & $i).exe proc boot(args: string) = var output = "compiler" / "nim".exe var finalDest = "bin" / "nim".exe # default to use the 'c' command: let defaultCommand = if getEnv("NIM_COMPILE_TO_CPP", "false") == "true": "cpp" else: "c" let bootOptions = if args.len == 0 or args.startsWith("-"): defaultCommand else: "" let smartNimcache = (if "release" in args: "nimcache/r_" else: "nimcache/d_") & hostOs & "_" & hostCpu copyExe(findStartNim(), 0.thVersion) for i in 0..2: echo "iteration: ", i+1 exec i.thVersion & " $# $# --nimcache:$# compiler" / "nim.nim" % [bootOptions, args, smartNimcache] if sameFileContent(output, i.thVersion): copyExe(output, finalDest) echo "executables are equal: SUCCESS!" return copyExe(output, (i+1).thVersion) copyExe(output, finalDest) when not defined(windows): echo "[Warning] executables are still not equal" # -------------- clean -------------------------------------------------------- const cleanExt = [ ".ppu", ".o", ".obj", ".dcu", ".~pas", ".~inc", ".~dsk", ".~dpr", ".map", ".tds", ".err", ".bak", ".pyc", ".exe", ".rod", ".pdb", ".idb", ".idx", ".ilk" ] ignore = [ ".bzrignore", "nim", "nim.exe", "koch", "koch.exe", ".gitignore" ] proc cleanAux(dir: string) = for kind, path in walkDir(dir): case kind of pcFile: var (_, name, ext) = splitFile(path) if ext == "" or cleanExt.contains(ext): if not ignore.contains(name): echo "removing: ", path removeFile(path) of pcDir: case splitPath(path).tail of "nimcache": echo "removing dir: ", path removeDir(path) of "dist", ".git", "icons": discard else: cleanAux(path) else: discard proc removePattern(pattern: string) = for f in walkFiles(pattern): echo "removing: ", f removeFile(f) proc clean(args: string) = removePattern("web/*.html") removePattern("doc/*.html") cleanAux(getCurrentDir()) for kind, path in walkDir(getCurrentDir() / "build"): if kind == pcDir: echo "removing dir: ", path removeDir(path) # -------------- builds a release --------------------------------------------- proc winReleaseArch(arch: string) = doAssert arch in ["32", "64"] let cpu = if arch == "32": "i386" else: "amd64" template withMingw(path, body) = let prevPath = getEnv("PATH") putEnv("PATH", (if path.len > 0: path & PathSep else: "") & prevPath) try: body finally: putEnv("PATH", prevPath) withMingw r"..\mingw" & arch & r"\bin": # Rebuilding koch is necessary because it uses its pointer size to # determine which mingw link to put in the NSIS installer. nimexec "c --cpu:$# koch" % cpu exec "koch boot -d:release --cpu:$#" % cpu exec "koch --latest zip -d:release" overwriteFile r"build\nim-$#.zip" % VersionAsString, r"web\upload\download\nim-$#_x$#.zip" % [VersionAsString, arch] proc winRelease*() = # Now used from "tools/winrelease" and not directly supported by koch # anymore! # Build -docs file: when true: buildDocs(gaCode) withDir "web/upload/" & VersionAsString: exec "7z a -tzip docs-$#.zip *.html" % VersionAsString overwriteFile "web/upload/$1/docs-$1.zip" % VersionAsString, "web/upload/download/docs-$1.zip" % VersionAsString when true: csource("-d:release") when sizeof(pointer) == 4: winReleaseArch "32" when sizeof(pointer) == 8: winReleaseArch "64" # -------------- tests -------------------------------------------------------- template `|`(a, b): string = (if a.len > 0: a else: b) proc tests(args: string) = # we compile the tester with taintMode:on to have a basic # taint mode test :-) nimexec "cc --taintMode:on --opt:speed testament/tester" # Since tests take a long time (on my machine), and we want to defy Murhpys # law - lets make sure the compiler really is freshly compiled! nimexec "c --lib:lib -d:release --opt:speed compiler/nim.nim" let tester = quoteShell(getCurrentDir() / "testament/tester".exe) let success = tryExec tester & " " & (args|"all") if not existsEnv("TRAVIS") and not existsEnv("APPVEYOR"): exec tester & " html" if not success: quit("tests failed", QuitFailure) proc temp(args: string) = proc splitArgs(a: string): (string, string) = # every --options before the command (indicated by starting # with not a dash) is part of the bootArgs, the rest is part # of the programArgs: let args = os.parseCmdLine a result = ("", "") var i = 0 while i < args.len and args[i][0] == '-': result[0].add " " & quoteShell(args[i]) inc i while i < args.len: result[1].add " " & quoteShell(args[i]) inc i let d = getAppDir() var output = d / "compiler" / "nim".exe var finalDest = d / "bin" / "nim_temp".exe # 125 is the magic number to tell git bisect to skip the current # commit. let (bootArgs, programArgs) = splitArgs(args) let nimexec = findNim() exec(nimexec & " c -d:debug --debugger:native " & bootArgs & " " & (d / "compiler" / "nim"), 125) copyExe(output, finalDest) if programArgs.len > 0: exec(finalDest & " " & programArgs) proc xtemp(cmd: string) = let d = getAppDir() copyExe(d / "bin" / "nim".exe, d / "bin" / "nim_backup".exe) try: withDir(d): temp"" copyExe(d / "bin" / "nim_temp".exe, d / "bin" / "nim".exe) exec(cmd) finally: copyExe(d / "bin" / "nim_backup".exe, d / "bin" / "nim".exe) proc pushCsources() = if not dirExists("../csources/.git"): quit "[Error] no csources git repository found" csource("-d:release") let cwd = getCurrentDir() try: copyDir("build/c_code", "../csources/c_code") copyFile("build/build.sh", "../csources/build.sh") copyFile("build/build.bat", "../csources/build.bat") copyFile("build/build64.bat", "../csources/build64.bat") copyFile("build/makefile", "../csources/makefile") setCurrentDir("../csources") for kind, path in walkDir("c_code"): if kind == pcDir: exec("git add " & path / "*.c") exec("git commit -am \"updated csources to version " & NimVersion & "\"") exec("git push origin master") exec("git tag -am \"Version $1\" v$1" % NimVersion) exec("git push origin v$1" % NimVersion) finally: setCurrentDir(cwd) proc testUnixInstall(cmdLineRest: string) = csource("-d:release " & cmdLineRest) xz(false, cmdLineRest) let oldCurrentDir = getCurrentDir() try: let destDir = getTempDir() copyFile("build/nim-$1.tar.xz" % VersionAsString, destDir / "nim-$1.tar.xz" % VersionAsString) setCurrentDir(destDir) execCleanPath("tar -xJf nim-$1.tar.xz" % VersionAsString) setCurrentDir("nim-$1" % VersionAsString) execCleanPath("sh build.sh") # first test: try if './bin/nim --version' outputs something sane: let output = execProcess("./bin/nim --version").splitLines if output.len > 0 and output[0].contains(VersionAsString): echo "Version check: success" execCleanPath("./bin/nim c koch.nim") execCleanPath("./koch boot -d:release", destDir / "bin") # check the docs build: execCleanPath("./koch docs", destDir / "bin") # check nimble builds: execCleanPath("./koch --latest tools") # check the tests work: putEnv("NIM_EXE_NOT_IN_PATH", "NOT_IN_PATH") execCleanPath("./koch tests", destDir / "bin") #execCleanPath("./koch tests cat newconfig", destDir / "bin") else: echo "Version check: failure" finally: setCurrentDir oldCurrentDir proc valgrind(cmd: string) = # somewhat hacky: '=' sign means "pass to valgrind" else "pass to Nim" let args = parseCmdLine(cmd) var nimcmd = "" var valcmd = "" for i, a in args: if i == args.len-1: # last element is the filename: valcmd.add ' ' valcmd.add changeFileExt(a, ExeExt) nimcmd.add ' ' nimcmd.add a elif '=' in a: valcmd.add ' ' valcmd.add a else: nimcmd.add ' ' nimcmd.add a exec("nim c" & nimcmd) let supp = getAppDir() / "tools" / "nimgrind.supp" exec("valgrind --suppressions=" & supp & valcmd) proc showHelp() = quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)), CompileDate, CompileTime], QuitSuccess) when isMainModule: var op = initOptParser() var latest = false var stable = false while true: op.next() case op.kind of cmdLongOption, cmdShortOption: case normalize(op.key) of "latest": latest = true of "stable": stable = true else: showHelp() of cmdArgument: case normalize(op.key) of "boot": boot(op.cmdLineRest) of "clean": clean(op.cmdLineRest) of "doc", "docs": buildDocs(op.cmdLineRest) of "doc0", "docs0": # undocumented command for Araq-the-merciful: buildDocs(op.cmdLineRest & gaCode) of "pdf": buildPdfDoc(op.cmdLineRest, "doc/pdf") of "csource", "csources": csource(op.cmdLineRest) of "zip": zip(latest, op.cmdLineRest) of "xz": xz(latest, op.cmdLineRest) of "nsis": nsis(latest, op.cmdLineRest) of "geninstall": geninstall(op.cmdLineRest) of "distrohelper": geninstall() of "install": install(op.cmdLineRest) of "testinstall": testUnixInstall(op.cmdLineRest) of "test", "tests": tests(op.cmdLineRest) of "temp": temp(op.cmdLineRest) of "xtemp": xtemp(op.cmdLineRest) of "wintools": bundleWinTools() of "nimble": if stable: buildNimble(false) else: buildNimble(existsDir(".git") or latest) of "nimsuggest": bundleNimsuggest(buildExe=true) of "tools": if stable: buildTools(false) else: buildTools(existsDir(".git") or latest) of "pushcsource", "pushcsources": pushCsources() of "valgrind": valgrind(op.cmdLineRest) else: showHelp() break of cmdEnd: break