File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -3488,7 +3488,10 @@ pub fn getPositionContext(
34883488 // `tok` is the latter of the two.
34893489 if (! should_do_lookahead ) break ;
34903490 switch (tok .tag ) {
3491- .identifier , .builtin = > should_do_lookahead = false ,
3491+ .identifier ,
3492+ .builtin ,
3493+ .number_literal ,
3494+ = > should_do_lookahead = false ,
34923495 else = > break ,
34933496 }
34943497 }
Original file line number Diff line number Diff line change @@ -354,6 +354,24 @@ test "global error set" {
354354 // , .global_error_set, .{});
355355}
356356
357+ test "number literal" {
358+ try testContext (
359+ \\var foo = <loc>5<cursor></loc>;
360+ , .number_literal , .{});
361+ try testContext (
362+ \\var foo = <loc><cursor>5</loc>;
363+ , .number_literal , .{ .lookahead = true });
364+ }
365+
366+ test "char literal" {
367+ try testContext (
368+ \\var foo = <loc>'5<cursor>'</loc>;
369+ , .char_literal , .{ .lookahead = true });
370+ try testContext (
371+ \\var foo = <loc>'<cursor>5'</loc>;
372+ , .char_literal , .{ .lookahead = true });
373+ }
374+
357375test "enum literal" {
358376 try testContext (
359377 \\var foo = <loc>.<cursor>tag</loc>;
You can’t perform that action at this time.
0 commit comments