Mercurial
comparison .cms/lib/codemirror/mode/julia/index.html @ 0:78edf6b517a0 draft
24.10
author | Coffee CMS <info@coffee-cms.ru> |
---|---|
date | Fri, 11 Oct 2024 22:40:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78edf6b517a0 |
---|---|
1 <!doctype html> | |
2 | |
3 <title>CodeMirror: Julia mode</title> | |
4 <meta charset="utf-8"/> | |
5 <link rel=stylesheet href="../../doc/docs.css"> | |
6 | |
7 <link rel="stylesheet" href="../../lib/codemirror.css"> | |
8 <script src="../../lib/codemirror.js"></script> | |
9 <script src="../../addon/edit/matchbrackets.js"></script> | |
10 <script src="julia.js"></script> | |
11 <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> | |
12 <div id=nav> | |
13 <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a> | |
14 | |
15 <ul> | |
16 <li><a href="../../index.html">Home</a> | |
17 <li><a href="../../doc/manual.html">Manual</a> | |
18 <li><a href="https://github.com/codemirror/codemirror5">Code</a> | |
19 </ul> | |
20 <ul> | |
21 <li><a href="../index.html">Language modes</a> | |
22 <li><a class=active href="#">Julia</a> | |
23 </ul> | |
24 </div> | |
25 | |
26 <article> | |
27 <h2>Julia mode</h2> | |
28 | |
29 <div><textarea id="code" name="code"> | |
30 #numbers | |
31 1234 | |
32 1234im | |
33 .234 | |
34 .234im | |
35 2.23im | |
36 2.3f3 | |
37 23e2 | |
38 0x234 | |
39 | |
40 #strings | |
41 'a' | |
42 "asdf" | |
43 r"regex" | |
44 b"bytestring" | |
45 | |
46 """ | |
47 multiline string | |
48 """ | |
49 | |
50 #identifiers | |
51 a | |
52 as123 | |
53 function_name! | |
54 | |
55 #unicode identifiers | |
56 # a = x\ddot | |
57 a⃗ = ẍ | |
58 # a = v\dot | |
59 a⃗ = v̇ | |
60 #F\vec = m \cdotp a\vec | |
61 F⃗ = m·a⃗ | |
62 | |
63 #literal identifier multiples | |
64 3x | |
65 4[1, 2, 3] | |
66 | |
67 #dicts and indexing | |
68 x=[1, 2, 3] | |
69 x[end-1] | |
70 x={"julia"=>"language of technical computing"} | |
71 | |
72 | |
73 #exception handling | |
74 try | |
75 f() | |
76 catch | |
77 @printf "Error" | |
78 finally | |
79 g() | |
80 end | |
81 | |
82 #types | |
83 immutable Color{T<:Number} | |
84 r::T | |
85 g::T | |
86 b::T | |
87 end | |
88 | |
89 #functions | |
90 function change!(x::Vector{Float64}) | |
91 for i = 1:length(x) | |
92 x[i] *= 2 | |
93 end | |
94 end | |
95 | |
96 #function invocation | |
97 f('b', (2, 3)...) | |
98 | |
99 #operators | |
100 |= | |
101 &= | |
102 ^= | |
103 \- | |
104 %= | |
105 *= | |
106 += | |
107 -= | |
108 <= | |
109 >= | |
110 != | |
111 == | |
112 % | |
113 * | |
114 + | |
115 - | |
116 < | |
117 > | |
118 ! | |
119 = | |
120 | | |
121 & | |
122 ^ | |
123 \ | |
124 ? | |
125 ~ | |
126 : | |
127 $ | |
128 <: | |
129 .< | |
130 .> | |
131 << | |
132 <<= | |
133 >> | |
134 >>>> | |
135 >>= | |
136 >>>= | |
137 <<= | |
138 <<<= | |
139 .<= | |
140 .>= | |
141 .== | |
142 -> | |
143 // | |
144 in | |
145 ... | |
146 // | |
147 := | |
148 .//= | |
149 .*= | |
150 ./= | |
151 .^= | |
152 .%= | |
153 .+= | |
154 .-= | |
155 \= | |
156 \\= | |
157 || | |
158 === | |
159 && | |
160 |= | |
161 .|= | |
162 <: | |
163 >: | |
164 |> | |
165 <| | |
166 :: | |
167 x ? y : z | |
168 | |
169 #macros | |
170 @spawnat 2 1+1 | |
171 @eval(:x) | |
172 | |
173 #keywords and operators | |
174 if else elseif while for | |
175 begin let end do | |
176 try catch finally return break continue | |
177 global local const | |
178 export import importall using | |
179 function macro module baremodule | |
180 type immutable quote | |
181 true false enumerate | |
182 | |
183 | |
184 </textarea></div> | |
185 <script> | |
186 var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | |
187 mode: {name: "julia", | |
188 }, | |
189 lineNumbers: true, | |
190 indentUnit: 4, | |
191 matchBrackets: true | |
192 }); | |
193 </script> | |
194 | |
195 <p><strong>MIME types defined:</strong> <code>text/x-julia</code>.</p> | |
196 </article> |