Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bug with parsing of macros and expressions #113

Closed
pdeffebach opened this issue Mar 29, 2024 · 3 comments
Closed

Bug with parsing of macros and expressions #113

pdeffebach opened this issue Mar 29, 2024 · 3 comments

Comments

@pdeffebach
Copy link

The following works when Infiltrator.jl is not loaded, but fails when it is loaded

julia> macro inner(x)
           println("One argument")
           x
       end;

julia> macro inner(x, y)
           println("Two arguments")
           Expr(:block, x, y)
       end;

julia> macro outer(args...)
           :(@inner $args...)
       end;

julia> @outer 1 2
One argument
ERROR: syntax: "..." expression outside call around REPL[5]:1
Stacktrace:
 [1] top-level scope
   @ REPL[5]:1
 [2] top-level scope
   @ ~/.julia/packages/Infiltrator/TNlCu/src/Infiltrator.jl:798
@pfitzseb
Copy link
Member

I'm seeing the same failure in a session without Infiltrator loaded. :(@inner $(args...)) fixes it.

What Julia version are you on?

@pdeffebach
Copy link
Author

Interesting. I just tried again and it's didn't work, but did with the extra parentheses. So Infiltrator.jl seems unrelated. I could have sworn it worked at some point though.


julia> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_PKG_DEVDIR = /home/peterwd/Documents/Development
  JULIA_EDITOR = subl

@pfitzseb
Copy link
Member

Maybe you had an old definition hanging around that got picked up for some reason?
Anyways, closing this since I don't see how Infiltrator could cause something like this. Feel free to reopen if you have any evidence to the contrary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants