-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_instruction_set_file.cdsl
More file actions
48 lines (25 loc) · 1.45 KB
/
Copy pathsample_instruction_set_file.cdsl
File metadata and controls
48 lines (25 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// This file is used to test the interpreter. There are intentional errors marked with comments
// To test any one kind of error, make sure all the previous error causing lines are commented out.
// Or run `cdsl sample_instruction_set_file.cdsl --check` to validate the instructions without running them.
set A 121 // Should run perfectly
print $A // Should print value of $A
print // Should raise error. No const passed
print M // Should raise an error. No const named M
//set Z 90 // Should ignore this line. As it is starting with `//` and no space afterwards.
set X // Should raise error. Invaild number of arguments
set @C 12 // Should raise error. `@C` is invalid constant name
move JOINT_2 120 // Should run perfectly
move JOINT_1 $A // Should run perfectly
move JOINT_1 $ // Should raise error. Empty constant passed
move JOINT abc // Should raise error. Proper value not passed
move JOINT 12abc // Should raise error. Proper value not passed
move JOINT 12.0.1 // Should raise error. Proper value not passed
wait 500 // Should run perfectly
wait -500 // Should raise error. Negative delay is invalid
wait abc // Should raise error. Invalid delay
move BASE $B // Should raise error. Constant `B` hasn't been set or is unknown as of now
set B 1330 // Should run perfectly
move BASE $B // Should run perfectly
// Empty line comment
align JX 21 // Should raise error. `ALIGN` is an undefined action
move BASE deg // Should raise error. `deg` is invalid value