wip
This commit is contained in:
parent
1ae5ba2536
commit
30b098fcaf
6 changed files with 10 additions and 8 deletions
|
|
@ -165,7 +165,7 @@ proc genGotoState(p: BProc, n: PNode) =
|
|||
statesCounter = n[1].intVal
|
||||
let prefix = if n.len == 3 and n[2].kind == nkStrLit: n[2].strVal.rope
|
||||
else: rope"STATE"
|
||||
for i in 0 .. statesCounter:
|
||||
for i in 0i64 .. statesCounter:
|
||||
lineF(p, cpsStmts, "case $2: goto $1$2;$n", [prefix, rope(i)])
|
||||
lineF(p, cpsStmts, "}$n", [])
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ proc semGenericStmt(c: PContext, n: PNode,
|
|||
considerQuotedIdent(fn).id notin ctx.toMixin:
|
||||
errorUndeclaredIdentifier(c, n.info, fn.renderTree)
|
||||
|
||||
var first = ord(withinConcept in flags)
|
||||
var first = int ord(withinConcept in flags)
|
||||
var mixinContext = false
|
||||
if s != nil:
|
||||
incl(s.flags, sfUsed)
|
||||
|
|
|
|||
|
|
@ -168,7 +168,9 @@ proc semTypeTraits(c: PContext, n: PNode): PNode =
|
|||
proc semOrd(c: PContext, n: PNode): PNode =
|
||||
result = n
|
||||
let parType = n.sons[1].typ
|
||||
if isOrdinalType(parType) or parType.kind == tySet:
|
||||
if isOrdinalType(parType):
|
||||
discard
|
||||
elif parType.kind == tySet:
|
||||
result.typ = makeRangeType(c, firstOrd(parType), lastOrd(parType), n.info)
|
||||
else:
|
||||
localError(n.info, errOrdinalTypeExpected)
|
||||
|
|
|
|||
|
|
@ -1004,7 +1004,7 @@ proc checkForMetaFields(n: PNode) =
|
|||
case t.kind
|
||||
of tySequence, tySet, tyArray, tyOpenArray, tyVar, tyPtr, tyRef,
|
||||
tyProc, tyGenericInvocation, tyGenericInst, tyAlias:
|
||||
let start = ord(t.kind in {tyGenericInvocation, tyGenericInst})
|
||||
let start = int ord(t.kind in {tyGenericInvocation, tyGenericInst})
|
||||
for i in start ..< t.sons.len:
|
||||
checkMeta(t.sons[i])
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType =
|
|||
if n.len < 1:
|
||||
result = newConstraint(c, kind)
|
||||
else:
|
||||
let isCall = ord(n.kind in nkCallKinds+{nkBracketExpr})
|
||||
let isCall = int ord(n.kind in nkCallKinds+{nkBracketExpr})
|
||||
let n = if n[0].kind == nkBracket: n[0] else: n
|
||||
checkMinSonsLen(n, 1)
|
||||
var t = semTypeNode(c, n.lastSon, nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue