Skip to content
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

Updating top repository version #353

Merged
merged 5 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 41 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,24 @@ module.exports = grammar({
$.constructor_suffix
)
),
_parenthesized_type: ($) =>
seq(
"(",
choice($.opaque_type, $.existential_type, $.dictionary_type),
")"
),
navigation_expression: ($) =>
prec.left(
PRECS.navigation,
seq(
field("target", choice($._navigable_type_expression, $._expression)),
field(
"target",
choice(
$._navigable_type_expression,
$._expression,
$._parenthesized_type
)
),
field("suffix", $.navigation_suffix)
)
),
Expand Down Expand Up @@ -1213,7 +1226,8 @@ module.exports = grammar({
$.protocol_declaration,
$.operator_declaration,
$.precedence_group_declaration,
$.associatedtype_declaration
$.associatedtype_declaration,
$.macro_declaration
),
_type_level_declaration: ($) =>
choice(
Expand Down Expand Up @@ -1355,6 +1369,29 @@ module.exports = grammar({
)
),
function_body: ($) => $._block,
macro_declaration: ($) =>
seq(
$._macro_head,
$.simple_identifier,
optional($.type_parameters),
$._macro_signature,
optional(field("definition", $.macro_definition)),
optional($.type_constraints)
),
_macro_head: ($) => seq(optional($.modifiers), "macro"),
_macro_signature: ($) =>
seq(
$._function_value_parameters,
optional(seq($._arrow_operator, $._unannotated_type))
),
macro_definition: ($) =>
seq(
$._equal_sign,
field("body", choice($._expression, $.external_macro_definition))
),

external_macro_definition: ($) => seq("#externalMacro", $.value_arguments),

class_declaration: ($) =>
seq(optional($.modifiers), $._modifierless_class_declaration),
_modifierless_class_declaration: ($) =>
Expand Down Expand Up @@ -1466,7 +1503,8 @@ module.exports = grammar({
"|",
"^",
"<<",
">>"
">>",
"&"
),
// Hide the fact that certain symbols come from the custom scanner by aliasing them to their
// string variants. This keeps us from having to see them in the syntax tree (which would be
Expand Down
3 changes: 3 additions & 0 deletions script-data/known_failures.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
ReactKit/ReactKitTests/OperationTests.swift
RxSwift/Tests/RxCocoaTests/SharedSequence+ConcurrencyTests.swift
GRDB/GRDB/Core/Statement.swift
lottie-ios/Sources/Public/Animation/LottieAnimationLayer.swift
58 changes: 29 additions & 29 deletions script-data/top-repositories.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Alamofire Alamofire/Alamofire 5.6.4
iina iina/iina v1.3.1
Charts danielgindi/Charts v4.1.0
lottie-ios airbnb/lottie-ios 4.2.0
Alamofire Alamofire/Alamofire 5.8.1
iina iina/iina v1.3.4
Charts danielgindi/Charts 5.0.0
lottie-ios airbnb/lottie-ios 4.4.0
vapor vapor/vapor 3.3.3
SwiftyJSON SwiftyJSON/SwiftyJSON 5.0.1
RxSwift ReactiveX/RxSwift 6.5.0 0 9
RxSwift ReactiveX/RxSwift 6.5.0 1 9
RxSwift ReactiveX/RxSwift 6.5.0 2 9
RxSwift ReactiveX/RxSwift 6.5.0 3 9
RxSwift ReactiveX/RxSwift 6.5.0 4 9
RxSwift ReactiveX/RxSwift 6.5.0 5 9
RxSwift ReactiveX/RxSwift 6.5.0 6 9
RxSwift ReactiveX/RxSwift 6.5.0 7 9
RxSwift ReactiveX/RxSwift 6.5.0 8 9
HeroTransitions HeroTransitions/Hero 1.6.2
Kingfisher onevcat/Kingfisher 7.6.2
RxSwift ReactiveX/RxSwift 6.6.0 0 9
RxSwift ReactiveX/RxSwift 6.6.0 1 9
RxSwift ReactiveX/RxSwift 6.6.0 2 9
RxSwift ReactiveX/RxSwift 6.6.0 3 9
RxSwift ReactiveX/RxSwift 6.6.0 4 9
RxSwift ReactiveX/RxSwift 6.6.0 5 9
RxSwift ReactiveX/RxSwift 6.6.0 6 9
RxSwift ReactiveX/RxSwift 6.6.0 7 9
RxSwift ReactiveX/RxSwift 6.6.0 8 9
HeroTransitions HeroTransitions/Hero 1.6.3
Kingfisher onevcat/Kingfisher 7.10.2
shadowsocks shadowsocks/ShadowsocksX-NG v1.10.2
SnapKit SnapKit/SnapKit 5.0.1
SwiftLint realm/SwiftLint 0.51.0 0 2
SwiftLint realm/SwiftLint 0.51.0 1 2
Carthage Carthage/Carthage 0.39.0
Rectangle rxhanson/Rectangle v0.68
PromiseKit mxcl/PromiseKit 6.22.1
SnapKit SnapKit/SnapKit 5.7.0
SwiftLint realm/SwiftLint 0.54.0 0 2
SwiftLint realm/SwiftLint 0.54.0 1 2
Carthage Carthage/Carthage 0.39.1
Rectangle rxhanson/Rectangle v0.75
PromiseKit mxcl/PromiseKit 8.1.1
Moya Moya/Moya 15.0.3
MonitorControl MonitorControl/MonitorControl v4.1.0
MonitorControl MonitorControl/MonitorControl v4.2.0
ObjectMapper tristanhimmelman/ObjectMapper 4.2.0
SkeletonView Juanpe/SkeletonView 1.30.4
firefox-ios mozilla-mobile/firefox-ios v39.0 0 6
Expand All @@ -32,14 +32,14 @@ firefox-ios mozilla-mobile/firefox-ios v39.0 2 6
firefox-ios mozilla-mobile/firefox-ios v39.0 3 6
firefox-ios mozilla-mobile/firefox-ios v39.0 4 6
firefox-ios mozilla-mobile/firefox-ios v39.0 5 6
AudioKit AudioKit/AudioKit 5.6.1
Starscream daltoniam/Starscream 4.0.4
MessageKit MessageKit/MessageKit 4.1.1
AudioKit AudioKit/AudioKit 5.6.2
Starscream daltoniam/Starscream 4.0.6
MessageKit MessageKit/MessageKit 4.2.0
KeychainAccess kishikawakatsumi/KeychainAccess v4.2.2
Nuke kean/Nuke 12.1.0
Swinject Swinject/Swinject 2.8.2
GRDB groue/GRDB.swift v6.12.0 0 2
GRDB groue/GRDB.swift v6.12.0 1 2
Nuke kean/Nuke 12.4.0
Swinject Swinject/Swinject 2.8.4
GRDB groue/GRDB.swift v6.24.2 0 2
GRDB groue/GRDB.swift v6.24.2 1 2
Dance saoudrizwan/Dance v1.0.7
StyleKit 146BC/StyleKit 0.7.0
ReactKit ReactKit/ReactKit 0.12.0
Expand Down
20 changes: 20 additions & 0 deletions test/corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1495,3 +1495,23 @@ parseStatements(.switch)
(value_argument
(prefix_expression
(_expression)))))))

================================================================================
Navigation expressions can have parenthesized types before them
================================================================================

let opaqueSelf = (any WithModifiersSyntax).self

--------------------------------------------------------------------------------

(source_file
(property_declaration
(value_binding_pattern)
(pattern
(simple_identifier))
(navigation_expression
(existential_type
(user_type
(type_identifier)))
(navigation_suffix
(simple_identifier)))))
94 changes: 93 additions & 1 deletion test/corpus/functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ test(block: ===)
(value_arguments
(value_argument
(value_argument_label
(simple_identifier)))))))
(simple_identifier)))))))

================================================================================
Higher-order functions - pt 8
Expand Down Expand Up @@ -837,3 +837,95 @@ let mainClosure = { @MainActor in print("Running on main") }
(value_argument
(line_string_literal
(line_str_text))))))))))

================================================================================
Operator override named ampersand
================================================================================

public static func & (lhs: Self, rhs: some SQLExpressible) -> SQLExpression {
.associativeBinary(.bitwiseAnd, [lhs.sqlExpression, rhs.sqlExpression])
}

--------------------------------------------------------------------------------

(source_file
(function_declaration
(modifiers
(visibility_modifier)
(property_modifier))
(parameter
(simple_identifier)
(user_type
(type_identifier)))
(parameter
(simple_identifier)
(opaque_type
(user_type
(type_identifier))))
(user_type
(type_identifier))
(function_body
(statements
(call_expression
(prefix_expression
(simple_identifier))
(call_suffix
(value_arguments
(value_argument
(prefix_expression
(simple_identifier)))
(value_argument
(array_literal
(navigation_expression
(simple_identifier)
(navigation_suffix
(simple_identifier)))
(navigation_expression
(simple_identifier)
(navigation_suffix
(simple_identifier))))))))))))

================================================================================
Macros
================================================================================

@attached(
member,
names: named(apply)
)
public macro AutoApply() = #externalMacro(
module: "SwiftLintCoreMacros",
type: "AutoApply"
)

--------------------------------------------------------------------------------

(source_file
(macro_declaration
(modifiers
(attribute
(user_type
(type_identifier))
(simple_identifier)
(simple_identifier)
(call_expression
(simple_identifier)
(call_suffix
(value_arguments
(value_argument
(simple_identifier))))))
(visibility_modifier))
(simple_identifier)
(macro_definition
(external_macro_definition
(value_arguments
(value_argument
(value_argument_label
(simple_identifier))
(line_string_literal
(line_str_text)))
(value_argument
(value_argument_label
(simple_identifier))
(line_string_literal
(line_str_text))))))))
Loading