presentations/highlight-js/test/detect/julia-repl/default.txt

37 lines
559 B
Text
Raw Permalink Normal View History

2018-12-07 08:48:05 -06:00
julia> function foo(x) x + 1 end
foo (generic function with 1 method)
julia> foo(42)
43
julia> foo(42) === 43.
false
Here we match all three lines of code:
julia> function foo(x::Float64)
42. - x
end
foo (generic function with 2 methods)
julia> for x in Any[1, 2, 3.4]
println("foo($x) = $(foo(x))")
end
foo(1) = 2
foo(2) = 3
foo(3.4) = 38.6
... unless it is not properly indented:
julia> function foo(x)
x + 1
end
Ordinary Julia code does not get highlighted:
Pkg.add("Combinatorics")
abstract type Foo end