commit before ov-res changes
This commit is contained in:
parent
2fb8ced454
commit
902bf05879
4 changed files with 37 additions and 23 deletions
|
|
@ -48,6 +48,7 @@ proc atomicDec(memLoc: var int, x: int): int =
|
||||||
when defined(Windows):
|
when defined(Windows):
|
||||||
type
|
type
|
||||||
THandle = int
|
THandle = int
|
||||||
|
TSysThread = THandle
|
||||||
TSysLock {.final, pure.} = object # CRITICAL_SECTION in WinApi
|
TSysLock {.final, pure.} = object # CRITICAL_SECTION in WinApi
|
||||||
DebugInfo: pointer
|
DebugInfo: pointer
|
||||||
LockCount: int32
|
LockCount: int32
|
||||||
|
|
@ -83,14 +84,32 @@ else:
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TThread* {.final, pure.} = object
|
TThread* = TSysThread
|
||||||
id: int
|
TLock* = TSysLock
|
||||||
next: ptr TThread
|
|
||||||
TThreadFunc* = proc (closure: pointer) {.cdecl.}
|
TThreadFunc* = proc (closure: pointer) {.cdecl.}
|
||||||
|
|
||||||
proc createThread*(t: var TThread, fn: TThreadFunc) =
|
DWORD WINAPI SuspendThread(
|
||||||
|
__in HANDLE hThread
|
||||||
|
);
|
||||||
|
DWORD WINAPI ResumeThread(
|
||||||
|
__in HANDLE hThread
|
||||||
|
);
|
||||||
|
DWORD WINAPI ThreadProc(
|
||||||
|
__in LPVOID lpParameter
|
||||||
|
);
|
||||||
|
|
||||||
|
proc createThread*(t: var TThread, fn: TThreadFunc, closure: pointer) =
|
||||||
|
when defined(windows):
|
||||||
|
|
||||||
|
else:
|
||||||
|
nil
|
||||||
|
#pthread_create(
|
||||||
|
|
||||||
|
proc joinThread*(t: TThread) =
|
||||||
nil
|
nil
|
||||||
|
|
||||||
|
#proc pthread_exit(void *value_ptr)
|
||||||
|
|
||||||
proc destroyThread*(t: var TThread) =
|
proc destroyThread*(t: var TThread) =
|
||||||
nil
|
nil
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -315,17 +315,13 @@ proc getRstName(n: PNode): PRstNode =
|
||||||
result = nil
|
result = nil
|
||||||
|
|
||||||
proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) =
|
proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) =
|
||||||
var
|
|
||||||
r: TSrcGen
|
|
||||||
kind: TTokType
|
|
||||||
literal: string
|
|
||||||
name, result, comm: PRope
|
|
||||||
if not isVisible(nameNode): return
|
if not isVisible(nameNode): return
|
||||||
name = toRope(getName(nameNode))
|
var name = toRope(getName(nameNode))
|
||||||
result = nil
|
var result: PRope = nil
|
||||||
literal = ""
|
var literal = ""
|
||||||
kind = tkEof
|
var kind = tkEof
|
||||||
comm = genRecComment(d, n) # call this here for the side-effect!
|
var comm = genRecComment(d, n) # call this here for the side-effect!
|
||||||
|
var r: TSrcGen
|
||||||
initTokRender(r, n, {renderNoPragmas, renderNoBody, renderNoComments,
|
initTokRender(r, n, {renderNoPragmas, renderNoBody, renderNoComments,
|
||||||
renderDocComments})
|
renderDocComments})
|
||||||
while true:
|
while true:
|
||||||
|
|
@ -630,10 +626,10 @@ proc renderRstToOut(d: PDoc, n: PRstNode): PRope =
|
||||||
result = renderAux(d, n, disp("<ul class=\"simple\">$1</ul>\n",
|
result = renderAux(d, n, disp("<ul class=\"simple\">$1</ul>\n",
|
||||||
"\\begin{itemize}$1\\end{itemize}\n"))
|
"\\begin{itemize}$1\\end{itemize}\n"))
|
||||||
of rnBulletItem, rnEnumItem:
|
of rnBulletItem, rnEnumItem:
|
||||||
result = renderAux(d, n, disp("<li>$1</li>" & "\n", "\\item $1" & "\n"))
|
result = renderAux(d, n, disp("<li>$1</li>\n", "\\item $1\n"))
|
||||||
of rnEnumList:
|
of rnEnumList:
|
||||||
result = renderAux(d, n, disp("<ol class=\"simple\">$1</ol>" & "\n",
|
result = renderAux(d, n, disp("<ol class=\"simple\">$1</ol>\n",
|
||||||
"\\begin{enumerate}$1\\end{enumerate}" & "\n"))
|
"\\begin{enumerate}$1\\end{enumerate}\n"))
|
||||||
of rnDefList:
|
of rnDefList:
|
||||||
result = renderAux(d, n, disp("<dl class=\"docutils\">$1</dl>\n",
|
result = renderAux(d, n, disp("<dl class=\"docutils\">$1</dl>\n",
|
||||||
"\\begin{description}$1\\end{description}\n"))
|
"\\begin{description}$1\\end{description}\n"))
|
||||||
|
|
@ -791,7 +787,7 @@ proc generateDoc(d: PDoc, n: PNode) =
|
||||||
|
|
||||||
proc genSection(d: PDoc, kind: TSymKind) =
|
proc genSection(d: PDoc, kind: TSymKind) =
|
||||||
if d.section[kind] == nil: return
|
if d.section[kind] == nil: return
|
||||||
var title = toRope(copy($kind, 0 + 2) & 's')
|
var title = toRope(copy($kind, 2) & 's')
|
||||||
d.section[kind] = ropeFormatNamedVars(getConfigVar("doc.section"), [
|
d.section[kind] = ropeFormatNamedVars(getConfigVar("doc.section"), [
|
||||||
"sectionid", "sectionTitle", "sectionTitleID", "content"], [
|
"sectionid", "sectionTitle", "sectionTitleID", "content"], [
|
||||||
toRope(ord(kind)), title, toRope(ord(kind) + 50), d.section[kind]])
|
toRope(ord(kind)), title, toRope(ord(kind) + 50), d.section[kind]])
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import
|
||||||
|
|
||||||
type
|
type
|
||||||
TIdObj* = object of TObject
|
TIdObj* = object of TObject
|
||||||
id*: int # unique id; use this for comparisons and not the pointers
|
id*: int # unique id; use this for comparisons and not the pointers
|
||||||
|
|
||||||
PIdObj* = ref TIdObj
|
PIdObj* = ref TIdObj
|
||||||
PIdent* = ref TIdent
|
PIdent* = ref TIdent
|
||||||
|
|
@ -48,8 +48,8 @@ proc cmpIgnoreStyle(a, b: cstring, blen: int): int =
|
||||||
result = 1
|
result = 1
|
||||||
while j < blen:
|
while j < blen:
|
||||||
while a[i] == '_': inc(i)
|
while a[i] == '_': inc(i)
|
||||||
while b[j] == '_':
|
while b[j] == '_': inc(j)
|
||||||
inc(j) # tolower inlined:
|
# tolower inlined:
|
||||||
aa = a[i]
|
aa = a[i]
|
||||||
bb = b[j]
|
bb = b[j]
|
||||||
if (aa >= 'A') and (aa <= 'Z'): aa = chr(ord(aa) + (ord('a') - ord('A')))
|
if (aa >= 'A') and (aa <= 'Z'): aa = chr(ord(aa) + (ord('a') - ord('A')))
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -103,7 +103,6 @@ Low priority
|
||||||
- find a way for easy constructors and destructors; (destructors are much more
|
- find a way for easy constructors and destructors; (destructors are much more
|
||||||
important than constructors)
|
important than constructors)
|
||||||
- code generated for type information is wasteful
|
- code generated for type information is wasteful
|
||||||
- icon installation for the Windows installer
|
|
||||||
|
|
||||||
|
|
||||||
Other ideas
|
Other ideas
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue