diff options
| author | dibyendumajumdar <mobile@majumdar.org.uk> | 2023-08-20 00:38:58 +0100 |
|---|---|---|
| committer | dibyendumajumdar <mobile@majumdar.org.uk> | 2023-08-20 00:38:58 +0100 |
| commit | 293506c1bd594f3d7a6a71bcd9aa8f140fbd13ab (patch) | |
| tree | 072b97516c985d0bcac6aac1ecc6c0832fce649a /src/test/java | |
| parent | 1571eeeb41c3af5cc2da23ce4edbc69cf53bd383 (diff) | |
| download | Simple-293506c1bd594f3d7a6a71bcd9aa8f140fbd13ab.tar.gz Simple-293506c1bd594f3d7a6a71bcd9aa8f140fbd13ab.zip | |
In this initial commit, following are included:
util classes from AA
Lexer code extracted from the Parse class.
This is all draft as likely to change as we start creating the AST parser.
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/com/seaofnodes/simple/lexer/TestLexer.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/java/com/seaofnodes/simple/lexer/TestLexer.java b/src/test/java/com/seaofnodes/simple/lexer/TestLexer.java new file mode 100644 index 00000000..335bcf5e --- /dev/null +++ b/src/test/java/com/seaofnodes/simple/lexer/TestLexer.java @@ -0,0 +1,33 @@ +/** + * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Contributor(s): + * + * The Initial Developer of the Original Software is Cliff Click. + * + * This file is part of the Sea Of Nodes Simple Programming language + * implementation. See https://github.com/SeaOfNodes/Simple + * + * The contents of this file are subject to the terms of the + * Apache License Version 2 (the "APL"). You may not use this + * file except in compliance with the License. A copy of the + * APL may be obtained from: + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +package com.seaofnodes.simple.lexer; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class TestLexer { + + @Test + public void testLexLineComment() + { + final String source = "//a comment\nx"; + Lexer lexer = new Lexer("test", source); + String token = lexer.token(); + Assertions.assertEquals("x", token); + } +} |
