Files
swift-mirror/lib/Parse/CMakeLists.txt
Hamish Knight 37f16520e6 Prototype regex literal AST and emission
With `-enable-experimental-string-processing`,
start lexing `'` delimiters as regex literals (this
is just a placeholder delimiter for now). The
contents of which gets passed to the libswift
library, which can return an error string to be
emitted, or null for success.

The libswift side isn't yet hooked up to the Swift
regex parser, so for now just emit a dummy
diagnostic for regexes starting with quantifiers.

If successful, build an AST node which will be
emitted as an implicit call to an
`init(_regexString:)` initializer of an in-scope
`Regex` decl (which will eventually be a known
stdlib decl).
2021-12-06 21:16:14 +00:00

41 lines
956 B
CMake

if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"")
else()
set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'")
endif()
add_swift_host_library(swiftParse STATIC
Confusables.cpp
Lexer.cpp
ParseDecl.cpp
ParsedRawSyntaxNode.cpp
ParsedRawSyntaxRecorder.cpp
ParsedTrivia.cpp
ParseExpr.cpp
ParseGeneric.cpp
ParseIfConfig.cpp
ParsePattern.cpp
Parser.cpp
ParseRegex.cpp
ParseRequests.cpp
ParseStmt.cpp
ParseType.cpp
PersistentParserState.cpp
SyntaxParsingCache.cpp
SyntaxParsingContext.cpp)
_swift_gyb_target_sources(swiftParse PRIVATE
ParsedSyntaxBuilders.cpp.gyb
ParsedSyntaxNodes.cpp.gyb
ParsedSyntaxRecorder.cpp.gyb)
target_link_libraries(swiftParse PRIVATE
swiftAST
swiftSyntax
swiftSyntaxParse
)
add_dependencies(swiftParse swift-parse-syntax-generated-headers)
set_swift_llvm_is_available(swiftParse)