[logos] Support multi-line block arguments in %orig
calls
#114
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.
What does this implement/fix? Explain your changes.
This PR adds the ability to specify inline blocks spanning multiple lines as arguments when calling
%orig(...)
, which was previously not supported.Example
%orig(...)
usages that are now supported:Does this close any currently open issues?
This PR closes an issue that's been open for 10y: [#6] "Logos errors out on calling %orig with an inline block with multiple lines."
Any relevant logs, error output, etc?
N/A
Any other comments?
%orig
,%log
, etc.) inside of a block passed to%orig(...)
is currently not supported.Example of unsupported usage:
Where has this been tested?
Operating System: macOS Sonoma, iOS 14, iOS 18, Ubuntu 22.0.4
Platform: arm64, x86_64
Target Platform: iOS, iOS Simulator
Toolchain Version: Xcode 15.4
SDK Version: iOS 14, iOS 15, iOS 16.5
Unit Testing
AFAIK, Logos (and Theos) lack official unit testing. This PR changes core behavior of the parser and has the potential to introduce significant breakage; this requires thorough testing to ensure reliability and backwards compatibility. To address this concern, I created a separate branch containing unit tests for my changes as well as some unrelated core behavior, as the project lacks these otherwise.
Coverage of these tests include, but is not limited to:
%orig
functionality to ensure backwards compatibility.%orig
usage.These tests validate the correctness of the current implementation and provide a safety net for future changes (helping prevent regressions). All of the tests I created can be found here.
Direct link to the tests for
%orig
behavior.I have Github Actions setup to run these tests (in my fork) -- they're currently passing: Latest Github Action run.