<commit_before>package org.moe.interpreter

import org.moe.runtime._
import org.moe.ast._

object Interpreter {

    def eval ( env : MoeEnvironment, node : AST ): Unit = {
        node match {
            // containers

            case CompilationUnitNode ( body  ) => eval( env, body )
            case StatementsNode      ( nodes ) => nodes.foreach( (n) => eval( env, n ) )
            case ScopeNode           ( body  ) => eval( new MoeEnvironment( env ), body )

            // literals

            case LiteralNode ( value ) => { }

            case SelfLiteralNode  () => { }
            case ClassLiteralNode () => { }
            case SuperLiteralNode () => { }

            case PairLiteralNode ( key, value ) => { }

            case ArrayLiteralNode ( values ) => { }
            case HashLiteralNode  ( map    ) => { }

            // unary operators

            case IncrementNode ( reciever ) => { }
            case DecrementNode ( reciever ) => { }
            case NotNode       ( reciever ) => { }

            // binary operators

            case AndNode ( lhs, rhs ) => { }
            case OrNode  ( lhs, rhs ) => { }

            // value lookup, assignment and declaration

            case ClassAccessNode      ( name ) => { }
            case ClassDeclarationNode ( name, superclass, body ) => { }

            case PackageDeclarationNode ( name, body ) => { }

            case ConstructorDeclarationNode ( params, body ) => { }
            case DestructorDeclarationNode  ( params, body ) => { }

            case MethodDeclarationNode     ( name, params, body ) => { }
            case SubroutineDeclarationNode ( name, params, body ) => { }

            case AttributeAccessNode      ( name             ) => { }
            case AttributeAssignmentNode  ( name, expression ) => { }
            case AttributeDeclarationNode ( name, expression ) => { }

            case VariableAccessNode      ( name             ) => { }
            case VariableAssignmentNode  ( name, expression ) => { }
            case VariableDeclarationNode ( name, expression ) => { }

            // operations

            case MethodCallNode     ( invocant, method_name, args ) => { }
            case SubroutineCallNode ( function_name, args ) => { }

            // statements

            case IfNode          ( if_condition, if_body ) => { }
            case IfElseNode      ( if_condition, if_body, else_body ) => { }
            case IfElsifNode     ( if_condition, if_body, elsif_condition, elsif_body ) => { }
            case IfElsifElseNode ( if_condition, if_body, elsif_condition, elsif_body, else_body ) => { }

            case UnlessNode     ( unless_condition, unless_body ) => { }
            case UnlessElseNode ( unless_condition, unless_body, else_body ) => { }

            case TryNode     ( body, catch_nodes, finally_nodes ) => { }
            case CatchNode   ( type_name, local_name, body ) => { }
            case FinallyNode ( body ) => { }

            case WhileNode   ( condition, body ) => { }
            case DoWhileNode ( condition, body ) => { }

            case ForeachNode ( topic, list, body ) => { }
            case ForNode ( init, condition, update, body ) => { }
        }
    }

}<commit_msg>sketching out the interpreter<commit_after>package org.moe.interpreter

import org.moe.runtime._
import org.moe.ast._

object Interpreter {

      val stub = new MoeObject()

      def eval ( env : MoeEnvironment, node : AST ): MoeObject = {
            node match {
                  // containers

                  case CompilationUnitNode ( body  ) => eval( env, body )
                  case ScopeNode           ( body  ) => eval( new MoeEnvironment( env ), body )
                  case StatementsNode      ( nodes ) => {
                        var result : MoeObject = Runtime.NativeObjects.getUndef()
                        for ( val node <- nodes ) {
                              result = eval( env, node )
                        }
                        result
                  }

                  // literals

                  case IntLiteralNode     ( value ) => Runtime.NativeObjects.getInt( value )
                  case FloatLiteralNode   ( value ) => Runtime.NativeObjects.getFloat( value )
                  case StringLiteralNode  ( value ) => Runtime.NativeObjects.getString( value )
                  case BooleanLiteralNode ( value ) => value match {
                        case true  => Runtime.NativeObjects.getTrue()
                        case false => Runtime.NativeObjects.getFalse()
                  }

                  case UndefLiteralNode () => Runtime.NativeObjects.getUndef()
                  case SelfLiteralNode  () => env.getCurrentInvocant()
                  case ClassLiteralNode () => env.getCurrentClass()
                  case SuperLiteralNode () => env.getCurrentClass().getSuperclass() match {
                        case s:MoeClass => s
                        case _          => throw new Runtime.Errors.SuperclassNotFound("")
                  }

                  case PairLiteralNode ( key, value ) => stub

                  case ArrayLiteralNode ( values ) => stub
                  case HashLiteralNode  ( map    ) => stub

                  // unary operators

                  case IncrementNode ( reciever ) => stub
                  case DecrementNode ( reciever ) => stub
                  case NotNode       ( reciever ) => stub

                  // binary operators

                  case AndNode ( lhs, rhs ) => stub
                  case OrNode  ( lhs, rhs ) => stub

                  // value lookup, assignment and declaration

                  case ClassAccessNode      ( name ) => stub
                  case ClassDeclarationNode ( name, superclass, body ) => stub

                  case PackageDeclarationNode ( name, body ) => stub

                  case ConstructorDeclarationNode ( params, body ) => stub
                  case DestructorDeclarationNode  ( params, body ) => stub

                  case MethodDeclarationNode     ( name, params, body ) => stub
                  case SubroutineDeclarationNode ( name, params, body ) => stub

                  case AttributeAccessNode      ( name             ) => stub
                  case AttributeAssignmentNode  ( name, expression ) => stub
                  case AttributeDeclarationNode ( name, expression ) => stub

                  case VariableAccessNode      ( name             ) => stub
                  case VariableAssignmentNode  ( name, expression ) => stub
                  case VariableDeclarationNode ( name, expression ) => stub

                  // operations

                  case MethodCallNode     ( invocant, method_name, args ) => stub
                  case SubroutineCallNode ( function_name, args ) => stub

                  // statements

                  case IfNode          ( if_condition, if_body ) => stub
                  case IfElseNode      ( if_condition, if_body, else_body ) => stub
                  case IfElsifNode     ( if_condition, if_body, elsif_condition, elsif_body ) => stub
                  case IfElsifElseNode ( if_condition, if_body, elsif_condition, elsif_body, else_body ) => stub

                  case UnlessNode     ( unless_condition, unless_body ) => stub
                  case UnlessElseNode ( unless_condition, unless_body, else_body ) => stub

                  case TryNode     ( body, catch_nodes, finally_nodes ) => stub
                  case CatchNode   ( type_name, local_name, body ) => stub
                  case FinallyNode ( body ) => stub

                  case WhileNode   ( condition, body ) => stub
                  case DoWhileNode ( condition, body ) => stub

                  case ForeachNode ( topic, list, body ) => stub
                  case ForNode ( init, condition, update, body ) => stub
            }
      }

}
{'fraction_non_alphanumeric': 0.08925410872313527, 'fraction_numerical': 0.0, 'mean_word_length': 1.474507350641226, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 98, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '525641', 'n_tokens_mistral': 1965, 'n_tokens_neox': 1845, 'n_words': 512}