fixed some typos

This commit is contained in:
Araq 2013-03-05 21:36:06 +01:00
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: # XXX too much work and fixing would break bootstrapping:
#Message(n.info, warnNilStatement) #Message(n.info, warnNilStatement)
result.typ = nil 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: gCmd != cmdInteractive:
localError(result.info, errDiscardValue) localError(result.info, errDiscardValue)
@ -1117,7 +1117,7 @@ proc semProcBody(c: PContext, n: PNode): PNode =
# ``result``: # ``result``:
if result.kind == nkSym and result.sym == c.p.resultSym: if result.kind == nkSym and result.sym == c.p.resultSym:
nil 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, # intended semantic: if it's 'discardable' and the context allows for it,
# discard it. This is bad for chaining but nicer for C wrappers. # discard it. This is bad for chaining but nicer for C wrappers.
# ambiguous :-( # ambiguous :-(

View file

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

View file

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