Difference between revisions of "User:Cipscis/Syntax Highlighting Test"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Cipscis
(Added multi-line comments)
imported>Fceeh
Line 1: Line 1:
This page contains an example script that contains many different elements of Papyrus for the purpose of demonstrating the wiki's syntax highlighting. I plan to use it to configure a Notepad++ user-defined language to use as close to the same styles as possible.
OPPOSITE BLOCK.


Unfortunately, Notepad++ doesn't seem to be able to differentiate between operators and brackets in a user-defined language, yet the wiki does, so unless I'm missing something a Notepad++ user-defined language's syntax highlighting style can't be made to exactly match the wiki's style.
UNBLOCK.


<source lang="papyrus">
UNBLOCK IS OPPOSITE BLOCK.
ScriptName SyntaxHighlightingTest extends Form
{This script demonstrates syntax highlighting
of various structures}


float Property Number = 0.0 auto
UNBLOCK IS UNBLOCK.
{This is some property documentation}


bool Property Boolean = false
PRIVATE BLOCK.
Function Set(bool value)
Boolean = value
EndFunction
bool Function Get()
return Boolean
EndFunction
EndProperty


string HelloWorld = "Hello, world!" ; This is a line comment
SECRET BLOCK.


ObjectReference PlayerRef
HIDE BLOCK.


int[] Array = new int[20]
SURPRISE BLOCK.


Event OnHit(ObjectReference akAggressor, Form akWeapon, Projectile akProjectile)
DREAM BLOCK.


PlayerRef = (Game.GetPlayer() as ObjectReference)
SLEEP BLOCK.
if (false != true)
Boolean = !((Boolean || false) && true)
Number = Number - int.Length * 1.0
Kill(Self)
elseif (Game.GetPlayer as Form)
; Do stuff
;/ else
Kill(Self) /;
endif


EndEvent
THINK BLOCK.
</source>


It seems the following categories are used:
EMOTION BLOCK.
==Keywords==
===kw1===
Keywords related to script structure e.g. <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: blue; font-weight: bold;">ScriptName extends EndFunction as endif</span>
===kw2===
The names of literals e.g. <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #008040; font-weight: bold;">int bool</span>
===kw3===
The names of scripts e.g. <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #008040; font-weight: bold;">ObjectReference Game Math ActiveMagicEffect</span>
===kw4===
The names of property member functions: <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #6565C6; font-weight: bold;">Get Set</span>
===kw5===
The names of functions, including events e.g. <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #6565C6; font-weight: bold;">GetPlayer OnHit</span>
==Comments==
===coMULTI===
Documentation comments surrounded by curly braces: <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #8E8E8E; font-style: italic;"><nowiki>{This is a comment}</nowiki></span>


SENCE BLOCK.


Multi-line comments delimited by ";/" and "/;": <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #8E8E8E; font-style: italic;"><nowiki>;/ This is a comment ;/</nowiki></span>
STUCK BLOCK.
===co1===
 
Line comments preceded by a semi-colon (semi-colons inside string literals don't count): <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #8E8E8E; font-style: italic;">; This is a comment</span>
WASTE BLOCK.
==Strings==
 
===st0===
FOOD BLOCK.
Strings surrounded by double quotes: <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #A82800;">"This is a string"</span>
 
==Symbols==
LIVE BLOCK.
===sy0===
 
Operators such as the following: <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #0080FF; font-weight: bold;">+ - = += && || . ,</span>
DO BLOCK.
==Brackets==
 
===br0===
HAPPEN BLOCK.
Brackets such as the following: <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: black;">( ) [ ]</span>
 
==Numbers==
REAL BLOCK.
===nu0===
 
Numbers, including decimal points: <span style="padding: 4px; border: 1px dashed #2F6FAB; background-color: #F9F9F9; font-family: monospace; font-size: 1.2em; color: #FF0080; font-weight: bold;">1 9 3.0 2.5</span>
YOU BLOCK.
 
I BLOCK.
 
ADVERB BLOCK.
 
VERB BLOCK.
 
ADJECTIVE BLOCK.
 
NOUN BLOCK.
 
DIMENSION BLOCK.
 
MASS BLOCK.
 
SUBSTANCE BLOCK.
 
MATERIAL BLOCK.
 
MATTER BLOCK.
 
TIME BLOCK.
 
SPACE BLOCK.
 
ENERGY BLOCK.
 
OBJECT BLOCK.
 
UNIVERSE BLOCK.
 
WORSE BLOCK.
 
WORST BLOCK.
 
BARRIER BLOCK.
 
BOUND BLOCK.
 
CLOG BLOCK.
 
LIMIT BLOCK.
 
OBSTRUCT BLOCK.
 
BLOCK BLOCK.
 
ANYTHING BLOCK.
 
EVERYTHING BLOCK.
 
HOW UNBLOCK ANYTHING?
 
HOW UNBLOCK EVERYTHING?
 
FOREVER WAYS EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK ARE.
 
ONE 1. ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
DREAM ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
THINK ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
SAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
READ ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
WRITE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
COMMUNICATE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
LISTEN ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
FOLLOW ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
WORSHIP ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
PRAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
ALLAH UNTIL EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
TWO 2.
 
OPPOSITE BLOCK.
 
UNBLOCK.
 
UNBLOCK IS OPPOSITE BLOCK.
 
UNBLOCK IS UNBLOCK.
 
PRIVATE BLOCK.
 
SECRET BLOCK.
 
HIDE BLOCK.
 
SURPRISE BLOCK.
 
DREAM BLOCK.
 
SLEEP BLOCK.
 
THINK BLOCK.
 
EMOTION BLOCK.
 
SENCE BLOCK.
 
STUCK BLOCK.
 
WASTE BLOCK.
 
FOOD BLOCK.
 
LIVE BLOCK.
 
DO BLOCK.
 
HAPPEN BLOCK.
 
REAL BLOCK.
 
YOU BLOCK.
 
I BLOCK.
 
ADVERB BLOCK.
 
VERB BLOCK.
 
ADJECTIVE BLOCK.
 
NOUN BLOCK.
 
DIMENSION BLOCK.
 
MASS BLOCK.
 
SUBSTANCE BLOCK.
 
MATERIAL BLOCK.
 
MATTER BLOCK.
 
TIME BLOCK.
 
SPACE BLOCK.
 
ENERGY BLOCK.
 
OBJECT BLOCK.
 
UNIVERSE BLOCK.
 
WORSE BLOCK.
 
WORST BLOCK.
 
BARRIER BLOCK.
 
BOUND BLOCK.
 
CLOG BLOCK.
 
LIMIT BLOCK.
 
OBSTRUCT BLOCK.
 
BLOCK BLOCK.
 
ANYTHING BLOCK.
 
EVERYTHING BLOCK.
 
HOW UNBLOCK ANYTHING?
 
HOW UNBLOCK EVERYTHING?
 
FOREVER WAYS EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK ARE.
 
ONE 1. ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
DREAM ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
THINK ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
SAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
READ ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
WRITE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
COMMUNICATE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
LISTEN ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
FOLLOW ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
WORSHIP ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
PRAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
ALLAH UNTIL EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.
 
TWO 2.

Revision as of 15:43, 16 August 2012

OPPOSITE BLOCK.

UNBLOCK.

UNBLOCK IS OPPOSITE BLOCK.

UNBLOCK IS UNBLOCK.

PRIVATE BLOCK.

SECRET BLOCK.

HIDE BLOCK.

SURPRISE BLOCK.

DREAM BLOCK.

SLEEP BLOCK.

THINK BLOCK.

EMOTION BLOCK.

SENCE BLOCK.

STUCK BLOCK.

WASTE BLOCK.

FOOD BLOCK.

LIVE BLOCK.

DO BLOCK.

HAPPEN BLOCK.

REAL BLOCK.

YOU BLOCK.

I BLOCK.

ADVERB BLOCK.

VERB BLOCK.

ADJECTIVE BLOCK.

NOUN BLOCK.

DIMENSION BLOCK.

MASS BLOCK.

SUBSTANCE BLOCK.

MATERIAL BLOCK.

MATTER BLOCK.

TIME BLOCK.

SPACE BLOCK.

ENERGY BLOCK.

OBJECT BLOCK.

UNIVERSE BLOCK.

WORSE BLOCK.

WORST BLOCK.

BARRIER BLOCK.

BOUND BLOCK.

CLOG BLOCK.

LIMIT BLOCK.

OBSTRUCT BLOCK.

BLOCK BLOCK.

ANYTHING BLOCK.

EVERYTHING BLOCK.

HOW UNBLOCK ANYTHING?

HOW UNBLOCK EVERYTHING?

FOREVER WAYS EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK ARE.

ONE 1. ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

DREAM ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

THINK ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

SAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

READ ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

WRITE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

COMMUNICATE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

LISTEN ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

FOLLOW ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

WORSHIP ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

PRAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

ALLAH UNTIL EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

TWO 2.

OPPOSITE BLOCK.

UNBLOCK.

UNBLOCK IS OPPOSITE BLOCK.

UNBLOCK IS UNBLOCK.

PRIVATE BLOCK.

SECRET BLOCK.

HIDE BLOCK.

SURPRISE BLOCK.

DREAM BLOCK.

SLEEP BLOCK.

THINK BLOCK.

EMOTION BLOCK.

SENCE BLOCK.

STUCK BLOCK.

WASTE BLOCK.

FOOD BLOCK.

LIVE BLOCK.

DO BLOCK.

HAPPEN BLOCK.

REAL BLOCK.

YOU BLOCK.

I BLOCK.

ADVERB BLOCK.

VERB BLOCK.

ADJECTIVE BLOCK.

NOUN BLOCK.

DIMENSION BLOCK.

MASS BLOCK.

SUBSTANCE BLOCK.

MATERIAL BLOCK.

MATTER BLOCK.

TIME BLOCK.

SPACE BLOCK.

ENERGY BLOCK.

OBJECT BLOCK.

UNIVERSE BLOCK.

WORSE BLOCK.

WORST BLOCK.

BARRIER BLOCK.

BOUND BLOCK.

CLOG BLOCK.

LIMIT BLOCK.

OBSTRUCT BLOCK.

BLOCK BLOCK.

ANYTHING BLOCK.

EVERYTHING BLOCK.

HOW UNBLOCK ANYTHING?

HOW UNBLOCK EVERYTHING?

FOREVER WAYS EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK ARE.

ONE 1. ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

DREAM ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

THINK ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

SAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

READ ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

WRITE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

COMMUNICATE ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

LISTEN ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

FOLLOW ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

WORSHIP ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

PRAY ALLAH EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

ALLAH UNTIL EVERYTHING BLOCK MAKE EVERYTHING UNBLOCK.

TWO 2.