fixed some typos

This commit is contained in:
Araq
2013-03-05 21:36:06 +01:00
parent 16821e31be
commit 4f79e34a9a
3 changed files with 8 additions and 7 deletions

View File

@@ -740,7 +740,7 @@ proc discardCheck(result: PNode) =
# XXX too much work and fixing would break bootstrapping:
#Message(n.info, warnNilStatement)
result.typ = nil
elif not ImplicitelyDiscardable(result) and result.typ.kind != tyError and
elif not ImplicitlyDiscardable(result) and result.typ.kind != tyError and
gCmd != cmdInteractive:
localError(result.info, errDiscardValue)
@@ -1117,7 +1117,7 @@ proc semProcBody(c: PContext, n: PNode): PNode =
# ``result``:
if result.kind == nkSym and result.sym == c.p.resultSym:
nil
elif result.kind == nkNilLit or ImplicitelyDiscardable(result):
elif result.kind == nkNilLit or ImplicitlyDiscardable(result):
# intended semantic: if it's 'discardable' and the context allows for it,
# discard it. This is bad for chaining but nicer for C wrappers.
# ambiguous :-(

View File

@@ -1071,7 +1071,7 @@ proc destroyCase(c: PContext, n: PNode, holder: PNode): PNode =
result = nil
proc generateDestructor(c: PContext, t: PType): PNode =
## generate a destructor for a user-defined object ot tuple type
## generate a destructor for a user-defined object or tuple type
## returns nil if the destructor turns out to be trivial
template addLine(e: expr): stmt =
@@ -1106,7 +1106,7 @@ proc instantiateDestructor*(c: PContext, typ: PType): bool =
if t.destructor != nil:
# XXX: This is not entirely correct for recursive types, but we need
# it temporarily to hide the "destroy is alrady defined" problem
# it temporarily to hide the "destroy is already defined" problem
return t.destructor notin [AnalyzingDestructor, DestructorIsTrivial]
case t.kind
@@ -1205,7 +1205,7 @@ proc insertDestructors(c: PContext,
return
proc ImplicitelyDiscardable(n: PNode): bool =
proc ImplicitlyDiscardable(n: PNode): bool =
result = isCallExpr(n) and n.sons[0].kind == nkSym and
sfDiscardable in n.sons[0].sym.flags
@@ -1256,7 +1256,7 @@ proc semStmtList(c: PContext, n: PNode): PNode =
# a statement list (s; e) has the type 'e':
if result.kind == nkStmtList and result.len > 0:
var lastStmt = lastSon(result)
if lastStmt.kind != nkNilLit and not ImplicitelyDiscardable(lastStmt):
if lastStmt.kind != nkNilLit and not ImplicitlyDiscardable(lastStmt):
result.typ = lastStmt.typ
#localError(lastStmt.info, errGenerated,
# "Last expression must be explicitly returned if it " &

View File

@@ -3,7 +3,7 @@ version 0.9.2
- lazy overloading resolution:
* get rid of ``expr[typ]``, use perhaps ``static[typ]`` instead
* typedesc[T] needs to be documented in ast.nim
* special case ``tyStmt``
- FFI:
* test libffi on windows
* test: times.format with the FFI
@@ -131,3 +131,4 @@ Bugs
- the better scoping for locals is the wrong default for endb
- osproc execProcesses can deadlock if all processes fail (as experienced
in c++ mode)
- case statement exhaustiveness checking is still wrong