ZackFreedman / MiRage

The most hackable keyboard in all the land
631 stars 46 forks source link

[parser] Refactor parser to use tokenization. #4

Open V-FEXrt opened 3 years ago

V-FEXrt commented 3 years ago

Summary

Replaces the parser with a token based parser. This allows for easier changes and additions to the language. It allow allows for easy fixes for the "comma in string" bug. This change also fixes small typos found in other parts of the firmware

Features

For the most part this should be a drop in replacement for the previous parser. The only known changes are listed below

Testing

This feature was not tested on real hardware (I haven't build the keeb yet :) ) but the code maintains the previous implementations public interface (via parse_layer_definition()) and the language itself is thoroughly tested to ensure correctness

The test can be ran with python3 Firmware/parser_test.py or time python3 Firmware/parser_test.py for timing stats