diff options
Diffstat (limited to 'compiler/syntaxes.nim')
-rw-r--r-- | compiler/syntaxes.nim | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/syntaxes.nim b/compiler/syntaxes.nim index 3b67b3263..59016b2b6 100644 --- a/compiler/syntaxes.nim +++ b/compiler/syntaxes.nim @@ -85,20 +85,20 @@ proc parsePipe(filename: AbsoluteFile, inputStream: PLLStream; cache: IdentCache llStreamClose(s) proc getFilter(ident: PIdent): TFilterKind = - for i in low(TFilterKind) .. high(TFilterKind): + for i in low(TFilterKind)..high(TFilterKind): if cmpIgnoreStyle(ident.s, filterNames[i]) == 0: return i result = filtNone proc getParser(conf: ConfigRef; n: PNode; ident: PIdent): TParserKind = - for i in low(TParserKind) .. high(TParserKind): + for i in low(TParserKind)..high(TParserKind): if cmpIgnoreStyle(ident.s, parserNames[i]) == 0: return i localError(conf, n.info, "unknown parser: " & ident.s) proc getCallee(conf: ConfigRef; n: PNode): PIdent = - if n.kind in nkCallKinds and n.sons[0].kind == nkIdent: - result = n.sons[0].ident + if n.kind in nkCallKinds and n[0].kind == nkIdent: + result = n[0].ident elif n.kind == nkIdent: result = n.ident else: @@ -131,13 +131,13 @@ proc evalPipe(p: var TParsers, n: PNode, filename: AbsoluteFile, result = start if n.kind == nkEmpty: return if n.kind == nkInfix and n[0].kind == nkIdent and n[0].ident.s == "|": - for i in 1 .. 2: - if n.sons[i].kind == nkInfix: - result = evalPipe(p, n.sons[i], filename, result) + for i in 1..2: + if n[i].kind == nkInfix: + result = evalPipe(p, n[i], filename, result) else: - result = applyFilter(p, n.sons[i], filename, result) + result = applyFilter(p, n[i], filename, result) elif n.kind == nkStmtList: - result = evalPipe(p, n.sons[0], filename, result) + result = evalPipe(p, n[0], filename, result) else: result = applyFilter(p, n, filename, result) @@ -168,7 +168,7 @@ proc setupParsers*(p: var TParsers; fileIdx: FileIndex; cache: IdentCache; openParsers(p, fileIdx, llStreamOpen(f), cache, config) result = true -proc parseFile*(fileIdx: FileIndex; cache: IdentCache; config: ConfigRef): PNode {.procvar.} = +proc parseFile*(fileIdx: FileIndex; cache: IdentCache; config: ConfigRef): PNode = var p: TParsers if setupParsers(p, fileIdx, cache, config): result = parseAll(p) |