Skip to content

Commit 38be2da

Browse files
committed
Support for backtick literals
1 parent c455329 commit 38be2da

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

docs/src/test.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ is supported.
377377
Base.show(Base.stdout)
378378
Base.@show Base.stdout
379379
println("x = $x")
380+
`echo "hello \`world\`"`
380381
"Compute nothing"
381382
function f(::Number)
382383
return
@@ -480,6 +481,8 @@ is supported.
480481

481482
println("x = $(x)")
482483

484+
`echo "hello \`world\`"`
485+
483486
"Compute nothing"
484487
function f(::Number)
485488
return nothing

src/expr.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ function tile_expr(ex::Expr, pr = -1)
176176
return tile_expr_function(head, decl, body)
177177
elseif (@isexpr ex Expr(:macrocall, ref::GlobalRef, docstr::String, def)) && ref === GlobalRef(Core, Symbol("@doc"))
178178
return tile_expr(docstr, pr) / tile_expr(def, pr)
179+
elseif (@isexpr ex Expr(:macrocall, ref::GlobalRef, str::String)) && ref === GlobalRef(Core, Symbol("@cmd"))
180+
return literal("`") * literal(escape_string(str, "`")) * literal("`")
179181
elseif @isexpr ex Expr(head := :break || :continue || :return)
180182
return literal(head)
181183
elseif @isexpr ex Expr(head := :return || :const, arg)

0 commit comments

Comments
 (0)