diff options
author | Araq <rumpf_a@web.de> | 2014-11-04 08:38:56 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-04 08:38:56 +0100 |
commit | 1f63d1c76e733812e5e61d81e83429f853511fe7 (patch) | |
tree | 37a91dccbf708885695b227dcf3c37db3250ff08 | |
parent | 0a2296b12313b8ce84e8190b6200885fdb06bf96 (diff) | |
download | Nim-1f63d1c76e733812e5e61d81e83429f853511fe7.tar.gz |
documented nimfix
-rw-r--r-- | compiler/nimfix/nimfix.nim | 2 | ||||
-rw-r--r-- | doc/nimfix.txt | 56 | ||||
-rw-r--r-- | doc/tools.txt | 4 | ||||
-rw-r--r-- | install.txt | 18 | ||||
-rw-r--r-- | todo.txt | 5 | ||||
-rw-r--r-- | web/news.txt | 8 | ||||
-rw-r--r-- | web/nim.ini | 1 |
7 files changed, 79 insertions, 15 deletions
diff --git a/compiler/nimfix/nimfix.nim b/compiler/nimfix/nimfix.nim index e561b6d4d..7b42537c4 100644 --- a/compiler/nimfix/nimfix.nim +++ b/compiler/nimfix/nimfix.nim @@ -16,7 +16,7 @@ import options, commands, modules, sem, passes, passaux, pretty, msgs, nimconf, const Usage = """ Nimfix - Tool to patch Nim code Usage: - nimfix [options] projectflie.nim + nimfix [options] projectfile.nim Options: --overwriteFiles:on|off overwrite the original nim files. diff --git a/doc/nimfix.txt b/doc/nimfix.txt new file mode 100644 index 000000000..6d78f3e3f --- /dev/null +++ b/doc/nimfix.txt @@ -0,0 +1,56 @@ +===================== + Nimfix User Guide +===================== + +:Author: Andreas Rumpf +:Version: |nimversion| + +**WARNING**: Nimfix is currently beta-quality. + +Nimfix is a tool to help you upgrade from Nimrod (<= version 0.9.6) to +Nim (=> version 0.10.0). + +It performs 3 different actions: + +1. It makes your code case consistent. +2. It renames every symbol that has a deprecation rule. So if a module has a + rule ``{.deprecated: [TFoo: Foo].}`` then ``TFoo`` is replaced by ``Foo``. +3. It can also check that your identifiers adhere to the official style guide + and optionally modify them to do so (via ``--styleCheck:auto``). + +Note that ``nimfix`` defaults to **overwrite** your code unless you +use ``--overwriteFiles:off``! But hey, if you do not use a version control +system by this day and age, your project is already in big trouble. + + +Installation +------------ + +Nimfix is part of the compiler distribution. Compile via:: + + nim c compiler/nimfix/nimfix.nim + mv compiler/nimfix/nimfix bin + +Or on windows:: + + nim c compiler\nimfix\nimfix.nim + move compiler\nimfix\nimfix.exe bin + +Usage +----- + +Usage: + nimfix [options] projectfile.nim + +Options: + + --overwriteFiles:on|off overwrite the original nim files. DEFAULT is ON! + --wholeProject overwrite every processed file. + --checkExtern:on|off style check also extern names + --styleCheck:on|off|auto performs style checking for identifiers + and suggests an alternative spelling; + 'auto' corrects the spelling. + +In addition, all command line options of Nim are supported. + + diff --git a/doc/tools.txt b/doc/tools.txt index 0b39762c6..7f2830879 100644 --- a/doc/tools.txt +++ b/doc/tools.txt @@ -18,3 +18,7 @@ The standard distribution ships with the following tools: - | `estp <estp.html>`_ | Nim's slow platform independent embedded stack trace profiler. + +- | `nimfix <nimfix.html>`_ + | Nimfix is a tool to help you upgrade from Nimrod (<= version 0.9.6) to + Nim (=> version 0.10.0). diff --git a/install.txt b/install.txt index 4543e4ece..deca55599 100644 --- a/install.txt +++ b/install.txt @@ -9,25 +9,25 @@ should be in your ``$PATH`` (most likely the case). Note that some few Linux distributions do not ship with a GCC compiler preinstalled - then you have to install it. -Install Nimrod by downloading the appropriate ``.zip`` file and extracting it -to a directory of your choice. The Nimrod Compiler will stay in this +Install Nim by downloading the appropriate ``.zip`` file and extracting it +to a directory of your choice. The Nim Compiler will stay in this directory (unless you copy it somewhere else). The compiler does not need -write access to its directory, so copying the nimrod folder to ``/opt`` +write access to its directory, so copying the nim folder to ``/opt`` works. Then run the following command:: sh build.sh -Unlike other software, Nimrod does not distribute its files over the whole file +Unlike other software, Nim does not distribute its files over the whole file hierarchy. This has the advantage that you can deinstall it by just deleting its folder. The disadvantage is that you have to add it to your ``PATH`` manually. An alternative is to create a symbolic link in ``/usr/bin``:: - [sudo] ln -s $your_install_dir/bin/nimrod /usr/bin/nimrod + [sudo] ln -s $your_install_dir/bin/nim /usr/bin/nim There are also ``install.sh`` and ``deinstall.sh`` scripts for distributing -the files over the UNIX hierarchy. However, updating your Nimrod installation +the files over the UNIX hierarchy. However, updating your Nim installation is more cumbersome then. @@ -43,9 +43,9 @@ You need to install Apple's developer's tools for the GNU Compiler Collection. Installation on Windows ----------------------- -Install Nimrod by downloading and running the ``nimrod_$version.exe`` file. +Install Nim by downloading and running the ``nim_$version.exe`` file. As default, the ``GCC`` compiler is used that is bundled with this installer. -You can change the configuration file ``config/nimrod.cfg`` to use +You can change the configuration file ``config/nim.cfg`` to use another C compiler or change the path to GCC. Currently, the following C compilers are supported under Windows: @@ -64,5 +64,5 @@ However, most testing is done with GCC. Bootstrapping from Github ------------------------- -Take a look at the readme file on github `here <https://github.com/Araq/Nimrod#readme>`_ +Take a look at the readme file on github `here <https://github.com/Araq/Nim#readme>`_ for instructions. diff --git a/todo.txt b/todo.txt index ca35efbae..3fddf20c2 100644 --- a/todo.txt +++ b/todo.txt @@ -1,10 +1,11 @@ version 0.10 ============ -- Declare nimfix as beta-quality. +- fix deepCopy bug in parallel section +- fix missing GC_ref bug for flow variables - implement 'static_call' - make nimble part of the distribution -- fix babelpackagelist bug + version 0.9.6 ============= diff --git a/web/news.txt b/web/news.txt index 9e6ca73b9..2f2290b5b 100644 --- a/web/news.txt +++ b/web/news.txt @@ -21,9 +21,9 @@ News without 'else' are deprecated. - Recursive tuple types are not allowed anymore. Use ``object`` instead. - The PEGS module returns ``nil`` instead of ``""`` when an optional capture - fails to match + fails to match. - The re module returns ``nil`` instead of ``""`` when an optional capture - fails to match + fails to match. Language Additions ------------------ @@ -55,7 +55,9 @@ News - Two backticks now produce a single backtick within an ``emit`` or ``asm`` statement. - + - There is a new tool, `nimfix <nimfix.html>`_ to help you in updating your + code from Nimrod to Nim. + Library Additions ----------------- diff --git a/web/nim.ini b/web/nim.ini index 98eadf3ce..6624910d1 100644 --- a/web/nim.ini +++ b/web/nim.ini @@ -39,6 +39,7 @@ UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson.""" [Documentation] doc: "endb;intern;apis;lib;manual.txt;tut1;tut2;nimc;overview;filters" doc: "tools;niminst;nimgrep;gc;estp;idetools;docgen;koch;backends.txt" +doc: "nimfix.txt" pdf: "manual;lib;tut1;tut2;nimc;niminst;gc" srcdoc2: "system.nim" srcdoc2: "core/macros;pure/marshal;core/typeinfo;core/unsigned" |