1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
<h1>Haxe</h1>
<p>To use this language, use the class "language-haxe".</p>
<h2>Strings and string interpolation</h2>
<pre><code>"Foo
bar $baz"
'Foo
bar'
"${4 + 2}"</code></pre>
<h2>Regular expressions</h2>
<pre><code>~/haxe/i
~/[A-Z0-9._%-]+@[A-Z0-9.-]+.[A-Z][A-Z][A-Z]?/i
~/(dog|fox)/g</code></pre>
<h2>Conditional compilation</h2>
<pre><code>#if !debug
trace("ok");
#elseif (debug_level > 3)
trace(3);
#else
trace("debug level too low");
#end</code></pre>
<h2>Metadata</h2>
<pre><code>@author("Nicolas")
@debug
class MyClass {
@range(1, 8)
var value:Int;
@broken
@:noCompletion
static function method() { }
}</code></pre>
<h2>Reification</h2>
<pre><code>macro static function add(e:Expr) {
return macro $e + $e;
}</code></pre>
<h2>Known failures</h2>
<p>There are certain edge cases where Prism will fail.
There are always such cases in every regex-based syntax highlighter.
However, Prism dares to be open and honest about them.
If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
</p>
<h3>Comment-like substrings</h3>
<pre><code>"foo // var"</code></pre>
<h3>Two quotes of the same type (i.e. both single or both double) inside a regex</h3>
<pre><code>~/"foo"/</code></pre>