Skip to content

Commit

Permalink
Support for raw"..." strings inside at-pgf {...}. (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre authored Sep 18, 2020
1 parent 3730316 commit ada0351
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ end
function prockey(key)
if isa(key, Symbol) || isa(key, String)
return :($(string(key)) => nothing)
elseif @capture(key, @raw_str(str_))
return :($(string(str)) => nothing)
elseif @capture(key, (a_ : b_) | (a_ => b_) | (a_ = b_))
return :($(string(a))=>$b)
elseif @capture(key, g_...)
Expand Down
4 changes: 2 additions & 2 deletions test/test_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ end
a = 1
b = 2
theme = @pgf {color = "white"}
opt = @pgf { xmax = a + b, title = "42", justkey, theme... }
opt = @pgf { xmax = a + b, title = "42", justkey, raw"rawstring", theme... }
@test opt["color"] == "white"
@test repr_tex(opt) == repr_tex(Options("xmax" => 3, "title" => "42", "justkey" => nothing,
"color" => "white"))
"rawstring" => nothing, "color" => "white"))
f(x...) = tuple(x...)
y = @pgf f({ look, we, are = f(1, 2, 3), nesting = { stuff = 9 }})
@test length(y) == 1
Expand Down

0 comments on commit ada0351

Please sign in to comment.