LBPL Challenge 1: Build a lexer for Blink
How to setup
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
How to complete the challenge
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
Your starting point ...
- tokentype.js contains all the types of token available in Blink.
- token.js contains a simple
- lexer.js contains a skeleton for a
Lexerclass with a empty
nextToken()method. This is the file where all of your changes should be made.
- lexer-test.js contains the unit tests validating that your implementation of the
Lexerclass works as expected.
- lexical-grammar.txt contains the regular expressions describing valid Blink lexemes. This will serve as guide when implementing the
nextToken()method in the
- A tour of Blink. An overview of all the features in Blink.
How to run the tests
Whenever you're ready to test your code
npm run buildat the root of the project to build
npm run testto run the tests
Reporting bugs and Suggestions
Please 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.
Support and Help
Feel free to ping me on Twitter @ftchirou if you have any question or need a clarification while completing this challenge.