Skip to content

Commit

Permalink
Make prefix_identifier return 2 values instead of 3 values
Browse files Browse the repository at this point in the history
Reviewed By: yangdanny97

Differential Revision: D60079665

fbshipit-source-id: c71004f2c29c05a646feddd72a67636ccb0bd56f
  • Loading branch information
grievejia authored and facebook-github-bot committed Jul 23, 2024
1 parent f4f8b19 commit 9229df3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions source/analysis/preprocessing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ module Qualify (Context : QualifyContext) = struct
~data:{ name = Reference.create renamed; qualifier = Context.source_qualifier };
locals = Set.add locals reference;
},
stars,
renamed )
stars ^ renamed )


let rec explore_scope ~scope statements =
Expand Down Expand Up @@ -419,13 +418,13 @@ module Qualify (Context : QualifyContext) = struct
({ Node.value = { Parameter.name; value; annotation }; _ } as parameter)
=
if not (is_qualified (snd (Identifier.split_star name))) then
let scope, stars, renamed = prefix_identifier ~scope ~prefix:"parameter" name in
let scope, renamed = prefix_identifier ~scope ~prefix:"parameter" name in
( scope,
{
parameter with
Node.value =
{
Parameter.name = stars ^ renamed;
Parameter.name = renamed;
value = value >>| qualify_expression ~qualify_strings:DoNotQualify ~scope;
annotation;
};
Expand Down Expand Up @@ -852,7 +851,7 @@ module Qualify (Context : QualifyContext) = struct
let renamed_scope, name =
match name with
| Some { Node.value = name; location } when not (is_qualified name) ->
let scope, _, renamed = prefix_identifier ~scope ~prefix:"target" name in
let scope, renamed = prefix_identifier ~scope ~prefix:"target" name in
scope, Some { Node.value = renamed; location }
| _ -> scope, name
in
Expand Down Expand Up @@ -991,7 +990,7 @@ module Qualify (Context : QualifyContext) = struct
if has_local name || is_qualified name then
scope
else
let scope, _, _ = prefix_identifier ~scope ~prefix:"target" name in
let scope, _ = prefix_identifier ~scope ~prefix:"target" name in
scope
| _ -> scope
in
Expand Down

0 comments on commit 9229df3

Please sign in to comment.