Skip to content

Commit

Permalink
init: include other files
Browse files Browse the repository at this point in the history
  • Loading branch information
SrijanSriv committed Jan 3, 2023
1 parent aeec8bb commit 6458394
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
8 changes: 4 additions & 4 deletions com/welambdas/lambda/Lambda.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.welambdas.lambda;

/* imports to use saveLib and readLib
// imports to use saveLib and readLib
/*
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
*/

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -110,15 +110,15 @@ static void error(Token token, String message) {
}
}

/* funtions to write tokens in a .sre file and read from .sre file
/*
// funtions to write tokens in a .sre file and read from .sre file
private static void saveLib(String fileName, List<Token> libtokens) throws IOException {
List<Token> send = new ArrayList<Token>(libtokens);
FileOutputStream fout= new FileOutputStream (fileName);
ObjectOutputStream oos = new ObjectOutputStream(fout);
oos.writeObject(send);
fout.close();
}
private static List<Token> readLib(String fileName) throws IOException {
List<Token> obtain = new ArrayList<Token>();
FileInputStream fin = new FileInputStream (fileName);
Expand Down
7 changes: 3 additions & 4 deletions hello.orz
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#>test

print a;
for (var itr = 0; itr < 5; itr = itr + 1) {
print itr;
}
var greeting = Greeter("srijan", "evening");

greeting.greet();
10 changes: 9 additions & 1 deletion lib/test.orz
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
var a = "completely works!";
class Greeter {
init(name, time) {
this.name = name;
this.time = time;
}
greet() {
print "Good " + this.time + " " + this.name + "!";
}
}
Binary file modified tokens/test.sre
Binary file not shown.

0 comments on commit 6458394

Please sign in to comment.