some code formating
This commit is contained in:
parent
afd8ca2f15
commit
ce1138dfa7
2 changed files with 10 additions and 11 deletions
|
|
@ -776,10 +776,10 @@ proc parseInline(p: var TRstParser, father: PRstNode) =
|
||||||
of tkAdornment, tkOther, tkWhite:
|
of tkAdornment, tkOther, tkWhite:
|
||||||
addSon(father, newLeaf(p))
|
addSon(father, newLeaf(p))
|
||||||
inc(p.idx)
|
inc(p.idx)
|
||||||
else: assert(false)
|
else: nil
|
||||||
|
|
||||||
proc getDirective(p: var TRstParser): string =
|
proc getDirective(p: var TRstParser): string =
|
||||||
if (p.tok[p.idx].kind == tkWhite) and (p.tok[p.idx + 1].kind == tkWord):
|
if p.tok[p.idx].kind == tkWhite and p.tok[p.idx+1].kind == tkWord:
|
||||||
var j = p.idx
|
var j = p.idx
|
||||||
inc(p.idx)
|
inc(p.idx)
|
||||||
result = p.tok[p.idx].symbol
|
result = p.tok[p.idx].symbol
|
||||||
|
|
@ -788,7 +788,7 @@ proc getDirective(p: var TRstParser): string =
|
||||||
if p.tok[p.idx].symbol == "::": break
|
if p.tok[p.idx].symbol == "::": break
|
||||||
add(result, p.tok[p.idx].symbol)
|
add(result, p.tok[p.idx].symbol)
|
||||||
inc(p.idx)
|
inc(p.idx)
|
||||||
if (p.tok[p.idx].kind == tkWhite): inc(p.idx)
|
if p.tok[p.idx].kind == tkWhite: inc(p.idx)
|
||||||
if p.tok[p.idx].symbol == "::":
|
if p.tok[p.idx].symbol == "::":
|
||||||
inc(p.idx)
|
inc(p.idx)
|
||||||
if (p.tok[p.idx].kind == tkWhite): inc(p.idx)
|
if (p.tok[p.idx].kind == tkWhite): inc(p.idx)
|
||||||
|
|
@ -814,8 +814,8 @@ proc parseComment(p: var TRstParser): PRstNode =
|
||||||
else:
|
else:
|
||||||
nil
|
nil
|
||||||
inc(p.idx)
|
inc(p.idx)
|
||||||
else:
|
else:
|
||||||
while not (p.tok[p.idx].kind in {tkIndent, tkEof}): inc(p.idx)
|
while p.tok[p.idx].kind notin {tkIndent, tkEof}: inc(p.idx)
|
||||||
result = nil
|
result = nil
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -941,9 +941,9 @@ proc isLineBlock(p: TRstParser): bool =
|
||||||
|
|
||||||
proc predNL(p: TRstParser): bool =
|
proc predNL(p: TRstParser): bool =
|
||||||
result = true
|
result = true
|
||||||
if (p.idx > 0):
|
if p.idx > 0:
|
||||||
result = (p.tok[p.idx - 1].kind == tkIndent) and
|
result = p.tok[p.idx-1].kind == tkIndent and
|
||||||
(p.tok[p.idx - 1].ival == currInd(p))
|
p.tok[p.idx-1].ival == currInd(p)
|
||||||
|
|
||||||
proc isDefList(p: TRstParser): bool =
|
proc isDefList(p: TRstParser): bool =
|
||||||
var j = tokenAfterNewline(p)
|
var j = tokenAfterNewline(p)
|
||||||
|
|
|
||||||
|
|
@ -162,15 +162,14 @@ proc ExecAffectedRows*(db: TDbConn, query: TSqlQuery,
|
||||||
|
|
||||||
proc Close*(db: TDbConn) =
|
proc Close*(db: TDbConn) =
|
||||||
## closes the database connection.
|
## closes the database connection.
|
||||||
if sqlite3.close(db) != SQLITE_OK:
|
if sqlite3.close(db) != SQLITE_OK: dbError(db)
|
||||||
dbError(db)
|
|
||||||
|
|
||||||
proc Open*(connection, user, password, database: string): TDbConn =
|
proc Open*(connection, user, password, database: string): TDbConn =
|
||||||
## opens a database connection. Raises `EDb` if the connection could not
|
## opens a database connection. Raises `EDb` if the connection could not
|
||||||
## be established. Only the ``connection`` parameter is used for ``sqlite``.
|
## be established. Only the ``connection`` parameter is used for ``sqlite``.
|
||||||
var db: TDbConn
|
var db: TDbConn
|
||||||
if sqlite3.open(connection, db) == SQLITE_OK:
|
if sqlite3.open(connection, db) == SQLITE_OK:
|
||||||
return db
|
result = db
|
||||||
else:
|
else:
|
||||||
dbError(db)
|
dbError(db)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue