8000 Cherry-pick some post-4.2 changes into swift-4.2-branch by allevato · Pull Request #6 · swiftlang/swift-syntax · GitHub
[go: up one dir, main page]

Skip to content

Cherry-pick some post-4.2 changes into swift-4.2-branch #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d259fcc
Simplify AbsolutePosition offset calculation and support columns
Apr 10, 2018
5018466
Clarify comment
Apr 24, 2018
8044478
Un-rename property
Apr 24, 2018
b664867
Monomorphize AbsolutePosition.copy()
Apr 24, 2018
23502d3
Rename byteOffset to utf8Offset and remove utf16
Apr 24, 2018
b970c42
Re-add AbsolutePosition.swift
Apr 24, 2018
cc54246
Actually add offsets in add(columns:) and add(lines:size:)
Apr 24, 2018
60e37d0
Add accessors for source locations and test diagnostic emission (#16141)
harlanhaskins Apr 26, 2018
3dc6e42
Manually cherry-pick tests from apple/swift:
allevato Aug 31, 2018
a2ed7fb
Add descriptions for SwiftSyntax errors (#16339)
harlanhaskins May 3, 2018
54ea839
SwiftSyntax: Allow absolute position access for dangling nodes.
nkcsgexi May 3, 2018
08fb8a0
Add incremental syntax tree deserialization to SwiftSyntax
ahoppen May 24, 2018
7deb6b4
Make RawSyntax a struct
ahoppen May 24, 2018
f104c5f
Add type annotations to speed up compile time
ahoppen Jun 26, 2018
156cc9f
Don't throw just because compilation fails
ahoppen Jul 26, 2018
9bf9210
Record the nodes that have been reused during an incremental transfer
ahoppen May 30, 2018
6294ff3
Refactor AbsolutePosition
ahoppen Jun 28, 2018
84c6d0d
Make AbsolutePosition a value type
ahoppen Aug 14, 2018
b7deaa6
Remove validate methods
ahoppen Aug 23, 2018
9cef71e
Make SourceLength a struct
ahoppen Aug 29, 2018
2703c00
Make RawSyntaxData a direct enum
ahoppen Aug 29, 2018
f511ccc
Don't set the process terminationHandler in SwiftcInvocation
ahoppen Aug 29, 2018
e58d288
Update tests after cherrypicks.
allevato Sep 7, 2018
5d9650b
Allow *ListSyntax nodes to be visited.
allevato Sep 7, 2018
bd3484b
Apply review fixes
allevato Sep 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add type annotations to speed up compile time
  • Loading branch information
ahoppen authored and allevato committed Sep 7, 2018
commit f104c5fd9d6c8ee66f420eaa7ea43791cbddfca8
5 changes: 3 additions & 2 deletions Sources/SwiftSyntax/SyntaxBuilders.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public struct ${Builder} {
if let list = layout[idx] {
layout[idx] = list.appending(elt.raw)
} else {
layout[idx] = RawSyntax(kind: .${child.swift_syntax_kind},
layout: [elt.raw], presence: .present)
layout[idx] = RawSyntax(kind: SyntaxKind.${child.swift_syntax_kind},
layout: [elt.raw],
presence: SourcePresence.present)
}
}
% else:
Expand Down
12 changes: 7 additions & 5 deletions Sources/SwiftSyntax/SyntaxFactory.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,26 @@ public enum SyntaxFactory {
% child_params.append("%s: %s" % (child.swift_name, param_type))
% child_params = ', '.join(child_params)
public static func make${node.syntax_kind}(${child_params}) -> ${node.name} {
let data = SyntaxData(raw: RawSyntax(kind: .${node.swift_syntax_kind},
layout: [
let layout: [RawSyntax?] = [
% for child in node.children:
% if child.is_optional:
${child.swift_name}?.data.raw ?? ${make_missing_swift_child(child)},
% else:
${child.swift_name}.data.raw,
% end
% end
], presence: .present))
]
let raw = RawSyntax(kind: SyntaxKind.${node.swift_syntax_kind},
layout: layout, presence: SourcePresence.present)
let data = SyntaxData(raw: raw)
return ${node.name}(root: data, data: data)
}
% elif node.is_syntax_collection():
public static func make${node.syntax_kind}(
_ elements: [${node.collection_element_type}]) -> ${node.name} {
let raw = RawSyntax(kind: .${node.swift_syntax_kind},
let raw = RawSyntax(kind: SyntaxKind.${node.swift_syntax_kind},
layout: elements.map { $0.data.raw },
presence: .present)
presence: SourcePresence.present)
let data = SyntaxData(raw: raw)
return ${node.name}(root: data, data: data)
}
Expand Down
0