mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-04 14:56:28 +00:00
working tokenizer
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package structure;
|
||||
|
||||
import com.dfsek.terra.structure.v2.tokenizer.Lookahead;
|
||||
import com.dfsek.terra.api.structures.tokenizer.Lookahead;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.StringReader;
|
||||
|
||||
23
common/src/test/java/structure/TokenizerTest.java
Normal file
23
common/src/test/java/structure/TokenizerTest.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package structure;
|
||||
|
||||
import com.dfsek.terra.api.structures.tokenizer.Token;
|
||||
import com.dfsek.terra.api.structures.tokenizer.Tokenizer;
|
||||
import com.dfsek.terra.api.structures.tokenizer.exceptions.TokenizerException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class TokenizerTest {
|
||||
@Test
|
||||
public void tokens() throws IOException, TokenizerException {
|
||||
Tokenizer tokenizer = new Tokenizer(IOUtils.toString(getClass().getResourceAsStream("/test.tesf")));
|
||||
|
||||
for(int i = 0; i < 100; i++) {
|
||||
Token t = tokenizer.fetch();
|
||||
if(t == null) break;
|
||||
System.out.println(t);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user