Permalink
Browse files

Nael now works with latest Nimrod compiler (`do` is now a nimrod keyw…

…ord). Some other really old changes too.
  • Loading branch information...
1 parent 1e72283 commit a30f0b26160ba7b2355a4eb3eba31783809f2004 @dom96 committed Mar 14, 2012
Showing with 10 additions and 10 deletions.
  1. +8 −8 src/core.nim
  2. +2 −2 src/lexer.nim
View
@@ -167,22 +167,22 @@ proc command*(cmnd: string, dataStack: var TStack, vars, gvars: var PType) =
of "while":
# Loop until cond becomes false
# (cond) (do) while
- var do = dataStack.pop()
+ var doAction = dataStack.pop()
var cond = dataStack.pop()
- if do.kind == ntQuot and cond.kind == ntQuot:
+ if doAction.kind == ntQuot and cond.kind == ntQuot:
interpretQuotation(cond, dataStack, vars, gvars)
var boolean = dataStack.pop()
if boolean.kind != ntBool:
raise invalidTypeErr($boolean.kind, "bool", "while")
while boolean.bValue:
- interpretQuotation(do, dataStack, vars, gvars)
+ interpretQuotation(doAction, dataStack, vars, gvars)
interpretQuotation(cond, dataStack, vars, gvars)
boolean = dataStack.pop()
else:
- raise invalidTypeErr($do.kind & " and " & $cond.kind, "quot and quot", "while")
+ raise invalidTypeErr($doAction.kind & " and " & $cond.kind, "quot and quot", "while")
of "==":
var first = dataStack.pop()
@@ -308,10 +308,10 @@ proc command*(cmnd: string, dataStack: var TStack, vars, gvars: var PType) =
var list = dataStack.pop()
if index.kind == ntInt and list.kind == ntlist:
# WTF, something is really wrong with exceptions
- #try:
- dataStack.push(list.lValue[int(index.iValue)])
- #except:
- # raise newException(ERuntimeError, "Error: $1" % [getCurrentExceptionMsg()])
+ try:
+ dataStack.push(list.lValue[int(index.iValue)])
+ except:
+ raise newException(ERuntimeError, "Error: $1" % [getCurrentExceptionMsg()])
else:
raise invalidTypeErr($index.kind & " and " & $list.kind, "int and list", "nth")
View
@@ -153,8 +153,8 @@ proc analyse*(code: string): seq[TTokens] =
inc(i)
when isMainModule:
- for i, cL, cC in items(analyse("func foo [arg] (print);")):
+ for i, cL, cC in items(analyse("func foo [arg] (((\"test\" print) call) call);")):
if i != "":
echo(i)
else:
- echo("<>EMPTY<>")
+ echo("<>EMPTY<>")

0 comments on commit a30f0b2

Please sign in to comment.