# Defines SciTE settings for OScript sources; osx files and/or OSpace dumps.
# OScript is a programming language used to develop applications for the
# Livelink server platform.

##############################################################################
# Specify file extension and lexer class.

file.patterns.oscript=*.osx
filter.oscript=OScript (osx)|$(file.patterns.oscript)|
*filter.oscript=$(filter.oscript)
lexer.$(file.patterns.oscript)=oscript

##############################################################################
# Specify various editor parameters.

word.chars.oscript=$(chars.alpha)$(chars.numeric)_$
word.characters.$(file.patterns.oscript)=$(word.chars.oscript)

#comment.block.at.line.start.oscript=1
comment.block.oscript=//~
#~ comment.stream.start.oscript=#ifdef DOC
#~ comment.stream.end.oscript=#endif
comment.stream.start.oscript=/*
comment.stream.end.oscript=*/
comment.box.start.oscript=/*
comment.box.middle.oscript= *
comment.box.end.oscript= */

statement.indent.$(file.patterns.oscript)=6 case default else for if \
repeat switch while
statement.lookback.$(file.patterns.oscript)=20
statement.end.$(file.patterns.oscript)=10 ;
block.start.$(file.patterns.oscript)=10 if
block.end.$(file.patterns.oscript)=10 end
indent.maintain.$(file.patterns.oscript)=1
indent.size.$(file.patterns.oscript)=4
use.tabs.$(file.patterns.oscript)=1
tab.size.$(file.patterns.oscript)=4

preprocessor.symbol.$(file.patterns.oscript)=#
preprocessor.start.$(file.patterns.oscript)=ifdef ifndef
preprocessor.middle.$(file.patterns.oscript)=else
preprocessor.end.$(file.patterns.oscript)=endif

##############################################################################
# Specify API autocompletion and calltip help.

api.$(file.patterns.oscript)=$(SciteDefaultHome)\api\oscript.api
autocomplete.oscript.ignorecase=1
calltip.oscript.ignorecase=1
calltip.oscript.use.escapes=1
calltip.oscript.word.characters=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$.

##############################################################################
# Define keyword classes separately according to the language semantics
# before grouping them to keywords for styling. OScript is not case-sensitive;
# all keywords configured here must be entered in lower-case.

# Language native value and reference types.
keywordclass.type=\
assoc boolean bytes date dynamic error extern file integer list long object \
point real recarray record script string

# Word-like (literal) operators (boolean).
keywordclass.operator=\
and eq ge gt le lt ne not or xor

# Code-flow control statements.
keywordclass.oscript.control=\
break breakif by case continue continueif default downto else elseif end for \
goto if in repeat switch to until while

# Keywords to declare functions.
keywordclass.function=\
function return void

# Various language native keywords and reserved words.
keywordclass.miscellaneous=\
dll inbyref inout linked nodebug super this xcmd xfcn

# Constants with values and defaults for primitive types.
keywordclass.constant=\
false true undefined

# Language native constants (type classification integers).
keywordclass.coreconstant=\
booleantype bytestype datatype dynamictype errortype externtype integertype \
listtype longtype objecttype objreftype pointtype realtype scripttype \
stringtype undefinedtype voidtype

# Language native functions not bound to any object (global).
keywordclass.corefunction=\
datatypename echo echodebug echoerror echoinfo echostamp echowarn \
getfeatures isdefined iserror isfeature isinvokable isnoterror isnotset \
isobject isset isundefined length nparameters parameters pointh pointv type

# Object types available in Livelink kernel and core modules.
keywordclass.builtintype=\
cachetree capiconnect capierr capilog capilogin compiler dapisession \
dapinode dapiversion dapistream filecopy fileprefs frame javaobject \
mailmessage pop3session smtpsession ssloptions patfind patchange regex \
socket sqlconnection sqlcursor uapisession uapiuser wapisession wapimap \
wapimaptask wapiwork wapisubwork domattr domcdatasection domcharacterdata \
domcomment domdocument domdocumentfragment domdocumenttype domelement \
domentity domentityreference domimplementation domnamednodemap domnode \
domnodelist domnotation domparser domprocessinginstruction domtext saxparser \
xslprocessor

# Singletons available in Livelink kernel and core modules; they offer only
# static methods to call.
keywordclass.builtinobject=\
capi dapi env global language logging math memcached otds pattern security \
sql str system uapi vis wapi web zip

# Keywords usable in WebLingo sources (HTML templates including OScript).
keywordclass.weblingo=\
call html oscript

##############################################################################
# Define keyword groups that are recognized by the lexer and can be assigned
# different styles.

# Language native keywords: SCE_OSCRIPT_KEYWORD state.
keywords.$(file.patterns.oscript)=$(keywordclass.oscript.control) \
$(keywordclass.function) $(keywordclass.miscellaneous)

# Constants: SCE_OSCRIPT_CONSTANT state.
keywords2.$(file.patterns.oscript)=$(keywordclass.constant) \
$(keywordclass.coreconstant)

# Word-like (literal) operators: SCE_OSCRIPT_OPERATOR state.
keywords3.$(file.patterns.oscript)=$(keywordclass.operator)

# Value and reference (object) types: SCE_OSCRIPT_TYPE state.
keywords4.$(file.patterns.oscript)=$(keywordclass.type) \
$(keywordclass.builtintype)

# Language native (global) functions: SCE_OSCRIPT_FUNCTION state.
keywords5.$(file.patterns.oscript)=$(keywordclass.corefunction)

# Core static objects: SCE_OSCRIPT_OBJECT state.
keywords6.$(file.patterns.oscript)=$(keywordclass.builtinobject)

##############################################################################
# Define Style definitions supported by the lexical states. There are multiple
# states for language keyword groups although they all are reserved words; to
# be able ot assign them different styles.

# Default text style.
style.oscript.0=
# Single-line comment.
style.oscript.1=$(colour.code.comment.line),$(font.code.comment.line)
# Multi-line comment.
style.oscript.2=$(colour.code.comment.box),$(font.code.comment.box)
# Documentation comment; a text delimited by preprocessor directives
# #ifdef DOC and #endif; the value of DOC is supposed to be never defined.
style.oscript.3=$(colour.code.comment.doc),$(font.code.comment.doc)
# Preprocessor directive.
style.oscript.4=$(colour.preproc)
# Number.
style.oscript.5=$(colour.number)
# String enclosed in single quotes (apostrophes).
style.oscript.6=$(colour.string)
# String enclosed in double quotes (quotation marks).
style.oscript.7=$(colour.string)
# Constant literal. See the property keywords2 above.
style.oscript.8=fore:#FF7F3F
# Identifier of a variable, an object or a script.
style.oscript.9=
# Server-global variable (prefixed by $).
style.oscript.10=fore:#7F007F
# Language native keyword or reserved word. See the property keywords above.
style.oscript.11=$(colour.keyword),bold
# Operator; either symbolic or literal. See the property keywords3 above.
style.oscript.12=$(colour.operator),bold
# Label to jump to with the GoTo statement.
style.oscript.13=fore:#FF00FF
# Type available in the language, in kernel or code modules.
# See the property keywords4 above.
style.oscript.14=fore:#00007F
# Global function in the language, in kernel or code modules.
# See the property keywords5 above.
style.oscript.15=fore:#0000FF
# Static built-in object. See the property keywords6 above.
style.oscript.16=fore:#007F7F
# Object property.
style.oscript.17=
# Object method.
style.oscript.18=

braces.oscript.style=12

##############################################################################
# Specify help.

if PLAT_WIN
	command.help.$(file.patterns.oscript)=$(CurrentWord)!C:\LL971\builder\documentation.chm
	command.help.subsystem.$(file.patterns.oscript)=4
