--stdout support; idetools implemented

This commit is contained in:
Araq 2011-02-25 01:53:58 +01:00
commit f8dd74a073
17 changed files with 188 additions and 112 deletions

View file

@ -275,7 +275,7 @@ proc semVar(c: PContext, n: PNode): PNode =
result = copyNode(n)
for i in countup(0, sonsLen(n)-1):
var a = n.sons[i]
if gCmd == cmdSuggest: suggestStmt(c, a)
if gCmd == cmdIdeTools: suggestStmt(c, a)
if a.kind == nkCommentStmt: continue
if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): IllFormedAst(a)
checkMinSonsLen(a, 3)
@ -332,7 +332,7 @@ proc semConst(c: PContext, n: PNode): PNode =
result = copyNode(n)
for i in countup(0, sonsLen(n) - 1):
var a = n.sons[i]
if gCmd == cmdSuggest: suggestStmt(c, a)
if gCmd == cmdIdeTools: suggestStmt(c, a)
if a.kind == nkCommentStmt: continue
if (a.kind != nkConstDef): IllFormedAst(a)
checkSonsLen(a, 3)
@ -485,7 +485,7 @@ proc SemTypeSection(c: PContext, n: PNode): PNode =
# we even look at the type definitions on the right
for i in countup(0, sonsLen(n) - 1):
var a = n.sons[i]
if gCmd == cmdSuggest: suggestStmt(c, a)
if gCmd == cmdIdeTools: suggestStmt(c, a)
if a.kind == nkCommentStmt: continue
if a.kind != nkTypeDef: IllFormedAst(a)
checkSonsLen(a, 3)
@ -795,7 +795,7 @@ proc SemStmt(c: PContext, n: PNode): PNode =
const # must be last statements in a block:
LastBlockStmts = {nkRaiseStmt, nkReturnStmt, nkBreakStmt, nkContinueStmt}
result = n
if gCmd == cmdSuggest:
if gCmd == cmdIdeTools:
suggestStmt(c, n)
if nfSem in n.flags: return
case n.kind