#--------------------------------------------------
#
#	Name      : Lua
#	Purpose   : StrongED mode file for RiscLua
#	Author    : Gavin Wraith
#	Licence   : Freeware
#	Version   : 0.02, 02/04/03
#
#-------------------------------------------

HelpPath	"Lua5/1/3,Lua51,"

ID_FirstChar	A-Za-z_
ID_Middle	A-Za-z_0-9

Search
	_Indent		{" "}
	_MarkWord	{AlphaNum|"_"}+ | {Punct}+
	luafunc		"function"  @0
	luafunc2	CW {" "} "=" {" "} "function" | "function" {" "}+ CW
#	luafile		{'A-Za-z_0-9.<>$:!?+\-/~'}+

End

SmartIndent Case
	IndentSize	2
	IndentAfter	< {" "} ("do" | "if" | "elseif" | "else" | "for" | "function" | "repeat" | "while") \s
	OutdentLine	< {" "} ("end" | "elseif" | "else" | "until") \s
End

SyntaxOptions
	SingleQuote	Yes
	DoubleQuote	Yes
	QuoteChar	\
	QuoteQuote	No
	SplitString	Yes
End

#SyntaxComment 1
#	CommentType	Oneline
#	StartWith	--
#End
#
#SyntaxComment 2
#	CommentType	OneLine
#	StartWith	#!
#End

SyntaxComment 1
	CommentType	MultiLine
	StartWith	--[[
	EndWith		--]]
End

SyntaxWords Group1 case
	and break do else elseif end false for function
	if in local nil not or repeat return then true until while
End

Syntaxwords Group2 case
	string table math io os debug coroutine dbl block swi lpeg
End

SyntaxWords Group3 case
	assert collectgarbage _G dofile error getfenv getmetatable
	gcinfo ipairs load loadfile loadstring module next
	newtry pairs pcall print protect rawequal rawget rawset
	require rnd select setfenv setmetatable tonumber tostring
	type unpack xpcall @
End

SyntaxWords Group4 EndOfLine
	#!
	--
End

KeyList
	cs-R	ReindentText(,Force)
	Return	ReindentText(Line,Force) Newline()
End

Functions

	Key	F10
	Menu	Run  F10
	Icon	Run
	Select	SetTmp() SaveRun("Lua <Tmp$Path>.<Tmp$Leaf>")
	Help	Save and run (Adjust- in Taskwindow)

	Adjust	SetTmp() SaveRun("Taskwindow \"Lua <Tmp$Path>.<Tmp$Leaf>\" -quit")

	Key	F2
	Menu	List of functions F2
	Icon	LoF
	Select	ListOfFound(luafunc,,,NoLine)
	Help	Hlua_lof

	Key	^G
	Menu	Goto function
	Icon	goto
	Select	Push GotoFound (luafunc2,All,Whole,NoLine,Case)
	Help	HBa_go

	Key	^G 2
	Adjust	Pop

End
