diff options
Diffstat (limited to 'compiler/parampatterns.nim')
-rw-r--r-- | compiler/parampatterns.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim index 283f83906..e94068776 100644 --- a/compiler/parampatterns.nim +++ b/compiler/parampatterns.nim @@ -42,7 +42,7 @@ const MaxStackSize* = 64 ## max required stack size by the VM proc patternError(n: PNode) = - LocalError(n.info, errIllFormedAstX, renderTree(n, {renderNoComments})) + localError(n.info, errIllFormedAstX, renderTree(n, {renderNoComments})) proc add(code: var TPatternCode, op: TOpcode) {.inline.} = add(code, chr(ord(op))) @@ -97,14 +97,14 @@ proc compileConstraints(p: PNode, result: var TPatternCode) = of "nosideeffect": result.add(ppNoSideEffect) else: # check all symkinds: - InternalAssert int(high(TSymKind)) < 255 + internalAssert int(high(TSymKind)) < 255 for i in low(TSymKind)..high(TSymKind): if cmpIgnoreStyle(($i).substr(2), spec) == 0: result.add(ppSymKind) result.add(chr(i.ord)) return # check all nodekinds: - InternalAssert int(high(TNodeKind)) < 255 + internalAssert int(high(TNodeKind)) < 255 for i in low(TNodeKind)..high(TNodeKind): if cmpIgnoreStyle($i, spec) == 0: result.add(ppNodeKind) @@ -124,8 +124,8 @@ proc semNodeKindConstraints*(p: PNode): PNode = if p.len >= 2: for i in 1.. <p.len: compileConstraints(p.sons[i], result.strVal) - if result.strVal.len > maxStackSize-1: - InternalError(p.info, "parameter pattern too complex") + if result.strVal.len > MaxStackSize-1: + internalError(p.info, "parameter pattern too complex") else: patternError(p) result.strVal.add(ppEof) @@ -216,12 +216,12 @@ proc isAssignable*(owner: PSym, n: PNode): TAssignableResult = of nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr: result = isAssignable(owner, n.sons[0]) else: - nil + discard proc matchNodeKinds*(p, n: PNode): bool = # matches the parameter constraint 'p' against the concrete AST 'n'. # Efficiency matters here. - var stack {.noinit.}: array[0..maxStackSize, bool] + var stack {.noinit.}: array[0..MaxStackSize, bool] # empty patterns are true: stack[0] = true var sp = 1 |