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

Allow lazy as a local modifier #273

Merged
merged 1 commit into from
Feb 19, 2023
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
15 changes: 11 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ module.exports = grammar({
[$._modifierless_class_declaration, $.property_modifier],
[$._modifierless_class_declaration, $.simple_identifier],
[$._fn_call_lambda_arguments],

// `lazy` is also allowed as an identifier...
[$.property_behavior_modifier, $.simple_identifier],
],
extras: ($) => [
$.comment,
Expand Down Expand Up @@ -261,7 +264,8 @@ module.exports = grammar({
/`[^\r\n` ]*`/,
/\$[0-9]+/,
token(seq("$", LEXICAL_IDENTIFIER)),
"actor"
"actor",
"lazy"
),
identifier: ($) => sep1($.simple_identifier, $._dot),
// Literals
Expand Down Expand Up @@ -1751,11 +1755,14 @@ module.exports = grammar({
$.function_modifier,
$.mutation_modifier,
$.property_modifier,
$.parameter_modifier,
$.property_behavior_modifier
$.parameter_modifier
),
_locally_permitted_modifier: ($) =>
choice($.ownership_modifier, $.inheritance_modifier),
choice(
$.ownership_modifier,
$.inheritance_modifier,
$.property_behavior_modifier
),
property_behavior_modifier: ($) => "lazy",
type_modifiers: ($) => repeat1($.attribute),
member_modifier: ($) =>
Expand Down
2 changes: 1 addition & 1 deletion script-data/top-repositories.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Alamofire Alamofire/Alamofire 5.6.4
iina iina/iina v1.3.1
Charts danielgindi/Charts v4.1.0
lottie-ios airbnb/lottie-ios 4.0.1
lottie-ios airbnb/lottie-ios 4.1.3
vapor vapor/vapor 3.3.3
SwiftyJSON SwiftyJSON/SwiftyJSON 5.0.1
RxSwift ReactiveX/RxSwift 6.5.0 0 9
Expand Down