fixed another docgen bug; initial mongodb wrapper

This commit is contained in:
Araq 2012-04-06 00:41:27 +02:00
commit 0f96e72b18
8 changed files with 1200 additions and 38 deletions

View file

@ -385,7 +385,11 @@ proc lsub(n: PNode): int =
of nkTypeDef: result = lsons(n) + 3 of nkTypeDef: result = lsons(n) + 3
of nkOfInherit: result = lsub(n.sons[0]) + len("of_") of nkOfInherit: result = lsub(n.sons[0]) + len("of_")
of nkProcTy: result = lsons(n) + len("proc_") of nkProcTy: result = lsons(n) + len("proc_")
of nkEnumTy: result = lsub(n.sons[0]) + lcomma(n, 1) + len("enum_") of nkEnumTy:
if sonsLen(n) > 0:
result = lsub(n.sons[0]) + lcomma(n, 1) + len("enum_")
else:
result = len("enum")
of nkEnumFieldDef: result = lsons(n) + 3 of nkEnumFieldDef: result = lsons(n) + 3
of nkVarSection, nkLetSection: of nkVarSection, nkLetSection:
if sonsLen(n) > 1: result = maxLineLen + 1 if sonsLen(n) > 1: result = maxLineLen + 1

View file

@ -340,6 +340,9 @@ Database support
A higher level SQLite database wrapper. The same interface is implemented A higher level SQLite database wrapper. The same interface is implemented
for other databases too. for other databases too.
* `mongodb <mongo.html>`_
Wrapper for the **mongodb** client C library.
Other Other
----- -----

View file

@ -451,34 +451,3 @@ 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))
..
The ECMAScript code generator
=============================
Note: As of version 0.7.0 the ECMAScript code generator is not maintained any
longer. Help if you are interested.
Note: I use the term `ECMAScript`:idx: here instead of `JavaScript`:idx:,
since it is the proper term.
The ECMAScript code generator is experimental!
Nimrod targets ECMAScript 1.5 which is supported by any widely used browser.
Since ECMAScript does not have a portable means to include another module,
Nimrod just generates a long ``.js`` file.
Features or modules that the ECMAScript platform does not support are not
available. This includes:
* manual memory management (``alloc``, etc.)
* casting and other unsafe operations (``cast`` operator, ``zeroMem``, etc.)
* file management
* most modules of the Standard library
* proper 64 bit integer arithmetic
* proper unsigned integer arithmetic
However, the modules `strutils`:idx:, `math`:idx:, and `times`:idx: are
available! To access the DOM, use the `dom`:idx: module that is only
available for the ECMAScript platform.

1178
lib/wrappers/mongo.nim Normal file

File diff suppressed because it is too large Load diff

View file

@ -28,8 +28,6 @@ else:
const const
dllname = "libglut.so.3" dllname = "libglut.so.3"
type type
PInteger* = ptr int
PPChar* = ptr cstring
TGlutVoidCallback* = proc (){.cdecl.} TGlutVoidCallback* = proc (){.cdecl.}
TGlut1IntCallback* = proc (value: cint){.cdecl.} TGlut1IntCallback* = proc (value: cint){.cdecl.}
TGlut2IntCallback* = proc (v1, v2: cint){.cdecl.} TGlut2IntCallback* = proc (v1, v2: cint){.cdecl.}
@ -231,8 +229,16 @@ const # glutGet parameters.
GLUT_GAME_MODE_REFRESH_RATE* = 5 GLUT_GAME_MODE_REFRESH_RATE* = 5
GLUT_GAME_MODE_DISPLAY_CHANGED* = 6 # GLUT initialization sub-API. GLUT_GAME_MODE_DISPLAY_CHANGED* = 6 # GLUT initialization sub-API.
proc glutInit*(argcp: PInteger, argv: PPChar){.dynlib: dllname, proc glutInit*(argcp: ptr cint, argv: pointer){.dynlib: dllname,
importc: "glutInit".} importc: "glutInit".}
proc glutInit*() =
## version that passes `argc` and `argc` implicitely.
var
cmdLine {.importc: "cmdLine".}: array[0..255, cstring]
cmdCount {.importc: "cmdCount".}: cint
glutInit(addr(cmdCount), addr(cmdLine))
proc glutInitDisplayMode*(mode: int16){.dynlib: dllname, proc glutInitDisplayMode*(mode: int16){.dynlib: dllname,
importc: "glutInitDisplayMode".} importc: "glutInitDisplayMode".}
proc glutInitDisplayString*(str: cstring){.dynlib: dllname, proc glutInitDisplayString*(str: cstring){.dynlib: dllname,

View file

@ -1,7 +1,8 @@
version 0.9.0 version 0.9.0
============= =============
- test and document AVR/embedded systems better - document AVR/embedded systems better
- 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 ``=``

View file

@ -32,6 +32,7 @@ Library Additions
- Added module ``endians``. - Added module ``endians``.
- Added a new OpenGL wrapper that supports OpenGL up to version 4.2. - Added a new OpenGL wrapper that supports OpenGL up to version 4.2.
- Added a wrapper for ``libsvm``. - Added a wrapper for ``libsvm``.
- Added a wrapper for ``mongodb``.
Changes affecting backwards compatibility Changes affecting backwards compatibility

View file

@ -55,7 +55,7 @@ webdoc: "posix/posix;wrappers/odbcsql;impure/dialogs"
webdoc: "wrappers/zip/zlib;wrappers/zip/libzip" webdoc: "wrappers/zip/zlib;wrappers/zip/libzip"
webdoc: "wrappers/cairo" webdoc: "wrappers/cairo"
webdoc: "wrappers/gtk" webdoc: "wrappers/gtk"
webdoc: "wrappers/libsvm.nim" webdoc: "wrappers/libsvm.nim;wrappers/mongo.nim"
webdoc: "windows" webdoc: "windows"
webdoc: "wrappers/x11;wrappers/opengl;wrappers/sdl;wrappers/lua" webdoc: "wrappers/x11;wrappers/opengl;wrappers/sdl;wrappers/lua"
webdoc: "wrappers/readline/readline;wrappers/readline/history" webdoc: "wrappers/readline/readline;wrappers/readline/history"