renamefest

This commit is contained in:
Araq 2014-08-23 01:43:49 +02:00
commit 2f43fdb837
62 changed files with 342 additions and 343 deletions

View file

@ -23,7 +23,7 @@ type
gtTagStart, gtTagEnd, gtKey, gtValue, gtRawData, gtAssembler,
gtPreprocessor, gtDirective, gtCommand, gtRule, gtHyperlink, gtLabel,
gtReference, gtOther
TGeneralTokenizer* = object of TObject
TGeneralTokenizer* = object of RootObj
kind*: TTokenClass
start*, length*: int
buf: cstring

View file

@ -118,7 +118,7 @@ type
line*, col*: int # line and column of the token
TTokenSeq = seq[TToken]
TLexer = object of TObject
TLexer = object of RootObj
buf*: cstring
bufpos*: int
line*, col*, baseIndent*: int
@ -273,7 +273,7 @@ type
findFile: TFindFileHandler # How to find files.
PSharedState = ref TSharedState
TRstParser = object of TObject
TRstParser = object of RootObj
idx*: int
tok*: TTokenSeq
s*: PSharedState
@ -282,7 +282,7 @@ type
line*, col*: int
hasToc*: bool
EParseError* = object of EInvalidValue
EParseError* = object of ValueError
proc whichMsgClass*(k: TMsgKind): TMsgClass =
## returns which message class `k` belongs to.

View file

@ -42,7 +42,7 @@ type
TMetaEnum* = enum
metaNone, metaTitle, metaSubtitle, metaAuthor, metaVersion
TRstGenerator* = object of TObject
TRstGenerator* = object of RootObj
target*: TOutputTarget
config*: PStringTable
splitAfter*: int # split too long entries in the TOC
@ -1011,7 +1011,7 @@ proc formatNamedVars*(frmt: string, varnames: openArray[string],
inc(i)
if i > L-1 or frmt[i] notin {'0'..'9'}: break
if j > high(varvalues) + 1:
raise newException(EInvalidValue, "invalid index: " & $j)
raise newException(ValueError, "invalid index: " & $j)
num = j
add(result, varvalues[j - 1])
of 'A'..'Z', 'a'..'z', '\x80'..'\xFF':
@ -1024,13 +1024,13 @@ proc formatNamedVars*(frmt: string, varnames: openArray[string],
if idx >= 0:
add(result, varvalues[idx])
else:
raise newException(EInvalidValue, "unknown substitution var: " & id)
raise newException(ValueError, "unknown substitution var: " & id)
of '{':
var id = ""
inc(i)
while frmt[i] != '}':
if frmt[i] == '\0':
raise newException(EInvalidValue, "'}' expected")
raise newException(ValueError, "'}' expected")
add(id, frmt[i])
inc(i)
inc(i) # skip }
@ -1038,9 +1038,9 @@ proc formatNamedVars*(frmt: string, varnames: openArray[string],
var idx = getVarIdx(varnames, id)
if idx >= 0: add(result, varvalues[idx])
else:
raise newException(EInvalidValue, "unknown substitution var: " & id)
raise newException(ValueError, "unknown substitution var: " & id)
else:
raise newException(EInvalidValue, "unknown substitution: $" & $frmt[i])
raise newException(ValueError, "unknown substitution: $" & $frmt[i])
var start = i
while i < L:
if frmt[i] != '$': inc(i)