The reference parser disallows bidirectional formatting to prevent certain types of malicious code. From Julia's test/syntax.jl:
@test_throws ParseError Meta.parse("""
function checkUserAccess(u::User)
if u.accessLevel != "user\u202e \u2066# users are not allowed\u2069\u2066"
return true
end
return false
end
""")
@test_throws ParseError Meta.parse("""
function checkUserAccess(u::User)
#=\u202e \u2066if (u.isAdmin)\u2069 \u2066 begin admins only =#
return true
#= end admin only \u202e \u2066end\u2069 \u2066=#
return false
end
""")
The reference parser disallows bidirectional formatting to prevent certain types of malicious code. From Julia's test/syntax.jl:
This needs to be fixed in the tokenizer
See also the fix in the reference parser: https://github.com/JuliaLang/julia/pull/42918