       when tok_unary
         @getNextToken()
         if !isascii(@curTok)
-          return ErrorP("Expected unary operator")
+          throw new Error("Expected unary operator")
         FnName = "unary" + @curTok
         Kind = 1
         @getNextToken()
       when tok_binary
         @getNextToken()
         if !isascii(@curTok)
-          return ErrorP("Expected binary operator")
+          return Error("Expected binary operator")
         FnName = "binary" + @curTok
         Kind = 2
         @getNextToken()
         
         # Read the precedence if present.
         if @curTok == tok_number
-          if NumVal < 1 || NumVal > 100
-            return ErrorP("Invalid precedence: must be 1..100")
-          BinaryPrecedence = NumVal
+          if @lexer.value < 1 || @lexer.value > 100
+            throw new Error("Invalid precedence: must be 1..100")
+          BinaryPrecedence = @lexer.value
           @getNextToken()
       else
-        return ErrorP("Expected function name in prototype")
+        throw new Error("Expected function name in prototype")
 
     if @curTok != '('
-      return ErrorP("Expected '(' in prototype")
+      throw new Error("Expected '(' in prototype")
     
     ArgNames = []
     while @getNextToken() == tok_identifier

  OperandV = @operand.Codegen()
  if not OperandV then return null
  
  F = TheModule.getFunction("unary"+@Opcode)
  if not F
    throw new Error("Unknown unary operator")
  
  return Builder.CreateCall(F, OperandV, "unop")

BinaryExprAST::Codegen = ->
  # Special case '=' because we don't want to emit the LHS as an expression.

  
  # If this is an operator, install it.
  if @Proto.isBinaryOp()
    parser.binopPrecedence[@Proto.getOperatorName()] = @Proto.precedence
  
  # Create a new basic block to start insertion into.
  BB = TheFunction.addBasicBlock("entry")
