Skip to content

Commit 8b3c9e3

Browse files
committed
remove duplicate partial member
1 parent 05d5219 commit 8b3c9e3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

cpp/generate.rb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,28 +1008,23 @@ def blockFinderFor( name:"", tag_as:"", start_pattern:nil, needs_semicolon: true
10081008
subsequent_object_with_operator = variable_name_without_bounds.maybe(@spaces).then(member_operator.without_numbered_capture_groups).maybe(@spaces)
10091009
# TODO: the member_access and method_access can probably be simplified considerably
10101010
# TODO: member_access and method_access might also need additional matching to handle scope resolutions
1011-
partial_member = the_this_keyword.or(
1011+
partialMemberFinder = ->(tag_name) do
1012+
the_this_keyword.or(
10121013
newPattern(
10131014
match: variable_name_without_bounds.or(lookBehindFor(/\]|\)/)).maybe(@spaces),
1014-
tag_as: "variable.other.object.access",
1015+
tag_as: tag_name,
10151016
)
10161017
).then(
10171018
member_operator
10181019
)
1020+
end
1021+
partial_member = partialMemberFinder["variable.other.object.access"]
10191022
member_context = [
10201023
mid_member = newPattern(
10211024
match: lookBehindFor(dot_or_arrow_operator).maybe(
10221025
@spaces
10231026
).then(
1024-
# this is duplicated from partial_member until #181 is resolved
1025-
the_this_keyword.or(
1026-
newPattern(
1027-
match: variable_name_without_bounds.or(lookBehindFor(/\]|\)/)).maybe(@spaces),
1028-
tag_as: "variable.other.object.property",
1029-
)
1030-
).then(
1031-
member_operator
1032-
)
1027+
partialMemberFinder["variable.other.object.property"]
10331028
)
10341029
),
10351030
partial_member,

0 commit comments

Comments
 (0)