Skip to content

Commit

Permalink
notes on upcoming method conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevan Little committed Feb 17, 2013
1 parent 450f596 commit 8aada24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/scala/org/moe/interpreter/Interpreter.scala
Expand Up @@ -152,6 +152,8 @@ class Interpreter {

// unary operators

// TODO - these three should be converted to methods of Int,Float and String

case IncrementNode(receiver: AST, is_prefix) => receiver match {
case VariableAccessNode(varName) => env.get(varName).getOrElse(
throw new MoeErrors.VariableNotFound(varName)
Expand Down Expand Up @@ -190,6 +192,7 @@ class Interpreter {
}
}

// TODO - these should be converted to method of Any
case NotNode(receiver) => {
if(eval(runtime, env, receiver).isTrue) {
getFalse
Expand All @@ -200,6 +203,8 @@ class Interpreter {

// binary operators

// TODO - these two should be converted to methods of Any

case AndNode(lhs, rhs) => {
val left_result = eval(runtime, env, lhs)
if(left_result.isTrue) {
Expand All @@ -218,6 +223,8 @@ class Interpreter {
}
}

// TODO - these two should be converted to methods of Int,Float and String

case LessThanNode(lhs, rhs) => {
val lhs_result: Double = eval(runtime, env, lhs).unboxToDouble.get
val rhs_result: Double = eval(runtime, env, rhs).unboxToDouble.get
Expand Down

0 comments on commit 8aada24

Please sign in to comment.