mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-25 08:43:58 +00:00
case consistency part 4
This commit is contained in:
@@ -321,7 +321,7 @@ proc generalStrLit(g: var TGeneralTokenizer, position: int): int =
|
||||
inc(pos)
|
||||
result = pos
|
||||
|
||||
proc isKeyword(x: openarray[string], y: string): int =
|
||||
proc isKeyword(x: openArray[string], y: string): int =
|
||||
var a = 0
|
||||
var b = len(x) - 1
|
||||
while a <= b:
|
||||
@@ -335,7 +335,7 @@ proc isKeyword(x: openarray[string], y: string): int =
|
||||
return mid
|
||||
result = - 1
|
||||
|
||||
proc isKeywordIgnoreCase(x: openarray[string], y: string): int =
|
||||
proc isKeywordIgnoreCase(x: openArray[string], y: string): int =
|
||||
var a = 0
|
||||
var b = len(x) - 1
|
||||
while a <= b:
|
||||
@@ -354,7 +354,7 @@ type
|
||||
hasPreprocessor, hasNestedComments
|
||||
TTokenizerFlags = set[TTokenizerFlag]
|
||||
|
||||
proc clikeNextToken(g: var TGeneralTokenizer, keywords: openarray[string],
|
||||
proc clikeNextToken(g: var TGeneralTokenizer, keywords: openArray[string],
|
||||
flags: TTokenizerFlags) =
|
||||
const
|
||||
hexChars = {'0'..'9', 'A'..'F', 'a'..'f'}
|
||||
|
||||
@@ -58,10 +58,10 @@ const
|
||||
mwUnsupportedLanguage: "language '$1' not supported"
|
||||
]
|
||||
|
||||
proc rstnodeToRefname*(n: PRstNode): string
|
||||
proc addNodes*(n: PRstNode): string
|
||||
proc getFieldValue*(n: PRstNode, fieldname: string): string
|
||||
proc getArgument*(n: PRstNode): string
|
||||
proc rstnodeToRefname*(n: PRSTNode): string
|
||||
proc addNodes*(n: PRSTNode): string
|
||||
proc getFieldValue*(n: PRSTNode, fieldname: string): string
|
||||
proc getArgument*(n: PRSTNode): string
|
||||
|
||||
# ----------------------------- scanner part --------------------------------
|
||||
|
||||
@@ -242,7 +242,7 @@ proc getTokens(buffer: string, skipPounds: bool, tokens: var TTokenSeq): int =
|
||||
inc(result)
|
||||
while true:
|
||||
inc(length)
|
||||
setlen(tokens, length)
|
||||
setLen(tokens, length)
|
||||
rawGetTok(L, tokens[length - 1])
|
||||
if tokens[length - 1].kind == tkEof: break
|
||||
if tokens[0].kind == tkWhite:
|
||||
@@ -254,7 +254,7 @@ type
|
||||
TLevelMap = array[Char, int]
|
||||
TSubstitution{.final.} = object
|
||||
key*: string
|
||||
value*: PRstNode
|
||||
value*: PRSTNode
|
||||
|
||||
TSharedState {.final.} = object
|
||||
options: TRstParseOptions # parsing options
|
||||
@@ -294,11 +294,11 @@ proc whichMsgClass*(k: TMsgKind): TMsgClass =
|
||||
|
||||
proc defaultMsgHandler*(filename: string, line, col: int, msgkind: TMsgKind,
|
||||
arg: string) {.procvar.} =
|
||||
let mc = msgKind.whichMsgClass
|
||||
let a = messages[msgKind] % arg
|
||||
let mc = msgkind.whichMsgClass
|
||||
let a = messages[msgkind] % arg
|
||||
let message = "$1($2, $3) $4: $5" % [filename, $line, $col, $mc, a]
|
||||
if mc == mcError: raise newException(EParseError, message)
|
||||
else: Writeln(stdout, message)
|
||||
else: writeln(stdout, message)
|
||||
|
||||
proc defaultFindFile*(filename: string): string {.procvar.} =
|
||||
if existsFile(filename): result = filename
|
||||
@@ -339,7 +339,7 @@ proc pushInd(p: var TRstParser, ind: int) =
|
||||
add(p.indentStack, ind)
|
||||
|
||||
proc popInd(p: var TRstParser) =
|
||||
if len(p.indentStack) > 1: setlen(p.indentStack, len(p.indentStack) - 1)
|
||||
if len(p.indentStack) > 1: setLen(p.indentStack, len(p.indentStack) - 1)
|
||||
|
||||
proc initParser(p: var TRstParser, sharedState: PSharedState) =
|
||||
p.indentStack = @[0]
|
||||
@@ -351,7 +351,7 @@ proc initParser(p: var TRstParser, sharedState: PSharedState) =
|
||||
p.line = 1
|
||||
p.s = sharedState
|
||||
|
||||
proc addNodesAux(n: PRstNode, result: var string) =
|
||||
proc addNodesAux(n: PRSTNode, result: var string) =
|
||||
if n.kind == rnLeaf:
|
||||
add(result, n.text)
|
||||
else:
|
||||
@@ -361,7 +361,7 @@ proc addNodes(n: PRstNode): string =
|
||||
result = ""
|
||||
addNodesAux(n, result)
|
||||
|
||||
proc rstnodeToRefnameAux(n: PRstNode, r: var string, b: var bool) =
|
||||
proc rstnodeToRefnameAux(n: PRSTNode, r: var string, b: var bool) =
|
||||
if n.kind == rnLeaf:
|
||||
for i in countup(0, len(n.text) - 1):
|
||||
case n.text[i]
|
||||
@@ -391,7 +391,7 @@ proc rstnodeToRefname(n: PRstNode): string =
|
||||
var b = false
|
||||
rstnodeToRefnameAux(n, result, b)
|
||||
|
||||
proc findSub(p: var TRstParser, n: PRstNode): int =
|
||||
proc findSub(p: var TRstParser, n: PRSTNode): int =
|
||||
var key = addNodes(n)
|
||||
# the spec says: if no exact match, try one without case distinction:
|
||||
for i in countup(0, high(p.s.subs)):
|
||||
@@ -402,17 +402,17 @@ proc findSub(p: var TRstParser, n: PRstNode): int =
|
||||
return i
|
||||
result = -1
|
||||
|
||||
proc setSub(p: var TRstParser, key: string, value: PRstNode) =
|
||||
proc setSub(p: var TRstParser, key: string, value: PRSTNode) =
|
||||
var length = len(p.s.subs)
|
||||
for i in countup(0, length - 1):
|
||||
if key == p.s.subs[i].key:
|
||||
p.s.subs[i].value = value
|
||||
return
|
||||
setlen(p.s.subs, length + 1)
|
||||
setLen(p.s.subs, length + 1)
|
||||
p.s.subs[length].key = key
|
||||
p.s.subs[length].value = value
|
||||
|
||||
proc setRef(p: var TRstParser, key: string, value: PRstNode) =
|
||||
proc setRef(p: var TRstParser, key: string, value: PRSTNode) =
|
||||
var length = len(p.s.refs)
|
||||
for i in countup(0, length - 1):
|
||||
if key == p.s.refs[i].key:
|
||||
@@ -421,19 +421,19 @@ proc setRef(p: var TRstParser, key: string, value: PRstNode) =
|
||||
|
||||
p.s.refs[i].value = value
|
||||
return
|
||||
setlen(p.s.refs, length + 1)
|
||||
setLen(p.s.refs, length + 1)
|
||||
p.s.refs[length].key = key
|
||||
p.s.refs[length].value = value
|
||||
|
||||
proc findRef(p: var TRstParser, key: string): PRstNode =
|
||||
proc findRef(p: var TRstParser, key: string): PRSTNode =
|
||||
for i in countup(0, high(p.s.refs)):
|
||||
if key == p.s.refs[i].key:
|
||||
return p.s.refs[i].value
|
||||
|
||||
proc newLeaf(p: var TRstParser): PRstNode =
|
||||
proc newLeaf(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnLeaf, p.tok[p.idx].symbol)
|
||||
|
||||
proc getReferenceName(p: var TRstParser, endStr: string): PRstNode =
|
||||
proc getReferenceName(p: var TRstParser, endStr: string): PRSTNode =
|
||||
var res = newRstNode(rnInner)
|
||||
while true:
|
||||
case p.tok[p.idx].kind
|
||||
@@ -451,7 +451,7 @@ proc getReferenceName(p: var TRstParser, endStr: string): PRstNode =
|
||||
inc(p.idx)
|
||||
result = res
|
||||
|
||||
proc untilEol(p: var TRstParser): PRstNode =
|
||||
proc untilEol(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnInner)
|
||||
while not (p.tok[p.idx].kind in {tkIndent, tkEof}):
|
||||
add(result, newLeaf(p))
|
||||
@@ -479,7 +479,7 @@ proc isInlineMarkupEnd(p: TRstParser, markup: string): bool =
|
||||
result = false
|
||||
|
||||
proc isInlineMarkupStart(p: TRstParser, markup: string): bool =
|
||||
var d: Char
|
||||
var d: char
|
||||
result = p.tok[p.idx].symbol == markup
|
||||
if not result:
|
||||
return # Rule 1:
|
||||
@@ -550,7 +550,7 @@ proc match(p: TRstParser, start: int, expr: string): bool =
|
||||
inc(i)
|
||||
result = true
|
||||
|
||||
proc fixupEmbeddedRef(n, a, b: PRstNode) =
|
||||
proc fixupEmbeddedRef(n, a, b: PRSTNode) =
|
||||
var sep = - 1
|
||||
for i in countdown(len(n) - 2, 0):
|
||||
if n.sons[i].text == "<":
|
||||
@@ -560,7 +560,7 @@ proc fixupEmbeddedRef(n, a, b: PRstNode) =
|
||||
for i in countup(0, sep - incr): add(a, n.sons[i])
|
||||
for i in countup(sep + 1, len(n) - 2): add(b, n.sons[i])
|
||||
|
||||
proc parsePostfix(p: var TRstParser, n: PRstNode): PRstNode =
|
||||
proc parsePostfix(p: var TRstParser, n: PRSTNode): PRSTNode =
|
||||
result = n
|
||||
if isInlineMarkupEnd(p, "_"):
|
||||
inc(p.idx)
|
||||
@@ -613,9 +613,9 @@ proc matchVerbatim(p: TRstParser, start: int, expr: string): int =
|
||||
inc result
|
||||
if j < expr.len: result = 0
|
||||
|
||||
proc parseSmiley(p: var TRstParser): PRstNode =
|
||||
proc parseSmiley(p: var TRstParser): PRSTNode =
|
||||
if p.tok[p.idx].symbol[0] notin SmileyStartChars: return
|
||||
for key, val in items(smilies):
|
||||
for key, val in items(Smilies):
|
||||
let m = matchVerbatim(p, p.idx, key)
|
||||
if m > 0:
|
||||
p.idx = m
|
||||
@@ -634,7 +634,7 @@ proc isURL(p: TRstParser, i: int): bool =
|
||||
(p.tok[i+3].kind == tkWord) and
|
||||
(p.tok[i].symbol in ["http", "https", "ftp", "telnet", "file"])
|
||||
|
||||
proc parseURL(p: var TRstParser, father: PRstNode) =
|
||||
proc parseURL(p: var TRstParser, father: PRSTNode) =
|
||||
#if p.tok[p.idx].symbol[strStart] == '<':
|
||||
if isURL(p, p.idx):
|
||||
var n = newRstNode(rnStandaloneHyperlink)
|
||||
@@ -654,7 +654,7 @@ proc parseURL(p: var TRstParser, father: PRstNode) =
|
||||
if p.tok[p.idx].symbol == "_": n = parsePostfix(p, n)
|
||||
add(father, n)
|
||||
|
||||
proc parseBackslash(p: var TRstParser, father: PRstNode) =
|
||||
proc parseBackslash(p: var TRstParser, father: PRSTNode) =
|
||||
assert(p.tok[p.idx].kind == tkPunct)
|
||||
if p.tok[p.idx].symbol == "\\\\":
|
||||
add(father, newRstNode(rnLeaf, "\\"))
|
||||
@@ -692,7 +692,7 @@ when false:
|
||||
if p.tok[p.idx].symbol == "_": n = parsePostfix(p, n)
|
||||
add(father, n)
|
||||
|
||||
proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string,
|
||||
proc parseUntil(p: var TRstParser, father: PRSTNode, postfix: string,
|
||||
interpretBackslash: bool) =
|
||||
let
|
||||
line = p.tok[p.idx].line
|
||||
@@ -723,7 +723,7 @@ proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string,
|
||||
inc(p.idx)
|
||||
else: rstMessage(p, meExpected, postfix, line, col)
|
||||
|
||||
proc parseMarkdownCodeblock(p: var TRstParser): PRstNode =
|
||||
proc parseMarkdownCodeblock(p: var TRstParser): PRSTNode =
|
||||
var args = newRstNode(rnDirArg)
|
||||
if p.tok[p.idx].kind == tkWord:
|
||||
add(args, newLeaf(p))
|
||||
@@ -753,7 +753,7 @@ proc parseMarkdownCodeblock(p: var TRstParser): PRstNode =
|
||||
add(result, nil)
|
||||
add(result, lb)
|
||||
|
||||
proc parseInline(p: var TRstParser, father: PRstNode) =
|
||||
proc parseInline(p: var TRstParser, father: PRSTNode) =
|
||||
case p.tok[p.idx].kind
|
||||
of tkPunct:
|
||||
if isInlineMarkupStart(p, "***"):
|
||||
@@ -797,7 +797,7 @@ proc parseInline(p: var TRstParser, father: PRstNode) =
|
||||
if n != nil:
|
||||
add(father, n)
|
||||
return
|
||||
parseUrl(p, father)
|
||||
parseURL(p, father)
|
||||
of tkAdornment, tkOther, tkWhite:
|
||||
if roSupportSmilies in p.s.options:
|
||||
let n = parseSmiley(p)
|
||||
@@ -828,7 +828,7 @@ proc getDirective(p: var TRstParser): string =
|
||||
else:
|
||||
result = ""
|
||||
|
||||
proc parseComment(p: var TRstParser): PRstNode =
|
||||
proc parseComment(p: var TRstParser): PRSTNode =
|
||||
case p.tok[p.idx].kind
|
||||
of tkIndent, tkEof:
|
||||
if p.tok[p.idx].kind != tkEof and p.tok[p.idx + 1].kind == tkIndent:
|
||||
@@ -863,20 +863,20 @@ proc getDirKind(s: string): TDirKind =
|
||||
if i >= 0: result = TDirKind(i)
|
||||
else: result = dkNone
|
||||
|
||||
proc parseLine(p: var TRstParser, father: PRstNode) =
|
||||
proc parseLine(p: var TRstParser, father: PRSTNode) =
|
||||
while True:
|
||||
case p.tok[p.idx].kind
|
||||
of tkWhite, tkWord, tkOther, tkPunct: parseInline(p, father)
|
||||
else: break
|
||||
|
||||
proc parseUntilNewline(p: var TRstParser, father: PRstNode) =
|
||||
proc parseUntilNewline(p: var TRstParser, father: PRSTNode) =
|
||||
while True:
|
||||
case p.tok[p.idx].kind
|
||||
of tkWhite, tkWord, tkAdornment, tkOther, tkPunct: parseInline(p, father)
|
||||
of tkEof, tkIndent: break
|
||||
|
||||
proc parseSection(p: var TRstParser, result: PRstNode)
|
||||
proc parseField(p: var TRstParser): PRstNode =
|
||||
proc parseSection(p: var TRstParser, result: PRSTNode)
|
||||
proc parseField(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnField)
|
||||
var col = p.tok[p.idx].col
|
||||
var fieldname = newRstNode(rnFieldname)
|
||||
@@ -892,7 +892,7 @@ proc parseField(p: var TRstParser): PRstNode =
|
||||
add(result, fieldname)
|
||||
add(result, fieldbody)
|
||||
|
||||
proc parseFields(p: var TRstParser): PRstNode =
|
||||
proc parseFields(p: var TRstParser): PRSTNode =
|
||||
result = nil
|
||||
var atStart = p.idx == 0 and p.tok[0].symbol == ":"
|
||||
if (p.tok[p.idx].kind == tkIndent) and (p.tok[p.idx + 1].symbol == ":") or
|
||||
@@ -926,8 +926,8 @@ proc getArgument(n: PRstNode): string =
|
||||
if n.sons[0] == nil: result = ""
|
||||
else: result = addNodes(n.sons[0])
|
||||
|
||||
proc parseDotDot(p: var TRstParser): PRstNode
|
||||
proc parseLiteralBlock(p: var TRstParser): PRstNode =
|
||||
proc parseDotDot(p: var TRstParser): PRSTNode
|
||||
proc parseLiteralBlock(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnLiteralBlock)
|
||||
var n = newRstNode(rnLeaf, "")
|
||||
if p.tok[p.idx].kind == tkIndent:
|
||||
@@ -953,7 +953,7 @@ proc parseLiteralBlock(p: var TRstParser): PRstNode =
|
||||
inc(p.idx)
|
||||
add(result, n)
|
||||
|
||||
proc getLevel(map: var TLevelMap, lvl: var int, c: Char): int =
|
||||
proc getLevel(map: var TLevelMap, lvl: var int, c: char): int =
|
||||
if map[c] == 0:
|
||||
inc(lvl)
|
||||
map[c] = lvl
|
||||
@@ -999,7 +999,7 @@ proc whichSection(p: TRstParser): TRstNodeKind =
|
||||
elif match(p, p.idx + 1, "i"): result = rnOverline
|
||||
else: result = rnLeaf
|
||||
of tkPunct:
|
||||
if match(p, tokenAfterNewLine(p), "ai"):
|
||||
if match(p, tokenAfterNewline(p), "ai"):
|
||||
result = rnHeadline
|
||||
elif p.tok[p.idx].symbol == "::":
|
||||
result = rnLiteralBlock
|
||||
@@ -1026,13 +1026,13 @@ proc whichSection(p: TRstParser): TRstNodeKind =
|
||||
else:
|
||||
result = rnParagraph
|
||||
of tkWord, tkOther, tkWhite:
|
||||
if match(p, tokenAfterNewLine(p), "ai"): result = rnHeadline
|
||||
if match(p, tokenAfterNewline(p), "ai"): result = rnHeadline
|
||||
elif match(p, p.idx, "e) ") or match(p, p.idx, "e. "): result = rnEnumList
|
||||
elif isDefList(p): result = rnDefList
|
||||
else: result = rnParagraph
|
||||
else: result = rnLeaf
|
||||
|
||||
proc parseLineBlock(p: var TRstParser): PRstNode =
|
||||
proc parseLineBlock(p: var TRstParser): PRSTNode =
|
||||
result = nil
|
||||
if p.tok[p.idx + 1].kind == tkWhite:
|
||||
var col = p.tok[p.idx].col
|
||||
@@ -1051,7 +1051,7 @@ proc parseLineBlock(p: var TRstParser): PRstNode =
|
||||
break
|
||||
popInd(p)
|
||||
|
||||
proc parseParagraph(p: var TRstParser, result: PRstNode) =
|
||||
proc parseParagraph(p: var TRstParser, result: PRSTNode) =
|
||||
while True:
|
||||
case p.tok[p.idx].kind
|
||||
of tkIndent:
|
||||
@@ -1082,9 +1082,9 @@ proc parseParagraph(p: var TRstParser, result: PRstNode) =
|
||||
parseInline(p, result)
|
||||
else: break
|
||||
|
||||
proc parseHeadline(p: var TRstParser): PRstNode =
|
||||
proc parseHeadline(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnHeadline)
|
||||
parseUntilNewLine(p, result)
|
||||
parseUntilNewline(p, result)
|
||||
assert(p.tok[p.idx].kind == tkIndent)
|
||||
assert(p.tok[p.idx + 1].kind == tkAdornment)
|
||||
var c = p.tok[p.idx + 1].symbol[0]
|
||||
@@ -1101,7 +1101,7 @@ proc getColumns(p: var TRstParser, cols: var TIntSeq) =
|
||||
var L = 0
|
||||
while true:
|
||||
inc(L)
|
||||
setlen(cols, L)
|
||||
setLen(cols, L)
|
||||
cols[L - 1] = tokEnd(p)
|
||||
assert(p.tok[p.idx].kind == tkAdornment)
|
||||
inc(p.idx)
|
||||
@@ -1112,16 +1112,16 @@ proc getColumns(p: var TRstParser, cols: var TIntSeq) =
|
||||
# last column has no limit:
|
||||
cols[L - 1] = 32000
|
||||
|
||||
proc parseDoc(p: var TRstParser): PRstNode
|
||||
proc parseDoc(p: var TRstParser): PRSTNode
|
||||
|
||||
proc parseSimpleTable(p: var TRstParser): PRstNode =
|
||||
proc parseSimpleTable(p: var TRstParser): PRSTNode =
|
||||
var
|
||||
cols: TIntSeq
|
||||
row: seq[string]
|
||||
i, last, line: int
|
||||
c: Char
|
||||
c: char
|
||||
q: TRstParser
|
||||
a, b: PRstNode
|
||||
a, b: PRSTNode
|
||||
result = newRstNode(rnTable)
|
||||
cols = @[]
|
||||
row = @[]
|
||||
@@ -1135,7 +1135,7 @@ proc parseSimpleTable(p: var TRstParser): PRstNode =
|
||||
p.idx = last
|
||||
break
|
||||
getColumns(p, cols)
|
||||
setlen(row, len(cols))
|
||||
setLen(row, len(cols))
|
||||
if a != nil:
|
||||
for j in 0..len(a)-1: a.sons[j].kind = rnTableHeaderCell
|
||||
if p.tok[p.idx].kind == tkEof: break
|
||||
@@ -1167,13 +1167,13 @@ proc parseSimpleTable(p: var TRstParser): PRstNode =
|
||||
add(a, b)
|
||||
add(result, a)
|
||||
|
||||
proc parseTransition(p: var TRstParser): PRstNode =
|
||||
proc parseTransition(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnTransition)
|
||||
inc(p.idx)
|
||||
if p.tok[p.idx].kind == tkIndent: inc(p.idx)
|
||||
if p.tok[p.idx].kind == tkIndent: inc(p.idx)
|
||||
|
||||
proc parseOverline(p: var TRstParser): PRstNode =
|
||||
proc parseOverline(p: var TRstParser): PRSTNode =
|
||||
var c = p.tok[p.idx].symbol[0]
|
||||
inc(p.idx, 2)
|
||||
result = newRstNode(rnOverline)
|
||||
@@ -1192,7 +1192,7 @@ proc parseOverline(p: var TRstParser): PRstNode =
|
||||
inc(p.idx) # XXX: check?
|
||||
if p.tok[p.idx].kind == tkIndent: inc(p.idx)
|
||||
|
||||
proc parseBulletList(p: var TRstParser): PRstNode =
|
||||
proc parseBulletList(p: var TRstParser): PRSTNode =
|
||||
result = nil
|
||||
if p.tok[p.idx + 1].kind == tkWhite:
|
||||
var bullet = p.tok[p.idx].symbol
|
||||
@@ -1212,7 +1212,7 @@ proc parseBulletList(p: var TRstParser): PRstNode =
|
||||
break
|
||||
popInd(p)
|
||||
|
||||
proc parseOptionList(p: var TRstParser): PRstNode =
|
||||
proc parseOptionList(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnOptionList)
|
||||
while true:
|
||||
if isOptionList(p):
|
||||
@@ -1241,9 +1241,9 @@ proc parseOptionList(p: var TRstParser): PRstNode =
|
||||
else:
|
||||
break
|
||||
|
||||
proc parseDefinitionList(p: var TRstParser): PRstNode =
|
||||
proc parseDefinitionList(p: var TRstParser): PRSTNode =
|
||||
result = nil
|
||||
var j = tokenAfterNewLine(p) - 1
|
||||
var j = tokenAfterNewline(p) - 1
|
||||
if (j >= 1) and (p.tok[j].kind == tkIndent) and
|
||||
(p.tok[j].ival > currInd(p)) and (p.tok[j - 1].symbol != "::"):
|
||||
var col = p.tok[p.idx].col
|
||||
@@ -1269,7 +1269,7 @@ proc parseDefinitionList(p: var TRstParser): PRstNode =
|
||||
break
|
||||
if (p.tok[p.idx].kind == tkIndent) and (p.tok[p.idx].ival == col):
|
||||
inc(p.idx)
|
||||
j = tokenAfterNewLine(p) - 1
|
||||
j = tokenAfterNewline(p) - 1
|
||||
if j >= 1 and p.tok[j].kind == tkIndent and p.tok[j].ival > col and
|
||||
p.tok[j-1].symbol != "::" and p.tok[j+1].kind != tkIndent:
|
||||
nil
|
||||
@@ -1277,7 +1277,7 @@ proc parseDefinitionList(p: var TRstParser): PRstNode =
|
||||
break
|
||||
if len(result) == 0: result = nil
|
||||
|
||||
proc parseEnumList(p: var TRstParser): PRstNode =
|
||||
proc parseEnumList(p: var TRstParser): PRSTNode =
|
||||
const
|
||||
wildcards: array[0..2, string] = ["(e) ", "e) ", "e. "]
|
||||
wildpos: array[0..2, int] = [1, 0, 0]
|
||||
@@ -1290,7 +1290,7 @@ proc parseEnumList(p: var TRstParser): PRstNode =
|
||||
var col = p.tok[p.idx].col
|
||||
result = newRstNode(rnEnumList)
|
||||
inc(p.idx, wildpos[w] + 3)
|
||||
var j = tokenAfterNewLine(p)
|
||||
var j = tokenAfterNewline(p)
|
||||
if (p.tok[j].col == p.tok[p.idx].col) or match(p, j, wildcards[w]):
|
||||
pushInd(p, p.tok[p.idx].col)
|
||||
while true:
|
||||
@@ -1307,7 +1307,7 @@ proc parseEnumList(p: var TRstParser): PRstNode =
|
||||
dec(p.idx, wildpos[w] + 3)
|
||||
result = nil
|
||||
|
||||
proc sonKind(father: PRstNode, i: int): TRstNodeKind =
|
||||
proc sonKind(father: PRSTNode, i: int): TRstNodeKind =
|
||||
result = rnLeaf
|
||||
if i < len(father): result = father.sons[i].kind
|
||||
|
||||
@@ -1328,7 +1328,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) =
|
||||
leave = true
|
||||
break
|
||||
if leave or p.tok[p.idx].kind == tkEof: break
|
||||
var a: PRstNode = nil
|
||||
var a: PRSTNode = nil
|
||||
var k = whichSection(p)
|
||||
case k
|
||||
of rnLiteralBlock:
|
||||
@@ -1359,7 +1359,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) =
|
||||
if sonKind(result, 0) == rnParagraph and sonKind(result, 1) != rnParagraph:
|
||||
result.sons[0].kind = rnInner
|
||||
|
||||
proc parseSectionWrapper(p: var TRstParser): PRstNode =
|
||||
proc parseSectionWrapper(p: var TRstParser): PRSTNode =
|
||||
result = newRstNode(rnInner)
|
||||
parseSection(p, result)
|
||||
while (result.kind == rnInner) and (len(result) == 1):
|
||||
@@ -1385,12 +1385,12 @@ type
|
||||
TDirFlag = enum
|
||||
hasArg, hasOptions, argIsFile, argIsWord
|
||||
TDirFlags = set[TDirFlag]
|
||||
TSectionParser = proc (p: var TRstParser): PRstNode {.nimcall.}
|
||||
TSectionParser = proc (p: var TRstParser): PRSTNode {.nimcall.}
|
||||
|
||||
proc parseDirective(p: var TRstParser, flags: TDirFlags): PRstNode =
|
||||
proc parseDirective(p: var TRstParser, flags: TDirFlags): PRSTNode =
|
||||
result = newRstNode(rnDirective)
|
||||
var args: PRstNode = nil
|
||||
var options: PRstNode = nil
|
||||
var args: PRSTNode = nil
|
||||
var options: PRSTNode = nil
|
||||
if hasArg in flags:
|
||||
args = newRstNode(rnDirArg)
|
||||
if argIsFile in flags:
|
||||
@@ -1420,7 +1420,7 @@ proc indFollows(p: TRstParser): bool =
|
||||
result = p.tok[p.idx].kind == tkIndent and p.tok[p.idx].ival > currInd(p)
|
||||
|
||||
proc parseDirective(p: var TRstParser, flags: TDirFlags,
|
||||
contentParser: TSectionParser): PRstNode =
|
||||
contentParser: TSectionParser): PRSTNode =
|
||||
result = parseDirective(p, flags)
|
||||
if not isNil(contentParser) and indFollows(p):
|
||||
pushInd(p, p.tok[p.idx].ival)
|
||||
@@ -1430,13 +1430,13 @@ proc parseDirective(p: var TRstParser, flags: TDirFlags,
|
||||
else:
|
||||
add(result, nil)
|
||||
|
||||
proc parseDirBody(p: var TRstParser, contentParser: TSectionParser): PRstNode =
|
||||
proc parseDirBody(p: var TRstParser, contentParser: TSectionParser): PRSTNode =
|
||||
if indFollows(p):
|
||||
pushInd(p, p.tok[p.idx].ival)
|
||||
result = contentParser(p)
|
||||
popInd(p)
|
||||
|
||||
proc dirInclude(p: var TRstParser): PRstNode =
|
||||
proc dirInclude(p: var TRstParser): PRSTNode =
|
||||
#
|
||||
#The following options are recognized:
|
||||
#
|
||||
@@ -1474,7 +1474,7 @@ proc dirInclude(p: var TRstParser): PRstNode =
|
||||
# InternalError("Too many binary zeros in include file")
|
||||
result = parseDoc(q)
|
||||
|
||||
proc dirCodeBlock(p: var TRstParser): PRstNode =
|
||||
proc dirCodeBlock(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {hasArg, hasOptions}, parseLiteralBlock)
|
||||
var filename = strip(getFieldValue(result, "file"))
|
||||
if filename != "":
|
||||
@@ -1485,34 +1485,34 @@ proc dirCodeBlock(p: var TRstParser): PRstNode =
|
||||
result.sons[2] = n
|
||||
result.kind = rnCodeBlock
|
||||
|
||||
proc dirContainer(p: var TRstParser): PRstNode =
|
||||
proc dirContainer(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {hasArg}, parseSectionWrapper)
|
||||
assert(result.kind == rnDirective)
|
||||
assert(len(result) == 3)
|
||||
result.kind = rnContainer
|
||||
|
||||
proc dirImage(p: var TRstParser): PRstNode =
|
||||
proc dirImage(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {hasOptions, hasArg, argIsFile}, nil)
|
||||
result.kind = rnImage
|
||||
|
||||
proc dirFigure(p: var TRstParser): PRstNode =
|
||||
proc dirFigure(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {hasOptions, hasArg, argIsFile},
|
||||
parseSectionWrapper)
|
||||
result.kind = rnFigure
|
||||
|
||||
proc dirTitle(p: var TRstParser): PRstNode =
|
||||
proc dirTitle(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {hasArg}, nil)
|
||||
result.kind = rnTitle
|
||||
|
||||
proc dirContents(p: var TRstParser): PRstNode =
|
||||
proc dirContents(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {hasArg}, nil)
|
||||
result.kind = rnContents
|
||||
|
||||
proc dirIndex(p: var TRstParser): PRstNode =
|
||||
proc dirIndex(p: var TRstParser): PRSTNode =
|
||||
result = parseDirective(p, {}, parseSectionWrapper)
|
||||
result.kind = rnIndex
|
||||
|
||||
proc dirRawAux(p: var TRstParser, result: var PRstNode, kind: TRstNodeKind,
|
||||
proc dirRawAux(p: var TRstParser, result: var PRSTNode, kind: TRstNodeKind,
|
||||
contentParser: TSectionParser) =
|
||||
var filename = getFieldValue(result, "file")
|
||||
if filename.len > 0:
|
||||
@@ -1527,7 +1527,7 @@ proc dirRawAux(p: var TRstParser, result: var PRstNode, kind: TRstNodeKind,
|
||||
result.kind = kind
|
||||
add(result, parseDirBody(p, contentParser))
|
||||
|
||||
proc dirRaw(p: var TRstParser): PRstNode =
|
||||
proc dirRaw(p: var TRstParser): PRSTNode =
|
||||
#
|
||||
#The following options are recognized:
|
||||
#
|
||||
@@ -1581,7 +1581,7 @@ proc parseDotDot(p: var TRstParser): PRstNode =
|
||||
# substitution definitions:
|
||||
inc(p.idx, 2)
|
||||
var a = getReferenceName(p, "|")
|
||||
var b: PRstNode
|
||||
var b: PRSTNode
|
||||
if p.tok[p.idx].kind == tkWhite: inc(p.idx)
|
||||
if cmpIgnoreStyle(p.tok[p.idx].symbol, "replace") == 0:
|
||||
inc(p.idx)
|
||||
@@ -1603,7 +1603,7 @@ proc parseDotDot(p: var TRstParser): PRstNode =
|
||||
else:
|
||||
result = parseComment(p)
|
||||
|
||||
proc resolveSubs(p: var TRstParser, n: PRstNode): PRstNode =
|
||||
proc resolveSubs(p: var TRstParser, n: PRSTNode): PRSTNode =
|
||||
result = n
|
||||
if n == nil: return
|
||||
case n.kind
|
||||
@@ -1634,7 +1634,7 @@ proc rstParse*(text, filename: string,
|
||||
line, column: int, hasToc: var bool,
|
||||
options: TRstParseOptions,
|
||||
findFile: TFindFileHandler = nil,
|
||||
msgHandler: TMsgHandler = nil): PRstNode =
|
||||
msgHandler: TMsgHandler = nil): PRSTNode =
|
||||
var p: TRstParser
|
||||
initParser(p, newSharedState(options, findFile, msgHandler))
|
||||
p.filename = filename
|
||||
|
||||
@@ -62,8 +62,8 @@ type
|
||||
# leaf val
|
||||
|
||||
|
||||
PRSTNode* = ref TRstNode ## an RST node
|
||||
TRstNodeSeq* = seq[PRstNode]
|
||||
PRSTNode* = ref TRSTNode ## an RST node
|
||||
TRstNodeSeq* = seq[PRSTNode]
|
||||
TRSTNode* {.acyclic, final.} = object ## an RST node's description
|
||||
kind*: TRstNodeKind ## the node's kind
|
||||
text*: string ## valid for leafs in the AST; and the title of
|
||||
@@ -71,25 +71,25 @@ type
|
||||
level*: int ## valid for some node kinds
|
||||
sons*: TRstNodeSeq ## the node's sons
|
||||
|
||||
proc len*(n: PRstNode): int =
|
||||
proc len*(n: PRSTNode): int =
|
||||
result = len(n.sons)
|
||||
|
||||
proc newRstNode*(kind: TRstNodeKind): PRstNode =
|
||||
proc newRstNode*(kind: TRstNodeKind): PRSTNode =
|
||||
new(result)
|
||||
result.sons = @[]
|
||||
result.kind = kind
|
||||
|
||||
proc newRstNode*(kind: TRstNodeKind, s: string): PRstNode =
|
||||
proc newRstNode*(kind: TRstNodeKind, s: string): PRSTNode =
|
||||
result = newRstNode(kind)
|
||||
result.text = s
|
||||
|
||||
proc lastSon*(n: PRstNode): PRstNode =
|
||||
proc lastSon*(n: PRSTNode): PRSTNode =
|
||||
result = n.sons[len(n.sons)-1]
|
||||
|
||||
proc add*(father, son: PRstNode) =
|
||||
proc add*(father, son: PRSTNode) =
|
||||
add(father.sons, son)
|
||||
|
||||
proc addIfNotNil*(father, son: PRstNode) =
|
||||
proc addIfNotNil*(father, son: PRSTNode) =
|
||||
if son != nil: add(father, son)
|
||||
|
||||
|
||||
@@ -98,9 +98,9 @@ type
|
||||
indent: int
|
||||
verbatim: int
|
||||
|
||||
proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string)
|
||||
proc renderRstToRst(d: var TRenderContext, n: PRSTNode, result: var string)
|
||||
|
||||
proc renderRstSons(d: var TRenderContext, n: PRstNode, result: var string) =
|
||||
proc renderRstSons(d: var TRenderContext, n: PRSTNode, result: var string) =
|
||||
for i in countup(0, len(n) - 1):
|
||||
renderRstToRst(d, n.sons[i], result)
|
||||
|
||||
@@ -132,7 +132,7 @@ proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) =
|
||||
var headline = ""
|
||||
renderRstSons(d, n, headline)
|
||||
|
||||
let lvl = repeatChar(headline.Len - d.indent, lvlToChar[n.level])
|
||||
let lvl = repeatChar(headline.len - d.indent, lvlToChar[n.level])
|
||||
result.add(lvl)
|
||||
result.add("\n")
|
||||
result.add(headline)
|
||||
@@ -281,7 +281,7 @@ proc renderRstToRst(d: var TRenderContext, n: PRstNode, result: var string) =
|
||||
else:
|
||||
result.add("Error: cannot render: " & $n.kind)
|
||||
|
||||
proc renderRstToRst*(n: PRstNode, result: var string) =
|
||||
proc renderRstToRst*(n: PRSTNode, result: var string) =
|
||||
## renders `n` into its string representation and appends to `result`.
|
||||
var d: TRenderContext
|
||||
renderRstToRst(d, n, result)
|
||||
|
||||
@@ -32,7 +32,7 @@ type
|
||||
outLatex # output is Latex
|
||||
|
||||
TTocEntry{.final.} = object
|
||||
n*: PRstNode
|
||||
n*: PRSTNode
|
||||
refname*, header*: string
|
||||
|
||||
TMetaEnum* = enum
|
||||
@@ -113,7 +113,7 @@ proc initRstGenerator*(g: var TRstGenerator, target: TOutputTarget,
|
||||
proc writeIndexFile*(g: var TRstGenerator, outfile: string) =
|
||||
if g.theIndex.len > 0: writeFile(outfile, g.theIndex)
|
||||
|
||||
proc addXmlChar(dest: var string, c: Char) =
|
||||
proc addXmlChar(dest: var string, c: char) =
|
||||
case c
|
||||
of '&': add(dest, "&")
|
||||
of '<': add(dest, "<")
|
||||
@@ -121,14 +121,14 @@ proc addXmlChar(dest: var string, c: Char) =
|
||||
of '\"': add(dest, """)
|
||||
else: add(dest, c)
|
||||
|
||||
proc addRtfChar(dest: var string, c: Char) =
|
||||
proc addRtfChar(dest: var string, c: char) =
|
||||
case c
|
||||
of '{': add(dest, "\\{")
|
||||
of '}': add(dest, "\\}")
|
||||
of '\\': add(dest, "\\\\")
|
||||
else: add(dest, c)
|
||||
|
||||
proc addTexChar(dest: var string, c: Char) =
|
||||
proc addTexChar(dest: var string, c: char) =
|
||||
case c
|
||||
of '_': add(dest, "\\_")
|
||||
of '{': add(dest, "\\symbol{123}")
|
||||
@@ -148,7 +148,7 @@ proc addTexChar(dest: var string, c: Char) =
|
||||
|
||||
var splitter*: string = "<wbr />"
|
||||
|
||||
proc escChar*(target: TOutputTarget, dest: var string, c: Char) {.inline.} =
|
||||
proc escChar*(target: TOutputTarget, dest: var string, c: char) {.inline.} =
|
||||
case target
|
||||
of outHtml: addXmlChar(dest, c)
|
||||
of outLatex: addTexChar(dest, c)
|
||||
@@ -196,7 +196,7 @@ proc dispA(target: TOutputTarget, dest: var string,
|
||||
if target != outLatex: addf(dest, xml, args)
|
||||
else: addf(dest, tex, args)
|
||||
|
||||
proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string)
|
||||
proc renderRstToOut*(d: var TRstGenerator, n: PRSTNode, result: var string)
|
||||
## Writes into ``result`` the rst ast ``n`` using the ``d`` configuration.
|
||||
##
|
||||
## Before using this proc you need to initialise a ``TRstGenerator`` with
|
||||
@@ -210,10 +210,10 @@ proc renderRstToOut*(d: var TRstGenerator, n: PRstNode, result: var string)
|
||||
## renderRstToOut(gen, rst, generatedHTML)
|
||||
## echo generatedHTML
|
||||
|
||||
proc renderAux(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderAux(d: PDoc, n: PRSTNode, result: var string) =
|
||||
for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], result)
|
||||
|
||||
proc renderAux(d: PDoc, n: PRstNode, frmtA, frmtB: string, result: var string) =
|
||||
proc renderAux(d: PDoc, n: PRSTNode, frmtA, frmtB: string, result: var string) =
|
||||
var tmp = ""
|
||||
for i in countup(0, len(n)-1): renderRstToOut(d, n.sons[i], tmp)
|
||||
if d.target != outLatex:
|
||||
@@ -232,7 +232,7 @@ proc setIndexTerm*(d: var TRstGenerator, id, term: string) =
|
||||
d.theIndex.add(id)
|
||||
d.theIndex.add("\n")
|
||||
|
||||
proc hash(n: PRstNode): int =
|
||||
proc hash(n: PRSTNode): int =
|
||||
if n.kind == rnLeaf:
|
||||
result = hash(n.text)
|
||||
elif n.len > 0:
|
||||
@@ -241,7 +241,7 @@ proc hash(n: PRstNode): int =
|
||||
result = result !& hash(n.sons[i])
|
||||
result = !$result
|
||||
|
||||
proc renderIndexTerm(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderIndexTerm(d: PDoc, n: PRSTNode, result: var string) =
|
||||
let id = rstnodeToRefname(n) & '_' & $abs(hash(n))
|
||||
var term = ""
|
||||
renderAux(d, n, term)
|
||||
@@ -314,13 +314,13 @@ proc mergeIndexes*(dir: string): string =
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
proc renderHeadline(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderHeadline(d: PDoc, n: PRSTNode, result: var string) =
|
||||
var tmp = ""
|
||||
for i in countup(0, len(n) - 1): renderRstToOut(d, n.sons[i], tmp)
|
||||
var refname = rstnodeToRefname(n)
|
||||
if d.hasToc:
|
||||
var length = len(d.tocPart)
|
||||
setlen(d.tocPart, length + 1)
|
||||
setLen(d.tocPart, length + 1)
|
||||
d.tocPart[length].refname = refname
|
||||
d.tocPart[length].n = n
|
||||
d.tocPart[length].header = tmp
|
||||
@@ -336,7 +336,7 @@ proc renderHeadline(d: PDoc, n: PRstNode, result: var string) =
|
||||
$n.level, refname, tmp,
|
||||
$chr(n.level - 1 + ord('A'))])
|
||||
|
||||
proc renderOverline(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderOverline(d: PDoc, n: PRSTNode, result: var string) =
|
||||
if d.meta[metaTitle].len == 0:
|
||||
for i in countup(0, len(n)-1):
|
||||
renderRstToOut(d, n.sons[i], d.meta[metaTitle])
|
||||
@@ -373,7 +373,7 @@ proc renderTocEntries*(d: var TRstGenerator, j: var int, lvl: int, result: var s
|
||||
else:
|
||||
result.add(tmp)
|
||||
|
||||
proc renderImage(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderImage(d: PDoc, n: PRSTNode, result: var string) =
|
||||
var options = ""
|
||||
var s = getFieldValue(n, "scale")
|
||||
if s != "": dispA(d.target, options, " scale=\"$1\"", " scale=$1", [strip(s)])
|
||||
@@ -396,13 +396,13 @@ proc renderImage(d: PDoc, n: PRstNode, result: var string) =
|
||||
[getArgument(n), options])
|
||||
if len(n) >= 3: renderRstToOut(d, n.sons[2], result)
|
||||
|
||||
proc renderSmiley(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderSmiley(d: PDoc, n: PRSTNode, result: var string) =
|
||||
dispA(d.target, result,
|
||||
"""<img src="/images/smilies/$1.gif" width="15"
|
||||
height="17" hspace="2" vspace="2" />""",
|
||||
"\\includegraphics{$1}", [n.text])
|
||||
|
||||
proc renderCodeBlock(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderCodeBlock(d: PDoc, n: PRSTNode, result: var string) =
|
||||
if n.sons[2] == nil: return
|
||||
var m = n.sons[2].sons[0]
|
||||
assert m.kind == rnLeaf
|
||||
@@ -433,7 +433,7 @@ proc renderCodeBlock(d: PDoc, n: PRstNode, result: var string) =
|
||||
deinitGeneralTokenizer(g)
|
||||
dispA(d.target, result, "</pre>", "\n\\end{rstpre}\n")
|
||||
|
||||
proc renderContainer(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderContainer(d: PDoc, n: PRSTNode, result: var string) =
|
||||
var tmp = ""
|
||||
renderRstToOut(d, n.sons[2], tmp)
|
||||
var arg = strip(getArgument(n))
|
||||
@@ -442,11 +442,11 @@ proc renderContainer(d: PDoc, n: PRstNode, result: var string) =
|
||||
else:
|
||||
dispA(d.target, result, "<div class=\"$1\">$2</div>", "$2", [arg, tmp])
|
||||
|
||||
proc texColumns(n: PRstNode): string =
|
||||
proc texColumns(n: PRSTNode): string =
|
||||
result = ""
|
||||
for i in countup(1, len(n)): add(result, "|X")
|
||||
|
||||
proc renderField(d: PDoc, n: PRstNode, result: var string) =
|
||||
proc renderField(d: PDoc, n: PRSTNode, result: var string) =
|
||||
var b = false
|
||||
if d.target == outLatex:
|
||||
var fieldname = addNodes(n.sons[0])
|
||||
@@ -456,7 +456,7 @@ proc renderField(d: PDoc, n: PRstNode, result: var string) =
|
||||
if d.meta[metaAuthor].len == 0:
|
||||
d.meta[metaAuthor] = fieldval
|
||||
b = true
|
||||
elif cmpIgnoreStyle(fieldName, "version") == 0:
|
||||
elif cmpIgnoreStyle(fieldname, "version") == 0:
|
||||
if d.meta[metaVersion].len == 0:
|
||||
d.meta[metaVersion] = fieldval
|
||||
b = true
|
||||
@@ -620,14 +620,14 @@ proc renderRstToOut(d: PDoc, n: PRstNode, result: var string) =
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
proc getVarIdx(varnames: openarray[string], id: string): int =
|
||||
proc getVarIdx(varnames: openArray[string], id: string): int =
|
||||
for i in countup(0, high(varnames)):
|
||||
if cmpIgnoreStyle(varnames[i], id) == 0:
|
||||
return i
|
||||
result = -1
|
||||
|
||||
proc formatNamedVars*(frmt: string, varnames: openarray[string],
|
||||
varvalues: openarray[string]): string =
|
||||
proc formatNamedVars*(frmt: string, varnames: openArray[string],
|
||||
varvalues: openArray[string]): string =
|
||||
var i = 0
|
||||
var L = len(frmt)
|
||||
result = ""
|
||||
@@ -646,7 +646,7 @@ proc formatNamedVars*(frmt: string, varnames: openarray[string],
|
||||
of '0'..'9':
|
||||
var j = 0
|
||||
while true:
|
||||
j = (j * 10) + Ord(frmt[i]) - ord('0')
|
||||
j = (j * 10) + ord(frmt[i]) - ord('0')
|
||||
inc(i)
|
||||
if i > L-1 or frmt[i] notin {'0'..'9'}: break
|
||||
if j > high(varvalues) + 1:
|
||||
|
||||
Reference in New Issue
Block a user