File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ function parse_unary_colon(ps::ParseState, op::EXPR)
243
243
ret = op
244
244
else
245
245
prev_errored = ps. errored
246
- arg = @precedence ps 20 parse_expression (ps)
246
+ arg = @precedence ps 20 @nocloser ps :inref parse_expression (ps)
247
247
if isbracketed (arg) && headof (arg. args[1 ]) === :errortoken && errorof (arg. args[1 ]) === UnexpectedAssignmentOp
248
248
ps. errored = prev_errored
249
249
arg. args[1 ] = arg. args[1 ]. args[1 ]
Original file line number Diff line number Diff line change @@ -1270,4 +1270,23 @@ end
1270
1270
@test test_expr (" 0x111111111111111111111111111111111" )
1271
1271
end
1272
1272
end
1273
+
1274
+ @testset " #302" begin
1275
+ str = """
1276
+ const _examples = PlotExample[
1277
+ PlotExample( # 1
1278
+ "Lines",
1279
+ "A simple line plot of the columns.",
1280
+ [:(
1281
+ begin
1282
+ plot(Plots.fakedata(50, 5), w = 3)
1283
+ end
1284
+ )],
1285
+ ),
1286
+ ]
1287
+ """
1288
+ @test test_expr (str)
1289
+ x, ps = CSTParser. parse (CSTParser. ParseState (str), true )
1290
+ @test ps. errored == false
1291
+ end
1273
1292
end
You can’t perform that action at this time.
0 commit comments