'use strict';

let parse     = require('../src/core/parser');
let d         = require('../src/util').logger('parseTests');


let inputs    = [
  '',
  '12\n',
  '123.21381720\n',
  '-10;',
  '-1231\n',
  '-10.231293;',
  '-123.2109480124\n',
  '(12);',
  '"as\dasd \t\'asdad\'\n"\n',
  'true\n',
  'false\n',
  'a;',
  'as;',
  '_123;',
  '_123\n',
  'let a = "mudit"\n',
  'let a = { 10; 20; }\n',
  'let a b c = { 10; }\n',
  'let a b c = {\n10\n}\n',
  'let a b c = { 10; 20; }\n',
  'let a b c = {\n10\n20\n}\n',
  'let a = 10; let b = "dude"; let x y z = { "lol"; true; }\n',
  'let a = 10\nlet b = "dude"\nlet x y z = {\n"lol"\ntrue\n}\n',
  'let a = fib 10;',
  'print 10;',
  'print 5 "-" 5;',
  'print 10 20;',
  'print 10 20\n',
  'print a b;',
  'print a b\n',
  'print a "asd";',
  'print 10 "asd"\n',
  'print true a\n',
  'let a = 10; let b x y = { print x y; }; b a 20;',
  'let a = 10\nlet b x y = { print x y; }\nb a 20\n',
  'let a b c = { print b c; }\na (10) 20\n',
  'let forever = { forever; }; forever;',
  '(10);',
  'print (fib 10);',
  'print (fib 10) 10 b c;',
  '\n if (true) { 1; } else { 2; };',
  '\nif (a < 2) {\n\tdosomething a\n} else {\n\tlet t = 10\n\tdosomeotherthing t\n}\n',
  'a + b;',
  '1+2\n',
  '(1-213);',
  '1/2\n10*2\n',
  'true && false;',
  '1 < 20;',
  '2 == 20\n',
  '!true;',
  '2 != 20\n',
  '1 + 2 + 5 - 4 / 6 * 10;',
  '2 < 20 || 3 > 40\n',
  '(2 < 20) || (3 > 40)\n',
  '2 == 2 || 3 >= 30;',
  '2 > 10 && 3 <= 20\n',
  '2 < !(4 <= 10)\n',
  'print (2-1);',
  'let m = {\n  let a =  m + 10\n}\n',
  '!true && (dothiss 20);',
  '2 - boom 10\n',
  'boom 10 - 2\n',
  '(2 - boom 10)\n',
  '(boom 12-boom 20)\n',
  '(boom 10 - boom 20)\n',
  'boom 10 - boom 20 / boom 30 * boom 40\n',
  '(boom 10 - boom 20 / boom 30 * boom 40) * 200\n',
  '1-9*10\n',
  '(1-9)*10;',
  '(1 + 2) / 20\n',
  'true && (v == 10);',
  '(a == b) && ( n < 10 )\n',
  '((n == 0))\n',
  '((n==0) && (n >= 1))\n',
  '(1-2) + (2*9) / (9-8);',
  '(fib (1-1)) + (fib (1-2));',
  '(fib (n-1) + fib (n-2));',
  'fib (n-1) + fib (n-2);',
  '(2) - 2\n',
  '2 - boom (2);',
  'boom (2) - 2\n',
  'fib 10 > 20;',
];

inputs.map(function(input) {
  d(input);
  d(JSON.stringify(parse(input), null, 4));
  d('\n');
});

@@ -148,24 +148,34 @@
 ,%0A  '12%5Cn',%0A
+  '1.2;',%0A
   '123.21381
@@ -1125,24 +1125,50 @@
 e %7B 2; %7D;',%0A
+  '%5Cn if (true) %7B 1; %7D;',%0A
   '%5Cnif (a %3C

Add more tests