on master help sign in
Update Julia syntax test
commit64763eafbeac7a45208e3d22791057e7cbe2dac1 authorDavid Peter <mail@david-peter.de> dateTue 13 Jul 2021, 09:07 (5 years ago) parent3da4651
1 file changed+22−22
tests/syntax-tests/highlighted/Julia/test.jl+22−22
tests/syntax-tests/highlighted/Julia/test.jl+22−22
@@ -1,10 +1,10 @@
1−x = 3
1+x = 3
22
3−y = 2x
3+y = 2x
44
55typeof(y)
66
7−f(x) = 2 + x
7+f(x) = 2 + x
88
99
1010f
@@ -12,44 +12,44 @@
1212f(10)
1313
1414
15−function g(x, y)
16− z = x + y
17− return z^2
15+function g(x, y)
16+ z = x + y
17+ return z^2
1818end
1919
2020g(1, 2)
2121
22−let s = 0
23− for i in 1:10
24− s += i # Equivalent to s = s + i
22+let s = 0
23+ for i in 1:10
24+ s += i # Equivalent to s = s + i
2525 end
26− s
26+ s
2727end
2828
2929
3030typeof(1:10)
3131
3232function mysum(n)
33− s = 0
34− for i in 1:n
35− s += i
33+ s = 0
34+ for i in 1:n
35+ s += i
3636 end
37− return s
37+ return s
3838end
3939
4040mysum(100)
4141
42−a = 3
42+a = 3
4343
44−a < 5
44+a < 5
4545
46−if a < 5
46+if a < 5
4747 "small"
4848else
4949 "big"
5050end
5151
52−v = [1, 2, 3]
52+v = [1, 2, 3]
5353
5454typeof(v)
5555
@@ -57,15 +57,15 @@
5757
5858v[2] = 10
5959
60−v2 = [i^2 for i in 1:10]
60+v2 = [i^2 for i in 1:10]
6161
62−M = [1 2
62+M = [1 2
6363 3 4]
6464
6565typeof(M)
6666
6767zeros(5, 5)
6868
69−zeros(Int, 4, 5)
69+zeros(Int, 4, 5)
7070
71−[i + j for i in 1:5, j in 1:6]
71+[i + j for i in 1:5, j in 1:6]