cleanup index generation
This commit is contained in:
parent
eec18896b7
commit
c2da0e9b3d
8 changed files with 71 additions and 37 deletions
|
|
@ -190,6 +190,6 @@ Real world example
|
||||||
The installers for the Nim compiler itself are generated by niminst. Have a
|
The installers for the Nim compiler itself are generated by niminst. Have a
|
||||||
look at its configuration file:
|
look at its configuration file:
|
||||||
|
|
||||||
.. include:: compiler/nim.ini
|
.. include:: compiler/installer.ini
|
||||||
:literal:
|
:literal:
|
||||||
|
|
||||||
|
|
|
||||||
14
koch.nim
14
koch.nim
|
|
@ -97,13 +97,13 @@ const
|
||||||
compileNimInst = "-d:useLibzipSrc tools/niminst/niminst"
|
compileNimInst = "-d:useLibzipSrc tools/niminst/niminst"
|
||||||
|
|
||||||
proc csource(args: string) =
|
proc csource(args: string) =
|
||||||
exec("$4 cc $1 -r $3 --var:version=$2 --var:mingw=none csource compiler/nim.ini $1" %
|
exec("$4 cc $1 -r $3 --var:version=$2 --var:mingw=none csource compiler/installer.ini $1" %
|
||||||
[args, VersionAsString, compileNimInst, findNim()])
|
[args, VersionAsString, compileNimInst, findNim()])
|
||||||
|
|
||||||
proc zip(args: string) =
|
proc zip(args: string) =
|
||||||
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none scripts compiler/nim.ini" %
|
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none scripts compiler/installer.ini" %
|
||||||
[VersionAsString, compileNimInst, findNim()])
|
[VersionAsString, compileNimInst, findNim()])
|
||||||
exec("$# --var:version=$# --var:mingw=none zip compiler/nim.ini" %
|
exec("$# --var:version=$# --var:mingw=none zip compiler/installer.ini" %
|
||||||
["tools/niminst/niminst".exe, VersionAsString])
|
["tools/niminst/niminst".exe, VersionAsString])
|
||||||
|
|
||||||
proc buildTool(toolname, args: string) =
|
proc buildTool(toolname, args: string) =
|
||||||
|
|
@ -121,20 +121,20 @@ proc nsis(args: string) =
|
||||||
" nsis compiler/nim") % [VersionAsString, $(sizeof(pointer)*8)])
|
" nsis compiler/nim") % [VersionAsString, $(sizeof(pointer)*8)])
|
||||||
|
|
||||||
proc install(args: string) =
|
proc install(args: string) =
|
||||||
exec("$# cc -r $# --var:version=$# --var:mingw=none scripts compiler/nim.ini" %
|
exec("$# cc -r $# --var:version=$# --var:mingw=none scripts compiler/installer.ini" %
|
||||||
[findNim(), compileNimInst, VersionAsString])
|
[findNim(), compileNimInst, VersionAsString])
|
||||||
exec("sh ./install.sh $#" % args)
|
exec("sh ./install.sh $#" % args)
|
||||||
|
|
||||||
proc web(args: string) =
|
proc web(args: string) =
|
||||||
exec("$# cc -r tools/nimweb.nim $# web/nim --putenv:nimversion=$#" %
|
exec("$# cc -r tools/nimweb.nim $# web/website.ini --putenv:nimversion=$#" %
|
||||||
[findNim(), args, VersionAsString])
|
[findNim(), args, VersionAsString])
|
||||||
|
|
||||||
proc website(args: string) =
|
proc website(args: string) =
|
||||||
exec("$# cc -r tools/nimweb.nim $# --website web/nim --putenv:nimversion=$#" %
|
exec("$# cc -r tools/nimweb.nim $# --website web/website.ini --putenv:nimversion=$#" %
|
||||||
[findNim(), args, VersionAsString])
|
[findNim(), args, VersionAsString])
|
||||||
|
|
||||||
proc pdf(args="") =
|
proc pdf(args="") =
|
||||||
exec("$# cc -r tools/nimweb.nim $# --pdf web/nim --putenv:nimversion=$#" %
|
exec("$# cc -r tools/nimweb.nim $# --pdf web/website.ini --putenv:nimversion=$#" %
|
||||||
[findNim(), args, VersionAsString])
|
[findNim(), args, VersionAsString])
|
||||||
|
|
||||||
# -------------- boot ---------------------------------------------------------
|
# -------------- boot ---------------------------------------------------------
|
||||||
|
|
|
||||||
27
tests/objects/trefobjsyntax.nim
Normal file
27
tests/objects/trefobjsyntax.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
discard """
|
||||||
|
output: '''wohoo
|
||||||
|
baz'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Test to ensure the popular 'ref T' syntax works everywhere
|
||||||
|
|
||||||
|
type
|
||||||
|
Foo = object
|
||||||
|
a, b: int
|
||||||
|
s: string
|
||||||
|
|
||||||
|
FooBar = object of RootObj
|
||||||
|
n, m: string
|
||||||
|
Baz = object of FooBar
|
||||||
|
|
||||||
|
proc invoke(a: ref Baz) =
|
||||||
|
echo "baz"
|
||||||
|
|
||||||
|
# check object construction:
|
||||||
|
let x = (ref Foo)(a: 0, b: 45, s: "wohoo")
|
||||||
|
echo x.s
|
||||||
|
|
||||||
|
var y: ref FooBar = (ref Baz)(n: "n", m: "m")
|
||||||
|
|
||||||
|
invoke((ref Baz)(y))
|
||||||
|
|
||||||
27
tests/objvariant/treassign.nim
Normal file
27
tests/objvariant/treassign.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
discard """
|
||||||
|
output: "SUCCESS"
|
||||||
|
"""
|
||||||
|
|
||||||
|
type
|
||||||
|
BasicNumber = object of RootObj
|
||||||
|
value: float32
|
||||||
|
RefChild* = ref object
|
||||||
|
curr*: TokenObject
|
||||||
|
Token* {.pure.} = enum
|
||||||
|
foo,
|
||||||
|
bar,
|
||||||
|
TokenObject = object
|
||||||
|
case kind*: Token
|
||||||
|
of Token.foo:
|
||||||
|
foo*: string
|
||||||
|
of Token.bar:
|
||||||
|
bar*: BasicNumber
|
||||||
|
|
||||||
|
|
||||||
|
var t = RefChild()
|
||||||
|
|
||||||
|
t.curr = TokenObject(kind: Token.bar, bar: BasicNumber(value: 12.34))
|
||||||
|
|
||||||
|
t.curr = TokenObject(kind: Token.foo, foo: "foo")
|
||||||
|
|
||||||
|
echo "SUCCESS"
|
||||||
3
todo.txt
3
todo.txt
|
|
@ -4,8 +4,6 @@ version 0.10.4
|
||||||
- make 'nil' work for 'add' and 'len'
|
- make 'nil' work for 'add' and 'len'
|
||||||
- improve GC-unsafety warnings
|
- improve GC-unsafety warnings
|
||||||
- get rid of 'mget'; aka priority of 'var' needs to be 'var{lvalue}'
|
- get rid of 'mget'; aka priority of 'var' needs to be 'var{lvalue}'
|
||||||
- improve documentation (theindex!)
|
|
||||||
- ensure (ref T)(a, b) works as a type conversion and type constructor
|
|
||||||
|
|
||||||
|
|
||||||
version 1.0
|
version 1.0
|
||||||
|
|
@ -95,4 +93,3 @@ CGEN
|
||||||
====
|
====
|
||||||
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
|
- codegen should use "NIM_CAST" macro and respect aliasing rules for GCC
|
||||||
- ``restrict`` pragma + backend support
|
- ``restrict`` pragma + backend support
|
||||||
- 'const' objects including case objects
|
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,7 @@ proc buildAddDoc(c: var TConfigData, destPath: string) =
|
||||||
# build additional documentation (without the index):
|
# build additional documentation (without the index):
|
||||||
var commands = newSeq[string](c.webdoc.len)
|
var commands = newSeq[string](c.webdoc.len)
|
||||||
for i, doc in pairs(c.webdoc):
|
for i, doc in pairs(c.webdoc):
|
||||||
commands[i] = "nim doc $# --docSeeSrcUrl:$#/$#/$# -o:$# $#" %
|
commands[i] = "nim doc2 $# --docSeeSrcUrl:$#/$#/$# -o:$# $#" %
|
||||||
[c.nimArgs, c.gitRepo, c.gitCommit, doc.pathPart,
|
[c.nimArgs, c.gitRepo, c.gitCommit, doc.pathPart,
|
||||||
destPath / changeFileExt(splitFile(doc).name, "html"), doc]
|
destPath / changeFileExt(splitFile(doc).name, "html"), doc]
|
||||||
mexec(commands, c.numProcessors)
|
mexec(commands, c.numProcessors)
|
||||||
|
|
|
||||||
|
|
@ -27,19 +27,6 @@ news: news
|
||||||
[Ticker]
|
[Ticker]
|
||||||
file: ticker.txt
|
file: ticker.txt
|
||||||
|
|
||||||
[Quotations]
|
|
||||||
# Page: quote - Person
|
|
||||||
# Bad things will happen if you use multiple dashes here.
|
|
||||||
index: """Is it so bad, then, to be misunderstood? Pythagoras was misunderstood,
|
|
||||||
and Socrates, and Jesus, and Luther, and Copernicus, and Galileo, and Newton,
|
|
||||||
and every pure and wise spirit that ever took flesh. To be great is to be
|
|
||||||
misunderstood. - Ralph Waldo Emerson"""
|
|
||||||
documentation: """Incorrect documentation is often worse than no documentation.
|
|
||||||
- Bertrand Meyer"""
|
|
||||||
download: """There are two major products that come out of Berkeley: LSD and
|
|
||||||
UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson."""
|
|
||||||
learn: """Repetition renders the ridiculous reasonable. - Norman Wildberger"""
|
|
||||||
|
|
||||||
[Documentation]
|
[Documentation]
|
||||||
doc: "endb;intern;apis;lib;manual.txt;tut1;tut2;nimc;overview;filters"
|
doc: "endb;intern;apis;lib;manual.txt;tut1;tut2;nimc;overview;filters"
|
||||||
doc: "tools;niminst;nimgrep;gc;estp;idetools;docgen;koch;backends.txt"
|
doc: "tools;niminst;nimgrep;gc;estp;idetools;docgen;koch;backends.txt"
|
||||||
|
|
@ -61,7 +48,7 @@ srcdoc2: "pure/httpserver;pure/httpclient;pure/smtp;impure/ssl;pure/fsmonitor"
|
||||||
srcdoc2: "pure/ropes;pure/unidecode/unidecode;pure/xmldom;pure/xmldomparser"
|
srcdoc2: "pure/ropes;pure/unidecode/unidecode;pure/xmldom;pure/xmldomparser"
|
||||||
srcdoc2: "pure/xmlparser;pure/htmlparser;pure/xmltree;pure/colors;pure/mimetypes"
|
srcdoc2: "pure/xmlparser;pure/htmlparser;pure/xmltree;pure/colors;pure/mimetypes"
|
||||||
srcdoc2: "pure/json;pure/base64;pure/scgi;pure/redis;impure/graphics"
|
srcdoc2: "pure/json;pure/base64;pure/scgi;pure/redis;impure/graphics"
|
||||||
srcdoc2: "impure/rdstdin;wrappers/sphinx"
|
srcdoc2: "impure/rdstdin"
|
||||||
srcdoc2: "pure/collections/tables;pure/collections/sets;pure/collections/lists"
|
srcdoc2: "pure/collections/tables;pure/collections/sets;pure/collections/lists"
|
||||||
srcdoc2: "pure/collections/intsets;pure/collections/queues;pure/encodings"
|
srcdoc2: "pure/collections/intsets;pure/collections/queues;pure/encodings"
|
||||||
srcdoc2: "pure/events;pure/collections/sequtils;pure/cookies"
|
srcdoc2: "pure/events;pure/collections/sequtils;pure/cookies"
|
||||||
|
|
@ -71,19 +58,15 @@ srcdoc2: "pure/nimprof;pure/unittest;packages/docutils/highlite"
|
||||||
srcdoc2: "packages/docutils/rst;packages/docutils/rstast"
|
srcdoc2: "packages/docutils/rst;packages/docutils/rstast"
|
||||||
srcdoc2: "packages/docutils/rstgen;pure/logging;pure/asyncdispatch;pure/asyncnet"
|
srcdoc2: "packages/docutils/rstgen;pure/logging;pure/asyncdispatch;pure/asyncnet"
|
||||||
srcdoc2: "pure/rawsockets;pure/asynchttpserver;pure/net;pure/selectors;pure/future"
|
srcdoc2: "pure/rawsockets;pure/asynchttpserver;pure/net;pure/selectors;pure/future"
|
||||||
srcdoc2: "wrappers/expat;wrappers/readline/history"
|
srcdoc2: "pure/md5"
|
||||||
srcdoc2: "wrappers/libsvm.nim;wrappers/libuv"
|
srcdoc2: "posix/posix"
|
||||||
srcdoc2: "wrappers/zip/zlib;wrappers/zip/libzip"
|
|
||||||
srcdoc2: "pure/md5;wrappers/mysql;wrappers/iup"
|
|
||||||
srcdoc2: "posix/posix;wrappers/odbcsql"
|
|
||||||
srcdoc2: "wrappers/tre;wrappers/openssl;wrappers/pcre"
|
|
||||||
srcdoc2: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc"
|
|
||||||
srcdoc2: "wrappers/readline/readline;wrappers/readline/rltypedefs"
|
|
||||||
srcdoc2: "wrappers/joyent_http_parser"
|
|
||||||
srcdoc2: "pure/fenv"
|
srcdoc2: "pure/fenv"
|
||||||
|
|
||||||
webdoc: "pure/md5;wrappers/mysql;wrappers/iup"
|
; Note: everything under 'webdoc' doesn't get listed in the index, so wrappers
|
||||||
webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc"
|
; should live here
|
||||||
|
|
||||||
|
webdoc: "wrappers/mysql;wrappers/iup;wrappers/sphinx"
|
||||||
|
webdoc: "wrappers/sqlite3;wrappers/postgres;wrappers/tinyc;wrappers/odbcsql"
|
||||||
webdoc: "wrappers/expat;wrappers/pcre"
|
webdoc: "wrappers/expat;wrappers/pcre"
|
||||||
webdoc: "wrappers/tre;wrappers/openssl"
|
webdoc: "wrappers/tre;wrappers/openssl"
|
||||||
webdoc: "wrappers/libuv;wrappers/joyent_http_parser"
|
webdoc: "wrappers/libuv;wrappers/joyent_http_parser"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue