mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-21 15:50:40 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package structure;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.StringReader;
|
||||
|
||||
import com.dfsek.terra.addons.terrascript.tokenizer.Lookahead;
|
||||
|
||||
|
||||
public class LookaheadTest {
|
||||
@Test
|
||||
public void lookahead() {
|
||||
Lookahead lookahead = new Lookahead(new StringReader("Test string..."));
|
||||
|
||||
for(int i = 0; lookahead.next(i) != null; i++) {
|
||||
System.out.print(lookahead.next(i).getCharacter());
|
||||
}
|
||||
while(lookahead.next(0) != null) {
|
||||
System.out.print(lookahead.consume().getCharacter());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user