| author | Christian Urban <christian.urban@kcl.ac.uk> | 
| Fri, 26 Sep 2025 23:10:52 +0100 | |
| changeset 990 | 8cb2e171d952 | 
| parent 977 | 7a02c5b9e0df | 
| permissions | -rw-r--r-- | 
| 
977
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
1  | 
// for testing compilation  | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
2  | 
import scala.util.{Try, Success, Failure}
 | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
3  | 
|
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
4  | 
import $file.cw041_add  | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
5  | 
import cw041_add._  | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
6  | 
|
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
7  | 
val ffile = os.read(os.pwd / "for.while")  | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
8  | 
|
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
9  | 
Try(test_string(ffile, "for")) match {
 | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
10  | 
case Success(v) => Console.println(s" Generated a j-file.")  | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
11  | 
case Failure(e) => Console.println(s" Exception raised.") ; throw(e)  | 
| 
 
7a02c5b9e0df
updated marking scripts
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
12  | 
}  |