fixed recently introduced parser bugs

This commit is contained in:
Araq
2012-11-26 19:31:55 +01:00
parent 2591ac0ada
commit c43bf78000

View File

@@ -738,7 +738,7 @@ proc isExprStart(p: TParser): bool =
of tkSymbol, tkAccent, tkOpr, tkNot, tkNil, tkCast, tkIf,
tkProc, tkIterator, tkBind,
tkParLe, tkBracketLe, tkCurlyLe, tkIntLit..tkCharLit, tkVar, tkRef, tkPtr,
tkTuple, tkType, tkWhen, tkCase, tkShared:
tkTuple, tkObject, tkType, tkWhen, tkCase, tkShared:
result = true
else: result = false
@@ -790,7 +790,7 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode =
of tkPtr: result = parseTypeDescKAux(p, nkPtrTy, mode)
of tkShared: result = parseTypeDescKAux(p, nkSharedTy, mode)
of tkType: result = parseTypeDescKAux(p, nkTypeOfExpr, mode)
of tkTuple: result = parseTuple(p)
of tkTuple: result = parseTuple(p, mode == pmTypeDef)
of tkProc: result = parseProcExpr(p, mode notin {pmTypeDesc, pmTypeDef})
of tkIterator:
if mode in {pmTypeDesc, pmTypeDef}: