Repository navigation
Lay out and assemble generated files through xr-syntax 0.3.0 - #113
Merged
Merged
Conversation
xrobot.cpp_layout is gone: the layout of generated code comes from xr_syntax.format. That module holds the line-breaking rules of both generators, each behind its own entry point and on shared primitives. User/ xrobot_main.hpp and the Module header are assembled by CppFileBuilder, which parses the whole file once at the build boundary; an empty last line is the newline at the end of the file, not one blank line more. Pin xr-syntax 0.3.0 and update the release record accordingly.
The module list is written with CMakeFileBuilder, which parses the whole file once in build(); the file is therefore always one xr-syntax can read back. A module identity long enough to make the command exceed the column limit still keeps the command on one line, and an empty module list writes the same two lines as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XRobot uses xr-syntax 0.3.0 for its C++ layout and for writing
Modules/CMakeLists.txt.cpp_layout.pyis gone.Changes
User/xrobot_main.hppand the Module header are laid out withxr_syntax.formatand assembled byCppFileBuilder.Modules/CMakeLists.txtis written withCMakeFileBuilder. Every command stays on one line whatever the length of the module identity.xr-syntax==0.3.0.Generated output
xrobot setup --frozenandxrobot genon bsp-dev-c (default config, sentry and all 9 RobotConfig files, with and without--no-line-directives), bsp-dev-mc02 and bsp_stm32f103;Requires xr-syntax 0.3.0 on PyPI (xrobot-org/xr-syntax#3), so CI installs only after that release. All tests pass locally on Windows with Python 3.13 (475 passed, 48 skipped).