Allow multiline pragmas #389
Merged
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.
This pull request introduces support for multiline pragmas and updates various test cases and sample files to accommodate this new feature. The most important changes include modifications to handle multiline strings in property setters, updates to test cases to ensure correct handling of multiline pragmas, and adjustments to sample files to reflect these changes.
Support for multiline pragmas:
src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaParser/Ast/AddedPropertySetterAstNode.cs: Enhanced theInitmethod to handle multiline strings by checking if the string starts with a quote and adjusting the initialization value accordingly.Updates to test cases:
src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs: Added a new test casemultiline_pragmasto verify the correct handling of multiline pragmas.src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/PragmasExtensionsTests.cs: Added a new test caseshould_set_property_multiline_stringto ensure multiline strings are set correctly.Adjustments to sample files:
src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/ax/.g/Onliners/multiline_pragmas.g.cs: Added a new sample file to demonstrate the usage of multiline pragmas in generated code.src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/ax/.g/POCO/multiline_pragmas.g.cs: Added a new sample POCO file to show how multiline pragmas are represented in plain objects.Project configuration updates:
src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/ax/units.csproj: Updated the project file to include necessary package references and enable support for multiple target frameworks.closes #388