prepare Nim codebase for upcoming parser changes

This commit is contained in:
Andreas Rumpf 2016-07-15 12:56:03 +02:00
commit 0834cd63d9
26 changed files with 46 additions and 46 deletions

View file

@ -18,7 +18,7 @@ type
RtArray*[T] = object ##
L: Natural
spart: seq[T]
apart: array [ArrayPartSize, T]
apart: array[ArrayPartSize, T]
UncheckedArray* {.unchecked.}[T] = array[0..100_000_000, T]
template usesSeqPart(x): expr = x.L > ArrayPartSize

View file

@ -126,7 +126,7 @@ type
TJsonParser: JsonParser, TTokKind: TokKind].}
const
errorMessages: array [JsonError, string] = [
errorMessages: array[JsonError, string] = [
"no error",
"invalid token",
"string expected",
@ -139,7 +139,7 @@ const
"EOF expected",
"expression expected"
]
tokToStr: array [TokKind, string] = [
tokToStr: array[TokKind, string] = [
"invalid token",
"EOF",
"string literal",

View file

@ -61,7 +61,7 @@ type
lvlNone ## no levels active
const
LevelNames*: array [Level, string] = [
LevelNames*: array[Level, string] = [
"DEBUG", "DEBUG", "INFO", "NOTICE", "WARN", "ERROR", "FATAL", "NONE"
]

View file

@ -27,7 +27,7 @@ const
tickCountCorrection = 50_000
when not declared(system.StackTrace):
type StackTrace = array [0..20, cstring]
type StackTrace = array[0..20, cstring]
{.deprecated: [TStackTrace: StackTrace].}
# We use a simple hash table of bounded size to keep track of the stack traces:
@ -35,7 +35,7 @@ type
ProfileEntry = object
total: int
st: StackTrace
ProfileData = array [0..64*1024-1, ptr ProfileEntry]
ProfileData = array[0..64*1024-1, ptr ProfileEntry]
{.deprecated: [TProfileEntry: ProfileEntry, TProfileData: ProfileData].}
proc `==`(a, b: StackTrace): bool =

View file

@ -1122,7 +1122,7 @@ proc parseCmdLine*(c: string): seq[string] {.
while true:
setLen(a, 0)
# eat all delimiting whitespace
while c[i] == ' ' or c[i] == '\t' or c [i] == '\l' or c [i] == '\r' : inc(i)
while c[i] == ' ' or c[i] == '\t' or c[i] == '\l' or c[i] == '\r' : inc(i)
when defined(windows):
# parse a single argument according to the above rules:
if c[i] == '\0': break

View file

@ -721,7 +721,7 @@ elif not defined(useNimRtl):
env: StringTableRef = nil,
options: set[ProcessOption] = {poStdErrToStdOut}): Process =
var
pStdin, pStdout, pStderr: array [0..1, cint]
pStdin, pStdout, pStderr: array[0..1, cint]
new(result)
result.options = options
result.exitCode = -3 # for ``waitForExit``

View file

@ -384,7 +384,7 @@ proc setForegroundColor*(f: File, fg: ForegroundColor, bright=false) =
var old = getAttributes(h) and not 0x0007
if bright:
old = old or FOREGROUND_INTENSITY
const lookup: array [ForegroundColor, int] = [
const lookup: array[ForegroundColor, int] = [
0,
(FOREGROUND_RED),
(FOREGROUND_GREEN),
@ -406,7 +406,7 @@ proc setBackgroundColor*(f: File, bg: BackgroundColor, bright=false) =
var old = getAttributes(h) and not 0x0070
if bright:
old = old or BACKGROUND_INTENSITY
const lookup: array [BackgroundColor, int] = [
const lookup: array[BackgroundColor, int] = [
0,
(BACKGROUND_RED),
(BACKGROUND_GREEN),

View file

@ -477,7 +477,7 @@ when not defined(JS):
# our own procs on top of that:
proc tmToTimeInfo(tm: StructTM, local: bool): TimeInfo =
const
weekDays: array [0..6, WeekDay] = [
weekDays: array[0..6, WeekDay] = [
dSun, dMon, dTue, dWed, dThu, dFri, dSat]
when defined(freebsd) or defined(netbsd) or defined(openbsd):
TimeInfo(second: int(tm.second),
@ -523,7 +523,7 @@ when not defined(JS):
proc timeInfoToTM(t: TimeInfo): StructTM =
const
weekDays: array [WeekDay, int8] = [1'i8,2'i8,3'i8,4'i8,5'i8,6'i8,0'i8]
weekDays: array[WeekDay, int8] = [1'i8,2'i8,3'i8,4'i8,5'i8,6'i8,0'i8]
result.second = t.second
result.minute = t.minute
result.hour = t.hour
@ -652,7 +652,7 @@ elif defined(JS):
return newDate()
const
weekDays: array [0..6, WeekDay] = [
weekDays: array[0..6, WeekDay] = [
dSun, dMon, dTue, dWed, dThu, dFri, dSat]
proc getLocalTime(t: Time): TimeInfo =