Skip to content

Commit

Permalink
the errors are working now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonak-Adipta-Kalita committed Apr 9, 2023
1 parent 4acae2a commit 1e66430
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion evaluator/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ func Eval(node ast.Node, env *object.Environment) object.Object {
case *ast.ForLoopExpression:
return evalForLoopExpression(node, env)
case *ast.PostfixExpression:
return evalPostfixExpression(env, node.Operator, node)
res := evalPostfixExpression(env, node.Operator, node)
if isError(res) {
fmt.Fprintf(os.Stderr, "%s\n", res.Inspect())
return NULL
} else {
return res
}
}
return nil
}
Expand Down

0 comments on commit 1e66430

Please sign in to comment.