somewhat better 'suggest'

This commit is contained in:
Araq
2011-02-21 01:07:12 +01:00
parent 7bc95676ac
commit 4e7a22cac3
6 changed files with 12 additions and 4 deletions

View File

@@ -104,7 +104,6 @@ proc existsConfigVar*(key: string): bool
proc getConfigVar*(key: string): string
proc setConfigVar*(key, val: string)
proc addImplicitMod*(filename: string)
proc getOutFile*(filename, ext: string): string
proc binaryStrSearch*(x: openarray[string], y: string): int
# implementation
@@ -117,7 +116,7 @@ proc getConfigVar(key: string): string =
proc setConfigVar(key, val: string) =
nstrtabs.put(gConfigVars, key, val)
proc getOutFile(filename, ext: string): string =
proc getOutFile*(filename, ext: string): string =
if options.outFile != "": result = options.outFile
else: result = changeFileExt(filename, ext)

View File

@@ -67,6 +67,7 @@ proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags = {}): PNode
L: int
a: PNode
result = n
if gCmd == cmdSuggest: suggestStmt(c, n)
case n.kind
of nkIdent:
var s = SymtabGet(c.Tab, n.ident)

View File

@@ -275,6 +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 a.kind == nkCommentStmt: continue
if (a.kind != nkIdentDefs) and (a.kind != nkVarTuple): IllFormedAst(a)
checkMinSonsLen(a, 3)
@@ -331,6 +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 a.kind == nkCommentStmt: continue
if (a.kind != nkConstDef): IllFormedAst(a)
checkSonsLen(a, 3)
@@ -483,6 +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 a.kind == nkCommentStmt: continue
if a.kind != nkTypeDef: IllFormedAst(a)
checkSonsLen(a, 3)

View File

@@ -2,6 +2,7 @@ discard """
file: "t99bott.nim"
line: 25
errormsg: "constant expression expected"
disabled: true
"""
## 99 Bottles of Beer
## http://www.99-bottles-of-beer.net/

View File

@@ -1,5 +1,5 @@
- 'suggest' needs tweaking: more places in the semantic checking
need to take it into account
- 'suggest' needs tweaking: support for '.'
- stdout support for doc, pretty
- thread support: threadvar on Windows seems broken;
add --deadlock_prevention:on|off switch

View File

@@ -61,6 +61,10 @@ case $ucpu in
*sparc*|*sun* )
mycpu="sparc" ;;
*ppc64* )
if [ "$myos" = "linux" ] ; then
COMP_FLAGS="$COMP_FLAGS -m64"
LINK_FLAGS="$LINK_FLAGS -m64"
fi
mycpu="powerpc64" ;;
*power*|*Power* )
mycpu="powerpc" ;;