Skip to content

interpreter: implement missing binary operations (comparison, logical, unary) #18

Description

@Prestgg1

Goal

Implement all missing binary and unary operations in the interpreter.

Current State

interpreter/src/runner/binary_op.rs only handles 7 of 14 operations:

Implemented

  • Add, Subtract, Multiply, Divide, Modulo, Equal, NotEqual (partial)

Missing Operations

  • Not - logical negation
  • Greater, GreaterEqual, Less, LessEqual - comparison operators
  • And, Or - logical operators

Improvements Needed

  • Equal/NotEqual only compares Value::Number; all other types (Float, String, Bool, Char, List) return false
  • No cross-type comparisons (e.g. comparing integer to float)
  • No comparison support for string, bool, char, list values
  • The _ => Value::Bool(false) catch-all silently gives wrong results for unimplemented ops
  • TODO comment at line 4: //TODO: Burası güncellene bilinir

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions