瀏覽代碼

Fixed all returns to return! in the test

Yentl Van Tendeloo 8 年之前
父節點
當前提交
3784117527

+ 2 - 2
interface/HUTN/test/grammar_action_language/code/fibonacci.al

@@ -1,8 +1,8 @@
 Integer function fib(param : Integer):
 	if (int_lt(param, 2)):
-		return 0
+		return 0!
 	else:
-		return fib(param - 1) + fib(param - 2)
+		return fib(param - 1) + fib(param - 2)!
 
 Void function main():
 	fib(5)

+ 1 - 1
interface/HUTN/test/grammar_action_language/code/return_in_assign.al

@@ -1,2 +1,2 @@
 Void function test():
-	a = return 1
+	a = return 1!

+ 2 - 2
interface/HUTN/test/graph_compilation_action_language/code/factorial.al

@@ -6,9 +6,9 @@ include "io.alh"
 
 Integer function factorial(n : Integer):
 	if(integer_lte(n, 1)):
-		return 1
+		return 1!
 	else:
-		return integer_multiplication(n, factorial(integer_subtraction(n, 1)))
+		return integer_multiplication(n, factorial(integer_subtraction(n, 1)))!
 
 Void function main():
 	while(True):

+ 2 - 2
interface/HUTN/test/graph_compilation_action_language/code/fibonacci.al

@@ -6,9 +6,9 @@ include "io.alh"
 
 Integer function fib(param : Integer):
 	if (integer_lte(param, 2)):
-		return 1
+		return 1!
 	else:
-		return integer_addition(fib(integer_subtraction(param, 1)), fib(integer_subtraction(param, 2)))
+		return integer_addition(fib(integer_subtraction(param, 1)), fib(integer_subtraction(param, 2)))!
 
 Void function main():
 	while(True):

+ 1 - 1
interface/HUTN/test/graph_compilation_action_language/code/fibonacci_smart.al

@@ -15,7 +15,7 @@ Integer function fib(param : Integer):
 	while (integer_gt(param, list_len(numbers))):
 		new = list_len(numbers)
 		list_append(numbers, integer_addition(dict_read(numbers, integer_subtraction(new, 2)), dict_read(numbers, integer_subtraction(new, 1))))
-	return dict_read(numbers, integer_subtraction(param, 1))
+	return dict_read(numbers, integer_subtraction(param, 1))!
 
 Void function main():
 	numbers = create_node()

+ 2 - 2
interface/HUTN/test/graph_compilation_action_language/code/mutual_recursion.al

@@ -2,7 +2,7 @@ Void function main():
 	a()
 
 Integer function a():
-	return b()
+	return b()!
 
 Integer function b():
-	return a()
+	return a()!

+ 1 - 1
interface/HUTN/test/graph_compilation_action_language/code/return_invalid.al

@@ -1,2 +1,2 @@
 Integer function abc(a : Integer):
-	return "def"
+	return "def"!

+ 3 - 3
interface/HUTN/test/modelling_language/code/petrinets_constraints.mvc

@@ -5,11 +5,11 @@ SCD PetriNets{
     Class Natural {
         $
             if (bool_not(is_physical_int(self))):
-                return "Natural has no integer value"
+                return "Natural has no integer value"!
             elif (integer_lt(self, 0)):
-                return "Natural does not have a positive or zero value"
+                return "Natural does not have a positive or zero value"!
             else:
-                return "OK"
+                return "OK"!
          $
     }
     Class Place{