Skip to content

Commit

Permalink
Removed fmt.Printf statements
Browse files Browse the repository at this point in the history
These were generally on error-paths, but they shouldn't be necessary.
  • Loading branch information
skx committed Nov 22, 2023
1 parent e549712 commit 2aa97a9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions evaluator/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,6 @@ func evalAssignStatement(ctx context.Context, a *ast.AssignStatement, env *objec

res := evalInfixExpression("+=", current, evaluated, env)
if isError(res) {
fmt.Printf("Error handling += %s\n", res.Inspect())
return res
}

Expand All @@ -697,7 +696,6 @@ func evalAssignStatement(ctx context.Context, a *ast.AssignStatement, env *objec

res := evalInfixExpression("-=", current, evaluated, env)
if isError(res) {
fmt.Printf("Error handling -= %s\n", res.Inspect())
return res
}

Expand All @@ -713,7 +711,6 @@ func evalAssignStatement(ctx context.Context, a *ast.AssignStatement, env *objec

res := evalInfixExpression("*=", current, evaluated, env)
if isError(res) {
fmt.Printf("Error handling *= %s\n", res.Inspect())
return res
}

Expand All @@ -730,7 +727,6 @@ func evalAssignStatement(ctx context.Context, a *ast.AssignStatement, env *objec

res := evalInfixExpression("/=", current, evaluated, env)
if isError(res) {
fmt.Printf("Error handling /= %s\n", res.Inspect())
return res
}

Expand Down
1 change: 0 additions & 1 deletion lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ func (l *Lexer) NextToken() token.Token {
tok.Type = token.REGEXP
tok.Literal = str
} else {
fmt.Printf("%s\n", err.Error())
tok.Type = token.REGEXP
tok.Literal = str
}
Expand Down
2 changes: 0 additions & 2 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ func (p *Parser) parseSwitchStatement() ast.Expression {

msg := fmt.Sprintf("expected token to be '{', got %s instead", p.curToken.Type)
p.errors = append(p.errors, msg)
fmt.Printf("error\n")
return nil
}

Expand All @@ -472,7 +471,6 @@ func (p *Parser) parseSwitchStatement() ast.Expression {
if !p.curTokenIs(token.RBRACE) {
msg := fmt.Sprintf("Syntax Error: expected token to be '}', got %s instead", p.curToken.Type)
p.errors = append(p.errors, msg)
fmt.Printf("error\n")
return nil

}
Expand Down

0 comments on commit 2aa97a9

Please sign in to comment.