Starting code of the first challenge in the Let's Build a Programming Language series.
Welcome to the first challenge in the Let's Build a Programming Language series. The goal of this challenge is to write a lexer for Blink.
Start by forking this repository to your own Github account.
Once the project is forked, make sure that you have the latest version of Node.js installed and run the following commands in a command line prompt to setup the challenge.
$ git clone https://github.com/<replace_with_your_github_username>/blink-lexer.git
$ cd blink-lexer
$ npm install
The goal of this challenge is to write a lexer for Blink in JavaScript (ES6). For that purpose, in the src/main/lexer directory, you have been provided with a Token
class, a TokenType
enumeration, a basic skeleton for the Lexer
class, as well as a test file in src/test/lexer/lexer-test.js. Your job is to make all the tests pass by completing the Lexer
class.
Token
class.Lexer
class with a empty nextToken()
method. This is the file where all of your changes should be made.Lexer
class works as expected.nextToken()
method in the Lexer
class.Whenever you're ready to test your code
npm run build
at the root of the project to buildnpm run test
to run the testsPlease create a Github issue if you found something that needs to be fixed on this project or if you have a suggestion to improve it.
Feel free to ping me on Twitter @ftchirou if you have any question or need a clarification while completing this challenge.
Have fun. 🙌