395
edits
(jEdit syntax file was not available anymore, re-uploaded on another server) |
Philosopher (talk | contribs) m (→FlightGear Wiki: isn't it just soo pretty?) |
||
Line 62: | Line 62: | ||
== FlightGear Wiki == | == FlightGear Wiki == | ||
Using the <syntaxhighight> tag with a lang="nasal" attribute, we can have highlighting right here on the wiki. Use enclose="div" to wrap the text, if it happens to be particularly wide. | |||
<nowiki><syntaxhighlight lang=" | <nowiki><syntaxhighlight lang="nasal"> | ||
# hello.nas | # hello.nas | ||
print('Hello World!'); | print('Hello World!'); | ||
Line 70: | Line 70: | ||
Which renders into: | Which renders into: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="nasal"> | ||
# hello.nas | # hello.nas | ||
print('Hello World!'); | print('Hello World!'); | ||
</syntaxhighlight> | |||
== Syntax highlighting test == | |||
Just a collection of keywords, etc. to test whether highlighting works (you can copy this to test your own highlighting): | |||
<syntaxhighlight lang="nasal"> | |||
# this is a comment | |||
# operators (if applicable): | |||
!a ? a+b - c/d*e : f~g; | |||
# Builtin functions, strings | |||
print('Hello World!'); | |||
die("We have an error, Houston!", arg[0]); | |||
cmdarg().getNode("setting").getValue(); | |||
streq(typeof(id(keys(hash))),10); | |||
# Loopoids | |||
foreach (var a; ["haha", {command:"NASAL!"}, me]) { | |||
if(0) break; | |||
elsif(1) continue; | |||
else return; | |||
while(1) sprintf("%s%s\n%s=%f", "Spam", "spam", "spam", 0e-0); | |||
for (var i=0; i < 0.00; i += 0x0) printf("%d", int(i)); | |||
forindex(var o; a) (func { | |||
var o = o; | |||
setlistener("/", func print(o), 1, 2); | |||
})(); | |||
} | |||
# Syntax error!: | |||
%$@&^|\` | |||
</syntaxhighlight> | </syntaxhighlight> | ||
edits