Skip to content

Commit

Permalink
[PR] [parser] Add comments to conditional_cover and logical_cover
Browse files Browse the repository at this point in the history
Summary:
<!--
  If this is a change to library defintions, please include links to relevant documentation.
  If this is a documentation change, please prefix the title with [DOCS].

  If this is neither, ensure you opened a discussion issue and link it in the PR description.
-->
Pull Request resolved: #7896

Differential Revision: D16149450

Pulled By: mroch

fbshipit-source-id: 0640d6202d2f1a214d4ab15bd300616ae48823e9
  • Loading branch information
goodmind authored and facebook-github-bot committed Jul 8, 2019
1 parent be91b25 commit c48b92c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/parser/expression_parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module Expression
let as_pattern = Pattern_cover.as_pattern

(* AssignmentExpression :
* [+Yield] YieldExpression
* ConditionalExpression
* LeftHandSideExpression = AssignmentExpression
* LeftHandSideExpression AssignmentOperator AssignmentExpression
Expand Down Expand Up @@ -249,6 +250,10 @@ module Expression
if op <> None then Eat.token env;
op

(* ConditionalExpression :
* LogicalExpression
* LogicalExpression ? AssignmentExpression : AssignmentExpression
*)
and conditional_cover env =
let start_loc = Peek.loc env in
let expr = logical_cover env in
Expand All @@ -270,6 +275,19 @@ module Expression

and conditional env = as_expression env (conditional_cover env)

(*
* LogicalANDExpression :
* BinaryExpression
* LogicalANDExpression && BitwiseORExpression
*
* LogicalORExpression :
* LogicalANDExpression
* LogicalORExpression || LogicalANDExpression
* LogicalORExpression ?? LogicalANDExpression
*
* LogicalExpression :
* LogicalORExpression
*)
and logical_cover =
let open Expression in
let make_logical env left right operator loc =
Expand Down

0 comments on commit c48b92c

Please sign in to comment.