-
-
Notifications
You must be signed in to change notification settings - Fork 21
Correctly parse tags related to each line #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tags]" tests in isolation.
+ fix wrong python binding
+ fixes typos in the c bindings
removed uneeded command in build.yml
|
Works under windows, fails differently under mac and Linux ... I will look into this soon, if you have an idea, feel free to check |
|
Thanks so much for iterating on my PR! Although I only have access to Windows machines, I'm familiar with the peculiarities of Linux and Clang. I'll see what I can do. 😊 |
-> changed code to be indipendent
|
This was stupid, it seems MSVC and clang have different execution order policies Would you mind checking if this PR still looks correct ^^ If you give your ok I would bump the version and bump the version to 0.1.8 (When I finished a basic UE binding [and tested it]) |
|
I'm happy to confirm your changes work perfectly for my game! LGTM, let's ship it!! 🫡 |
|
I tested it today a bit and noticed that the knot tracking fails if you jump to a stitch of another knot (you keep your current knot tags) |
+ Adapted UE demo to reflect knew knot and global feature + added interface to access global and knot/stitch tags + added test for stitch tags + ignore choice/schared/wave/"b" named knots for knot and stich detection
|
Implemented the solution, added a TODO:
|
this will increase the consistancey, and hopefully ease the navigation on the page
My major goal with this pull request was to support retrieving the correct tags per line, and I've succeeded with that. Unfortunately, I also broke several existing tests in the process and haven't been able to get them working yet. I don’t think it’s very nice of me to leave your project in a worse state than I found it, so I’m providing you with as much documentation as possible about where I suspect the problems lie. I hope we can work together to integrate my changes into your main branch.
Major issues
While all tests passed for adding tags to lines and parsing global tags, my changes caused 12 failed assertions and three failed test cases in the existing unit and integration tests. This is because my changes require looking ahead to the following line to see if we have glue or choices that could affect the current line. But this spawns several edge cases I tried to handle as they popped up from testing, and the logic is now very complicated. I suspect there is a much cleaner solution, but I just can’t see it yet. Here are the major issues that came up in my testing.
Glue is not parsed correctly across multiple lines
Specifically, the first glue command is handled correctly, but subsequent commands are not processed as part of the same line. This results in breakages like these:
I suspect this is caused by my changes to read ahead in the
step()method. It has proven very tricky to read ahead enough to check if the following command is part of the current line while not accidentally calling functions on the next line.External functions assert due to command buffer depletion
Again, I suspect this is caused by my changes to look ahead in the command buffer. Here’s what the failure looks like:
This assertion triggers on line 1129 in my changes, but I suspect the problem occurred much earlier. I suspect that the look-ahead already executed the function, and it cannot be found again on line 1228:
Changelog
snap_tag*held by therunner_implinstead ofconst char*.num_global_tags()andget_global_tag()methods.line_typeforstd::stringorFStringdepending on compile settings.getline()method to returnline_type.entries_since_marker()asfind_first_of()andfind_last_of()methods.saved_ends_with()method in favor of anoffsetparameter to theends_with()method.size_tinstead ofintfor offsets into the data.discard()method.nposconstexpr for invalid positions in the buffer.add_tag()andclear_tags()methods to manage tag info.advance_line()clears line and choice tags while keeping the global ones.line_step()reads steps from the execution buffer until the next new line.line_step()copies global tags to the first line.line_step()continues stepping execution until it's satisfied it doesn't affect the current line.set_debug_enabled()to optionally write command info to a debug stream as the instance steps through the execution buffer.step()writes debug info to the debug stream, if available.getline()implementation to work with eitherstd::stringorFString.getall()implementation to callgetline()multiple times, reducing the need to test this method separately.detect_change()to check for extending past the newline only.std::ostreamoperator for streamingCommandandCommandFlagenum values as strings.text()method to retrieve stored string directly.Unit test changes
REQUIRE()calls withCHECK()to ensure test execution isn’t halted immediately.WHEN()andTHEN()tests can be run in sequence correctly.