lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2002/10/22 18:43:00, "Thomas Wrensch" <twrensch@uop.edu> wrote:

> Think you could post the properties file somewhere? Maybe on the Wiki?
> 
>   - Tom
> 
>>>> PhiLho@GMX.net 10/22/02 08:17 AM >>>
> I just sent to the Scintilla mailing list an update of the Lua lexer.
> It supports now an almost unlimited number of nesting levels for literal
> 
> strings and block comments.
> And yes, it supports Lua 5.0's block comments.
> I have a properties file with the Lua 5.0 library functions.

Well, it is small enough, I think I can paste it below.

I have desactivated the Lua 5.0 names, as I cannot find a way to make it
coexists with the 4.0 ones, except by using different extensions, which
I don't want to. 

After all, I have spent some time to make a little utility to run the
right Lua interpreter on Windows, using a shbang (#!) line, as I have
Lua 4.0, 5.0, LuaPDF, LuaWin32 (mine), a Lua interpreter to test the API
of a client, etc. I will polish it a little more and upload it on my
site, in a couple week (I will go away some time, as I move to another
appartment). 

And, of course, the list of Lua 5.0 library function names is subject to changes.

-----8<----------
# Define SciTE settings for Lua files.

file.patterns.lua=*.lua

filter.lua=Lua (lua)|$(file.patterns.lua)|

lexer.$(file.patterns.lua)=lua

keywordclass.lua=and break do else elseif end false for function global if \
in local nil not or repeat return then true until while
keywords.$(file.patterns.lua)=$(keywordclass.lua)

#### Lua 4.0/4.1
# Basic Functions
keywords2.$(file.patterns.lua)=_ALERT _ERRORMESSAGE _INPUT _PROMPT _OUTPUT \
_STDERR _STDIN _STDOUT _VERSION assert call collectgarbage dofile dostring \
error foreach foreachi gcinfo getn globals loadfile loadstring newtype print \
rawget rawset require sort tonumber tostring tinsert tremove type unpack

# String Manipulation & Mathematical Functions
keywords3.$(file.patterns.lua)=abs acos asin atan atan2 ceil cos deg exp \
floor format frexp gsub ldexp log log10 max min mod rad random randomseed \
sin sqrt strbyte strchar strfind strlen strlower strrep strsub strupper tan

# Input and Output Facilities & System Facilities
keywords4.$(file.patterns.lua)=openfile closefile readfrom writeto appendto \
remove rename flush seek tmpfile tmpname read write \
clock date difftime execute exit getenv setlocale time

#### Lua 5.0
#~ # Basic Functions
#~ keywords2.$(file.patterns.lua)=_ALERT _ERRORMESSAGE _PROMPT _VERSION \
#~ assert collectgarbage create error gcinfo globals loadfile loadstring metatable \
#~ next nexti pcall print rawget rawset require tonumber tostring type unpack xpcall yield
#~
#~ # String & Table Manipulation, Mathematical Functions (string & table & math)
#~ keywords3.$(file.patterns.lua)=abs acos asin atan atan2 byte ceil char concat cos deg exp \
#~ find floor foreach foreachi format frexp getn gfind gsub insert ldexp len log log10 lower \
#~ max min mod pi rad random randomseed rep remove sin sort sqrt sub tan upper
#~
#~ # Input and Output Facilities & System Facilities (io & os)
#~ keywords4.$(file.patterns.lua)=clock close date difftime execute exit flush getenv \
#~ input open output popen read remove rename seek setlocale stdin stderr stdout \
#~ time tmpfile tmpname write
# I keep keywords5 & keywords6 for other libraries

#~ statement.indent.$(file.patterns.lua)=5 do else function then
#~ statement.end.$(file.patterns.lua)=5 end until
#~ statement.lookback.$(file.patterns.lua)=20
indent.maintain.$(file.patterns.lua)=1

comment.block.lua=--~
comment.block.at.line.start.lua=1

# Lua styles

#Default
style.lua.32=$(font.code.base),fore:#000000
# White space: Visible only in View Whitespace mode (or if it has a back colour)
style.lua.0=fore:#FF0000
# Block comment (Lua 5.0)
style.lua.1=$(colour.code.comment.box),$(font.code.comment.box),back:#E0F0F0
# Line comment
style.lua.2=$(colour.code.comment.line),$(font.code.comment.line)
# Doc comment -- Not used in Lua (yet?)
style.lua.3=$(colour.notused),$(font.notused)
# Number
style.lua.4=$(colour.number)
# Keyword
style.lua.5=$(colour.keyword)
# String
style.lua.6=$(colour.string)
# Character
style.lua.7=$(colour.char)
# Literal string
style.lua.8=$(colour.string),$(font.code.comment.box),back:#E0FFFF
# Preprocessor (obsolete in Lua 4.0 and up)
style.lua.9=$(colour.preproc)
# Operators
style.lua.10=$(colour.operator)
# Identifier (everything else...)
style.lua.11=
# End of line where string is not closed
style.lua.12=back:#E0C0E0,eolfilled
# Other keywords (bozo test colors :-)
style.lua.13=$(style.lua.5),back:#D0FFD0
style.lua.14=$(style.lua.5),back:#D0D0FF
style.lua.15=$(style.lua.5),back:#FFD0D0
style.lua.16=$(style.lua.5),back:#FFD0FF
style.lua.17=$(style.lua.5),back:#FFFFD0
# Braces are only matched in operator style
braces.lua.style=10

command.compile.*.lua=luac -o "$(FileName).luc" "$(FileNameExt)"
# Lua 5.0
command.go.*.lua=lua "$(FileNameExt)"
# Lua 4.0
#command.go.*.lua=lua40 -c -f "$(FileNameExt)"
---------->8-----

Hopefully, most of this file will go into the official SciTE distribution
(or not, depending on Neil :-)

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/