Commit Graph

396 Commits

Author SHA1 Message Date
Richard Wei
1b83efb512 Revert "Revert "[Regex] Switch regex match to Swift tuples."" 2022-02-11 01:32:45 -08:00
Mishal Shah
dcd9e8e84e Revert "[Regex] Switch regex match to Swift tuples." 2022-02-10 15:21:53 -08:00
Richard Wei
7179a8d4ba Merge pull request #41275 from rxwei/regex-update-dev-6
[Regex] Switch regex match to Swift tuples.
2022-02-10 11:19:54 -08:00
Richard Wei
cf8e0fea12 [Regex] Switch regex match to Swift tuples.
Typed captures no longer use ad-hoc nominal tuples. We use Swift native tuples instead. See apple/swift-experimental-string-processing#127.

Update checkout tag to dev/6.
2022-02-09 16:21:57 -08:00
Anders Bertelrud
182e194b7e Bump SwiftArgumentParser checkout to 1.0.3. 2022-01-31 21:49:12 -08:00
Max Desiatov
53d8c59cd0 Fix formatting in update-checkout-config.json
3-spaces formatting is inconsistently used for some keys instead of 4 spaces. This change makes the formatting consistent in `update-checkout-config.json`.
2022-01-20 10:17:29 +00:00
Mishal Shah
070fb8f1c7 Update the main scheme llvm-project branch to stable/20211026 2022-01-18 19:23:21 -08:00
Mishal Shah
ee3e72f0d6 Update the branch for swift-installer-scripts to release/5.6 2022-01-17 14:13:08 -08:00
Pavel Yaskevich
4eabfa9354 [update-checkout] Fetch if the local branch/tag doesn't exist
Dependencies are usually updated to a different branch/tag name
when new versions get new released, but local checkout might not
have that fetched yet, so if initial checkout fails, let's fetch
before attempting to checkout.
2022-01-12 13:06:54 -08:00
Richard Wei
e5175d595e [Regex] Infer 'Match' type of regex literals.
Applies swift-experimental-string-processing#68 in regex literal type inference. Regex literals with captures will have type `Regex<Tuple{n}<Substring, {Captures...}>>`. This is a temporary thing that allows us to define generic constraints on captures. We will switch back to native tuples once we have variadic generics.
2022-01-06 10:54:10 -08:00
Richard Wei
1b3c0b7a73 [Regex] Infer capture types of regex literals.
When parsing a regular expression literal, accept a serialized capture structure from the regex parser. During type checking, decode it and form Swift types.

Examples:
```swift
'/(.)(.)/' // ==> `Regex<(Substring, Substring)>`
'/(?<label>.)(.)/' // ==> `Regex<(label: Substring, Substring)`
'/((.))*((.)?)/' //==> `Regex<([Substring], [Substring], Substring, Substring?)>`
```

Also:
- Fix a bug where a regex literal parsing error is not returning an error parser result.

Note:
- This needs to land after apple/swift-experimental-string-processing#92 and after `dev/4` tag has been created.
- See apple/swift-experimental-string-processing#92 for regex parser changes and the capture structure encoding.
- The `RegexLiteralParsingFn` `CaptureStructureOut` pointer type change from `char *` to `void *` will not break builds due to implicit pointer conversion (SE-0324) and unchanged ABI.

Resolves rdar://83253511.
2021-12-22 02:58:21 -08:00
Hamish Knight
128f5d4bc6 Update regex literal lexing and emission
Update the lexing implementation to defer to the
regex library, which will pass back the pointer
from to resume lexing, and update the emission to
call the new `Regex(_regexString:version:)`
overload, that will accept the regex string with
delimiters.

Because this uses the library's lexing
implementation, the delimiters are now `'/.../'`
and `'|...|'` instead of plain `'...'`.
2021-12-17 18:05:31 +00:00
Richard Wei
300cbaba31 Integrate experimental string processing modules and enable end-to-end regex.
- Checkout apple/swift-experimental-string-processing using a tag.
- Build `_MatchingEngine` as part of libswift (`ExperimentalRegex`) using sources from the package.
- Parse regex literals using the parser from `_MatchingEngine`.
- Build both `_MatchingEngine` and `_StringProcessing` as part of core libs using sources from the package.
- Use `Regex<DynamicCaptures>` as the default regex type until we finalize apple/swift-experimental-string-processing#68.
2021-12-17 10:33:07 +00:00
Mishal Shah
b799e47724 Add support for Swift 5.6 branch 2021-12-07 19:04:23 -08:00
Mishal Shah
5fa7324618 Merge pull request #40381 from apple/tomerd-patch-1
update swift-system to 1.1.1
2021-12-06 09:51:09 -08:00
Richard Wei
5ca95ef291 Revert "[update-checkout] Clone experimental string processing package" 2021-12-02 16:55:48 -08:00
tomer doron
3c7e0bd10f update swift-system to 1.1.1 2021-12-02 14:32:37 -08:00
Richard Wei
81631685c0 Merge pull request #40352 from rxwei/update-checkout-string-processing
[update-checkout] Clone experimental string processing package
2021-12-01 20:40:48 -08:00
Mishal Shah
63230ea842 Merge pull request #40349 from apple/tomerd-patch-1
update swift-system to 1.1.0
2021-12-01 15:49:50 -08:00
Richard Wei
a0825f4fdf [update-checkout] Clone experimental string processing package
Clone apple/swift-experimental-string-processing as part of the checkout. We'll use the main branch for now and will version it as needed.
2021-12-01 00:06:40 -08:00
tomer doron
d433f32926 update swift-system to 1.1.0 2021-11-30 21:15:50 -08:00
Alex Hoppen
02d2978184 [update-checkout] Decode stderr from failed update command
Otherwise, the error message gets printed as a Python binary string, e.g. you see
```
b'error: Your local changes to the following files would be overwritten by checkout:\n\tinclude/swift/IDE/CodeCompletion.h\n\tutils/update_checkout/update_checkout/update_checkout.py\nPlease commit your changes or stash them before you switch branches.\nAborting\n'
```
instead of
```
error: Your local changes to the following files would be overwritten by checkout:
	include/swift/IDE/CodeCompletion.h
	utils/update_checkout/update_checkout/update_checkout.py
Please commit your changes or stash them before you switch branches.
Aborting
```
2021-11-29 12:40:03 +01:00
Gwynne Raskind
27e011498f Turns out, if you actually pass the environment, it doesn't like it because 0 isn't a string! 2021-11-26 12:11:58 -06:00
Mishal Shah
eb77eaa4f2 Merge pull request #40129 from jorng/fix_update_checkout_tests
update_checkout (tests): Use 'main' for test branch
2021-11-12 08:54:19 -08:00
Rob Prentiss
1b344b3271 Update call_quietly to show output on failure
If 'call_quietly' fails, there is no indication as to what the failure
was, except for the exit/status code from the subprocess. This adds a
new exception type that will print out stdout/stderr from the subprocess
2021-11-11 11:46:55 -08:00
Rob Prentiss
7f7758bcaa update_checkout: Use 'main' for test branch
In addition to following current best practices for inclusive terms,
this also fixes an issue that occurs if a user has customized their
local git config to use an alternate default branch name (using
'init.defaultBranch').

If a user has set 'init.defaultBranch' in their git config to anything
other than master, the update_checkout tests fail. By setting the
sybolic-ref for HEAD after initializing the bare repo, the user's
setting will not affect the test.
2021-11-11 11:46:54 -08:00
Rob Prentiss
0f44c0c91d update-checkout: Explicitly use python3
This changes the shebangs for the update_checkout executable files to
specifically call Python 3. The code is already compatible and
functional with python3, so this removes any implied backward
compatibility, and removes any ambiguity based on the user's current
environment, especially since some systems, like macOS, still link
'python' to Python 2.

This also removes the now unnecessary 'from __future__' imports.
2021-11-10 15:29:38 -08:00
Mishal Shah
2ff10a57f4 Update the branch for swift-format to swift-5.5-branch 2021-11-10 09:32:29 -08:00
Jake Petroules
ffbb63c519 Update swift-argument-parser 2021-11-09 13:38:40 -08:00
Franklin Schrans
0a04ccec1b Merge pull request #39723 from d-ronnqvist/add-docc-in-build-script
[BuildScript] Add products for Swift-DocC and Swift-DocC-Render
2021-11-02 09:55:17 +00:00
Mishal Shah
0a7272b466 Add support for new rebranch 2021-10-26 23:08:49 -07:00
Ethan Kusters
6fff54d215 Use swift-docc-render-artifact instead of building swift-docc-render 2021-10-19 17:26:02 -07:00
David Rönnqvist
f662d50684 Add build script products for Swift-DocC and Swift-DocC-Render
(rdar://79703353)
2021-10-13 12:36:28 -07:00
Mishal Shah
6c252d06e4 Clean up update-checkout json file 2021-10-11 10:01:31 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
tomer doron
10c9b67f96 Update update-checkout-config.json 2021-09-29 16:38:29 -07:00
Mishal Shah
9d3b7590ef Update llvm-project branch to stable/20210726 2021-09-27 15:57:14 -07:00
tomer doron
54b015b687 update versions of stdlib libraries
update versions of stdlib libraries

swift-atomics -> 1.0.1
swift-collections -> 1.0.0
swift-numerics -> 1.0.1
swift-system -> 1.0.0
2021-09-13 10:51:41 -07:00
tomer doron
398e5f6c4a update swift-collections to 0.0.5 2021-08-13 21:26:10 -07:00
Mishal Shah
8ced62b2fe Add branch support for release/5.5-08092021 2021-08-09 14:23:19 -07:00
Mishal Shah
85dd0acf7a Add support for swift-installer-scripts in update-checkout 2021-08-04 23:04:56 -07:00
Mishal Shah
165e2001c9 Update the swift-argument-parser tag and sync rebranch scheme with main branch. 2021-08-03 17:06:13 -07:00
Mishal Shah
640e0674cc Update the rebranch scheme to use stable/20210726 llvm-project branch 2021-07-28 09:37:41 -07:00
Mishal Shah
7cb2ad4d03 Remove duplicate aliases in next 2021-07-21 15:33:05 -07:00
Jonas Devlieghere
15efc43518 [update-checkout] Update swift/next to next for llvm-project
https://forums.swift.org/t/simplifying-the-apple-llvm-project-branches/50287/
2021-07-21 13:38:27 -07:00
Saleem Abdulrasool
655a74c6da Merge pull request #38411 from compnerd/tags
update_checkout: add a `--skip-tags` option
2021-07-18 15:41:52 -07:00
Mishal Shah
503ea651ce Update argument parser tag for 5.5 to 0.4.3 2021-07-16 13:33:25 -07:00
Saleem Abdulrasool
f7bddc4557 update_checkout: add a --skip-tags option
When fetching the sources, the tags take a very long time due to the
daily tags.  Add an option to skip fetching tags.
2021-07-15 13:03:49 -07:00
tomer doron
73c61bd071 update swift-collections to 0.0.4 2021-07-08 12:25:26 -07:00
Mishal Shah
c36a98e570 Merge pull request #37431 from apple/tomerd-patch-1
add additional apple packages
2021-06-30 00:06:58 -07:00