mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-11 09:04:38 +00:00
0430d340024f07b9add0b66f7c8361dc5367f16e
We were parsing Python in JavaScript to find imports, using a jison parser that allocated memory proportional to lines times file size, so large programs could exhaust browser memory. The grammar also rejected f-strings containing the same quote character and decimal literals with a leading zero, and since parse errors were swallowed, any such program silently downloaded with no modules at all. Read the imports back out of the .mpy instead. Each module is already compiled by mpy-cross, so this removes a pass rather than adding one, and MicroPython's own compiler decides what an import is. Fixes: https://github.com/pybricks/support/issues/1804 Fixes: https://github.com/pybricks/support/issues/1954 Fixes: https://github.com/pybricks/support/issues/1981 Assisted-by: Claude Opus 5 <noreply@anthropic.com>
pybricks-code
A Web App for programming LEGO® Powered Up smart hubs using Pybricks MicroPython.
Try it at https://code.pybricks.com or the latest updates https://beta.pybricks.com.
Contributing
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
For more details, see the file CONTRIBUTING.md.
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this project.
Languages
TypeScript
90%
JavaScript
7.6%
SCSS
2.1%
HTML
0.2%
Python
0.1%
