mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ASTGen always builds with the host Swift compiler, without requiring bootstrapping, and is enabled in more places. Move the regex literal parsing logic there so it is enabled in more host environments, and makes use of CMake's Swift support. Enable all of the regex literal tests when ASTGen is built, to ensure everything is working. Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources, because they are no longer needed.
24 lines
573 B
Swift
24 lines
573 B
Swift
// RUN: %target-typecheck-verify-swift -enable-bare-slash-regex -disable-availability-checking
|
|
// REQUIRES: swift_swift_parser
|
|
|
|
_ = /abc/
|
|
_ = #/abc/#
|
|
_ = ##/abc/##
|
|
|
|
func foo<T>(_ x: T...) {}
|
|
foo(/abc/, #/abc/#, ##/abc/##)
|
|
|
|
let arr = [/abc/, #/abc/#, ##/abc/##]
|
|
|
|
_ = /\w+/.self
|
|
_ = #/\w+/#.self
|
|
_ = ##/\w+/##.self
|
|
|
|
_ = /#\/\#\\/
|
|
_ = #/#/\/\#\\/#
|
|
_ = ##/#|\|\#\\/##
|
|
|
|
_ = (#/[*/#, #/+]/#, #/.]/#)
|
|
// expected-error@-1:16 {{cannot parse regular expression: quantifier '+' must appear after expression}}
|
|
// expected-error@-2:10 {{cannot parse regular expression: expected ']'}}
|