<commit_before>﻿namespace IronJS.REPL

module Main = 

  open System
  open IronJS
  open IronJS.Compiler
  open IronJS.Compiler.Core

  let main () =

    let ctx = IronJS.Hosting.Context.Create()

    ctx.Execute @"
      var a = 1;

      switch(a) {
        case 1:
          print('1');
      
        case 2:
          print('2');

        default:
          print('default');

        case 3:
          print('3');
          break;

        case 4:
          print('4');
          break;
      }

    " |> ignore

    Console.ReadLine() |> ignore

  main() |> ignore<commit_msg>Changes to REPL<commit_after>﻿namespace IronJS.REPL

module Main = 

  open System
  open IronJS
  open IronJS.Compiler
  open IronJS.Compiler.Core

  let main () =
    #if DEBUG
    #else
    System.Threading.Thread.CurrentThread.Priority <- System.Threading.ThreadPriority.Highest
    #endif

    let ctx = IronJS.Hosting.Context.Create()
    let src = @"function foo(a, b) {
	      var c = 3;

	      function bar() {
		      return a + b + c + d;
	      }

	      function zoo() {  
		      if(true) {
			      return false;
		      } else {
			      return true;
		      }
	      }

	      return bar() + zoo();
      }"

    let ast = src |> IronJS.Compiler.Parser.parseString ctx.Environment

    FSKit.Perf.time "IronJS" (fun () ->
      for i = 0 to 10000 do
         src |> IronJS.Compiler.Parser.parseString ctx.Environment |> ignore
    )

    Console.ReadLine() |> ignore

  main() |> ignore
{'fraction_non_alphanumeric': 0.11618535930154467, 'fraction_numerical': 0.010745466756212223, 'mean_word_length': 1.7140255009107468, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 12, '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': '5686454', 'n_tokens_mistral': 518, 'n_tokens_neox': 455, 'n_words': 115}