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
Commas are now allowed in strings
[COMMA] => , substitution has been removed as it is redundant now
[RETURN] and [SINGLE QUOTE] have been added as substitutions
It is now trivial to add any other substitution in the code
A keycode can be directly specifed via hex R0, K0: 0x01+0x02+0xFF
A HUGE number of error messages were added (and tested) so when an invalid key map is uploaded it should be easier to figure out what/where when wrong
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
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
[COMMA]
=>,
substitution has been removed as it is redundant now[RETURN]
and[SINGLE QUOTE]
have been added as substitutionsR0, K0: 0x01+0x02+0xFF
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 correctnessThe test can be ran with
python3 Firmware/parser_test.py
ortime python3 Firmware/parser_test.py
for timing stats