Skip to content

parser gives wrong line number of codes with semi-colon #57645

Open
@songjhaha

Description

@songjhaha

Julia version: 1.10.8

Parser gives wrong line number of codes end with semi-colon, which leads to wrong behavior of debugger when stepping next.

MWE:

code = """
       x = 1:0.1:10;
       a = sin.(x);
       b = cos.(x)
       c = 1;
       """

Meta.parseall(code)

in code line :(a = sin.(x)), gives line number 1 instead of 2

:($(Expr(:toplevel, :(#= none:1 =#), :($(Expr(:toplevel, :(x = 1:0.1:10)))), :(#= none:1 =#), :($(Expr(:toplevel, :(a = sin.(x))))), :(#= none:3 =#), :(b = cos.(x)), :(#= none:3 =#), :($(Expr(:toplevel, :(c = 1)))))))

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions