Skip to content

Commit 0c7adb8

Browse files
committed
Propagate prec.right
1 parent 06a5237 commit 0c7adb8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

grammar.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const PREC = {
33
using_directive: 2,
44
control: 1,
55
stable_type_id: 2,
6+
then: 2,
67
while: 2,
78
assign: 3,
89
case: 3,
@@ -1134,14 +1135,17 @@ module.exports = grammar({
11341135
),
11351136

11361137
_if_condition: $ =>
1137-
choice(
1138-
$.parenthesized_expression,
1139-
$._then_condition,
1138+
prec.right(
1139+
PREC.then,
1140+
choice(
1141+
$.parenthesized_expression,
1142+
$._then_condition,
1143+
)
11401144
),
11411145

11421146
_then_condition: $ =>
11431147
prec.right(
1144-
PREC.control,
1148+
PREC.then,
11451149
seq($._indentable_expression, "then"),
11461150
),
11471151

0 commit comments

Comments
 (0)