Skip to content

macro_name_str should not wrap around full macro path #582

@c42f

Description

@c42f

As of #572 we now have macro_name_str wrapping around the full path of the macro in a macro call, as in

julia> parsestmt(SyntaxNode, "A.b.c\"asdf\"")
SyntaxNode:
[macrocall]
  [macro_name_str]
    [.]
      [.]
        A                                :: Identifier
        b                                :: Identifier
      c                                  :: Identifier
  [string-r]
    "asdf"                               :: String

But this is inconvenient to work with - I think the macro_name_str should just wrap around the identifier c:

julia> parsestmt(SyntaxNode, "A.b.c\"asdf\"")
SyntaxNode:
[macrocall]
  [.]
    [.]
      A                                :: Identifier
      b                                :: Identifier
    [macro_name_str]
      c                                :: Identifier
  [string-r]
    "asdf"                             :: String

In the future, I'd like to enforce that macro_name, macro_name_str and macro_name_cmd only wrap an Identifier (ok, and var), and the only reason we don't have this right now is due to the existence of the syntax @A.b.x

@Keno I assume this is just a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions