Skip to content

Conversation

@milseman
Copy link
Member

@milseman milseman commented Dec 23, 2021

Compiler support by using save points.

@milseman milseman force-pushed the progressive_avowals branch from 332da1e to 50ecd39 Compare December 23, 2021 23:50

let positive = kind == .lookahead
assert(positive || kind == .negativeLookahead)
_ = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a comment instead? What's the benefit of using a string literal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks prettier in the editor (and sometimes better indentation than a multi-line comment), but I can use comments

Comment on lines 85 to 87
case .lookahead, .negativeLookahead,
.lookbehind, .negativeLookbehind:
try compileLookaround(g.kind.value, g.child)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use a Lookaround enum in the AST to group these four cases. Then compileLookaround(_:_:) would not need to handle unreachable cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a var lookaroundKind: (forwards: Bool, positive: Bool)? to Group. This is probably a little more useful than an enum, which we'd want to immediately destructure or add these APIs to anyways. If we have more uses for more semantic info here, we can make the enum.

@milseman milseman force-pushed the progressive_avowals branch from 50ecd39 to 4ae4d4e Compare December 24, 2021 00:19
@milseman
Copy link
Member Author

@swift-ci please test linux platform

@milseman milseman merged commit 0e25188 into swiftlang:main Dec 24, 2021
@milseman milseman deleted the progressive_avowals branch December 24, 2021 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants