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

Unexpected behavior when using @csgrammar macro with a :symbol #68

Open
ReubenJ opened this issue Apr 25, 2024 · 0 comments
Open

Unexpected behavior when using @csgrammar macro with a :symbol #68

ReubenJ opened this issue Apr 25, 2024 · 0 comments

Comments

@ReubenJ
Copy link
Member

ReubenJ commented Apr 25, 2024

We expect both Symbol("a_symbol") and :a_symbol to work similarly, but the colon variant doesn't currently work:

g_original = @csgrammar begin
     Int = ...
    Ret = Dict(:output1 => Int)
end

When you use this grammar to construct a program, you get something like

Dict{QuoteNode, Int}(:(:output1) => Int)

When we expected

Dict{Symbol, Int}(:output1 => Int)

If you use

g_fixed = @csgrammar begin
     Int = ...
    Ret = Dict(Symbol("output1") => Int)
end

You get the following program

Dict{Symbol, Int}(Symbol("output1") => Int)

Which is what we expected.

TLDR: the two versions of the above grammars should result in the same expression/program

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

No branches or pull requests

1 participant