summary refs log tree commit diff stats
path: root/compiler/docgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* Complete adding google analytics to docsFlaviu Tamas2014-12-251-21/+21
| | | | | theindex.html doesn't have analytics because I don't want to deal with global variables
* Mostly get analytics working for docsFlaviu Tamas2014-12-251-2/+21
|
* Merge branch 'pr_adds_code_directive_to_rst' into ↵Grzegorz Adam Hankiewicz2014-11-031-0/+1
|\ | | | | | | | | | | | | | | | | pr_bigbreak_adds_code_directive_to_rst Conflicts: doc/tut2.txt lib/packages/docutils/rstgen.nim lib/system.nim
| * Modifies docgen to support new warning message.Grzegorz Adam Hankiewicz2014-07-191-0/+1
| |
* | Merge branch 'devel' into bigbreakAraq2014-10-201-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: compiler/nim.ini doc/manual.txt doc/tut2.txt koch.nim lib/system/channels.nim readme.txt tools/niminst/niminst.nim tools/nimweb.nim web/download.txt web/news.txt
| * | disable 'view source' featureAraq2014-10-201-0/+2
| |/
* | renamed URLencode to encodeUrlAraq2014-09-101-2/+2
| |
* | Fix case issues in compiler/docgen.Dominik Picheta2014-09-101-2/+2
| |
* | updated the compiler to use the new symbol namesAraq2014-08-281-4/+4
| |
* | Nimrod renamed to NimAraq2014-08-281-1/+1
| |
* | renamefestAraq2014-08-231-2/+2
|/
* Moves TOC index entry generation to rstgen module.Grzegorz Adam Hankiewicz2014-04-211-25/+0
| | | | | We want it there so that index entries appear in the same order as they are found in the input text.
* Splits index into documents and APIs.Grzegorz Adam Hankiewicz2014-04-211-2/+2
|
* Adds documentation sections to the index.Grzegorz Adam Hankiewicz2014-04-211-0/+25
|
* Adds explicit titles to documentation index.Grzegorz Adam Hankiewicz2014-04-211-2/+8
|
* merged better html links #850Araq2014-04-081-9/+159
|
* split the inline and closure iterators into different symbol kinds for ↵Zahary Karadjov2014-03-061-1/+1
| | | | easier discrimination between them
* made 'koch web' work when current dir has a space in itAraq2014-02-151-2/+8
|
* case consistency: cs:partial bootstraps on windowsAraq2013-12-291-2/+2
|
* case consistency: next stepsAraq2013-12-291-5/+5
|
* case consistency part 4Araq2013-12-271-12/+12
|
* case consistency part 1Araq2013-12-271-10/+10
|
* Added jsondoc compiler switchErik O'Leary2013-12-121-106/+178
| | | | Outputs top-level exported information in JSON
* next steps for the new parser/grammarAraq2013-04-201-1/+1
|
* first steps to the new parser/grammarAraq2013-04-191-1/+1
|
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
|
* merged upstream masterZahary Karadjov2013-01-271-5/+30
|\
| * implements #295Araq2013-01-081-1/+21
| |
| * fixes #269Araq2012-12-051-0/+3
| |
| * first version of ropes.nim with unsafeNew (broken)Araq2012-12-021-3/+5
| |
| * implemented 'import except'Araq2012-11-281-1/+1
| |
* | CaaS in-memory cachingZahary Karadjov2012-11-281-1/+1
|/ | | | | removed some redundant filepath params and variables and switched to canonical paths in most places
* exception tracking should workAraq2012-11-041-5/+13
|
* implements/fixes #195Araq2012-09-221-2/+1
|
* added warning for confusing var declarationsAraq2012-07-261-2/+2
|
* doc2 improvementsAraq2012-06-241-2/+2
|
* docgen2 improvementsAraq2012-06-231-4/+4
|
* docgen2 improvementsAraq2012-06-231-1/+1
|
* first implementation of docgen2Araq2012-06-231-9/+9
|
* better support for unsigned integers.Zahary Karadjov2012-06-111-2/+2
|
* extracted documentation generatorAraq2012-05-091-507/+73
|
* added system.getStackTrace; docgen refactoring (incomplete)Araq2012-05-061-238/+82
|
* rst parser does not support 'raw' directive per default (security risk)Araq2012-05-011-2/+4
|
* small bugfixes; documentation generator supports smilies for the forumAraq2012-05-011-14/+31
|
* ERecoverableError exception contains the error messageAraq2012-02-251-0/+1
|
* added docgen.rst2html for the forum; fixed tester bug concerning removeDirAraq2012-02-211-0/+54
|
* year 2012 for most copyright headersAraq2012-01-021-1/+1
|
* the current directory is no longer taken into account when resolving module ↵Zahary Karadjov2011-12-111-1/+1
| | | | paths
* path canonicalization for imported modules, relative paths written in rod filesZahary Karadjov2011-12-111-10/+1
|
* cleaned up configuration file handling and documented the new behaviourAraq2011-11-301-5/+5
|
an>nkType: result = true else: if sonsLen(a) == sonsLen(b): for i in countup(0, sonsLen(a) - 1): if not sameTree(a.sons[i], b.sons[i]): return result = true proc getProcSym*(call: PNode): PSym = result = call.sons[0].sym proc getOpSym*(op: PNode): PSym = if op.kind notin {nkCall, nkHiddenCallConv, nkCommand, nkCallStrLit}: result = nil else: if sonsLen(op) <= 0: internalError(op.info, "getOpSym") elif op.sons[0].kind == nkSym: result = op.sons[0].sym else: result = nil proc getMagic*(op: PNode): TMagic = case op.kind of nkCallKinds: case op.sons[0].kind of nkSym: result = op.sons[0].sym.magic else: result = mNone else: result = mNone proc treeToSym*(t: PNode): PSym = result = t.sym proc isConstExpr*(n: PNode): bool = result = (n.kind in {nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit, nkFloatLit..nkFloat64Lit, nkNilLit}) or (nfAllConst in n.flags) proc isDeepConstExpr*(n: PNode): bool = case n.kind of nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit, nkFloatLit..nkFloat64Lit, nkNilLit: result = true of nkExprEqExpr, nkExprColonExpr, nkHiddenStdConv, nkHiddenSubConv: result = isDeepConstExpr(n.sons[1]) of nkCurly, nkBracket, nkPar, nkObjConstr, nkClosure: for i in 0 .. <n.len: if not isDeepConstExpr(n.sons[i]): return false result = true else: discard proc flattenTreeAux(d, a: PNode, op: TMagic) = if (getMagic(a) == op): # a is a "leaf", so add it: for i in countup(1, sonsLen(a) - 1): # BUGFIX flattenTreeAux(d, a.sons[i], op) else: addSon(d, copyTree(a)) proc flattenTree*(root: PNode, op: TMagic): PNode = result = copyNode(root) if getMagic(root) == op: # BUGFIX: forget to copy prc addSon(result, copyNode(root.sons[0])) flattenTreeAux(result, root, op) proc swapOperands*(op: PNode) = var tmp = op.sons[1] op.sons[1] = op.sons[2] op.sons[2] = tmp proc isRange*(n: PNode): bool {.inline.} = if n.kind == nkInfix: if n[0].kind == nkIdent and n[0].ident.id == ord(wDotDot) or n[0].kind in {nkClosedSymChoice, nkOpenSymChoice} and n[0][1].sym.name.id == ord(wDotDot): result = true proc whichPragma*(n: PNode): TSpecialWord = let key = if n.kind == nkExprColonExpr: n.sons[0] else: n if key.kind == nkIdent: result = whichKeyword(key.ident) proc unnestStmts(n, result: PNode) = if n.kind == nkStmtList: for x in items(n): unnestStmts(x, result) elif n.kind notin {nkCommentStmt, nkNilLit}: result.add(n) proc flattenStmts*(n: PNode): PNode = ## flattens a nested statement list; used for pattern matching result = newNodeI(nkStmtList, n.info) unnestStmts(n, result) if result.len == 1: result = result.sons[0] proc extractRange*(k: TNodeKind, n: PNode, a, b: int): PNode = result = newNodeI(k, n.info, b-a+1) for i in 0 .. b-a: result.sons[i] = n.sons[i+a]