Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 4eb6448

Browse files
committed
For most unused implicit values defined initialization value, removed non-testable incorrect variable declaration
1 parent 10da8e7 commit 4eb6448

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

ifj2017/tests/02_functions/11.code

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ function GHGKghgk55() as integer
55
end function
66

77
function GHGKghgk67() as integer
8-
dim a as integer
8+
dim a as integer = 40
99
a = GHGKghgk55()
1010
a = a + a
1111
return a
1212
end function
1313

1414
scope
15-
dim b as integer
15+
dim b as integer = 20
1616
b = GHGKghgk67()
1717
print b;
1818
b = GHGKghgk67()

ifj2017/tests/02_functions/12.code

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
' Recursive function
22

33
function recursive(param as integer) as integer
4-
dim param0 as integer
5-
dim res as integer
4+
dim param0 as integer = 12
5+
dim res as integer = 10
66
param0 = param - 1
77
if param = 0 then
88
return 42
@@ -13,7 +13,7 @@ function recursive(param as integer) as integer
1313
end function
1414

1515
scope
16-
dim a as integer
16+
dim a as integer = 12
1717
a = recursive(4)
1818
print a;
1919

ifj2017/tests/02_functions/13.code

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
' calling multiple functions
22

33
function _add_two(_ as integer) as integer
4-
dim res as integer
4+
dim res as integer = 0 - 15
55
res = _ + 2
66
return res
77
end function
@@ -18,7 +18,7 @@ function ____(_______ as integer) as double
1818
end function
1919

2020
function __compute() as double
21-
dim res as integer
21+
dim res as integer = 10 - 9
2222
res = _multiply(30, 10)
2323
res = _add_two(res)
2424
res = ____(res)

ifj2017/tests/02_functions/14.code

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
' Input in function
22

33
function dsfs_567() as integer
4-
dim a as integer
4+
dim a as integer = 10
55
input a
66
return a
77
end function
88

99
scope
10-
dim a as integer
10+
dim a as integer = 12
1111
a = dsfs_567()
1212
print a;
1313
end scope

ifj2017/tests/02_functions/15.code

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
' Function call function which have input
22

33
function foo() as integer
4-
dim a as integer
4+
dim a as integer = 10
55
input a
66
return a
77
end function
88

99
function ghGHgh654655646() as integer
10-
dim a as integer
10+
dim a as integer = 12
1111
a = foo()
1212
return a
1313
end function
1414

1515
scope
16-
dim a as integer
16+
dim a as integer = 10
1717
a = ghGHgh654655646()
1818
print a;
1919
end scope

ifj2017/tests/02_functions/16.code

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ function GK6767__() as integer
55
end function
66

77
function GKJ5___GGK() as integer
8-
dim a as integer
8+
dim a as integer = 10
99
a = GK6767__()
1010
return a
1111
end function
1212

1313
function foo() as integer
14-
dim a as integer
14+
dim a as integer = 11
1515
a = GKJ5___GGK()
1616
return a
1717
end function
1818

1919
scope
20-
dim a as integer
20+
dim a as integer = 9
2121
a = foo()
2222
print a;
2323
end scope

ifj2017/tests/02_functions/18.code

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end function
99

1010
SCOPE
1111

12-
dim a as integer
12+
dim a as integer = 0 - 10
1313
a = __HJHLH(__HJHLH(__HJHLH(2)))
1414
print a;
1515

ifj2017/tests/02_functions/19.code

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ end function
88

99
SCOPE
1010

11-
dim __HJJ677 as integer
11+
dim __HJJ677 as integer = 10
1212
__HJJ677 = HJKLHJKL_(HJKLHJKL_(2) * HJKLHJKL_(2))
1313
print __HJJ677;
1414

ifj2017/tests/66_errors/tests.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@
163163
"compiler_exit_code": 3
164164
},
165165
{
166-
"info": "assignment or undefined variable in same variable declaration",
167-
"code": "scope \n dim a as integer = a + 1 \n end scope",
168-
"compiler_exit_code": 0
166+
"info": "assignment or undefined variable in variable declaration",
167+
"code": "scope \n dim a as integer = b + 1 \n end scope",
168+
"compiler_exit_code": 3
169169
},
170170
{
171171
"info": "condition type error with string value",

0 commit comments

Comments
 (0)