A simple lexer implemented in JavaScript. It recognizes simple arithmetic expressions and variable assignment like:
2 + 5 == 7;
a = 8;
b = 10;
suma = a + b == 18;
Run the tests:
$ node __tests__
// if all test pass you should see a message 'All passed!!!'
Run the lexer to tokenize script from script.txt
file:
// the path to the script.txt file is hardcoded inside 'index.js'
$ node src
// if all went fine the script will print an array of tokens
This project is licensed under the MIT License.