Commit Graph

10 Commits

Author SHA1 Message Date
Richard Wei
65bffd7ad7 Add _MatchingEngine and _StringProcessing modules.
These modules are part of the experimental declarative string processing feature. If accepted to the Standard Library, _StringProcessing will be available via implicit import just like _Concurrency, though _MatchingEngine will still be hidden as an implementation detail.

`_MatchingEngine` will contain the general-purpose pattern matching engine ISA, bytecode, and executor. `_StringProcessing` will contain regular expression and pattern matching APIs whose implementation depends on the matching engine..

Also consolidates frontend flag `-enable-experimental-regex` as `-enable-experimental-string-processing`.

Resolves rdar://85478647.
2021-11-19 09:27:33 -08:00
Michael Gottesman
e2c1db5b64 [test] Change swift-refactor tooling to specify a resource-dir. 2021-09-02 14:08:24 -07:00
Hamish Knight
2887f4048e Have refactor-check-compiles pass down -I -sdk -target
Forward these flags to both swift-frontend and
swift-refactor.
2021-08-18 13:21:06 +01:00
Hamish Knight
b03c06f721 Don't error on placeholders for refactor-check-compiles
This allows us to test more cases that type-check
modulo placeholders.
2021-08-18 13:21:05 +01:00
Ben Barham
717a932a3f [Utils] Make sure to write the rewritten file in refactor-check-compiles
`ClangFileRewriterHelper` only outputs the rewritten buffer when it's
destroyed, but the consumers were never being freed. Cleanup the
lifetime management of the stream and consumers so that they're properly
destroyed.

Rename `DuplicatingSourceEditConsumer` to
`BroadcastingSourceEditConsumer` to better describe its purpose.
2021-06-03 21:11:00 +10:00
jiaren wang
68eb0d7087 [Refactoring] generate both '-dump-text' and dump-rewritten from a single swift-refactor invocation (SR-14587) 2021-05-27 16:29:59 +08:00
Ben Barham
762337cc9b [Refactoring] Add @completionHandlerAsync to sync function
When adding an async alternative, add the @completionHandlerAsync
attribute to the sync function. Check for this attribute in addition to
the name check, ie. convert a call if the callee has either
@completionHandlerAsync or a name that is completion-handler-like name.

The addition of the attribute is currently gated behind the experimental
concurrency flag.

Resolves rdar://77486504
2021-05-14 20:19:02 +10:00
Andrew Trick
9537b14404 Fix refactor-check-compiles.py for python3
Fixes:
    sys.stdout.write(dump_text_output)
TypeError: write() argument must be str, not bytes
2021-05-10 20:50:18 -07:00
Alex Hoppen
98e6680c85 [Refactoring] When adding an async alternative refactor the old method to call the async method using detach
Instead of leaving two copies of the same implementation, rewrite the old method with the completion handler to call the newly added `async` method.

Resolves rdar://74464833
2021-05-04 12:06:27 +02:00
Alex Hoppen
9916a6d5c7 [Refactoring] Add a drop-in replacement for swift-refactor which checks that the code compiles after refactoring 2021-04-30 23:48:23 +02:00