documentation improvements
This commit is contained in:
parent
da9ff288d9
commit
752cddb91a
6 changed files with 102 additions and 5 deletions
50
doc/nimgrep.txt
Normal file
50
doc/nimgrep.txt
Normal 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
|
||||||
|
|
@ -11,7 +11,8 @@ Introduction
|
||||||
============
|
============
|
||||||
|
|
||||||
niminst is a tool to generate an installer for a Nimrod program. Currently
|
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
|
installation/deinstallation scripts for UNIX. Later versions will support
|
||||||
Linux' package management systems.
|
Linux' package management systems.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,28 @@ To link against ``nimrtl.dll`` use the command::
|
||||||
never been tested and is unlikely to work!
|
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
|
Additional Features
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
|
@ -367,6 +389,22 @@ line is an incomplete statement to be continued these rules are used:
|
||||||
does not work if the line contains more than one ``"""``.
|
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
|
Debugging with Nimrod
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
|
|
@ -451,3 +489,7 @@ efficient:
|
||||||
else: quit(errorStr(p, "expected: console or gui"))
|
else: quit(errorStr(p, "expected: console or gui"))
|
||||||
of "license": c.license = UnixToNativePath(k.value)
|
of "license": c.license = UnixToNativePath(k.value)
|
||||||
else: quit(errorStr(p, "unknown variable: " & k.key))
|
else: quit(errorStr(p, "unknown variable: " & k.key))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Target specific
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,8 @@ The standard distribution ships with the following tools:
|
||||||
- | `C2nim <c2nim.html>`_
|
- | `C2nim <c2nim.html>`_
|
||||||
| C to Nimrod source converter. Translates C header files to Nimrod.
|
| 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.
|
||||||
|
|
|
||||||
5
todo.txt
5
todo.txt
|
|
@ -1,9 +1,6 @@
|
||||||
version 0.9.0
|
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 GC realtime capable: GC_step(ms: int)
|
||||||
- make templates hygienic by default
|
- make templates hygienic by default
|
||||||
- ``=`` should be overloadable; requires specialization for ``=``
|
- ``=`` should be overloadable; requires specialization for ``=``
|
||||||
|
|
@ -133,6 +130,8 @@ Low priority
|
||||||
--> solve by implicit conversion from varargs to openarray
|
--> solve by implicit conversion from varargs to openarray
|
||||||
- implement closures that support nesting > 1
|
- implement closures that support nesting > 1
|
||||||
- optimize method dispatchers
|
- optimize method dispatchers
|
||||||
|
- implement ``--script:sh|bat`` command line option; think about script
|
||||||
|
generation
|
||||||
|
|
||||||
|
|
||||||
Further optimization ideas
|
Further optimization ideas
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ file: ticker
|
||||||
|
|
||||||
[Documentation]
|
[Documentation]
|
||||||
doc: "endb;intern;apis;lib;manual;tut1;tut2;nimrodc;overview;filters"
|
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"
|
pdf: "manual;lib;tut1;tut2;nimrodc;c2nim;niminst"
|
||||||
srcdoc: "core/macros;pure/marshal;core/typeinfo"
|
srcdoc: "core/macros;pure/marshal;core/typeinfo"
|
||||||
srcdoc: "impure/graphics;impure/re;pure/sockets"
|
srcdoc: "impure/graphics;impure/re;pure/sockets"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue