Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Failure to parse string macros with module name & suffix (X.y"z"q) #371

Closed
mortenpi opened this issue Mar 6, 2023 · 0 comments · Fixed by #379 or #380
Closed

Failure to parse string macros with module name & suffix (X.y"z"q) #371

mortenpi opened this issue Mar 6, 2023 · 0 comments · Fixed by #379 or #380
Labels

Comments

@mortenpi
Copy link

mortenpi commented Mar 6, 2023

String macro calls of the form X.y"z"q fail to parse it seems like, causing problems for JuliaFormatter and the vscode linter:

julia> CSTParser.parse("X.y\"z\"q")
  1:7   errortoken
  1:6    macrocall
  1:3       1:1   OP: .
  1:1      X
  2:2      quotenode
  2:2       @y_str
  4:3     NOTHING: nothing
  4:6     STRING: z
  7:7    q

If the module name or the suffix are removed, all seems to be fine:

julia> CSTParser.parse("y\"z\"q")
  1:5   macrocall
  1:1    @y_str
  2:1    NOTHING: nothing
  2:4    STRING: z
  5:5    STRING: q

julia> CSTParser.parse("X.y\"z\"")
  1:6   macrocall
  1:3      1:1   OP: .
  1:1     X
  2:2     quotenode
  2:2      @y_str
  4:3    NOTHING: nothing
  4:6    STRING: z

The Julia parser handles it fine:

julia> :(X.y"z"q)
:(#= REPL[10]:1 =# X.@y_str "z" "q")
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
2 participants