1<?php
2/*************************************************************************************
3 * stonescript.php
4 * --------
5 * Author: Archimmersion ( based on ruby.php by Moises Deniz )
6 * Copyright: (c) 2011 Archimmersion ( http://www.archimmersion.com )
7 * Release Version: 1.0.9.1
8 * Date Started: 2011/03/30
9 *
10 * StoneScript language file for GeSHi.
11 *
12 * StonesCript is a Lua based script language for the ShiVa3D game engine ( http://www.stonetrip.com )
13 *
14 * More information can be found at http://www.stonetrip.com/developer/doc/api/introduction
15 *
16 * CHANGES
17 * -------
18 * 2011/04/18 (1.0.8.11)
19 *   -  Initial release
20 *
21 *************************************************************************************
22 *
23 *   This file is part of GeSHi.
24 *
25 *   GeSHi is free software; you can redistribute it and/or modify
26 *   it under the terms of the GNU General Public License as published by
27 *   the Free Software Foundation; either version 2 of the License, or
28 *   (at your option) any later version.
29 *
30 *   GeSHi is distributed in the hope that it will be useful,
31 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
32 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33 *   GNU General Public License for more details.
34 *
35 *   You should have received a copy of the GNU General Public License
36 *   along with GeSHi; if not, write to the Free Software
37 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
38 *
39 ************************************************************************************/
40
41$language_data = array (
42    'LANG_NAME' => 'StoneScript',
43    'COMMENT_SINGLE' => array(1 => "--"),
44    'COMMENT_MULTI' => array("--[[" => "]]"),
45    'COMMENT_REGEXP' => array(
46        4 => '/<<\s*?(\w+)\\n.*?\\n\\1(?![a-zA-Z0-9])/si',
47        ),
48    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
49    'QUOTEMARKS' => array('"', '`','\''),
50    'ESCAPE_CHAR' => '\\',
51    'KEYWORDS' => array(
52        // Blue - General Keywords
53        1 => array(
54                'and', 'begin', 'break', 'do', 'else', 'elseif', 'end',
55                'for', 'if', 'in', 'while', 'next', 'not', 'or', 'redo',
56                'then', 'unless', 'until', 'when', 'false', 'nil', 'self',
57                'true', 'local', 'this', 'return',
58            ),
59        // Dark Blue - Main API names
60        2 => array(
61                'animation', 'application', 'cache', 'camera', 'debug',
62                'dynamics', 'group', 'hashtable', 'hud', 'input', 'light',
63                'log', 'math', 'mesh', 'microphone', 'music', 'navigation',
64                'network', 'object', 'pixelmap', 'projector', 'scene',
65                'sensor', 'server', 'session', 'sfx', 'shape', 'sound',
66                'string', 'system', 'table', 'user', 'video', 'xml',
67                // Plugin API names
68                'plasma', 'watersim',
69                'winDirectories',
70                'ActionSheet', 'Alert', 'Mail', 'Picker', 'StatusBar',
71            ),
72        // Constants
73        // Can be commented out if performance is crucial -> then these keywords will appear in a slightly lighter color
74        3 => array(
75                //Animation
76                'kPlaybackModeLoop', 'kPlaybackModeLoopMirrored', 'kPlaybackModeLoopReversed',
77                'kPlaybackModeOnce', 'kPlaybackModeOnceReversed',
78                //Application - Environment
79                'kStatusLoading', 'kStatusReady', 'kStatusSaving', // 'kStatusNone'
80                //Application - Options
81                'kOptionAudioMasterVolume', 'kOptionAutomaticVirtualKeyboard', 'kOptionDynamicShadowsBufferCount',
82                'kOptionDynamicShadowsBufferSize', 'kOptionDynamicShadowsConstantSampling', 'kOptionDynamicShadowsPCFSampleCount',
83                'kOptionDynamicShadowsQuality', 'kOptionDynamicShadowsScreenSpaceBlur', 'kOptionFullscreen',
84                'kOptionFullscreenHeight', 'kOptionFullscreenWidth', 'kOptionHardwareOcclusion',
85                'kOptionMaxEventBouncesPerFrame', 'kOptionNetworkStreams', 'kOptionNetworkStreamsUseBrowser',
86                'kOptionPrioritizeEventBounces', 'kOptionRenderingEnabled', 'kOptionShadersQuality',
87                'kOptionSwapInterval', 'kOptionTerrainsQuality', 'kOptionTexturesAnisotropyLevel',
88                'kOptionTexturesMipmapBias', 'kOptionTexturesQuality', 'kOptionViewportRotation',
89                //Application - Resource Types
90                'kResourceTypeAnimBank', 'kResourceTypeFont', 'kResourceTypeHUD',
91                'kResourceTypeMaterial', 'kResourceTypeMesh', 'kResourceTypeParticle',
92                'kResourceTypePixelMap', 'kResourceTypeSoundBank', 'kResourceTypeTexture',
93                'kResourceTypeTextureClip', 'kResourceTypeTrail',
94                //Cache
95                'kPropertyHeight', 'kPropertySize', 'kPropertyWidth',
96                //Dynamics
97                'kAxisX', 'kAxisY', 'kAxisZ',
98                'kTypeBox', 'kTypeCapsule', 'kTypeSphere',
99                //HUD
100                'kAddressingModeClamp', 'kAddressingModeRepeat', 'kAlignCenter', 'kAlignJustify','kAlignLeft', 'kAlignRight',
101                'kAlignTop', 'kBlendModeAdd', 'kBlendModeDefault', 'kBlendModeModulate', 'kCaseFixed', 'kCaseVariable',
102                'kCommandTypeCallAction', 'kCommandTypeCopyCheckStateToRegister', 'kCommandTypeCopyEditTextToRegister',
103                'kCommandTypeCopyListItemTextToRegister', 'kCommandTypeCopyListLastSelectedItemToRegister',
104                'kCommandTypeCopyProgressValueToRegister', 'kCommandTypeCopySliderValueToRegister', 'kCommandTypeCopyTagToRegister',
105                'kCommandTypeEnterModalMode', 'kCommandTypeInterpolateBackgroundColor', 'kCommandTypeInterpolateBorderColor',
106                'kCommandTypeInterpolateForegroundColor', 'kCommandTypeInterpolateHeight', 'kCommandTypeInterpolateOpacity',
107                'kCommandTypeInterpolatePosition', 'kCommandTypeInterpolateProgressValue', 'kCommandTypeInterpolateRotation',
108                'kCommandTypeInterpolateSize', 'kCommandTypeInterpolateWidth', 'kCommandTypeLeaveModalMode',
109                'kCommandTypeMatchScreenSpaceBottomLeftCorner', 'kCommandTypeMatchScreenSpaceBottomRightCorner',
110                'kCommandTypeMatchScreenSpaceCenter', 'kCommandTypeMatchScreenSpaceHeight', 'kCommandTypeMatchScreenSpaceTopLeftCorner',
111                'kCommandTypeMatchScreenSpaceTopRightCorner', 'kCommandTypeMatchScreenSpaceWidth', 'kCommandTypePauseMovie',
112                'kCommandTypePauseSound', 'kCommandTypePauseTimer', 'kCommandTypePlayMovie', 'kCommandTypePlaySound',
113                'kCommandTypePlaySoundLoop', 'kCommandTypeResumeSound', 'kCommandTypeSendEventToUser', 'kCommandTypeSetActive',
114                'kCommandTypeSetBackgroundColor', 'kCommandTypeSetBackgroundImage', 'kCommandTypeSetBackgroundImageUVOffset',
115                'kCommandTypeSetBackgroundImageUVScale', 'kCommandTypeSetBorderColor', 'kCommandTypeSetButtonText',
116                'kCommandTypeSetCheckState', 'kCommandTypeSetCheckText', 'kCommandTypeSetCursorPosition', 'kCommandTypeSetCursorVisible',
117                'kCommandTypeSetEditText', 'kCommandTypeSetFocus', 'kCommandTypeSetForegroundColor', 'kCommandTypeSetHeight',
118                'kCommandTypeSetLabelText', 'kCommandTypeSetOpacity', 'kCommandTypeSetPosition', 'kCommandTypeSetRotation',
119                'kCommandTypeSetSize', 'kCommandTypeSetVisible', 'kCommandTypeSetWidth', 'kCommandTypeSleep', 'kCommandTypeStartTimer',
120                'kCommandTypeStopAction', 'kCommandTypeStopMovie', 'kCommandTypeStopSound', 'kCommandTypeStopTimer',
121                'kComponentTypeButton', 'kComponentTypeCheck', 'kComponentTypeContainer', 'kComponentTypeEdit', 'kComponentTypeLabel',
122                'kComponentTypeList', 'kComponentTypeMovie', 'kComponentTypePicture', 'kComponentTypePixelMap', 'kComponentTypeProgress',
123                'kComponentTypeRenderMap', 'kComponentTypeSlider', 'kCursorShapeCross', 'kCursorShapeDefault', 'kCursorShapeHandPointing',
124                'kCursorShapeIBeam', 'kCursorShapeNone', 'kCursorShapeWaiting', 'kDirectionLeftToRight', 'kDirectionRightToLeft',
125                'kEncodingASCII', 'kEncodingUTF8', 'kEventTypeGainFocus', 'kEventTypeLooseFocus', 'kEventTypeMouseEnter',
126                'kEventTypeMouseLeave', 'kFillModeSolid', 'kInterpolatorTypeLinear', 'kInterpolatorTypePower2', 'kInterpolatorTypePower3',
127                'kInterpolatorTypePower4', 'kInterpolatorTypeRoot2', 'kInterpolatorTypeRoot3', 'kInterpolatorTypeRoot4',
128                'kInterpolatorTypeSpring1', 'kInterpolatorTypeSpring2', 'kInterpolatorTypeSpring3', 'kInterpolatorTypeSpring4',
129                'kInterpolatorTypeSpring5', 'kInterpolatorTypeSpring6',
130                'kOriginBottom', 'kOriginBottomLeft', 'kOriginBottomRight', 'kOriginCenter', 'kOriginLeft', 'kOriginRight',
131                'kOriginTop', 'kOriginTopLeft', 'kOriginTopRight', 'kProgressTypeBottomToTop', 'kProgressTypeLeftToRight',
132                'kProgressTypeRightToLeft', 'kProgressTypeTopToBottom', 'kRuntimeValueCallArgument0', 'kRuntimeValueCallArgument1',
133                'kRuntimeValueCallArgument2', 'kRuntimeValueCallArgument3', 'kRuntimeValueCurrentUser', 'kRuntimeValueCurrentUserMainCamera',
134                'kRuntimeValueRegister0', 'kRuntimeValueRegister1', 'kRuntimeValueRegister2', 'kRuntimeValueRegister3',
135                'kShapeTypeEllipsoid', 'kShapeTypeRectangle', 'kShapeTypeRoundRectangle', 'kSliderTypeBottomToTop',
136                'kSliderTypeLeftToRight', 'kSliderTypeRightToLeft', 'kSliderTypeTopToBottom', 'kWaveTypeConstant',
137                'kWaveTypeSawtooth', 'kWaveTypeSawtoothInv', 'kWaveTypeSinus', 'kWaveTypeSinusNoise', 'kWaveTypeSquare', 'kWaveTypeTriangle',
138                //Input
139                'kJoypadTypeIPhone', 'kJoypadTypeNone', 'kJoypadTypePhone', 'kJoypadTypeStandard', 'kJoypadTypeWiimote',
140                'kKey0', 'kKey1', 'kKey2', 'kKey3', 'kKey4', 'kKey5', 'kKey6', 'kKey7', 'kKey8', 'kKey9', 'kKeyA', 'kKeyB',
141                'kKeyBackspace', 'kKeyC', 'kKeyD', 'kKeyDelete', 'kKeyDown', 'kKeyE', 'kKeyEnd', 'kKeyEscape', 'kKeyF',
142                'kKeyF1', 'kKeyF10', 'kKeyF11', 'kKeyF12', 'kKeyF2', 'kKeyF3', 'kKeyF4', 'kKeyF5', 'kKeyF6', 'kKeyF7',
143                'kKeyF8', 'kKeyF9', 'kKeyG', 'kKeyH', 'kKeyHome', 'kKeyI', 'kKeyInsert', 'kKeyJ', 'kKeyK', 'kKeyL',
144                'kKeyLAlt', 'kKeyLControl', 'kKeyLeft', 'kKeyLShift', 'kKeyM', 'kKeyN', 'kKeyO', 'kKeyP', 'kKeyPageDown',
145                'kKeyPageUp', 'kKeyQ', 'kKeyR', 'kKeyRAlt', 'kKeyRControl', 'kKeyReturn', 'kKeyRight', 'kKeyRShift',
146                'kKeyS', 'kKeySpace', 'kKeyT', 'kKeyTab', 'kKeyU', 'kKeyUp', 'kKeyV', 'kKeyW', 'kKeyX', 'kKeyY',
147                'kKeyZ', 'kJoypadButtonPSPCircle', 'kJoypadButtonPSPCross', 'kJoypadButtonPSPDown', 'kJoypadButtonPSPL',
148                'kJoypadButtonPSPLeft', 'kJoypadButtonPSPR', 'kJoypadButtonPSPRight', 'kJoypadButtonPSPSelect',
149                'kJoypadButtonPSPSquare', 'kJoypadButtonPSPStart', 'kJoypadButtonPSPTriangle', 'kJoypadButtonPSPUp',
150                'kJoypadTypePSP', 'kJoypadButtonWiimoteA', 'kJoypadButtonWiimoteB', 'kJoypadButtonWiimoteC',
151                'kJoypadButtonWiimoteDown', 'kJoypadButtonWiimoteHome', 'kJoypadButtonWiimoteLeft',
152                'kJoypadButtonWiimoteMinus', 'kJoypadButtonWiimoteOne', 'kJoypadButtonWiimotePlus',
153                'kJoypadButtonWiimoteRight', 'kJoypadButtonWiimoteTwo', 'kJoypadButtonWiimoteUp', 'kJoypadButtonWiimoteZ',
154                //Light
155                'kTypeDirectional', 'kTypePoint',
156                //Math
157                'kEpsilon', 'kInfinity', 'kPi',
158                //Mesh
159                'kLockModeRead', 'kLockModeWrite', 'kLockReadWrite',
160                //Network
161                'kBluetoothServerPort', 'kDefaultServerPort', 'kStatusAuthenticated', 'kStatusSearchFinished', // 'kStatusNone', 'kStatusPending',
162                //Object
163                'kControllerTypeAI', 'kControllerTypeAnimation', 'kControllerTypeAny', 'kControllerTypeDynamics',
164                'kControllerTypeNavigation', 'kControllerTypeSound', 'kGlobalSpace', 'kLocalSpace', 'kParentSpace',
165                'kTransformOptionInheritsParentRotation', 'kTransformOptionInheritsParentScale', 'kTransformOptionInheritsParentTranslation',
166                'kTransformOptionTranslationAffectedByParentRotation', 'kTransformOptionTranslationAffectedByParentScale', 'kTypeCamera',
167                'kTypeCollider', 'kTypeDummy', 'kTypeGroup', 'kTypeLight', 'kTypeOccluder', 'kTypeProjector', 'kTypeReflector',
168                'kTypeSensor', 'kTypeSfx', 'kTypeShape',
169                //Pixelmap
170                'kBlendModeDecal', 'kBlendModeReplace', 'kFillModeBrush', 'kFillModeNone', 'kPenModeBrush', // 'kFillModeSolid',
171                'kPenModeNone', 'kPenModeSolid',
172                //Projector
173                'kMapTypeMovie', 'kMapTypePixelMap', 'kMapTypeRenderMap', 'kMapTypeTexture', 'kMapTypeTextureClip',
174                //Scene
175                'kFilteringModeBilinear', 'kFilteringModeNearest', 'kFilteringModeTrilinear', // 'kAddressingModeClamp', 'kAddressingModeRepeat',
176                'kSkyBoxFaceBack', 'kSkyBoxFaceBottom', 'kSkyBoxFaceFront', 'kSkyBoxFaceLeft', 'kSkyBoxFaceRight', 'kSkyBoxFaceTop',
177                //Sensor
178                'kShapeTypeBox', 'kShapeTypeSphere',
179                //Server
180                'kStatusConnected', 'kStatusNone', 'kStatusPending',
181                //Session - duplicate keywords
182                //'kStatusConnected', 'kStatusNone', 'kStatusPending',
183                //Shape
184                'kMapTypeUnknown', 'kCurveTypeBezier', 'kCurveTypeBSpline', 'kCurveTypeCatmullRom', 'kCurveTypePolyLine',
185                // 'kMapTypeMovie', 'kMapTypePixelMap', 'kMapTypeRenderMap', 'kMapTypeTexture',  'kMapTypeTextureClip',
186
187                //System
188                'kOSType3DS', 'kOSTypeBada', 'kOSTypeBrew', 'kOSTypePalm', 'kOSTypePS3',
189                'kClientTypeEditor', 'kClientTypeEmbedded', 'kClientTypeStandalone',
190                'kGPUCapabilityBloomFilterSupport', 'kGPUCapabilityContrastFilterSupport', 'kGPUCapabilityDepthBlurFilterSupport',
191                'kGPUCapabilityDistortionFilterSupport', 'kGPUCapabilityDynamicShadowsSupport', 'kGPUCapabilityHardwareOcclusionSupport',
192                'kGPUCapabilityHardwareRenderingSupport', 'kGPUCapabilityMonochromeFilterSupport', 'kGPUCapabilityMotionBlurFilterSupport',
193                'kGPUCapabilityPixelShaderSupport', 'kGPUCapabilityVelocityBlurFilterSupport', 'kGPUCapabilityVertexShaderSupport',
194                'kLanguageAlbanian', 'kLanguageArabic', 'kLanguageBulgarian', 'kLanguageCatalan', 'kLanguageCzech', 'kLanguageDanish',
195                'kLanguageDutch', 'kLanguageEnglish', 'kLanguageFinnish', 'kLanguageFrench', 'kLanguageGerman', 'kLanguageGreek',
196                'kLanguageHebrew', 'kLanguageHungarian', 'kLanguageIcelandic', 'kLanguageItalian', 'kLanguageJapanese', 'kLanguageKorean',
197                'kLanguageNorwegian', 'kLanguagePolish', 'kLanguagePortuguese', 'kLanguageRomanian', 'kLanguageRussian',
198                'kLanguageSerboCroatian', 'kLanguageSlovak', 'kLanguageSpanish', 'kLanguageSwedish', 'kLanguageThai',
199                'kLanguageTurkish', 'kLanguageUnknown', 'kLanguageUrdu', 'kOSTypeAndroid', 'kOSTypeAngstrom', 'kOSTypeIPhone',
200                'kOSTypeLinux', 'kOSTypeMac', 'kOSTypePSP', 'kOSTypeSymbian', 'kOSTypeWii', 'kOSTypeWindows', 'kOSTypeWindowsCE',
201            ),
202        // Not used yet
203        4 => array(
204                'dummycommand',
205            ),
206        ),
207    'SYMBOLS' => array(
208        '(', ')', '[', ']', '{', '}', '%', '&', '*', '|', '/', '<', '>',
209        '+', '-', '=>', '<<'
210        ),
211    'CASE_SENSITIVE' => array(
212        GESHI_COMMENTS => false,
213        1 => false,
214        2 => false,
215        3 => false,
216        4 => true,
217        ),
218    'STYLES' => array(
219        'KEYWORDS' => array(
220            1 => 'color:#0000FF; font-weight:bold;',
221            2 => 'color:#000088; font-weight:bold;',
222            3 => 'color:#C088C0; font-weight:bold;',
223            4 => 'color:#00FEFE; font-weight:bold;',
224            ),
225        'COMMENTS' => array(
226            1 => 'color:#008000; font-style:italic;',
227            4 => 'color: #cc0000; font-style: italic;',
228            'MULTI' => 'color:#008000; font-style:italic;'
229            ),
230        'ESCAPE_CHAR' => array(
231            0 => 'color:#000099;'
232            ),
233        'BRACKETS' => array(
234            0 => 'color:#000000; font-weight:bold;'
235            ),
236        'STRINGS' => array(
237            0 => 'color:#888800;'
238            ),
239        'NUMBERS' => array(
240            0 => 'color:#AA0000;'
241            ),
242        // names after "."
243        'METHODS' => array(
244            1 => 'color:#FF00FF; font-weight:bold;'
245            ),
246        'SYMBOLS' => array(
247            0 => 'color:#000000; font-weight:bold;'
248            ),
249        'REGEXPS' => array(
250            0 => 'color:#ff6633; font-weight:bold;',
251            1 => 'color:#0066ff; font-weight:bold;',
252            2 => 'color:#6666ff; font-weight:bold;',
253            3 => 'color:#ff3333; font-weight:bold;'
254            ),
255        'SCRIPT' => array(
256            0 => '',
257            1 => '',
258            2 => '',
259            )
260        ),
261    'URLS' => array(
262        1 => '',
263        2 => '',
264        3 => '',
265        4 => ''
266        ),
267    'OOLANG' => true,
268    'OBJECT_SPLITTERS' => array(
269        1 => '.'
270        ),
271    'REGEXPS' => array(
272        0 => array(//Variables
273            GESHI_SEARCH => "([[:space:]])(\\$[a-zA-Z_][a-zA-Z0-9_]*)",
274            GESHI_REPLACE => '\\2',
275            GESHI_MODIFIERS => '',
276            GESHI_BEFORE => '\\1',
277            GESHI_AFTER => ''
278            ),
279        1 => array(//Arrays
280            GESHI_SEARCH => "([[:space:]])(@[a-zA-Z_][a-zA-Z0-9_]*)",
281            GESHI_REPLACE => '\\2',
282            GESHI_MODIFIERS => '',
283            GESHI_BEFORE => '\\1',
284            GESHI_AFTER => ''
285            ),
286        2 => "([A-Z][a-zA-Z0-9_]*::)+[A-Z][a-zA-Z0-9_]*",//Static OOP symbols
287        3 => array(
288            GESHI_SEARCH => "([[:space:]]|\[|\()(:[a-zA-Z_][a-zA-Z0-9_]*)",
289            GESHI_REPLACE => '\\2',
290            GESHI_MODIFIERS => '',
291            GESHI_BEFORE => '\\1',
292            GESHI_AFTER => ''
293            )
294        ),
295    'STRICT_MODE_APPLIES' => GESHI_MAYBE,
296    'SCRIPT_DELIMITERS' => array(
297        0 => array(
298            '<%' => '%>'
299            )
300        ),
301    'HIGHLIGHT_STRICT_BLOCK' => array(
302        0 => true,
303        ),
304    'TAB_WIDTH' => 2
305);
306