documentation improvements

This commit is contained in:
Araq
2012-04-16 00:37:41 +02:00
parent da9ff288d9
commit 752cddb91a
6 changed files with 102 additions and 5 deletions

50
doc/nimgrep.txt Normal file
View File

@@ -0,0 +1,50 @@
=================================
nimgrep User's manual
=================================
:Author: Andreas Rumpf
:Version: 0.9
Nimgrep is a command line tool for search&replace tasks. It can search for
regex or peg patterns and can search whole directories at once. User
confirmation for every single replace operation can be requested.
Nimgrep has particularly good support for Nimrod's
eccentric *style insensitivity*. Apart from that it is a generic text
manipulation tool.
Installation
============
Compile nimgrep with the command::
nimrod c -d:release tools/nimgrep.nim
And copy the executable somewhere in your ``$PATH``.
Command line switches
=====================
Usage:
nimgrep [options] [pattern] [replacement] (file/directory)*
Options:
--find, -f find the pattern (default)
--replace, -r replace the pattern
--peg pattern is a peg
--re pattern is a regular expression (default); extended
syntax for the regular expression is always turned on
--recursive process directories recursively
--confirm confirm each occurence/replacement; there is a chance
to abort any time without touching the file
--stdin read pattern from stdin (to avoid the shell's confusing
quoting rules)
--word, -w the match should have word boundaries (buggy for pegs!)
--ignoreCase, -i be case insensitive
--ignoreStyle, -y be style insensitive
--ext:EX1|EX2|... only search the files with the given extension(s)
--verbose be verbose: list every processed file
--help, -h shows this help
--version, -v shows the version

View File

@@ -11,7 +11,8 @@ Introduction
============
niminst is a tool to generate an installer for a Nimrod program. Currently
it can create an installer for Windows via `Inno Setup <>`_ as well as
it can create an installer for Windows
via `Inno Setup <http://www.jrsoftware.org/isinfo.php>`_ as well as
installation/deinstallation scripts for UNIX. Later versions will support
Linux' package management systems.

View File

@@ -122,6 +122,28 @@ To link against ``nimrtl.dll`` use the command::
**Note**: Currently the creation of ``nimrtl.dll`` with thread support has
never been tested and is unlikely to work!
Additional compilation switches
===============================
The standard library supports a growing number of ``useX`` conditional defines
affecting how some features are implemented. This section tries to give a
complete list.
================== =========================================================
Define Effect
================== =========================================================
``release`` Turns off runtime checks and turns on the optimizer.
``useWinAnsi`` Modules like ``os`` and ``osproc`` use the Ansi versions
of the Windows API. The default build uses the Unicode
version.s
``useFork`` Makes ``osproc`` use ``fork`` instead of ``posix_spawn``.
``useNimRtl`` Compile and link against ``nimrtl.dll``.
``useMalloc`` Makes Nimrod use C's `malloc`:idx: instead of Nimrod's
own memory manager. This only works with ``gc:none``.
================== =========================================================
Additional Features
@@ -365,6 +387,22 @@ line is an incomplete statement to be continued these rules are used:
2. The line starts with a space (indentation).
3. The line is within a triple quoted string literal. However, the detection
does not work if the line contains more than one ``"""``.
Nimrod for embedded systems
===========================
The standard library can be avoided to a point where C code generation
for a 16bit micro controllers is feasible. Use the `standalone`:idx: target
(``--os:standalone``) for a bare bones standard library that lacks any
OS features.
To make the compiler output code for a 16bit target use the ``--cpu:avr``
target.
So to generate code for an `AVR`:idx: processor use this command::
nimrod c --cpu:avr --os:standalone --gc:none -d:useMalloc --genScript x.nim
Debugging with Nimrod
@@ -451,3 +489,7 @@ efficient:
else: quit(errorStr(p, "expected: console or gui"))
of "license": c.license = UnixToNativePath(k.value)
else: quit(errorStr(p, "unknown variable: " & k.key))
Target specific

View File

@@ -10,3 +10,8 @@ The standard distribution ships with the following tools:
- | `C2nim <c2nim.html>`_
| C to Nimrod source converter. Translates C header files to Nimrod.
- | `nimgrep <nimgrep.html>`_
| Nimrod search and replace utility.
- | `endb <endb.html>`_
| Nimrod's slow platform independent embedded debugger.

View File

@@ -1,9 +1,6 @@
version 0.9.0
=============
- document AVR/embedded systems better; document all the ``useX`` conditional
symbols for the stdlib
- implement ``--script:sh|bat`` command line option
- make GC realtime capable: GC_step(ms: int)
- make templates hygienic by default
- ``=`` should be overloadable; requires specialization for ``=``
@@ -133,6 +130,8 @@ Low priority
--> solve by implicit conversion from varargs to openarray
- implement closures that support nesting > 1
- optimize method dispatchers
- implement ``--script:sh|bat`` command line option; think about script
generation
Further optimization ideas

View File

@@ -22,7 +22,7 @@ file: ticker
[Documentation]
doc: "endb;intern;apis;lib;manual;tut1;tut2;nimrodc;overview;filters"
doc: "tools;c2nim;niminst"
doc: "tools;c2nim;niminst;nimgrep"
pdf: "manual;lib;tut1;tut2;nimrodc;c2nim;niminst"
srcdoc: "core/macros;pure/marshal;core/typeinfo"
srcdoc: "impure/graphics;impure/re;pure/sockets"