diff --git a/examples/99bottles.hco b/examples/99bottles.hco index 4c377a0f..ffe6e81f 100644 --- a/examples/99bottles.hco +++ b/examples/99bottles.hco @@ -2,9 +2,9 @@ let plural = "s"; let i = 99; while (i >= 0) { - print(toString(i) + " bottle" + plural + " of beer on the wall"); - print(toString(i) + " bottle" + plural + " of beer!"); - print("Take one down, pass it around!"); + printLn(toString(i) + " bottle" + plural + " of beer on the wall"); + printLn(toString(i) + " bottle" + plural + " of beer!"); + printLn("Take one down, pass it around!"); if (i - 1 == 1) { plural = ""; @@ -12,11 +12,11 @@ while (i >= 0) if (i > 1) { - print(toString(i - 1) + " bottle" + plural + " of beer on the wall!"); + printLn(toString(i - 1) + " bottle" + plural + " of beer on the wall!"); } else { - print("No more bottles of beer on the wall!"); + printLn("No more bottles of beer on the wall!"); } i--; } diff --git a/examples/ackerman.hco b/examples/ackerman.hco index 77cee0fd..3acac6bd 100644 --- a/examples/ackerman.hco +++ b/examples/ackerman.hco @@ -19,7 +19,7 @@ while (m <= 0) /* We keep this to 0 as the application stack size is not big en while (n < 6 - m) { let text = "A(" + m + ", " + n + ") = " + ackermann(m, n); - print(text); + printLn(text); n++; } m++; diff --git a/examples/array.hco b/examples/array.hco index c5e69026..8167bf96 100644 --- a/examples/array.hco +++ b/examples/array.hco @@ -12,15 +12,15 @@ while (i < 10) let i = 0; while (i < 10) { - print(list[i]); + printLn(list[i]); i++; } -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); let universe = array(); universe["Galaxy"]["Earth"] = "Hello Earth!"; universe["Galaxy"]["Mars"] = "Hello Mars!"; -print(universe["Galaxy"]["Earth"]); -print(universe["Galaxy"]["Mars"]); +printLn(universe["Galaxy"]["Earth"]); +printLn(universe["Galaxy"]["Mars"]); diff --git a/examples/brainfuck.hco b/examples/brainfuck.hco index ce763fa7..bb451c40 100644 --- a/examples/brainfuck.hco +++ b/examples/brainfuck.hco @@ -1,6 +1,6 @@ function bf(bufferSize, is) { - print(is); + printLn(is); let ds = array(); let dp = 0; let ip = 0; @@ -37,7 +37,7 @@ function bf(bufferSize, is) else if (curr == ".") { let v = ds[dp]; - print(cha(v)); + printLn(cha(v)); } else if (curr == ",") { diff --git a/examples/caesar.hco b/examples/caesar.hco index fede640b..cd9eafd8 100644 --- a/examples/caesar.hco +++ b/examples/caesar.hco @@ -26,4 +26,4 @@ function caesarCipher(rot, phrase) return rotPhrase; } -print(caesarCipher(2, "Hello world")); +printLn(caesarCipher(2, "Hello world")); diff --git a/examples/christmastree.hco b/examples/christmastree.hco index acdedb22..46bda610 100644 --- a/examples/christmastree.hco +++ b/examples/christmastree.hco @@ -45,12 +45,12 @@ while (i > 1) line = line + padTreeLine(n-i-1, " ", "@") + "#"; } - print(line); + printLn(line); i=i-2; } -print(padLine(n+1, "#")); -print(padLine(n/2, " ") + "##"); -print(padLine(n/2, " ") + "##"); -print(padLine(n/2, " ") + "##"); +printLn(padLine(n+1, "#")); +printLn(padLine(n/2, " ") + "##"); +printLn(padLine(n/2, " ") + "##"); +printLn(padLine(n/2, " ") + "##"); diff --git a/examples/compound.hco b/examples/compound.hco index b78e3d52..c87b9cb1 100644 --- a/examples/compound.hco +++ b/examples/compound.hco @@ -1,15 +1,15 @@ let a = 10; a += 2; -print(a); +printLn(a); a = 10; a -= 2; -print(a); +printLn(a); a = 10; a *= 2; -print(a); +printLn(a); a = 10; a /= 2; -print(a); +printLn(a); diff --git a/examples/conway.hco b/examples/conway.hco index 877d3163..a1cc96bf 100644 --- a/examples/conway.hco +++ b/examples/conway.hco @@ -121,7 +121,7 @@ function draw() output += "\n"; i++; } - print(output); + printLn(output); } setupGrid(); diff --git a/examples/crement.hco b/examples/crement.hco index fbd2c00d..eb096889 100644 --- a/examples/crement.hco +++ b/examples/crement.hco @@ -1,5 +1,5 @@ let a = 10; a++; -print(a); +printLn(a); a--; -print(a); +printLn(a); diff --git a/examples/csv/countrycodes.hco b/examples/csv/countrycodes.hco index 68002e3f..ca093d29 100644 --- a/examples/csv/countrycodes.hco +++ b/examples/csv/countrycodes.hco @@ -53,11 +53,11 @@ let i = 0; while (i < len(countyCodes)) { let country = countyCodes[i]; - print("Item: " + i); - print("Country: " + country[0]); - print("Alpha-2 code : " + country[1]); - print("Alpha-3 code : " + country[2]); - print("Numeric: " + country[3]); - print(""); + printLn("Item: " + i); + printLn("Country: " + country[0]); + printLn("Alpha-2 code : " + country[1]); + printLn("Alpha-3 code : " + country[2]); + printLn("Numeric: " + country[3]); + printLn(""); i++; } diff --git a/examples/fac.hco b/examples/fac.hco index b49b2212..f60e9525 100644 --- a/examples/fac.hco +++ b/examples/fac.hco @@ -12,4 +12,4 @@ function factailrec(acc, n) return factailrec(n * acc, n - 1); } -print(fac(14)); +printLn(fac(14)); diff --git a/examples/fib.hco b/examples/fib.hco index 6fdbd376..e99e5d98 100755 --- a/examples/fib.hco +++ b/examples/fib.hco @@ -15,6 +15,6 @@ while (c < n) first = second; second = next; } - print(next); + printLn(next); c = c + 1; } diff --git a/examples/fizzbuzz.hco b/examples/fizzbuzz.hco index 4ce8e0fc..12603a82 100755 --- a/examples/fizzbuzz.hco +++ b/examples/fizzbuzz.hco @@ -4,19 +4,19 @@ while (i < maxNumber) { if (i % 5 == 0 && i % 3 == 0) { - print("FizzBuzz"); + printLn("FizzBuzz"); } else if (i % 3 == 0) { - print("Fizz"); + printLn("Fizz"); } else if (i % 5 == 0) { - print("Buzz"); + printLn("Buzz"); } else { - print(i); + printLn(i); } i++; } diff --git a/examples/functions.hco b/examples/functions.hco index 40379406..012552ab 100755 --- a/examples/functions.hco +++ b/examples/functions.hco @@ -1,16 +1,16 @@ -print(asc("a")); -print(cha(67)); -print(toUpper("hello world!")); -print(toLower("HELLO WORLD!")); -print(inStr("hello world", "world")); -print(inStrRev("hello world", "world")); -print(strRev("!dlroW olleH")); -print(len("Hello World!")); -print(space(10)); -print(strCmp("Hello World","Hello Earth")); -print(trim(" Hello World! ")); -print(lTrim(" Hello World!")); -print(rTrim("Hello World! ")); -print(left("Hello World!",5)); -print(mid("Hello World!",2,5)); -print(right("Hello World!",4)); +printLn(asc("a")); +printLn(cha(67)); +printLn(toUpper("hello world!")); +printLn(toLower("HELLO WORLD!")); +printLn(inStr("hello world", "world")); +printLn(inStrRev("hello world", "world")); +printLn(strRev("!dlroW olleH")); +printLn(len("Hello World!")); +printLn(space(10)); +printLn(strCmp("Hello World","Hello Earth")); +printLn(trim(" Hello World! ")); +printLn(lTrim(" Hello World!")); +printLn(rTrim("Hello World! ")); +printLn(left("Hello World!",5)); +printLn(mid("Hello World!",2,5)); +printLn(right("Hello World!",4)); diff --git a/examples/functions2.hco b/examples/functions2.hco index 8412f436..6ba76057 100755 --- a/examples/functions2.hco +++ b/examples/functions2.hco @@ -1,5 +1,5 @@ -print(month(1485199747)); -print(monthName(month(1485199747))); -print(weekday(1485199747)); -print(weekdayName(1485199747)); -print(year(1440544844)); \ No newline at end of file +printLn(month(1485199747)); +printLn(monthName(month(1485199747))); +printLn(weekday(1485199747)); +printLn(weekdayName(1485199747)); +printLn(year(1440544844)); \ No newline at end of file diff --git a/examples/functions3.hco b/examples/functions3.hco index d4991bfc..5fba6307 100755 --- a/examples/functions3.hco +++ b/examples/functions3.hco @@ -1,15 +1,15 @@ -print(abs(1)); -print(acos(1)); -print(asin(1)); -print(atan(1)); -print(atan2(1,1)); -print(ceil(1)); -print(cos(1)); -print(exp(1)); -print(sin(1)); -print(sqrt(2)); -print(tan(1)); -print(pow(2,2)); -print(sqrt(2)); -print(min(1,2,3)); -print(max(1,2,3)); \ No newline at end of file +printLn(abs(1)); +printLn(acos(1)); +printLn(asin(1)); +printLn(atan(1)); +printLn(atan2(1,1)); +printLn(ceil(1)); +printLn(cos(1)); +printLn(exp(1)); +printLn(sin(1)); +printLn(sqrt(2)); +printLn(tan(1)); +printLn(pow(2,2)); +printLn(sqrt(2)); +printLn(min(1,2,3)); +printLn(max(1,2,3)); \ No newline at end of file diff --git a/examples/gcd.hco b/examples/gcd.hco index d1d7c913..becf8f6a 100644 --- a/examples/gcd.hco +++ b/examples/gcd.hco @@ -17,4 +17,4 @@ function gcd(a, b) return a; } -print(gcd(20, 4)); +printLn(gcd(20, 4)); diff --git a/examples/ifelse.hco b/examples/ifelse.hco index 3c2b3162..36cd17a3 100755 --- a/examples/ifelse.hco +++ b/examples/ifelse.hco @@ -1,9 +1,9 @@ let c= 1+1; if (c<1) { - print("If"); + printLn("If"); } else { - print("Else"); + printLn("Else"); } \ No newline at end of file diff --git a/examples/import/helloworld.hco b/examples/import/helloworld.hco index d1b78b54..93c5c156 100644 --- a/examples/import/helloworld.hco +++ b/examples/import/helloworld.hco @@ -1,6 +1,6 @@ -print("Hello World!"); +printLn("Hello World!"); function hello() { return "Hello!"; } -print(number); +printLn(number); diff --git a/examples/import/import1.hco b/examples/import/import1.hco index 7591d229..1efacf9e 100644 --- a/examples/import/import1.hco +++ b/examples/import/import1.hco @@ -2,6 +2,6 @@ let number = 42; import("/home/huw/projects/huwinterpreter/import/helloworld.hco"); -print("Hello Galaxy!"); +printLn("Hello Galaxy!"); -print(hello()); +printLn(hello()); diff --git a/examples/leap_year.hco b/examples/leap_year.hco index ca45ecfb..2f07a470 100644 --- a/examples/leap_year.hco +++ b/examples/leap_year.hco @@ -21,11 +21,11 @@ while (i < 2100) let isLeap = isLeapYear(i); if (isLeap == true) { - print(str(i) + " is a leap year"); + printLn(str(i) + " is a leap year"); } else { - print(str(i) + " is not a leap year"); + printLn(str(i) + " is not a leap year"); } i++; } diff --git a/examples/logic1.hco b/examples/logic1.hco index 81e00e90..889412dd 100755 --- a/examples/logic1.hco +++ b/examples/logic1.hco @@ -1,26 +1,26 @@ -print(1&&1); -print(1||0); -print(1&&(1||0)); +printLn(1&&1); +printLn(1||0); +printLn(1&&(1||0)); -print("OR"); -print(0||0); -print(0||1); -print(1||0); -print(1||1); +printLn("OR"); +printLn(0||0); +printLn(0||1); +printLn(1||0); +printLn(1||1); -print("AND"); -print(0&&0); -print(0&&1); -print(1&&0); -print(1&&1); +printLn("AND"); +printLn(0&&0); +printLn(0&&1); +printLn(1&&0); +printLn(1&&1); -print("AND/OR"); -print(0||(1&&1)); -print(1||(0&&0)); -print(0&&(0||1)); -print(1&&(1||0)); +printLn("AND/OR"); +printLn(0||(1&&1)); +printLn(1||(0&&0)); +printLn(0&&(0||1)); +printLn(1&&(1||0)); -print("LOGIC/MATH"); -print(0+1||0); -print(0); -print(1); +printLn("LOGIC/MATH"); +printLn(0+1||0); +printLn(0); +printLn(1); diff --git a/examples/math1.hco b/examples/math1.hco index 2a55cf84..5a38787c 100755 --- a/examples/math1.hco +++ b/examples/math1.hco @@ -1,16 +1,16 @@ -print(1234); -print(1+2*3); -print(5*(4+4+1)); -print(5*((1+3)*2+1)); -print(5 * ((1 + 3) * 2 + 1)); -print(5 - 2 * ( 3 )); -print(5 - 2 * ( ( 4 ) - 1 )); -print(1.5/5); -print((4-3)/(4*4)); -print(1/2/2); -print(0.25 * .5 * 0.5); -print(.25 / 2 * .5); -print(1+-2); -print(-4*(2+1)); -print(-2); -print(+2); +printLn(1234); +printLn(1+2*3); +printLn(5*(4+4+1)); +printLn(5*((1+3)*2+1)); +printLn(5 * ((1 + 3) * 2 + 1)); +printLn(5 - 2 * ( 3 )); +printLn(5 - 2 * ( ( 4 ) - 1 )); +printLn(1.5/5); +printLn((4-3)/(4*4)); +printLn(1/2/2); +printLn(0.25 * .5 * 0.5); +printLn(.25 / 2 * .5); +printLn(1+-2); +printLn(-4*(2+1)); +printLn(-2); +printLn(+2); diff --git a/examples/mathparser.hco b/examples/mathparser.hco index 0ffb626d..f9ca2818 100644 --- a/examples/mathparser.hco +++ b/examples/mathparser.hco @@ -66,16 +66,16 @@ function valueOfExpr() i = 0; list = "1+2*5"; -print(valueOfExpr()); +printLn(valueOfExpr()); i = 0; list = "1+2*5+2/2"; -print(valueOfExpr()); +printLn(valueOfExpr()); i = 0; list = "5*(4+4+1)"; -print(valueOfExpr()); +printLn(valueOfExpr()); i = 0; list = "1+(2*2)"; -print(valueOfExpr()); +printLn(valueOfExpr()); diff --git a/examples/newlines.hco b/examples/newlines.hco index ff19116a..63a85a7c 100644 --- a/examples/newlines.hco +++ b/examples/newlines.hco @@ -1,2 +1,2 @@ let text = "\n\n\n\n"; -print(text); \ No newline at end of file +printLn(text); \ No newline at end of file diff --git a/examples/queensproblem.hco b/examples/queensproblem.hco index f5d72166..bf05a665 100644 --- a/examples/queensproblem.hco +++ b/examples/queensproblem.hco @@ -97,4 +97,4 @@ function hasConflict(newRow, newColumn, solution) return false; } -print(queenPuzzle(4,4)); +printLn(queenPuzzle(4,4)); diff --git a/examples/sorting.hco b/examples/sorting.hco index 95a1da99..033281fc 100644 --- a/examples/sorting.hco +++ b/examples/sorting.hco @@ -103,8 +103,8 @@ list[5] = 10; list[6] = 4; list[7] = 1; let a = insertationSort(list); -print(a); -print(checkSort(a)); +printLn(a); +printLn(checkSort(a)); list[0] = 701; list[1] = 301; @@ -116,9 +116,9 @@ list[6] = 4; list[7] = 1; let a = bubbleSort(list); -print(a); +printLn(a); -print(checkSort(a)); +printLn(checkSort(a)); list[0] = 701; list[1] = 301; @@ -130,5 +130,5 @@ list[6] = 4; list[7] = 1; let a = shellSort(list); -print(a); -print(checkSort(a)); +printLn(a); +printLn(checkSort(a)); diff --git a/examples/towerofhanoi.hco b/examples/towerofhanoi.hco index a8073e45..c0d66629 100644 --- a/examples/towerofhanoi.hco +++ b/examples/towerofhanoi.hco @@ -3,7 +3,7 @@ function move(n, a, b, c) if (n > 0) { move(n-1, a, c, b); - print("Move disk from " + a + " to " + c); + printLn("Move disk from " + a + " to " + c); move(n-1, b, a, c); } } diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 172af4d8..8e14d61c 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -98,6 +98,7 @@ set(SOURCE functions/now.cpp functions/pow.cpp functions/print.cpp + functions/println.cpp functions/random.cpp functions/replace.cpp functions/right.cpp @@ -307,6 +308,7 @@ set(HEADER functions/now.h functions/pow.h functions/print.h + functions/println.h functions/random.h functions/replace.h functions/right.h diff --git a/source/CMakeLists.txt.user b/source/CMakeLists.txt.user index 351162fc..3ea07e43 100644 --- a/source/CMakeLists.txt.user +++ b/source/CMakeLists.txt.user @@ -1,9 +1,10 @@ + EnvironmentId - {4e9552eb-1a71-43da-805a-f68b3b3fcfe8} + {d6007a69-fb54-4f74-b91e-6d3c0611e30c} ProjectExplorer.Project.ActiveTarget @@ -66,11 +67,14 @@ 0 true + + true + Builtin.Questionable true true Builtin.DefaultTidyAndClazy - 4 + 6 @@ -82,9 +86,9 @@ ProjectExplorer.Project.Target.0 Desktop - Desktop - Desktop - {c84bc2c7-bad4-4373-9d35-c1bab0556384} + Imported Kit + Imported Kit + {c7ebd624-b68b-47ac-958f-5ff1f9ce8632} 0 0 0 @@ -95,7 +99,7 @@ -DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} -DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} -DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - /home/huw/projects/huwinterpreter/source/../build-source-Desktop-Debug + /home/huw/projects/huwinterpreter/build-source-Desktop-Debug @@ -131,130 +135,7 @@ Debug CMakeProjectManager.CMakeBuildConfiguration - - -GCodeBlocks - Unix Makefiles --DCMAKE_BUILD_TYPE:String=Release --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - /home/huw/projects/huwinterpreter/source/../build-source-Desktop-Release - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Release - CMakeProjectManager.CMakeBuildConfiguration - - - -GCodeBlocks - Unix Makefiles --DCMAKE_BUILD_TYPE:String=RelWithDebInfo --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - /home/huw/projects/huwinterpreter/source/../build-source-Desktop-RelWithDebInfo - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Release with Debug Information - CMakeProjectManager.CMakeBuildConfiguration - - - -GCodeBlocks - Unix Makefiles --DCMAKE_BUILD_TYPE:String=MinSizeRel --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - /home/huw/projects/huwinterpreter/source/../build-source-Desktop-MinSizeRel - - - - all - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Minimum Size Release - CMakeProjectManager.CMakeBuildConfiguration - - 4 + 1 0 @@ -332,7 +213,7 @@ HuwInterpreter CMakeProjectManager.CMakeRunConfiguration.HuwInterpreter HuwInterpreter - /home/huw/Desktop/conway/bug.hco + /home/huw/examples/out_of_bounds.hco false true false @@ -343,149 +224,9 @@ 1 - - ProjectExplorer.Project.Target.1 - - Desktop - Imported Kit - Imported Kit - {707ad6c4-73be-482a-a06c-fb8419d18b8b} - 0 - 0 - 0 - - -GUnix Makefiles --DCMAKE_BUILD_TYPE:String=Build --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} - /home/huw/huwinterpreter/source/build - - - - all - - true - Build - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - Build - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - - Build - CMakeProjectManager.CMakeBuildConfiguration - - 1 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - - 2 - - HuwInterpreter - CMakeProjectManager.CMakeRunConfiguration.HuwInterpreter - HuwInterpreter - false - true - true - false - true - - 1 - - ProjectExplorer.Project.TargetCount - 2 + 1 ProjectExplorer.Project.Updater.FileVersion diff --git a/source/functions/functionlist.h b/source/functions/functionlist.h index ed8e9f92..a7b4259b 100755 --- a/source/functions/functionlist.h +++ b/source/functions/functionlist.h @@ -81,6 +81,7 @@ // Other #include "print.h" +#include "println.h" #include "emptyfunction.h" //Array diff --git a/source/functions/functions.cpp b/source/functions/functions.cpp index 2ebea0e0..ed5e5e78 100755 --- a/source/functions/functions.cpp +++ b/source/functions/functions.cpp @@ -34,6 +34,7 @@ namespace Functions { functions["not"] = std::make_shared(passable); functions["print"] = std::make_shared(passable); + functions["printLn"] = std::make_shared(passable); functions["scan"] = std::make_shared(passable); functions["abs"] = std::make_shared(passable); diff --git a/source/functions/print.cpp b/source/functions/print.cpp index 9552b96d..75ea4374 100755 --- a/source/functions/print.cpp +++ b/source/functions/print.cpp @@ -34,7 +34,7 @@ namespace HuwInterpreter { std::shared_ptr var = (*it)->execute(globalScope, scope); if (var != nullptr) { - std::cout << var->toString() << std::endl; + std::cout << var->toString(); } } else diff --git a/source/functions/println.cpp b/source/functions/println.cpp new file mode 100644 index 00000000..4f4ffddb --- /dev/null +++ b/source/functions/println.cpp @@ -0,0 +1,49 @@ +/* + HuwInterpreter is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + HuwInterpreter is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with HuwInterpreter. If not, see . +*/ + +#include "println.h" + +namespace HuwInterpreter { + namespace Functions { + PrintLn::PrintLn(std::shared_ptr passable) + : Function(passable) + { + setName("print"); + } + + std::shared_ptr PrintLn::execute(std::shared_ptr token, std::shared_ptr globalScope, + std::shared_ptr scope, + std::vector> arguments) + { + for (std::vector>::iterator it = arguments.begin(); it != arguments.end(); ++it) + { + if ((*it) != nullptr) + { + std::shared_ptr var = (*it)->execute(globalScope, scope); + if (var != nullptr) + { + std::cout << var->toString() << std::endl; + } + } + else + { + passable->getErrorManager()->add(passable->getErrorFactory()->invalidArgument(token, RUNTIME_ERROR, name)); + return nullVariable; + } + } + return nullVariable; + } + } +} diff --git a/source/functions/println.h b/source/functions/println.h new file mode 100644 index 00000000..2efb2a12 --- /dev/null +++ b/source/functions/println.h @@ -0,0 +1,40 @@ +/* + HuwInterpreter is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + HuwInterpreter is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with HuwInterpreter. If not, see . +*/ + +#ifndef PRINTLN_H +#define PRINTLN_H + +#include "function.h" +#include "../nodes/node.h" +#include +#include +#include + +namespace HuwInterpreter { + namespace Functions { + class PrintLn : public Function + { + public: + PrintLn(std::shared_ptr passable); + virtual ~PrintLn() {} + std::shared_ptr execute(std::shared_ptr token, + std::shared_ptr globalScope, + std::shared_ptr scope, + std::vector> arguments) final; + }; + } +} + +#endif // PRINTLN_H diff --git a/stdlib/examples/and.hco b/stdlib/examples/and.hco index 9aa15401..ac041298 100644 --- a/stdlib/examples/and.hco +++ b/stdlib/examples/and.hco @@ -7,7 +7,7 @@ function and(left, right) return 0; } -print(and(1,1)); /* Expected true */ -print(and(1,0)); /* Expected false */ -print(and(0,1)); /* Expected false */ -print(and(0,0)); /* Expected false */ \ No newline at end of file +printLn(and(1,1)); /* Expected true */ +printLn(and(1,0)); /* Expected false */ +printLn(and(0,1)); /* Expected false */ +printLn(and(0,0)); /* Expected false */ \ No newline at end of file diff --git a/stdlib/examples/coalesce.hco b/stdlib/examples/coalesce.hco index d78410c1..c94cfda6 100644 --- a/stdlib/examples/coalesce.hco +++ b/stdlib/examples/coalesce.hco @@ -11,11 +11,11 @@ function coalesce(value, replacementValue) return value; } -print(coalesce("", "Replacement text")); /* Expected "Replacement text" */ -print(coalesce("Text", "Replacement text")); /* Expected "Text" */ +printLn(coalesce("", "Replacement text")); /* Expected "Replacement text" */ +printLn(coalesce("Text", "Replacement text")); /* Expected "Text" */ let items = array(); -print(coalesce(items, "Replacement text")); /* Expected "Replacement text" */ +printLn(coalesce(items, "Replacement text")); /* Expected "Replacement text" */ items[0] = "Item 1"; -print(coalesce(items, "Replacement text")); /* Expected "Text" */ -print(coalesce(0, "Replacement text")); /* Expected "Text" */ -print(coalesce(1, "Replacement text")); /* Expected "Text" */ +printLn(coalesce(items, "Replacement text")); /* Expected "Text" */ +printLn(coalesce(0, "Replacement text")); /* Expected "Text" */ +printLn(coalesce(1, "Replacement text")); /* Expected "Text" */ diff --git a/stdlib/examples/degrees.hco b/stdlib/examples/degrees.hco index 7b327d61..dd453cc8 100644 --- a/stdlib/examples/degrees.hco +++ b/stdlib/examples/degrees.hco @@ -3,4 +3,4 @@ function degress(value) return cos(value * PI / 180.0); } -print(degress(1)); /* Expected 57.2958 */ \ No newline at end of file +printLn(degress(1)); /* Expected 57.2958 */ \ No newline at end of file diff --git a/stdlib/examples/endswith.hco b/stdlib/examples/endswith.hco index 869ffab9..c5b519e4 100644 --- a/stdlib/examples/endswith.hco +++ b/stdlib/examples/endswith.hco @@ -7,5 +7,5 @@ function endsWith(source, text) return 0; } -print(endsWith("Hello World!", "World!")); /* Expected true */ -print(endsWith("Lorem ipsum", "World!")); /* Expected false */ \ No newline at end of file +printLn(endsWith("Hello World!", "World!")); /* Expected true */ +printLn(endsWith("Lorem ipsum", "World!")); /* Expected false */ \ No newline at end of file diff --git a/stdlib/examples/fill.hco b/stdlib/examples/fill.hco index 76b6cb01..bb4e1411 100644 --- a/stdlib/examples/fill.hco +++ b/stdlib/examples/fill.hco @@ -10,4 +10,4 @@ function fill(value, n) return output; } -print(fill("=",10)); /* Expected: ========== */ \ No newline at end of file +printLn(fill("=",10)); /* Expected: ========== */ \ No newline at end of file diff --git a/stdlib/examples/first.hco b/stdlib/examples/first.hco index 69bbeafe..897bd582 100644 --- a/stdlib/examples/first.hco +++ b/stdlib/examples/first.hco @@ -7,8 +7,8 @@ function first(value) return ""; } -print(first("hello")); /* Expected h */ +printLn(first("hello")); /* Expected h */ let items = array(); items[0] = "First item"; items[1] = "Second item"; -print(first(items)); /* First item */ \ No newline at end of file +printLn(first(items)); /* First item */ \ No newline at end of file diff --git a/stdlib/examples/isBlank.hco b/stdlib/examples/isBlank.hco index 9de0a9a3..71bed886 100644 --- a/stdlib/examples/isBlank.hco +++ b/stdlib/examples/isBlank.hco @@ -11,11 +11,11 @@ function isBlank(value) return 0; } -print(isBlank("")); /* Expected true */ -print(isBlank("Text")); /* Expected false */ +printLn(isBlank("")); /* Expected true */ +printLn(isBlank("Text")); /* Expected false */ let items = array(); -print(isBlank(items)); /* Expected true */ +printLn(isBlank(items)); /* Expected true */ items[0] = "Item 1"; -print(isBlank(items)); /* Expected false */ -print(isBlank(0)); /* Expected false */ -print(isBlank(1)); /* Expected false */ +printLn(isBlank(items)); /* Expected false */ +printLn(isBlank(0)); /* Expected false */ +printLn(isBlank(1)); /* Expected false */ diff --git a/stdlib/examples/join.hco b/stdlib/examples/join.hco index 843d2661..3f58fa73 100644 --- a/stdlib/examples/join.hco +++ b/stdlib/examples/join.hco @@ -16,10 +16,10 @@ function join(input, seperator) return str(input); } -print(join(str("123456789"), ",")); +printLn(join(str("123456789"), ",")); let list = array(); list[0] = "a"; list[1] = "b"; list[2] = "c"; list[3] = "d"; -print(join(list, ":")); +printLn(join(list, ":")); diff --git a/stdlib/examples/last.hco b/stdlib/examples/last.hco index 3959ce6f..ed4e7592 100644 --- a/stdlib/examples/last.hco +++ b/stdlib/examples/last.hco @@ -8,8 +8,8 @@ function last(value) return ""; } -print(last("hello")); /* Expected o */ +printLn(last("hello")); /* Expected o */ let items = array(); items[0] = "First item"; items[1] = "Second item"; -print(last(items)); /* Expected Second item */ \ No newline at end of file +printLn(last(items)); /* Expected Second item */ \ No newline at end of file diff --git a/stdlib/examples/not.hco b/stdlib/examples/not.hco index d90b93c5..9a2261a9 100644 --- a/stdlib/examples/not.hco +++ b/stdlib/examples/not.hco @@ -1,4 +1,4 @@ -print(not(1)); /* Expected 0 */ -print(not(0)); /* Expected 1 */ \ No newline at end of file +printLn(not(1)); /* Expected 0 */ +printLn(not(0)); /* Expected 1 */ \ No newline at end of file diff --git a/stdlib/examples/or.hco b/stdlib/examples/or.hco index 1316e7b8..1a3733ed 100644 --- a/stdlib/examples/or.hco +++ b/stdlib/examples/or.hco @@ -7,7 +7,7 @@ function or(left, right) return 0; } -print(or(1,1)); /* Expected true */ -print(or(1,0)); /* Expected true */ -print(or(0,1)); /* Expected true */ -print(or(0,0)); /* Expected false */ \ No newline at end of file +printLn(or(1,1)); /* Expected true */ +printLn(or(1,0)); /* Expected true */ +printLn(or(0,1)); /* Expected true */ +printLn(or(0,0)); /* Expected false */ \ No newline at end of file diff --git a/stdlib/examples/proper.hco b/stdlib/examples/proper.hco index 5a3a14b9..61ad70ca 100644 --- a/stdlib/examples/proper.hco +++ b/stdlib/examples/proper.hco @@ -16,5 +16,5 @@ function proper(value) return output; } -print(proper("hello")); /* Expected Hello */ -print(proper("l")); /* Expected L */ \ No newline at end of file +printLn(proper("hello")); /* Expected Hello */ +printLn(proper("l")); /* Expected L */ \ No newline at end of file diff --git a/stdlib/examples/radians.hco b/stdlib/examples/radians.hco index c9e78cff..311187c8 100644 --- a/stdlib/examples/radians.hco +++ b/stdlib/examples/radians.hco @@ -3,4 +3,4 @@ function radians(value) return tan(value * PI / 180.0); } -print(radians(1)); /* Expected 0.017455 */ \ No newline at end of file +printLn(radians(1)); /* Expected 0.017455 */ \ No newline at end of file diff --git a/stdlib/examples/reverse.hco b/stdlib/examples/reverse.hco index fbade2c9..cbb7d8ef 100644 --- a/stdlib/examples/reverse.hco +++ b/stdlib/examples/reverse.hco @@ -15,4 +15,4 @@ function reverse(value) return output; } -print(reverse("olleh")); \ No newline at end of file +printLn(reverse("olleh")); \ No newline at end of file diff --git a/stdlib/examples/shuffle.hco b/stdlib/examples/shuffle.hco index d79c03a2..47304038 100644 --- a/stdlib/examples/shuffle.hco +++ b/stdlib/examples/shuffle.hco @@ -33,5 +33,5 @@ list[6] = 7; list[7] = 8; list[8] = 9; list[8] = 10; -print(list); -print(shuffle(list)); +printLn(list); +printLn(shuffle(list)); diff --git a/stdlib/examples/split.hco b/stdlib/examples/split.hco index 350b7a7a..8e72fb24 100644 --- a/stdlib/examples/split.hco +++ b/stdlib/examples/split.hco @@ -28,5 +28,5 @@ function split(input, deliminator) return output; } -print(split("Hello,world!", ",")); -print(split("1,2,3,4,5,6,7,8,9",",")); +printLn(split("Hello,world!", ",")); +printLn(split("1,2,3,4,5,6,7,8,9",",")); diff --git a/stdlib/examples/startswith.hco b/stdlib/examples/startswith.hco index 48ab12e5..8e141417 100644 --- a/stdlib/examples/startswith.hco +++ b/stdlib/examples/startswith.hco @@ -7,5 +7,5 @@ function startsWith(source, text) return 0; } -print(startsWith("Hello World!", "Hello")); /* Expected true */ -print(startsWith("Lorem ipsum", "Hello")); /* Expected false */ \ No newline at end of file +printLn(startsWith("Hello World!", "Hello")); /* Expected true */ +printLn(startsWith("Lorem ipsum", "Hello")); /* Expected false */ \ No newline at end of file diff --git a/stdlib/examples/strContains.hco b/stdlib/examples/strContains.hco index 3e64a35a..cb5e519c 100644 --- a/stdlib/examples/strContains.hco +++ b/stdlib/examples/strContains.hco @@ -7,7 +7,7 @@ function strContains(string1, string2) return 1; } -print(strContains("Lorem ipsum dolor sit amet", "sit")); /* True */ -print(strContains("Hello world!", "world")); /* True */ -print(strContains("Lorem ipsum dolor sit amet", "unknown")); /* False */ -print(strContains("Hello world!", "unknown")); /* False */ +printLn(strContains("Lorem ipsum dolor sit amet", "sit")); /* True */ +printLn(strContains("Hello world!", "world")); /* True */ +printLn(strContains("Lorem ipsum dolor sit amet", "unknown")); /* False */ +printLn(strContains("Hello world!", "unknown")); /* False */ diff --git a/stdlib/examples/toint.hco b/stdlib/examples/toint.hco index d16857f8..f0118908 100644 --- a/stdlib/examples/toint.hco +++ b/stdlib/examples/toint.hco @@ -2,9 +2,9 @@ function int(value) { return round(toDouble(value)); } -print(int(0.4)); -print(int(0.6)); -print(int(1)); -print(int(1.2)); -print(int(-1)); -print(int(999999)); +printLn(int(0.4)); +printLn(int(0.6)); +printLn(int(1)); +printLn(int(1.2)); +printLn(int(-1)); +printLn(int(999999)); diff --git a/tests/logic/tests/11.hco b/tests/logic/tests/11.hco index 264142c4..1841602e 100755 --- a/tests/logic/tests/11.hco +++ b/tests/logic/tests/11.hco @@ -1,6 +1,6 @@ let a = "1"; while (a < 10+1) { - print(a); + printLn(a); a = a + 1; } diff --git a/tests/logic/tests/12.hco b/tests/logic/tests/12.hco index 03fda603..cc87c4a8 100755 --- a/tests/logic/tests/12.hco +++ b/tests/logic/tests/12.hco @@ -1 +1 @@ -print(1+(1+2)); \ No newline at end of file +printLn(1+(1+2)); \ No newline at end of file diff --git a/tests/logic/tests/3.hco b/tests/logic/tests/3.hco index 6ba0f4e4..335eeef5 100755 --- a/tests/logic/tests/3.hco +++ b/tests/logic/tests/3.hco @@ -1,2 +1,2 @@ -print(1+1); -print(1+1); \ No newline at end of file +printLn(1+1); +printLn(1+1); \ No newline at end of file diff --git a/tests/logic/tests/4.hco b/tests/logic/tests/4.hco index ba4a9b26..17b99650 100755 --- a/tests/logic/tests/4.hco +++ b/tests/logic/tests/4.hco @@ -1,3 +1,3 @@ let a = 1+1; -print(a); -print(1+1); \ No newline at end of file +printLn(a); +printLn(1+1); \ No newline at end of file diff --git a/tests/logic/tests/5.hco b/tests/logic/tests/5.hco index ec9f3e4e..5013769b 100755 --- a/tests/logic/tests/5.hco +++ b/tests/logic/tests/5.hco @@ -1,6 +1,6 @@ let a = 1 + ( 9 * 8) ; if ( a ) { - print( a ) ; + printLn( a ) ; } -print ( 1 + 1 ) ; \ No newline at end of file +printLn ( 1 + 1 ) ; diff --git a/tests/logic/tests/6.hco b/tests/logic/tests/6.hco index b5f2d36a..0bd92712 100755 --- a/tests/logic/tests/6.hco +++ b/tests/logic/tests/6.hco @@ -1,6 +1,6 @@ let a = 1; if (a>0) { - print(a); + printLn(a); } -print(1+1); \ No newline at end of file +printLn(1+1); \ No newline at end of file diff --git a/tests/logic/tests/7.hco b/tests/logic/tests/7.hco index 709179e0..fd793e75 100755 --- a/tests/logic/tests/7.hco +++ b/tests/logic/tests/7.hco @@ -1,6 +1,6 @@ let a = 1; while ( a < 100 ) { - print(a); + printLn(a); a = a + 1 ; } diff --git a/tests/logic/tests/8.hco b/tests/logic/tests/8.hco index b260486e..81c9a077 100755 --- a/tests/logic/tests/8.hco +++ b/tests/logic/tests/8.hco @@ -6,7 +6,7 @@ while (a < c + 1) while (b < a+1) { - print(b); + printLn(b); b = b + 1; } b = 1; diff --git a/tests/logic/tests/9.hco b/tests/logic/tests/9.hco index 4b2a142c..c34312b4 100755 --- a/tests/logic/tests/9.hco +++ b/tests/logic/tests/9.hco @@ -1,6 +1,6 @@ let a = 1; while (a < 10+1) { - print(a); + printLn(a); a = a + 1; } diff --git a/tests/logic/tests/99bottles.hco b/tests/logic/tests/99bottles.hco index 4c377a0f..ffe6e81f 100644 --- a/tests/logic/tests/99bottles.hco +++ b/tests/logic/tests/99bottles.hco @@ -2,9 +2,9 @@ let plural = "s"; let i = 99; while (i >= 0) { - print(toString(i) + " bottle" + plural + " of beer on the wall"); - print(toString(i) + " bottle" + plural + " of beer!"); - print("Take one down, pass it around!"); + printLn(toString(i) + " bottle" + plural + " of beer on the wall"); + printLn(toString(i) + " bottle" + plural + " of beer!"); + printLn("Take one down, pass it around!"); if (i - 1 == 1) { plural = ""; @@ -12,11 +12,11 @@ while (i >= 0) if (i > 1) { - print(toString(i - 1) + " bottle" + plural + " of beer on the wall!"); + printLn(toString(i - 1) + " bottle" + plural + " of beer on the wall!"); } else { - print("No more bottles of beer on the wall!"); + printLn("No more bottles of beer on the wall!"); } i--; } diff --git a/tests/logic/tests/ackerman.hco b/tests/logic/tests/ackerman.hco index 77cee0fd..3acac6bd 100644 --- a/tests/logic/tests/ackerman.hco +++ b/tests/logic/tests/ackerman.hco @@ -19,7 +19,7 @@ while (m <= 0) /* We keep this to 0 as the application stack size is not big en while (n < 6 - m) { let text = "A(" + m + ", " + n + ") = " + ackermann(m, n); - print(text); + printLn(text); n++; } m++; diff --git a/tests/logic/tests/add.hco b/tests/logic/tests/add.hco index 3b4075c2..5f756dfc 100755 --- a/tests/logic/tests/add.hco +++ b/tests/logic/tests/add.hco @@ -1,7 +1,7 @@ -print(1+1-1); -print(6*(5+3)); -print(2 + 5 * 3); -print(30 / 5 * 3); -print(4*(3 + 2)); -print(4* 5 / 2 + 7); -print(4+ 6-7 + 3); +printLn(1+1-1); +printLn(6*(5+3)); +printLn(2 + 5 * 3); +printLn(30 / 5 * 3); +printLn(4*(3 + 2)); +printLn(4* 5 / 2 + 7); +printLn(4+ 6-7 + 3); diff --git a/tests/logic/tests/addfunction.hco b/tests/logic/tests/addfunction.hco index a6a3b16b..5c8c10c8 100644 --- a/tests/logic/tests/addfunction.hco +++ b/tests/logic/tests/addfunction.hco @@ -1,7 +1,7 @@ function add(x,y,z) { - print(x); - print(y); - print(z); + printLn(x); + printLn(y); + printLn(z); } add(1,2,3); diff --git a/tests/logic/tests/and.hco b/tests/logic/tests/and.hco index 9aa15401..ac041298 100644 --- a/tests/logic/tests/and.hco +++ b/tests/logic/tests/and.hco @@ -7,7 +7,7 @@ function and(left, right) return 0; } -print(and(1,1)); /* Expected true */ -print(and(1,0)); /* Expected false */ -print(and(0,1)); /* Expected false */ -print(and(0,0)); /* Expected false */ \ No newline at end of file +printLn(and(1,1)); /* Expected true */ +printLn(and(1,0)); /* Expected false */ +printLn(and(0,1)); /* Expected false */ +printLn(and(0,0)); /* Expected false */ \ No newline at end of file diff --git a/tests/logic/tests/array.hco b/tests/logic/tests/array.hco index 50bc7909..0c315067 100644 --- a/tests/logic/tests/array.hco +++ b/tests/logic/tests/array.hco @@ -1,7 +1,7 @@ let i = 0; let list = array(); -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); /* Add items to the hash table */ while (i < 10) @@ -14,8 +14,8 @@ while (i < 10) let i = 0; while (i < 10) { - print(list[i]); + printLn(list[i]); i++; } -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); diff --git a/tests/logic/tests/array1.hco b/tests/logic/tests/array1.hco index 3a492fbe..332d4bb0 100755 --- a/tests/logic/tests/array1.hco +++ b/tests/logic/tests/array1.hco @@ -12,8 +12,8 @@ while (i < 10) let i = 0; while (i < 10) { - print(list[i]); + printLn(list[i]); i++; } -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); diff --git a/tests/logic/tests/array2.hco b/tests/logic/tests/array2.hco index 28580baa..1d30ca03 100644 --- a/tests/logic/tests/array2.hco +++ b/tests/logic/tests/array2.hco @@ -4,4 +4,4 @@ let list2 = array(); list2["2"] = "3"; list["1"] = list2; -print(list["1"]["2"]); +printLn(list["1"]["2"]); diff --git a/tests/logic/tests/array3.hco b/tests/logic/tests/array3.hco index 3bb6884f..be22679d 100644 --- a/tests/logic/tests/array3.hco +++ b/tests/logic/tests/array3.hco @@ -1,5 +1,5 @@ let universe = array(); universe["Galaxy"]["Earth"] = "Hello Earth!"; universe["Galaxy"]["Mars"] = "Hello Mars!"; -print(universe["Galaxy"]["Earth"]); -print(universe["Galaxy"]["Mars"]); +printLn(universe["Galaxy"]["Earth"]); +printLn(universe["Galaxy"]["Mars"]); diff --git a/tests/logic/tests/array4.hco b/tests/logic/tests/array4.hco index b126f511..55884746 100644 --- a/tests/logic/tests/array4.hco +++ b/tests/logic/tests/array4.hco @@ -12,15 +12,15 @@ while (i < 10) let i = 0; while (i < 10) { - print(list[i]); + printLn(list[i]); i++; } -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); let universe = array(); universe["Galaxy"]["Earth"] = "Hello Earth!"; universe["Galaxy"]["Mars"] = "Hello Mars!"; -print(universe["Galaxy"]["Earth"]); -print(universe["Galaxy"]["Mars"]); +printLn(universe["Galaxy"]["Earth"]); +printLn(universe["Galaxy"]["Mars"]); diff --git a/tests/logic/tests/arraytype.hco b/tests/logic/tests/arraytype.hco index a0a7ea3e..37179425 100755 --- a/tests/logic/tests/arraytype.hco +++ b/tests/logic/tests/arraytype.hco @@ -2,36 +2,36 @@ let a = array(); if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/logic/tests/assignment1.hco b/tests/logic/tests/assignment1.hco index 16ace552..e928409a 100755 --- a/tests/logic/tests/assignment1.hco +++ b/tests/logic/tests/assignment1.hco @@ -1,19 +1,19 @@ let a = 1; a = 1; -print(a); +printLn(a); let b = 2; b += 1; -print(b); +printLn(b); let c = 3; c -= 1; -print(c); +printLn(c); let d = 4; d *= 5; -print(d); +printLn(d); let f = 6; f /= 2; -print(f); +printLn(f); diff --git a/tests/logic/tests/bitwise.hco b/tests/logic/tests/bitwise.hco index 50c5287b..7e6b2fbb 100644 --- a/tests/logic/tests/bitwise.hco +++ b/tests/logic/tests/bitwise.hco @@ -1,5 +1,5 @@ -print(12&25); -print(12|25); -print(12^25); -print(~35); -print(~-12); +printLn(12&25); +printLn(12|25); +printLn(12^25); +printLn(~35); +printLn(~-12); diff --git a/tests/logic/tests/brainfuck.hco b/tests/logic/tests/brainfuck.hco index ce763fa7..bb451c40 100644 --- a/tests/logic/tests/brainfuck.hco +++ b/tests/logic/tests/brainfuck.hco @@ -1,6 +1,6 @@ function bf(bufferSize, is) { - print(is); + printLn(is); let ds = array(); let dp = 0; let ip = 0; @@ -37,7 +37,7 @@ function bf(bufferSize, is) else if (curr == ".") { let v = ds[dp]; - print(cha(v)); + printLn(cha(v)); } else if (curr == ",") { diff --git a/tests/logic/tests/caesar.hco b/tests/logic/tests/caesar.hco index fede640b..cd9eafd8 100644 --- a/tests/logic/tests/caesar.hco +++ b/tests/logic/tests/caesar.hco @@ -26,4 +26,4 @@ function caesarCipher(rot, phrase) return rotPhrase; } -print(caesarCipher(2, "Hello world")); +printLn(caesarCipher(2, "Hello world")); diff --git a/tests/logic/tests/coalesce.hco b/tests/logic/tests/coalesce.hco index d78410c1..c94cfda6 100644 --- a/tests/logic/tests/coalesce.hco +++ b/tests/logic/tests/coalesce.hco @@ -11,11 +11,11 @@ function coalesce(value, replacementValue) return value; } -print(coalesce("", "Replacement text")); /* Expected "Replacement text" */ -print(coalesce("Text", "Replacement text")); /* Expected "Text" */ +printLn(coalesce("", "Replacement text")); /* Expected "Replacement text" */ +printLn(coalesce("Text", "Replacement text")); /* Expected "Text" */ let items = array(); -print(coalesce(items, "Replacement text")); /* Expected "Replacement text" */ +printLn(coalesce(items, "Replacement text")); /* Expected "Replacement text" */ items[0] = "Item 1"; -print(coalesce(items, "Replacement text")); /* Expected "Text" */ -print(coalesce(0, "Replacement text")); /* Expected "Text" */ -print(coalesce(1, "Replacement text")); /* Expected "Text" */ +printLn(coalesce(items, "Replacement text")); /* Expected "Text" */ +printLn(coalesce(0, "Replacement text")); /* Expected "Text" */ +printLn(coalesce(1, "Replacement text")); /* Expected "Text" */ diff --git a/tests/logic/tests/compound.hco b/tests/logic/tests/compound.hco index b78e3d52..c87b9cb1 100755 --- a/tests/logic/tests/compound.hco +++ b/tests/logic/tests/compound.hco @@ -1,15 +1,15 @@ let a = 10; a += 2; -print(a); +printLn(a); a = 10; a -= 2; -print(a); +printLn(a); a = 10; a *= 2; -print(a); +printLn(a); a = 10; a /= 2; -print(a); +printLn(a); diff --git a/tests/logic/tests/constants.hco b/tests/logic/tests/constants.hco index 37720b7b..f5cd5e11 100644 --- a/tests/logic/tests/constants.hco +++ b/tests/logic/tests/constants.hco @@ -1,8 +1,8 @@ -print(PI); -print(e); -print(γ); -print(Φ); -print(φ); -print(ρ); -print(true); -print(false); \ No newline at end of file +printLn(PI); +printLn(e); +printLn(γ); +printLn(Φ); +printLn(φ); +printLn(ρ); +printLn(true); +printLn(false); \ No newline at end of file diff --git a/tests/logic/tests/crement.hco b/tests/logic/tests/crement.hco index fbd2c00d..eb096889 100755 --- a/tests/logic/tests/crement.hco +++ b/tests/logic/tests/crement.hco @@ -1,5 +1,5 @@ let a = 10; a++; -print(a); +printLn(a); a--; -print(a); +printLn(a); diff --git a/tests/logic/tests/csv/countrycodes.hco b/tests/logic/tests/csv/countrycodes.hco index 68002e3f..ca093d29 100644 --- a/tests/logic/tests/csv/countrycodes.hco +++ b/tests/logic/tests/csv/countrycodes.hco @@ -53,11 +53,11 @@ let i = 0; while (i < len(countyCodes)) { let country = countyCodes[i]; - print("Item: " + i); - print("Country: " + country[0]); - print("Alpha-2 code : " + country[1]); - print("Alpha-3 code : " + country[2]); - print("Numeric: " + country[3]); - print(""); + printLn("Item: " + i); + printLn("Country: " + country[0]); + printLn("Alpha-2 code : " + country[1]); + printLn("Alpha-3 code : " + country[2]); + printLn("Numeric: " + country[3]); + printLn(""); i++; } diff --git a/tests/logic/tests/customaddfun.hco b/tests/logic/tests/customaddfun.hco index 2f074b35..b311ec15 100644 --- a/tests/logic/tests/customaddfun.hco +++ b/tests/logic/tests/customaddfun.hco @@ -5,6 +5,6 @@ function add(a) { add(a); } - print(a); + printLn(a); } add (1); diff --git a/tests/logic/tests/degrees.hco b/tests/logic/tests/degrees.hco index 7b327d61..dd453cc8 100644 --- a/tests/logic/tests/degrees.hco +++ b/tests/logic/tests/degrees.hco @@ -3,4 +3,4 @@ function degress(value) return cos(value * PI / 180.0); } -print(degress(1)); /* Expected 57.2958 */ \ No newline at end of file +printLn(degress(1)); /* Expected 57.2958 */ \ No newline at end of file diff --git a/tests/logic/tests/doubletype.hco b/tests/logic/tests/doubletype.hco index 1a7870d2..0c9fd7ad 100755 --- a/tests/logic/tests/doubletype.hco +++ b/tests/logic/tests/doubletype.hco @@ -2,36 +2,36 @@ let a = 1.1; if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/logic/tests/endswith.hco b/tests/logic/tests/endswith.hco index 869ffab9..c5b519e4 100644 --- a/tests/logic/tests/endswith.hco +++ b/tests/logic/tests/endswith.hco @@ -7,5 +7,5 @@ function endsWith(source, text) return 0; } -print(endsWith("Hello World!", "World!")); /* Expected true */ -print(endsWith("Lorem ipsum", "World!")); /* Expected false */ \ No newline at end of file +printLn(endsWith("Hello World!", "World!")); /* Expected true */ +printLn(endsWith("Lorem ipsum", "World!")); /* Expected false */ \ No newline at end of file diff --git a/tests/logic/tests/fac.hco b/tests/logic/tests/fac.hco index b49b2212..f60e9525 100644 --- a/tests/logic/tests/fac.hco +++ b/tests/logic/tests/fac.hco @@ -12,4 +12,4 @@ function factailrec(acc, n) return factailrec(n * acc, n - 1); } -print(fac(14)); +printLn(fac(14)); diff --git a/tests/logic/tests/fib.hco b/tests/logic/tests/fib.hco index 6fdbd376..e99e5d98 100755 --- a/tests/logic/tests/fib.hco +++ b/tests/logic/tests/fib.hco @@ -15,6 +15,6 @@ while (c < n) first = second; second = next; } - print(next); + printLn(next); c = c + 1; } diff --git a/tests/logic/tests/fill.hco b/tests/logic/tests/fill.hco index 76b6cb01..bb4e1411 100644 --- a/tests/logic/tests/fill.hco +++ b/tests/logic/tests/fill.hco @@ -10,4 +10,4 @@ function fill(value, n) return output; } -print(fill("=",10)); /* Expected: ========== */ \ No newline at end of file +printLn(fill("=",10)); /* Expected: ========== */ \ No newline at end of file diff --git a/tests/logic/tests/first.hco b/tests/logic/tests/first.hco index 69bbeafe..897bd582 100644 --- a/tests/logic/tests/first.hco +++ b/tests/logic/tests/first.hco @@ -7,8 +7,8 @@ function first(value) return ""; } -print(first("hello")); /* Expected h */ +printLn(first("hello")); /* Expected h */ let items = array(); items[0] = "First item"; items[1] = "Second item"; -print(first(items)); /* First item */ \ No newline at end of file +printLn(first(items)); /* First item */ \ No newline at end of file diff --git a/tests/logic/tests/fizzbuzz.hco b/tests/logic/tests/fizzbuzz.hco index 49ed4e8a..162192a2 100755 --- a/tests/logic/tests/fizzbuzz.hco +++ b/tests/logic/tests/fizzbuzz.hco @@ -4,23 +4,23 @@ while (i < maxNumber) { if (i % 5 == 0 && i % 3 == 0) { - print("FizzBuzz"); + printLn("FizzBuzz"); } else { if (i % 3 == 0) { - print("Fizz"); + printLn("Fizz"); } else { if (i % 5 == 0) { - print("Buzz"); + printLn("Buzz"); } else { - print(i); + printLn(i); } } } diff --git a/tests/logic/tests/functions.hco b/tests/logic/tests/functions.hco index 6b849746..be5825df 100755 --- a/tests/logic/tests/functions.hco +++ b/tests/logic/tests/functions.hco @@ -1,17 +1,17 @@ -print(asc("a")); -print(cha(67)); -print(toUpper("hello world!")); -print(toLower("HELLO WORLD!")); -print(inStr("hello world", "world")); -print(inStrRev("hello world", "world")); -print(strRev("!dlroW olleH")); -print(len("Hello World!")); -print(space(10)); -print(strCmp("Hello World","Hello Earth")); -print(trim(" Hello World! ")); -print(lTrim(" Hello World!")); -print(rTrim("Hello World! ")); -print(left("Hello World!",5)); -print(mid("Hello World!",2,5)); -print(right("Hello World!",4)); -print(toString("1")); +printLn(asc("a")); +printLn(cha(67)); +printLn(toUpper("hello world!")); +printLn(toLower("HELLO WORLD!")); +printLn(inStr("hello world", "world")); +printLn(inStrRev("hello world", "world")); +printLn(strRev("!dlroW olleH")); +printLn(len("Hello World!")); +printLn(space(10)); +printLn(strCmp("Hello World","Hello Earth")); +printLn(trim(" Hello World! ")); +printLn(lTrim(" Hello World!")); +printLn(rTrim("Hello World! ")); +printLn(left("Hello World!",5)); +printLn(mid("Hello World!",2,5)); +printLn(right("Hello World!",4)); +printLn(toString("1")); diff --git a/tests/logic/tests/functions2.hco b/tests/logic/tests/functions2.hco index 8412f436..6ba76057 100755 --- a/tests/logic/tests/functions2.hco +++ b/tests/logic/tests/functions2.hco @@ -1,5 +1,5 @@ -print(month(1485199747)); -print(monthName(month(1485199747))); -print(weekday(1485199747)); -print(weekdayName(1485199747)); -print(year(1440544844)); \ No newline at end of file +printLn(month(1485199747)); +printLn(monthName(month(1485199747))); +printLn(weekday(1485199747)); +printLn(weekdayName(1485199747)); +printLn(year(1440544844)); \ No newline at end of file diff --git a/tests/logic/tests/functions3.hco b/tests/logic/tests/functions3.hco index de79ad84..8b49f128 100755 --- a/tests/logic/tests/functions3.hco +++ b/tests/logic/tests/functions3.hco @@ -1,16 +1,16 @@ -print(abs(1)); -print(acos(1)); -print(asin(1)); -print(atan(1)); -print(atan2(1,1)); -print(ceil(1)); -print(cos(1)); -print(exp(1)); -print(sin(1)); -print(sqrt(2)); -print(tan(1)); -print(pow(2,2)); -print(sqrt(2)); -print(min(1,2,3)); -print(max(1,2,3)); -print(floor(1.2)); +printLn(abs(1)); +printLn(acos(1)); +printLn(asin(1)); +printLn(atan(1)); +printLn(atan2(1,1)); +printLn(ceil(1)); +printLn(cos(1)); +printLn(exp(1)); +printLn(sin(1)); +printLn(sqrt(2)); +printLn(tan(1)); +printLn(pow(2,2)); +printLn(sqrt(2)); +printLn(min(1,2,3)); +printLn(max(1,2,3)); +printLn(floor(1.2)); diff --git a/tests/logic/tests/functions4.hco b/tests/logic/tests/functions4.hco index f36b1eb5..428d1722 100755 --- a/tests/logic/tests/functions4.hco +++ b/tests/logic/tests/functions4.hco @@ -1,5 +1,5 @@ let txt = "This is a beautiful day!"; -print(inStrRev(txt,"i")); -print(inStrRev(txt,"t")); -print(inStrRev(txt,"T")); -print(timeFormat(1505150753, "%c")); +printLn(inStrRev(txt,"i")); +printLn(inStrRev(txt,"t")); +printLn(inStrRev(txt,"T")); +printLn(timeFormat(1505150753, "%c")); diff --git a/tests/logic/tests/gcd.hco b/tests/logic/tests/gcd.hco index d1d7c913..becf8f6a 100644 --- a/tests/logic/tests/gcd.hco +++ b/tests/logic/tests/gcd.hco @@ -17,4 +17,4 @@ function gcd(a, b) return a; } -print(gcd(20, 4)); +printLn(gcd(20, 4)); diff --git a/tests/logic/tests/ifelse.hco b/tests/logic/tests/ifelse.hco index 6bb1ae46..0e986633 100755 --- a/tests/logic/tests/ifelse.hco +++ b/tests/logic/tests/ifelse.hco @@ -1,18 +1,18 @@ let i = 10; if (i < 10) { - print("If"); + printLn("If"); } else if (i > 10) { - print("Else If 1"); + printLn("Else If 1"); } else if (i > 5) { - print("Else If 2"); + printLn("Else If 2"); } else { - print("Else"); + printLn("Else"); } -print("Done"); \ No newline at end of file +printLn("Done"); \ No newline at end of file diff --git a/tests/logic/tests/ifs.hco b/tests/logic/tests/ifs.hco index 2d1f2630..4f0e79c2 100755 --- a/tests/logic/tests/ifs.hco +++ b/tests/logic/tests/ifs.hco @@ -1,76 +1,76 @@ let value = 5; if (value > 4) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value < 5) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value > 1 && value < 9) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value >= 5) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value <= 5) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (not(value)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value > 5 && (value < 1 || value > 1)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } -print("DONE"); +printLn("DONE"); diff --git a/tests/logic/tests/inttype.hco b/tests/logic/tests/inttype.hco index f3a5cb94..984c6a9e 100755 --- a/tests/logic/tests/inttype.hco +++ b/tests/logic/tests/inttype.hco @@ -2,36 +2,36 @@ let a = 1; if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/logic/tests/isBlank.hco b/tests/logic/tests/isBlank.hco index 9de0a9a3..71bed886 100644 --- a/tests/logic/tests/isBlank.hco +++ b/tests/logic/tests/isBlank.hco @@ -11,11 +11,11 @@ function isBlank(value) return 0; } -print(isBlank("")); /* Expected true */ -print(isBlank("Text")); /* Expected false */ +printLn(isBlank("")); /* Expected true */ +printLn(isBlank("Text")); /* Expected false */ let items = array(); -print(isBlank(items)); /* Expected true */ +printLn(isBlank(items)); /* Expected true */ items[0] = "Item 1"; -print(isBlank(items)); /* Expected false */ -print(isBlank(0)); /* Expected false */ -print(isBlank(1)); /* Expected false */ +printLn(isBlank(items)); /* Expected false */ +printLn(isBlank(0)); /* Expected false */ +printLn(isBlank(1)); /* Expected false */ diff --git a/tests/logic/tests/join.hco b/tests/logic/tests/join.hco index 843d2661..3f58fa73 100644 --- a/tests/logic/tests/join.hco +++ b/tests/logic/tests/join.hco @@ -16,10 +16,10 @@ function join(input, seperator) return str(input); } -print(join(str("123456789"), ",")); +printLn(join(str("123456789"), ",")); let list = array(); list[0] = "a"; list[1] = "b"; list[2] = "c"; list[3] = "d"; -print(join(list, ":")); +printLn(join(list, ":")); diff --git a/tests/logic/tests/json.hco b/tests/logic/tests/json.hco index 4bea5b58..f539617a 100644 --- a/tests/logic/tests/json.hco +++ b/tests/logic/tests/json.hco @@ -1,5 +1,5 @@ let emptyArray = array(); -print(jsonEncode(emptyArray)); +printLn(jsonEncode(emptyArray)); let list = array(); list[1] = "1"; @@ -7,11 +7,11 @@ list[2] = "2"; list[3] = "3"; list[4] = "4"; list[5] = "5"; -print(jsonEncode(list)); +printLn(jsonEncode(list)); let arrayOfArrays = array(); let innerArray = array(); innerArray["1"] = "1"; innerArray["2"] = "2"; arrayOfArrays["array"] = innerArray; -print(jsonEncode(arrayOfArrays)); +printLn(jsonEncode(arrayOfArrays)); diff --git a/tests/logic/tests/json2.hco b/tests/logic/tests/json2.hco index 9868d00c..15db67f0 100644 --- a/tests/logic/tests/json2.hco +++ b/tests/logic/tests/json2.hco @@ -1,4 +1,4 @@ -print(jsonDecode("[1]")); -print(jsonDecode("{}")); -print(jsonDecode("[1,2,3,4,5]")); -print(jsonDecode("{ \"key1\" : { \"key2\": \"value\"}")); +printLn(jsonDecode("[1]")); +printLn(jsonDecode("{}")); +printLn(jsonDecode("[1,2,3,4,5]")); +printLn(jsonDecode("{ \"key1\" : { \"key2\": \"value\"}")); diff --git a/tests/logic/tests/last.hco b/tests/logic/tests/last.hco index 3959ce6f..ed4e7592 100644 --- a/tests/logic/tests/last.hco +++ b/tests/logic/tests/last.hco @@ -8,8 +8,8 @@ function last(value) return ""; } -print(last("hello")); /* Expected o */ +printLn(last("hello")); /* Expected o */ let items = array(); items[0] = "First item"; items[1] = "Second item"; -print(last(items)); /* Expected Second item */ \ No newline at end of file +printLn(last(items)); /* Expected Second item */ \ No newline at end of file diff --git a/tests/logic/tests/leap_year.hco b/tests/logic/tests/leap_year.hco index ca45ecfb..2f07a470 100644 --- a/tests/logic/tests/leap_year.hco +++ b/tests/logic/tests/leap_year.hco @@ -21,11 +21,11 @@ while (i < 2100) let isLeap = isLeapYear(i); if (isLeap == true) { - print(str(i) + " is a leap year"); + printLn(str(i) + " is a leap year"); } else { - print(str(i) + " is not a leap year"); + printLn(str(i) + " is not a leap year"); } i++; } diff --git a/tests/logic/tests/logic1.hco b/tests/logic/tests/logic1.hco index 81e00e90..889412dd 100755 --- a/tests/logic/tests/logic1.hco +++ b/tests/logic/tests/logic1.hco @@ -1,26 +1,26 @@ -print(1&&1); -print(1||0); -print(1&&(1||0)); +printLn(1&&1); +printLn(1||0); +printLn(1&&(1||0)); -print("OR"); -print(0||0); -print(0||1); -print(1||0); -print(1||1); +printLn("OR"); +printLn(0||0); +printLn(0||1); +printLn(1||0); +printLn(1||1); -print("AND"); -print(0&&0); -print(0&&1); -print(1&&0); -print(1&&1); +printLn("AND"); +printLn(0&&0); +printLn(0&&1); +printLn(1&&0); +printLn(1&&1); -print("AND/OR"); -print(0||(1&&1)); -print(1||(0&&0)); -print(0&&(0||1)); -print(1&&(1||0)); +printLn("AND/OR"); +printLn(0||(1&&1)); +printLn(1||(0&&0)); +printLn(0&&(0||1)); +printLn(1&&(1||0)); -print("LOGIC/MATH"); -print(0+1||0); -print(0); -print(1); +printLn("LOGIC/MATH"); +printLn(0+1||0); +printLn(0); +printLn(1); diff --git a/tests/logic/tests/math1.hco b/tests/logic/tests/math1.hco index d0f14b76..a3ab36d9 100755 --- a/tests/logic/tests/math1.hco +++ b/tests/logic/tests/math1.hco @@ -1,16 +1,16 @@ -print(1234); -print(1+2*3); -print(5*(4+4+1)); -print(5*((1+3)*2+1)); -print(5 * ((1 + 3) * 2 + 1)); -print(5 - 2 * ( 3 )); -print(5 - 2 * ( ( 4 ) - 1 )); -print(1.5/5); -print((4-3)/(4*4)); -print(1/2/2); -print(0.25 * .5 * 0.5); -print(.25 / 2 * .5); -print(1+-2); -print(-4*(2+1)); -print(-2); -print(+2); \ No newline at end of file +printLn(1234); +printLn(1+2*3); +printLn(5*(4+4+1)); +printLn(5*((1+3)*2+1)); +printLn(5 * ((1 + 3) * 2 + 1)); +printLn(5 - 2 * ( 3 )); +printLn(5 - 2 * ( ( 4 ) - 1 )); +printLn(1.5/5); +printLn((4-3)/(4*4)); +printLn(1/2/2); +printLn(0.25 * .5 * 0.5); +printLn(.25 / 2 * .5); +printLn(1+-2); +printLn(-4*(2+1)); +printLn(-2); +printLn(+2); \ No newline at end of file diff --git a/tests/logic/tests/math2.hco b/tests/logic/tests/math2.hco index ec85cb97..24d64adf 100755 --- a/tests/logic/tests/math2.hco +++ b/tests/logic/tests/math2.hco @@ -1,17 +1,17 @@ -print(1234); -print(1+2*3); -print(5*(4+4+1)); -print(5*((1+3)*2+1)); -print(5 * ((1 + 3) * 2 + 1)); -print(5 - 2 * ( 3 )); -print(5 - 2 * ( ( 4 ) - 1 )); -print(1.5/5); -print((4-3)/(4*4)); -print(1/2/2); -print(0.25 * .5 * 0.5); -print(.25 / 2 * .5); -print(1+-2); -print(-4*(2+1)); -print(-2); -print(+2); -print(-(2+1)*4); +printLn(1234); +printLn(1+2*3); +printLn(5*(4+4+1)); +printLn(5*((1+3)*2+1)); +printLn(5 * ((1 + 3) * 2 + 1)); +printLn(5 - 2 * ( 3 )); +printLn(5 - 2 * ( ( 4 ) - 1 )); +printLn(1.5/5); +printLn((4-3)/(4*4)); +printLn(1/2/2); +printLn(0.25 * .5 * 0.5); +printLn(.25 / 2 * .5); +printLn(1+-2); +printLn(-4*(2+1)); +printLn(-2); +printLn(+2); +printLn(-(2+1)*4); diff --git a/tests/logic/tests/mathparser.hco b/tests/logic/tests/mathparser.hco index 0ffb626d..f9ca2818 100644 --- a/tests/logic/tests/mathparser.hco +++ b/tests/logic/tests/mathparser.hco @@ -66,16 +66,16 @@ function valueOfExpr() i = 0; list = "1+2*5"; -print(valueOfExpr()); +printLn(valueOfExpr()); i = 0; list = "1+2*5+2/2"; -print(valueOfExpr()); +printLn(valueOfExpr()); i = 0; list = "5*(4+4+1)"; -print(valueOfExpr()); +printLn(valueOfExpr()); i = 0; list = "1+(2*2)"; -print(valueOfExpr()); +printLn(valueOfExpr()); diff --git a/tests/logic/tests/newlines.hco b/tests/logic/tests/newlines.hco index ff19116a..63a85a7c 100644 --- a/tests/logic/tests/newlines.hco +++ b/tests/logic/tests/newlines.hco @@ -1,2 +1,2 @@ let text = "\n\n\n\n"; -print(text); \ No newline at end of file +printLn(text); \ No newline at end of file diff --git a/tests/logic/tests/not.hco b/tests/logic/tests/not.hco index d90b93c5..9a2261a9 100644 --- a/tests/logic/tests/not.hco +++ b/tests/logic/tests/not.hco @@ -1,4 +1,4 @@ -print(not(1)); /* Expected 0 */ -print(not(0)); /* Expected 1 */ \ No newline at end of file +printLn(not(1)); /* Expected 0 */ +printLn(not(0)); /* Expected 1 */ \ No newline at end of file diff --git a/tests/logic/tests/not1.hco b/tests/logic/tests/not1.hco index b1f551a1..05d435d0 100755 --- a/tests/logic/tests/not1.hco +++ b/tests/logic/tests/not1.hco @@ -1,2 +1,2 @@ -print(!1); -print(!0); +printLn(!1); +printLn(!0); diff --git a/tests/logic/tests/or.hco b/tests/logic/tests/or.hco index 1316e7b8..1a3733ed 100644 --- a/tests/logic/tests/or.hco +++ b/tests/logic/tests/or.hco @@ -7,7 +7,7 @@ function or(left, right) return 0; } -print(or(1,1)); /* Expected true */ -print(or(1,0)); /* Expected true */ -print(or(0,1)); /* Expected true */ -print(or(0,0)); /* Expected false */ \ No newline at end of file +printLn(or(1,1)); /* Expected true */ +printLn(or(1,0)); /* Expected true */ +printLn(or(0,1)); /* Expected true */ +printLn(or(0,0)); /* Expected false */ \ No newline at end of file diff --git a/tests/logic/tests/printSyntax.hco b/tests/logic/tests/printSyntax.hco index 2cd2d740..15f7bd63 100755 --- a/tests/logic/tests/printSyntax.hco +++ b/tests/logic/tests/printSyntax.hco @@ -1,4 +1,4 @@ -print +printLn ( ( ( @@ -7,4 +7,4 @@ print ) ) ) -); \ No newline at end of file +); diff --git a/tests/logic/tests/proper.hco b/tests/logic/tests/proper.hco index 5a3a14b9..61ad70ca 100644 --- a/tests/logic/tests/proper.hco +++ b/tests/logic/tests/proper.hco @@ -16,5 +16,5 @@ function proper(value) return output; } -print(proper("hello")); /* Expected Hello */ -print(proper("l")); /* Expected L */ \ No newline at end of file +printLn(proper("hello")); /* Expected Hello */ +printLn(proper("l")); /* Expected L */ \ No newline at end of file diff --git a/tests/logic/tests/queensproblem.hco b/tests/logic/tests/queensproblem.hco index f5d72166..bf05a665 100644 --- a/tests/logic/tests/queensproblem.hco +++ b/tests/logic/tests/queensproblem.hco @@ -97,4 +97,4 @@ function hasConflict(newRow, newColumn, solution) return false; } -print(queenPuzzle(4,4)); +printLn(queenPuzzle(4,4)); diff --git a/tests/logic/tests/radians.hco b/tests/logic/tests/radians.hco index c9e78cff..311187c8 100644 --- a/tests/logic/tests/radians.hco +++ b/tests/logic/tests/radians.hco @@ -3,4 +3,4 @@ function radians(value) return tan(value * PI / 180.0); } -print(radians(1)); /* Expected 0.017455 */ \ No newline at end of file +printLn(radians(1)); /* Expected 0.017455 */ \ No newline at end of file diff --git a/tests/logic/tests/regex.hco b/tests/logic/tests/regex.hco index 38c89823..25376e1b 100755 --- a/tests/logic/tests/regex.hco +++ b/tests/logic/tests/regex.hco @@ -1,5 +1,5 @@ -print(regexSearch("Roses are #ff0000", "#([a-f0-9]{2})")); -print(regexSearch("Roses are #ff0000", "#([a-f0-9]{2})")); +printLn(regexSearch("Roses are #ff0000", "#([a-f0-9]{2})")); +printLn(regexSearch("Roses are #ff0000", "#([a-f0-9]{2})")); regexReplace("Quick brown fox", "a|e|i|o|u", "[$&]"); /* Returns "Q[u][i]ck br[o]wn f[o]x" */ let result = regexMatch("huwcode.hco", "[a-z]+\\.hco"); -print(result); +printLn(result); diff --git a/tests/logic/tests/return.hco b/tests/logic/tests/return.hco index ab7c2bd1..930ed5ce 100644 --- a/tests/logic/tests/return.hco +++ b/tests/logic/tests/return.hco @@ -1,15 +1,15 @@ function test() { return "Hello World"; - print("Hello World"); + printLn("Hello World"); return "Hello World"; } -print(test()); +printLn(test()); function test2() { return 1; - print("Hello World"); + printLn("Hello World"); return 2; } -print(test2()); +printLn(test2()); diff --git a/tests/logic/tests/reverse.hco b/tests/logic/tests/reverse.hco index fbade2c9..cbb7d8ef 100644 --- a/tests/logic/tests/reverse.hco +++ b/tests/logic/tests/reverse.hco @@ -15,4 +15,4 @@ function reverse(value) return output; } -print(reverse("olleh")); \ No newline at end of file +printLn(reverse("olleh")); \ No newline at end of file diff --git a/tests/logic/tests/shift.hco b/tests/logic/tests/shift.hco index 8048e1da..f0bafd4d 100644 --- a/tests/logic/tests/shift.hco +++ b/tests/logic/tests/shift.hco @@ -1,2 +1,2 @@ -print(212<<1); -print(212>>2); +printLn(212<<1); +printLn(212>>2); diff --git a/tests/logic/tests/sleep.hco b/tests/logic/tests/sleep.hco index 49192a72..2eb11a50 100644 --- a/tests/logic/tests/sleep.hco +++ b/tests/logic/tests/sleep.hco @@ -1,2 +1,2 @@ sleep(1000); -print("Done"); +printLn("Done"); diff --git a/tests/logic/tests/sort.hco b/tests/logic/tests/sort.hco index a0f57bd0..37dea546 100644 --- a/tests/logic/tests/sort.hco +++ b/tests/logic/tests/sort.hco @@ -10,6 +10,6 @@ list[7] = 12; list[8] = 27; list[9] = 26; -print(list); -print(sort(list)); -print(list); +printLn(list); +printLn(sort(list)); +printLn(list); diff --git a/tests/logic/tests/sorting.hco b/tests/logic/tests/sorting.hco index 95a1da99..033281fc 100644 --- a/tests/logic/tests/sorting.hco +++ b/tests/logic/tests/sorting.hco @@ -103,8 +103,8 @@ list[5] = 10; list[6] = 4; list[7] = 1; let a = insertationSort(list); -print(a); -print(checkSort(a)); +printLn(a); +printLn(checkSort(a)); list[0] = 701; list[1] = 301; @@ -116,9 +116,9 @@ list[6] = 4; list[7] = 1; let a = bubbleSort(list); -print(a); +printLn(a); -print(checkSort(a)); +printLn(checkSort(a)); list[0] = 701; list[1] = 301; @@ -130,5 +130,5 @@ list[6] = 4; list[7] = 1; let a = shellSort(list); -print(a); -print(checkSort(a)); +printLn(a); +printLn(checkSort(a)); diff --git a/tests/logic/tests/split.hco b/tests/logic/tests/split.hco index 350b7a7a..8e72fb24 100644 --- a/tests/logic/tests/split.hco +++ b/tests/logic/tests/split.hco @@ -28,5 +28,5 @@ function split(input, deliminator) return output; } -print(split("Hello,world!", ",")); -print(split("1,2,3,4,5,6,7,8,9",",")); +printLn(split("Hello,world!", ",")); +printLn(split("1,2,3,4,5,6,7,8,9",",")); diff --git a/tests/logic/tests/startswith.hco b/tests/logic/tests/startswith.hco index 48ab12e5..8e141417 100644 --- a/tests/logic/tests/startswith.hco +++ b/tests/logic/tests/startswith.hco @@ -7,5 +7,5 @@ function startsWith(source, text) return 0; } -print(startsWith("Hello World!", "Hello")); /* Expected true */ -print(startsWith("Lorem ipsum", "Hello")); /* Expected false */ \ No newline at end of file +printLn(startsWith("Hello World!", "Hello")); /* Expected true */ +printLn(startsWith("Lorem ipsum", "Hello")); /* Expected false */ \ No newline at end of file diff --git a/tests/logic/tests/strContains.hco b/tests/logic/tests/strContains.hco index 3e64a35a..cb5e519c 100644 --- a/tests/logic/tests/strContains.hco +++ b/tests/logic/tests/strContains.hco @@ -7,7 +7,7 @@ function strContains(string1, string2) return 1; } -print(strContains("Lorem ipsum dolor sit amet", "sit")); /* True */ -print(strContains("Hello world!", "world")); /* True */ -print(strContains("Lorem ipsum dolor sit amet", "unknown")); /* False */ -print(strContains("Hello world!", "unknown")); /* False */ +printLn(strContains("Lorem ipsum dolor sit amet", "sit")); /* True */ +printLn(strContains("Hello world!", "world")); /* True */ +printLn(strContains("Lorem ipsum dolor sit amet", "unknown")); /* False */ +printLn(strContains("Hello world!", "unknown")); /* False */ diff --git a/tests/logic/tests/stringtype.hco b/tests/logic/tests/stringtype.hco index e423a920..fcd198d3 100755 --- a/tests/logic/tests/stringtype.hco +++ b/tests/logic/tests/stringtype.hco @@ -2,36 +2,36 @@ let a = "Hello world!"; if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/logic/tests/todouble.hco b/tests/logic/tests/todouble.hco index 71aa1061..a28a0ef6 100755 --- a/tests/logic/tests/todouble.hco +++ b/tests/logic/tests/todouble.hco @@ -1,4 +1,4 @@ let a = "1.1"; -print(toDouble(a)); +printLn(toDouble(a)); let a = "1"; -print(toDouble(a)); +printLn(toDouble(a)); diff --git a/tests/logic/tests/toint.hco b/tests/logic/tests/toint.hco index 7d54a4f2..a71e4df0 100755 --- a/tests/logic/tests/toint.hco +++ b/tests/logic/tests/toint.hco @@ -1,4 +1,4 @@ let a = "1.0"; -print(toInt(a)); +printLn(toInt(a)); let a = "1"; -print(toInt(a)); +printLn(toInt(a)); diff --git a/tests/logic/tests/towerofhanoi.hco b/tests/logic/tests/towerofhanoi.hco index a8073e45..c0d66629 100644 --- a/tests/logic/tests/towerofhanoi.hco +++ b/tests/logic/tests/towerofhanoi.hco @@ -3,7 +3,7 @@ function move(n, a, b, c) if (n > 0) { move(n-1, a, c, b); - print("Move disk from " + a + " to " + c); + printLn("Move disk from " + a + " to " + c); move(n-1, b, a, c); } } diff --git a/tests/logic/tests/types.hco b/tests/logic/tests/types.hco index 10709c48..9eea5766 100755 --- a/tests/logic/tests/types.hco +++ b/tests/logic/tests/types.hco @@ -2,4 +2,4 @@ let number = 0; number = ""; let example1 = "0"; number = number + "bob"; -print(number); +printLn(number); diff --git a/tests/transpiler/expected/error-arrayStringComparison.hco b/tests/transpiler/expected/error-arrayStringComparison.hco index d5b91ced..c5cca4d0 100644 --- a/tests/transpiler/expected/error-arrayStringComparison.hco +++ b/tests/transpiler/expected/error-arrayStringComparison.hco @@ -1,4 +1,4 @@ let a = array(); let b = ""; -print(a == b); +printLn(a == b); diff --git a/tests/transpiler/expected/error-missingRightParentheses.hco b/tests/transpiler/expected/error-missingRightParentheses.hco index 6b29db8d..991158da 100644 --- a/tests/transpiler/expected/error-missingRightParentheses.hco +++ b/tests/transpiler/expected/error-missingRightParentheses.hco @@ -1 +1 @@ -print("Hello" +printLn("Hello" diff --git a/tests/transpiler/expected/error-missingSemicolon.hco b/tests/transpiler/expected/error-missingSemicolon.hco index 2f9a147d..6b2868a7 100644 --- a/tests/transpiler/expected/error-missingSemicolon.hco +++ b/tests/transpiler/expected/error-missingSemicolon.hco @@ -1 +1 @@ -print("Hello") +printLn("Hello") diff --git a/tests/transpiler/expected/error-outOfBounds.hco b/tests/transpiler/expected/error-outOfBounds.hco index 8c566182..2f5925d4 100644 --- a/tests/transpiler/expected/error-outOfBounds.hco +++ b/tests/transpiler/expected/error-outOfBounds.hco @@ -2,6 +2,6 @@ let text = "Hello World"; let i = -10; while (i < count(text)+10) { - print(arrayGet(text, i)); + printLn(arrayGet(text, i)); i++; } diff --git a/tests/transpiler/expected/error-undeclared.hco b/tests/transpiler/expected/error-undeclared.hco index 99a5e87a..73a94d8c 100644 --- a/tests/transpiler/expected/error-undeclared.hco +++ b/tests/transpiler/expected/error-undeclared.hco @@ -1 +1 @@ -print(text); +printLn(text); diff --git a/tests/transpiler/formatter/11.hco b/tests/transpiler/formatter/11.hco index 2b01f04b..165d5e80 100644 --- a/tests/transpiler/formatter/11.hco +++ b/tests/transpiler/formatter/11.hco @@ -1 +1 @@ -let a=1;while (a<10+1){print(a);let a=a+1;} +let a=1;while (a<10+1){printLn(a);a=a+1;} diff --git a/tests/transpiler/formatter/12.hco b/tests/transpiler/formatter/12.hco index 83a67ff5..efc25718 100644 --- a/tests/transpiler/formatter/12.hco +++ b/tests/transpiler/formatter/12.hco @@ -1 +1 @@ -print(1+(1+2)); +printLn(1+(1+2)); diff --git a/tests/transpiler/formatter/3.hco b/tests/transpiler/formatter/3.hco index 151ff8e4..caeedd42 100644 --- a/tests/transpiler/formatter/3.hco +++ b/tests/transpiler/formatter/3.hco @@ -1 +1 @@ -print(1+1);print(1+1); +printLn(1+1);printLn(1+1); diff --git a/tests/transpiler/formatter/4.hco b/tests/transpiler/formatter/4.hco index acb7a5ed..c24aa78b 100644 --- a/tests/transpiler/formatter/4.hco +++ b/tests/transpiler/formatter/4.hco @@ -1 +1 @@ -let a=1+1;print(a);print(1+1); +let a=1+1;printLn(a);printLn(1+1); diff --git a/tests/transpiler/formatter/5.hco b/tests/transpiler/formatter/5.hco index dc120695..94150a09 100644 --- a/tests/transpiler/formatter/5.hco +++ b/tests/transpiler/formatter/5.hco @@ -1 +1 @@ -let a=1+(9*8);if (a){print(a);}print(1+1); +let a=1+(9*8);if (a){printLn(a);}printLn(1+1); diff --git a/tests/transpiler/formatter/6.hco b/tests/transpiler/formatter/6.hco index 2726688b..e1376c94 100644 --- a/tests/transpiler/formatter/6.hco +++ b/tests/transpiler/formatter/6.hco @@ -1 +1 @@ -let a=1;if (a>0){print(a);}print(1+1); +let a=1;if (a>0){printLn(a);}printLn(1+1); diff --git a/tests/transpiler/formatter/7.hco b/tests/transpiler/formatter/7.hco index 4f061a8f..a5008285 100644 --- a/tests/transpiler/formatter/7.hco +++ b/tests/transpiler/formatter/7.hco @@ -1 +1 @@ -let a=1;while (a<100){print(a);let a=a+1;} +let a=1;while (a<100){printLn(a);a=a+1;} diff --git a/tests/transpiler/formatter/8.hco b/tests/transpiler/formatter/8.hco index 2dfde143..11df5060 100644 --- a/tests/transpiler/formatter/8.hco +++ b/tests/transpiler/formatter/8.hco @@ -1 +1 @@ -let a=1;let b=1;let c=30;while (a10){print("Else If 1");}else{if (i>5){print("Else If 2");}else{print("Else");}}}print("Done"); +let i=10;if (i<10){printLn("If");}else{if (i>10){printLn("Else If 1");}else{if (i>5){printLn("Else If 2");}else{printLn("Else");}}}printLn("Done"); diff --git a/tests/transpiler/formatter/ifs.hco b/tests/transpiler/formatter/ifs.hco index ce4d26bc..108a0a47 100644 --- a/tests/transpiler/formatter/ifs.hco +++ b/tests/transpiler/formatter/ifs.hco @@ -1 +1 @@ -let value=5;if (value>4){print("TRUE");}else{print("FALSE");}if (value<5){print("TRUE");}else{print("FALSE");}if (value>1&&value<9){print("TRUE");}else{print("FALSE");}if (value>=5){print("TRUE");}else{print("FALSE");}if (value<=5){print("TRUE");}else{print("FALSE");}if (value){print("TRUE");}else{print("FALSE");}if (not(value)){print("TRUE");}else{print("FALSE");}if (value>5&&(value<1||value>1)){print("TRUE");}else{print("FALSE");}print("DONE"); +let value=5;if (value>4){printLn("TRUE");}else{printLn("FALSE");}if (value<5){printLn("TRUE");}else{printLn("FALSE");}if (value>1&&value<9){printLn("TRUE");}else{printLn("FALSE");}if (value>=5){printLn("TRUE");}else{printLn("FALSE");}if (value<=5){printLn("TRUE");}else{printLn("FALSE");}if (value){printLn("TRUE");}else{printLn("FALSE");}if (not(value)){printLn("TRUE");}else{printLn("FALSE");}if (value>5&&(value<1||value>1)){printLn("TRUE");}else{printLn("FALSE");}printLn("DONE"); diff --git a/tests/transpiler/formatter/inttype.hco b/tests/transpiler/formatter/inttype.hco index 1d5ca498..f46cbffb 100644 --- a/tests/transpiler/formatter/inttype.hco +++ b/tests/transpiler/formatter/inttype.hco @@ -1 +1 @@ -let a=1;if (isDoubleType(a)){print("TRUE");}else{print("FALSE");}if (isIntType(a)){print("TRUE");}else{print("FALSE");}if (isStringType(a)){print("TRUE");}else{print("FALSE");}if (isArrayType(a)){print("TRUE");}else{print("FALSE");} +let a=1;if (isDoubleType(a)){printLn("TRUE");}else{printLn("FALSE");}if (isIntType(a)){printLn("TRUE");}else{printLn("FALSE");}if (isStringType(a)){printLn("TRUE");}else{printLn("FALSE");}if (isArrayType(a)){printLn("TRUE");}else{printLn("FALSE");} diff --git a/tests/transpiler/formatter/logic1.hco b/tests/transpiler/formatter/logic1.hco index 4f918f7c..c8b9ced5 100644 --- a/tests/transpiler/formatter/logic1.hco +++ b/tests/transpiler/formatter/logic1.hco @@ -1 +1 @@ -print(1&&1);print(1||0);print(1&&(1||0));print("OR");print(0||0);print(0||1);print(1||0);print(1||1);print("AND");print(0&&0);print(0&&1);print(1&&0);print(1&&1);print("AND/OR");print(0||(1&&1));print(1||(0&&0));print(0&&(0||1));print(1&&(1||0));print("LOGIC/MATH");print(0+1||0);print(0);print(1); +printLn(1&&1);printLn(1||0);printLn(1&&(1||0));printLn("OR");printLn(0||0);printLn(0||1);printLn(1||0);printLn(1||1);printLn("AND");printLn(0&&0);printLn(0&&1);printLn(1&&0);printLn(1&&1);printLn("AND/OR");printLn(0||(1&&1));printLn(1||(0&&0));printLn(0&&(0||1));printLn(1&&(1||0));printLn("LOGIC/MATH");printLn(0+1||0);printLn(0);printLn(1); diff --git a/tests/transpiler/formatter/math1.hco b/tests/transpiler/formatter/math1.hco index c655edda..7cb8aa71 100644 --- a/tests/transpiler/formatter/math1.hco +++ b/tests/transpiler/formatter/math1.hco @@ -1 +1 @@ -print(1234);print(1+2*3);print(5*(4+4+1));print(5*((1+3)*2+1));print(5*((1+3)*2+1));print(5-2*(3));print(5-2*((4)-1));print(1.5/5);print((4-3)/(4*4));print(1/2/2);print(0.25*0.5*0.5);print(0.25/2*0.5);print(1+-2);print(-4*(2+1));print(-2);print(2); +printLn(1234);printLn(1+2*3);printLn(5*(4+4+1));printLn(5*((1+3)*2+1));printLn(5*((1+3)*2+1));printLn(5-2*(3));printLn(5-2*((4)-1));printLn(1.5/5);printLn((4-3)/(4*4));printLn(1/2/2);printLn(0.25*0.5*0.5);printLn(0.25/2*0.5);printLn(1+-2);printLn(-4*(2+1));printLn(-2);printLn(2); diff --git a/tests/transpiler/formatter/math2.hco b/tests/transpiler/formatter/math2.hco index 1aec5f1a..8057c517 100644 --- a/tests/transpiler/formatter/math2.hco +++ b/tests/transpiler/formatter/math2.hco @@ -1 +1 @@ -print(1234);print(1+2*3);print(5*(4+4+1));print(5*((1+3)*2+1));print(5*((1+3)*2+1));print(5-2*(3));print(5-2*((4)-1));print(1.5/5);print((4-3)/(4*4));print(1/2/2);print(0.25*0.5*0.5);print(0.25/2*0.5);print(1+-2);print(-4*(2+1));print(-2);print(2);print(-(2+1)*4); +printLn(1234);printLn(1+2*3);printLn(5*(4+4+1));printLn(5*((1+3)*2+1));printLn(5*((1+3)*2+1));printLn(5-2*(3));printLn(5-2*((4)-1));printLn(1.5/5);printLn((4-3)/(4*4));printLn(1/2/2);printLn(0.25*0.5*0.5);printLn(0.25/2*0.5);printLn(1+-2);printLn(-4*(2+1));printLn(-2);printLn(2);printLn(-(2+1)*4); diff --git a/tests/transpiler/formatter/not1.hco b/tests/transpiler/formatter/not1.hco index 5ded9777..2b303bf8 100644 --- a/tests/transpiler/formatter/not1.hco +++ b/tests/transpiler/formatter/not1.hco @@ -1 +1 @@ -print(!1);print(!0); +printLn(!1);printLn(!0); diff --git a/tests/transpiler/formatter/printSyntax.hco b/tests/transpiler/formatter/printSyntax.hco index 95a5dc41..cc0f0b66 100644 --- a/tests/transpiler/formatter/printSyntax.hco +++ b/tests/transpiler/formatter/printSyntax.hco @@ -1 +1 @@ -print(((("\"Hello WorldD556546!&%&%*%*%(%$")))); +printLn(((("\"Hello WorldD556546!&%&%*%*%(%$")))); diff --git a/tests/transpiler/formatter/return.hco b/tests/transpiler/formatter/return.hco index 407fda99..a5af9d56 100644 --- a/tests/transpiler/formatter/return.hco +++ b/tests/transpiler/formatter/return.hco @@ -1 +1 @@ -function test2(){return 1;print("Hello World");return 2;}function test(){return "Hello World";print("Hello World");return "Hello World";}print(test());print(test2()); +function test2(){return 1;printLn("Hello World");return 2;}function test(){return "Hello World";printLn("Hello World");return "Hello World";}printLn(test());printLn(test2()); diff --git a/tests/transpiler/formatter/shift.hco b/tests/transpiler/formatter/shift.hco index 8244b3b7..d62c8d32 100644 --- a/tests/transpiler/formatter/shift.hco +++ b/tests/transpiler/formatter/shift.hco @@ -1 +1 @@ -print(212<<1);print(212>>2); +printLn(212<<1);printLn(212>>2); diff --git a/tests/transpiler/formatter/stringtype.hco b/tests/transpiler/formatter/stringtype.hco index c8ff3227..7c500bf6 100644 --- a/tests/transpiler/formatter/stringtype.hco +++ b/tests/transpiler/formatter/stringtype.hco @@ -1 +1 @@ -let a="Hello world!";if (isDoubleType(a)){print("TRUE");}else{print("FALSE");}if (isIntType(a)){print("TRUE");}else{print("FALSE");}if (isStringType(a)){print("TRUE");}else{print("FALSE");}if (isArrayType(a)){print("TRUE");}else{print("FALSE");} +let a="Hello world!";if (isDoubleType(a)){printLn("TRUE");}else{printLn("FALSE");}if (isIntType(a)){printLn("TRUE");}else{printLn("FALSE");}if (isStringType(a)){printLn("TRUE");}else{printLn("FALSE");}if (isArrayType(a)){printLn("TRUE");}else{printLn("FALSE");} diff --git a/tests/transpiler/formatter/todouble.hco b/tests/transpiler/formatter/todouble.hco index 27b81421..ccd650a4 100644 --- a/tests/transpiler/formatter/todouble.hco +++ b/tests/transpiler/formatter/todouble.hco @@ -1 +1 @@ -let a=1.1;print(toDouble(a));let a=1;print(toDouble(a)); +let a=1.1;printLn(toDouble(a));let a=1;printLn(toDouble(a)); diff --git a/tests/transpiler/formatter/toint.hco b/tests/transpiler/formatter/toint.hco index c1be6143..dffeb21e 100644 --- a/tests/transpiler/formatter/toint.hco +++ b/tests/transpiler/formatter/toint.hco @@ -1 +1 @@ -let a=1;print(toInt(a));let a=1;print(toInt(a)); +let a=1;printLn(toInt(a));let a=1;printLn(toInt(a)); diff --git a/tests/transpiler/formatter/types.hco b/tests/transpiler/formatter/types.hco index 32f8ff13..3216d194 100644 --- a/tests/transpiler/formatter/types.hco +++ b/tests/transpiler/formatter/types.hco @@ -1 +1 @@ -let number=0;let number="";let example1=0;let number=number+"bob";print(number); +let number=0;number="";let example1=0;number=number+"bob";printLn(number); diff --git a/tests/transpiler/tests/11.hco b/tests/transpiler/tests/11.hco index 264142c4..1841602e 100755 --- a/tests/transpiler/tests/11.hco +++ b/tests/transpiler/tests/11.hco @@ -1,6 +1,6 @@ let a = "1"; while (a < 10+1) { - print(a); + printLn(a); a = a + 1; } diff --git a/tests/transpiler/tests/12.hco b/tests/transpiler/tests/12.hco index 03fda603..cc87c4a8 100755 --- a/tests/transpiler/tests/12.hco +++ b/tests/transpiler/tests/12.hco @@ -1 +1 @@ -print(1+(1+2)); \ No newline at end of file +printLn(1+(1+2)); \ No newline at end of file diff --git a/tests/transpiler/tests/3.hco b/tests/transpiler/tests/3.hco index 6ba0f4e4..335eeef5 100755 --- a/tests/transpiler/tests/3.hco +++ b/tests/transpiler/tests/3.hco @@ -1,2 +1,2 @@ -print(1+1); -print(1+1); \ No newline at end of file +printLn(1+1); +printLn(1+1); \ No newline at end of file diff --git a/tests/transpiler/tests/4.hco b/tests/transpiler/tests/4.hco index ba4a9b26..17b99650 100755 --- a/tests/transpiler/tests/4.hco +++ b/tests/transpiler/tests/4.hco @@ -1,3 +1,3 @@ let a = 1+1; -print(a); -print(1+1); \ No newline at end of file +printLn(a); +printLn(1+1); \ No newline at end of file diff --git a/tests/transpiler/tests/5.hco b/tests/transpiler/tests/5.hco index ec9f3e4e..5013769b 100755 --- a/tests/transpiler/tests/5.hco +++ b/tests/transpiler/tests/5.hco @@ -1,6 +1,6 @@ let a = 1 + ( 9 * 8) ; if ( a ) { - print( a ) ; + printLn( a ) ; } -print ( 1 + 1 ) ; \ No newline at end of file +printLn ( 1 + 1 ) ; diff --git a/tests/transpiler/tests/6.hco b/tests/transpiler/tests/6.hco index b5f2d36a..0bd92712 100755 --- a/tests/transpiler/tests/6.hco +++ b/tests/transpiler/tests/6.hco @@ -1,6 +1,6 @@ let a = 1; if (a>0) { - print(a); + printLn(a); } -print(1+1); \ No newline at end of file +printLn(1+1); \ No newline at end of file diff --git a/tests/transpiler/tests/7.hco b/tests/transpiler/tests/7.hco index 709179e0..fd793e75 100755 --- a/tests/transpiler/tests/7.hco +++ b/tests/transpiler/tests/7.hco @@ -1,6 +1,6 @@ let a = 1; while ( a < 100 ) { - print(a); + printLn(a); a = a + 1 ; } diff --git a/tests/transpiler/tests/8.hco b/tests/transpiler/tests/8.hco index b260486e..81c9a077 100755 --- a/tests/transpiler/tests/8.hco +++ b/tests/transpiler/tests/8.hco @@ -6,7 +6,7 @@ while (a < c + 1) while (b < a+1) { - print(b); + printLn(b); b = b + 1; } b = 1; diff --git a/tests/transpiler/tests/9.hco b/tests/transpiler/tests/9.hco index 4b2a142c..c34312b4 100755 --- a/tests/transpiler/tests/9.hco +++ b/tests/transpiler/tests/9.hco @@ -1,6 +1,6 @@ let a = 1; while (a < 10+1) { - print(a); + printLn(a); a = a + 1; } diff --git a/tests/transpiler/tests/add.hco b/tests/transpiler/tests/add.hco index 3b4075c2..5f756dfc 100755 --- a/tests/transpiler/tests/add.hco +++ b/tests/transpiler/tests/add.hco @@ -1,7 +1,7 @@ -print(1+1-1); -print(6*(5+3)); -print(2 + 5 * 3); -print(30 / 5 * 3); -print(4*(3 + 2)); -print(4* 5 / 2 + 7); -print(4+ 6-7 + 3); +printLn(1+1-1); +printLn(6*(5+3)); +printLn(2 + 5 * 3); +printLn(30 / 5 * 3); +printLn(4*(3 + 2)); +printLn(4* 5 / 2 + 7); +printLn(4+ 6-7 + 3); diff --git a/tests/transpiler/tests/array1.hco b/tests/transpiler/tests/array1.hco index 3a492fbe..332d4bb0 100755 --- a/tests/transpiler/tests/array1.hco +++ b/tests/transpiler/tests/array1.hco @@ -12,8 +12,8 @@ while (i < 10) let i = 0; while (i < 10) { - print(list[i]); + printLn(list[i]); i++; } -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); diff --git a/tests/transpiler/tests/array2.hco b/tests/transpiler/tests/array2.hco index 28580baa..1d30ca03 100644 --- a/tests/transpiler/tests/array2.hco +++ b/tests/transpiler/tests/array2.hco @@ -4,4 +4,4 @@ let list2 = array(); list2["2"] = "3"; list["1"] = list2; -print(list["1"]["2"]); +printLn(list["1"]["2"]); diff --git a/tests/transpiler/tests/array3.hco b/tests/transpiler/tests/array3.hco index 3bb6884f..be22679d 100644 --- a/tests/transpiler/tests/array3.hco +++ b/tests/transpiler/tests/array3.hco @@ -1,5 +1,5 @@ let universe = array(); universe["Galaxy"]["Earth"] = "Hello Earth!"; universe["Galaxy"]["Mars"] = "Hello Mars!"; -print(universe["Galaxy"]["Earth"]); -print(universe["Galaxy"]["Mars"]); +printLn(universe["Galaxy"]["Earth"]); +printLn(universe["Galaxy"]["Mars"]); diff --git a/tests/transpiler/tests/array4.hco b/tests/transpiler/tests/array4.hco index b126f511..55884746 100644 --- a/tests/transpiler/tests/array4.hco +++ b/tests/transpiler/tests/array4.hco @@ -12,15 +12,15 @@ while (i < 10) let i = 0; while (i < 10) { - print(list[i]); + printLn(list[i]); i++; } -print("Array count: " + count(list)); +printLn("Array count: " + count(list)); let universe = array(); universe["Galaxy"]["Earth"] = "Hello Earth!"; universe["Galaxy"]["Mars"] = "Hello Mars!"; -print(universe["Galaxy"]["Earth"]); -print(universe["Galaxy"]["Mars"]); +printLn(universe["Galaxy"]["Earth"]); +printLn(universe["Galaxy"]["Mars"]); diff --git a/tests/transpiler/tests/arraytype.hco b/tests/transpiler/tests/arraytype.hco index a0a7ea3e..37179425 100755 --- a/tests/transpiler/tests/arraytype.hco +++ b/tests/transpiler/tests/arraytype.hco @@ -2,36 +2,36 @@ let a = array(); if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/transpiler/tests/assignment1.hco b/tests/transpiler/tests/assignment1.hco index 16ace552..e928409a 100755 --- a/tests/transpiler/tests/assignment1.hco +++ b/tests/transpiler/tests/assignment1.hco @@ -1,19 +1,19 @@ let a = 1; a = 1; -print(a); +printLn(a); let b = 2; b += 1; -print(b); +printLn(b); let c = 3; c -= 1; -print(c); +printLn(c); let d = 4; d *= 5; -print(d); +printLn(d); let f = 6; f /= 2; -print(f); +printLn(f); diff --git a/tests/transpiler/tests/bitwise.hco b/tests/transpiler/tests/bitwise.hco index 50c5287b..7e6b2fbb 100644 --- a/tests/transpiler/tests/bitwise.hco +++ b/tests/transpiler/tests/bitwise.hco @@ -1,5 +1,5 @@ -print(12&25); -print(12|25); -print(12^25); -print(~35); -print(~-12); +printLn(12&25); +printLn(12|25); +printLn(12^25); +printLn(~35); +printLn(~-12); diff --git a/tests/transpiler/tests/compound.hco b/tests/transpiler/tests/compound.hco index b78e3d52..c87b9cb1 100755 --- a/tests/transpiler/tests/compound.hco +++ b/tests/transpiler/tests/compound.hco @@ -1,15 +1,15 @@ let a = 10; a += 2; -print(a); +printLn(a); a = 10; a -= 2; -print(a); +printLn(a); a = 10; a *= 2; -print(a); +printLn(a); a = 10; a /= 2; -print(a); +printLn(a); diff --git a/tests/transpiler/tests/crement.hco b/tests/transpiler/tests/crement.hco index fbd2c00d..eb096889 100755 --- a/tests/transpiler/tests/crement.hco +++ b/tests/transpiler/tests/crement.hco @@ -1,5 +1,5 @@ let a = 10; a++; -print(a); +printLn(a); a--; -print(a); +printLn(a); diff --git a/tests/transpiler/tests/customaddfun.hco b/tests/transpiler/tests/customaddfun.hco index 2f074b35..b311ec15 100644 --- a/tests/transpiler/tests/customaddfun.hco +++ b/tests/transpiler/tests/customaddfun.hco @@ -5,6 +5,6 @@ function add(a) { add(a); } - print(a); + printLn(a); } add (1); diff --git a/tests/transpiler/tests/doubletype.hco b/tests/transpiler/tests/doubletype.hco index 1a7870d2..0c9fd7ad 100755 --- a/tests/transpiler/tests/doubletype.hco +++ b/tests/transpiler/tests/doubletype.hco @@ -2,36 +2,36 @@ let a = 1.1; if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/transpiler/tests/fib.hco b/tests/transpiler/tests/fib.hco index 6fdbd376..e99e5d98 100755 --- a/tests/transpiler/tests/fib.hco +++ b/tests/transpiler/tests/fib.hco @@ -15,6 +15,6 @@ while (c < n) first = second; second = next; } - print(next); + printLn(next); c = c + 1; } diff --git a/tests/transpiler/tests/fizzbuzz.hco b/tests/transpiler/tests/fizzbuzz.hco index 49ed4e8a..162192a2 100755 --- a/tests/transpiler/tests/fizzbuzz.hco +++ b/tests/transpiler/tests/fizzbuzz.hco @@ -4,23 +4,23 @@ while (i < maxNumber) { if (i % 5 == 0 && i % 3 == 0) { - print("FizzBuzz"); + printLn("FizzBuzz"); } else { if (i % 3 == 0) { - print("Fizz"); + printLn("Fizz"); } else { if (i % 5 == 0) { - print("Buzz"); + printLn("Buzz"); } else { - print(i); + printLn(i); } } } diff --git a/tests/transpiler/tests/functions.hco b/tests/transpiler/tests/functions.hco index 40379406..012552ab 100755 --- a/tests/transpiler/tests/functions.hco +++ b/tests/transpiler/tests/functions.hco @@ -1,16 +1,16 @@ -print(asc("a")); -print(cha(67)); -print(toUpper("hello world!")); -print(toLower("HELLO WORLD!")); -print(inStr("hello world", "world")); -print(inStrRev("hello world", "world")); -print(strRev("!dlroW olleH")); -print(len("Hello World!")); -print(space(10)); -print(strCmp("Hello World","Hello Earth")); -print(trim(" Hello World! ")); -print(lTrim(" Hello World!")); -print(rTrim("Hello World! ")); -print(left("Hello World!",5)); -print(mid("Hello World!",2,5)); -print(right("Hello World!",4)); +printLn(asc("a")); +printLn(cha(67)); +printLn(toUpper("hello world!")); +printLn(toLower("HELLO WORLD!")); +printLn(inStr("hello world", "world")); +printLn(inStrRev("hello world", "world")); +printLn(strRev("!dlroW olleH")); +printLn(len("Hello World!")); +printLn(space(10)); +printLn(strCmp("Hello World","Hello Earth")); +printLn(trim(" Hello World! ")); +printLn(lTrim(" Hello World!")); +printLn(rTrim("Hello World! ")); +printLn(left("Hello World!",5)); +printLn(mid("Hello World!",2,5)); +printLn(right("Hello World!",4)); diff --git a/tests/transpiler/tests/functions2.hco b/tests/transpiler/tests/functions2.hco index 8412f436..6ba76057 100755 --- a/tests/transpiler/tests/functions2.hco +++ b/tests/transpiler/tests/functions2.hco @@ -1,5 +1,5 @@ -print(month(1485199747)); -print(monthName(month(1485199747))); -print(weekday(1485199747)); -print(weekdayName(1485199747)); -print(year(1440544844)); \ No newline at end of file +printLn(month(1485199747)); +printLn(monthName(month(1485199747))); +printLn(weekday(1485199747)); +printLn(weekdayName(1485199747)); +printLn(year(1440544844)); \ No newline at end of file diff --git a/tests/transpiler/tests/functions3.hco b/tests/transpiler/tests/functions3.hco index d4991bfc..5fba6307 100755 --- a/tests/transpiler/tests/functions3.hco +++ b/tests/transpiler/tests/functions3.hco @@ -1,15 +1,15 @@ -print(abs(1)); -print(acos(1)); -print(asin(1)); -print(atan(1)); -print(atan2(1,1)); -print(ceil(1)); -print(cos(1)); -print(exp(1)); -print(sin(1)); -print(sqrt(2)); -print(tan(1)); -print(pow(2,2)); -print(sqrt(2)); -print(min(1,2,3)); -print(max(1,2,3)); \ No newline at end of file +printLn(abs(1)); +printLn(acos(1)); +printLn(asin(1)); +printLn(atan(1)); +printLn(atan2(1,1)); +printLn(ceil(1)); +printLn(cos(1)); +printLn(exp(1)); +printLn(sin(1)); +printLn(sqrt(2)); +printLn(tan(1)); +printLn(pow(2,2)); +printLn(sqrt(2)); +printLn(min(1,2,3)); +printLn(max(1,2,3)); \ No newline at end of file diff --git a/tests/transpiler/tests/functions4.hco b/tests/transpiler/tests/functions4.hco index f36b1eb5..428d1722 100755 --- a/tests/transpiler/tests/functions4.hco +++ b/tests/transpiler/tests/functions4.hco @@ -1,5 +1,5 @@ let txt = "This is a beautiful day!"; -print(inStrRev(txt,"i")); -print(inStrRev(txt,"t")); -print(inStrRev(txt,"T")); -print(timeFormat(1505150753, "%c")); +printLn(inStrRev(txt,"i")); +printLn(inStrRev(txt,"t")); +printLn(inStrRev(txt,"T")); +printLn(timeFormat(1505150753, "%c")); diff --git a/tests/transpiler/tests/ifelse.hco b/tests/transpiler/tests/ifelse.hco index 6bb1ae46..0e986633 100755 --- a/tests/transpiler/tests/ifelse.hco +++ b/tests/transpiler/tests/ifelse.hco @@ -1,18 +1,18 @@ let i = 10; if (i < 10) { - print("If"); + printLn("If"); } else if (i > 10) { - print("Else If 1"); + printLn("Else If 1"); } else if (i > 5) { - print("Else If 2"); + printLn("Else If 2"); } else { - print("Else"); + printLn("Else"); } -print("Done"); \ No newline at end of file +printLn("Done"); \ No newline at end of file diff --git a/tests/transpiler/tests/ifs.hco b/tests/transpiler/tests/ifs.hco index 2d1f2630..4f0e79c2 100755 --- a/tests/transpiler/tests/ifs.hco +++ b/tests/transpiler/tests/ifs.hco @@ -1,76 +1,76 @@ let value = 5; if (value > 4) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value < 5) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value > 1 && value < 9) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value >= 5) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value <= 5) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (not(value)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (value > 5 && (value < 1 || value > 1)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } -print("DONE"); +printLn("DONE"); diff --git a/tests/transpiler/tests/inttype.hco b/tests/transpiler/tests/inttype.hco index f3a5cb94..984c6a9e 100755 --- a/tests/transpiler/tests/inttype.hco +++ b/tests/transpiler/tests/inttype.hco @@ -2,36 +2,36 @@ let a = 1; if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/transpiler/tests/logic1.hco b/tests/transpiler/tests/logic1.hco index 81e00e90..889412dd 100755 --- a/tests/transpiler/tests/logic1.hco +++ b/tests/transpiler/tests/logic1.hco @@ -1,26 +1,26 @@ -print(1&&1); -print(1||0); -print(1&&(1||0)); +printLn(1&&1); +printLn(1||0); +printLn(1&&(1||0)); -print("OR"); -print(0||0); -print(0||1); -print(1||0); -print(1||1); +printLn("OR"); +printLn(0||0); +printLn(0||1); +printLn(1||0); +printLn(1||1); -print("AND"); -print(0&&0); -print(0&&1); -print(1&&0); -print(1&&1); +printLn("AND"); +printLn(0&&0); +printLn(0&&1); +printLn(1&&0); +printLn(1&&1); -print("AND/OR"); -print(0||(1&&1)); -print(1||(0&&0)); -print(0&&(0||1)); -print(1&&(1||0)); +printLn("AND/OR"); +printLn(0||(1&&1)); +printLn(1||(0&&0)); +printLn(0&&(0||1)); +printLn(1&&(1||0)); -print("LOGIC/MATH"); -print(0+1||0); -print(0); -print(1); +printLn("LOGIC/MATH"); +printLn(0+1||0); +printLn(0); +printLn(1); diff --git a/tests/transpiler/tests/math1.hco b/tests/transpiler/tests/math1.hco index d0f14b76..a3ab36d9 100755 --- a/tests/transpiler/tests/math1.hco +++ b/tests/transpiler/tests/math1.hco @@ -1,16 +1,16 @@ -print(1234); -print(1+2*3); -print(5*(4+4+1)); -print(5*((1+3)*2+1)); -print(5 * ((1 + 3) * 2 + 1)); -print(5 - 2 * ( 3 )); -print(5 - 2 * ( ( 4 ) - 1 )); -print(1.5/5); -print((4-3)/(4*4)); -print(1/2/2); -print(0.25 * .5 * 0.5); -print(.25 / 2 * .5); -print(1+-2); -print(-4*(2+1)); -print(-2); -print(+2); \ No newline at end of file +printLn(1234); +printLn(1+2*3); +printLn(5*(4+4+1)); +printLn(5*((1+3)*2+1)); +printLn(5 * ((1 + 3) * 2 + 1)); +printLn(5 - 2 * ( 3 )); +printLn(5 - 2 * ( ( 4 ) - 1 )); +printLn(1.5/5); +printLn((4-3)/(4*4)); +printLn(1/2/2); +printLn(0.25 * .5 * 0.5); +printLn(.25 / 2 * .5); +printLn(1+-2); +printLn(-4*(2+1)); +printLn(-2); +printLn(+2); \ No newline at end of file diff --git a/tests/transpiler/tests/math2.hco b/tests/transpiler/tests/math2.hco index ec85cb97..24d64adf 100755 --- a/tests/transpiler/tests/math2.hco +++ b/tests/transpiler/tests/math2.hco @@ -1,17 +1,17 @@ -print(1234); -print(1+2*3); -print(5*(4+4+1)); -print(5*((1+3)*2+1)); -print(5 * ((1 + 3) * 2 + 1)); -print(5 - 2 * ( 3 )); -print(5 - 2 * ( ( 4 ) - 1 )); -print(1.5/5); -print((4-3)/(4*4)); -print(1/2/2); -print(0.25 * .5 * 0.5); -print(.25 / 2 * .5); -print(1+-2); -print(-4*(2+1)); -print(-2); -print(+2); -print(-(2+1)*4); +printLn(1234); +printLn(1+2*3); +printLn(5*(4+4+1)); +printLn(5*((1+3)*2+1)); +printLn(5 * ((1 + 3) * 2 + 1)); +printLn(5 - 2 * ( 3 )); +printLn(5 - 2 * ( ( 4 ) - 1 )); +printLn(1.5/5); +printLn((4-3)/(4*4)); +printLn(1/2/2); +printLn(0.25 * .5 * 0.5); +printLn(.25 / 2 * .5); +printLn(1+-2); +printLn(-4*(2+1)); +printLn(-2); +printLn(+2); +printLn(-(2+1)*4); diff --git a/tests/transpiler/tests/not1.hco b/tests/transpiler/tests/not1.hco index b1f551a1..05d435d0 100755 --- a/tests/transpiler/tests/not1.hco +++ b/tests/transpiler/tests/not1.hco @@ -1,2 +1,2 @@ -print(!1); -print(!0); +printLn(!1); +printLn(!0); diff --git a/tests/transpiler/tests/printSyntax.hco b/tests/transpiler/tests/printSyntax.hco index 2cd2d740..15f7bd63 100755 --- a/tests/transpiler/tests/printSyntax.hco +++ b/tests/transpiler/tests/printSyntax.hco @@ -1,4 +1,4 @@ -print +printLn ( ( ( @@ -7,4 +7,4 @@ print ) ) ) -); \ No newline at end of file +); diff --git a/tests/transpiler/tests/return.hco b/tests/transpiler/tests/return.hco index ab7c2bd1..930ed5ce 100644 --- a/tests/transpiler/tests/return.hco +++ b/tests/transpiler/tests/return.hco @@ -1,15 +1,15 @@ function test() { return "Hello World"; - print("Hello World"); + printLn("Hello World"); return "Hello World"; } -print(test()); +printLn(test()); function test2() { return 1; - print("Hello World"); + printLn("Hello World"); return 2; } -print(test2()); +printLn(test2()); diff --git a/tests/transpiler/tests/shift.hco b/tests/transpiler/tests/shift.hco index 8048e1da..f0bafd4d 100644 --- a/tests/transpiler/tests/shift.hco +++ b/tests/transpiler/tests/shift.hco @@ -1,2 +1,2 @@ -print(212<<1); -print(212>>2); +printLn(212<<1); +printLn(212>>2); diff --git a/tests/transpiler/tests/stringtype.hco b/tests/transpiler/tests/stringtype.hco index e423a920..fcd198d3 100755 --- a/tests/transpiler/tests/stringtype.hco +++ b/tests/transpiler/tests/stringtype.hco @@ -2,36 +2,36 @@ let a = "Hello world!"; if (isDoubleType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isIntType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isStringType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } if (isArrayType(a)) { - print("TRUE"); + printLn("TRUE"); } else { - print("FALSE"); + printLn("FALSE"); } diff --git a/tests/transpiler/tests/todouble.hco b/tests/transpiler/tests/todouble.hco index 71aa1061..a28a0ef6 100755 --- a/tests/transpiler/tests/todouble.hco +++ b/tests/transpiler/tests/todouble.hco @@ -1,4 +1,4 @@ let a = "1.1"; -print(toDouble(a)); +printLn(toDouble(a)); let a = "1"; -print(toDouble(a)); +printLn(toDouble(a)); diff --git a/tests/transpiler/tests/toint.hco b/tests/transpiler/tests/toint.hco index 7d54a4f2..a71e4df0 100755 --- a/tests/transpiler/tests/toint.hco +++ b/tests/transpiler/tests/toint.hco @@ -1,4 +1,4 @@ let a = "1.0"; -print(toInt(a)); +printLn(toInt(a)); let a = "1"; -print(toInt(a)); +printLn(toInt(a)); diff --git a/tests/transpiler/tests/types.hco b/tests/transpiler/tests/types.hco index 10709c48..9eea5766 100755 --- a/tests/transpiler/tests/types.hco +++ b/tests/transpiler/tests/types.hco @@ -2,4 +2,4 @@ let number = 0; number = ""; let example1 = "0"; number = number + "bob"; -print(number); +printLn(number);