You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 13, 2024. It is now read-only.
throw`RunTimeError: Segmentation Fault expected array size to be less than 1e7 at '${declaration.name}'`;
52
52
}elseif(arr_size<=0){
53
-
throw`Invalid Array size`;
53
+
throw`RunTimeError: Invalid Array size${arr_size} at '${declaration.name}'`;
54
54
}
55
55
if(values_provided>arr_size){
56
-
throw`Size of array exceeded`;
56
+
throw`RunTimeError: Excess elements in array initializer at '${declaration.name}'. Provided array size ${arr_size} while number of elements in ${values_provided}`;
Copy file name to clipboardExpand all lines: BackEnd/Scope/globalScope.ts
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
import{
2
+
ArrayVal,
2
3
BooleanVal,
3
4
MAKE_BOOL,
4
5
MAKE_FUNCTION,
@@ -39,7 +40,7 @@ export function setupGlobalScope() {
39
40
MAKE_NATIVE_FN((args,_scope): RuntimeVal=>{
40
41
if(args.length!==2){
41
42
consterror_msg: any=
42
-
`No matching function for call to 'assertEqual'. Note: candidate function not viable. Function assertEqual requires 2 arguments, but ${args.length} was provided.`;
43
+
`RunTimeError: No matching function for call to 'assertEqual'. Note: candidate function not viable. Function assertEqual requires 2 arguments, but ${args.length} was provided.`;
43
44
throwerror_msg;
44
45
}
45
46
constactual_type=args[0].type;
@@ -66,7 +67,7 @@ export function setupGlobalScope() {
66
67
}
67
68
68
69
default:
69
-
throw`Error: Null value exception`;
70
+
throw`RunTimeError: Null value exception`;
70
71
}
71
72
}
72
73
}),
@@ -77,11 +78,12 @@ export function setupGlobalScope() {
77
78
MAKE_NATIVE_FN((args,_scope): RuntimeVal=>{
78
79
for(leti=0;i<args.length;i++){
79
80
consttype=args[i].type;
81
+
80
82
switch(type){
81
83
case"number": {
82
84
constnum_to_print=(args[i]asNumberVal).value;
83
85
console.log(num_to_print);
84
-
returnMAKE_NUll();
86
+
break;
85
87
}
86
88
case"boolean": {
87
89
constbool_to_print=(args[i]asBooleanVal).value;
@@ -92,19 +94,19 @@ export function setupGlobalScope() {
92
94
ans="false";
93
95
}
94
96
console.log(ans);
95
-
returnMAKE_NUll();
97
+
break;
96
98
}
97
99
case"string": {
98
100
conststring_to_print=(args[i]asStringVal).value;
99
101
console.log(string_to_print);
100
-
returnMAKE_NUll();
102
+
break;
101
103
}
102
104
case"array": {
103
-
throw`Invalid Array Print Operation. Use Iterative Method Instead.`;
105
+
throw`RunTimeError: Invalid Array Print Operation. Use Iterative Method Instead.`;
0 commit comments