Skip to content

Reduce amount of \Q...\E quoting in _literalPattern#858

Merged
natecook1000 merged 5 commits intomainfrom
literal-pattern-less-quoting
Apr 15, 2026
Merged

Reduce amount of \Q...\E quoting in _literalPattern#858
natecook1000 merged 5 commits intomainfrom
literal-pattern-less-quoting

Conversation

@natecook1000
Copy link
Copy Markdown
Member

This change switches to manually escape regex metacharacters,
which lessens the circumstances that use the more cumbersome
regex quoting syntax.

The recursive DSLTree approach required nodes nested in nodes.
The DSLTree implementation flattened this tree, but didn't remove
the nested nodes, instead replacing them with placeholder entries
that were unused, in order to reduce the code change. This
change completes the transition, modifying the nodes to no
longer store their children.

With this change, we can also remove a significant amount of
unused code. The change includes some expanded test coverage
of the RegexBuilder syntax conversion, as well.

Note that even though `DSLTree.Node` no longer requires
declaration as `indirect`, compilation times are worsened
if we remove the indirection.
This change switches to manually escape regex metacharacters,
which lessens the circumstances that use the more cumbersome
regex quoting syntax.
Base automatically changed from remove-old-dslnode to main April 15, 2026 22:41
@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please test Linux platform

@natecook1000 natecook1000 merged commit 0302056 into main Apr 15, 2026
23 checks passed
@natecook1000 natecook1000 deleted the literal-pattern-less-quoting branch April 15, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant