mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-10 05:38:10 +00:00
small bugfixes; documentation generator supports smilies for the forum
This commit is contained in:
@@ -106,7 +106,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery,
|
||||
var sqlres = mysql.UseResult(db)
|
||||
if sqlres != nil:
|
||||
var L = int(mysql.NumFields(sqlres))
|
||||
var result = newRow(L)
|
||||
result = newRow(L)
|
||||
var row = mysql.FetchRow(sqlres)
|
||||
if row != nil:
|
||||
for i in 0..L-1:
|
||||
|
||||
@@ -108,7 +108,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery,
|
||||
## retrieves a single row.
|
||||
var res = setupQuery(db, query, args)
|
||||
var L = int(PQnfields(res))
|
||||
var result = newRow(L)
|
||||
result = newRow(L)
|
||||
setRow(res, result, 0, L)
|
||||
PQclear(res)
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery,
|
||||
## retrieves a single row.
|
||||
var stmt = setupQuery(db, query, args)
|
||||
var L = int(columnCount(stmt))
|
||||
var result = newRow(L)
|
||||
result = newRow(L)
|
||||
if step(stmt) == SQLITE_ROW:
|
||||
setRow(stmt, result, L)
|
||||
if finalize(stmt) != SQLITE_OK: dbError(db)
|
||||
|
||||
@@ -222,7 +222,7 @@ macro head*(e: expr): expr =
|
||||
|
||||
macro html*(e: expr): expr =
|
||||
## generates the HTML ``html`` element.
|
||||
result = xmlCheckedTag(e, "html", "", "xmlns")
|
||||
result = xmlCheckedTag(e, "html", "xmlns", "")
|
||||
|
||||
macro hr*(e: expr): expr =
|
||||
## generates the HTML ``hr`` element.
|
||||
|
||||
@@ -531,6 +531,16 @@ proc endsWith*(s, suffix: string): bool {.noSideEffect,
|
||||
if s[i+j] != suffix[i]: return false
|
||||
inc(i)
|
||||
if suffix[i] == '\0': return true
|
||||
|
||||
proc continuesWith*(s, substr: string, start: int): bool {.noSideEffect,
|
||||
rtl, extern: "nsuContinuesWith".} =
|
||||
## Returns true iff ``s`` continues with ``substr`` at position ``start``.
|
||||
## If ``substr == ""`` true is returned.
|
||||
var i = 0
|
||||
while true:
|
||||
if substr[i] == '\0': return true
|
||||
if s[i+start] != substr[i]: return false
|
||||
inc(i)
|
||||
|
||||
proc addSep*(dest: var string, sep = ", ", startLen = 0) {.noSideEffect,
|
||||
inline.} =
|
||||
|
||||
Reference in New Issue
Block a user