#-------------------------------------------------------------------------------
#
#	Name    : Python
#	Purpose : StrongED mode file for Python source files
#	Author  :  Laurence Tratt 1997 - 1999
#	Licence : (?) Freeware
#	Version : 0.13, 24-12-06
#
#-------------------------------------------------------------------------------

HelpPath	Python,


#-------------------------------------------

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

Search
	ClassStart	("class" * ":")
	ClassEnd	< NL NL
	MethodStart	("def" * ":")
	MethodEnd	< NL

	Class		< {" "} "class " * ":"
	Method		< {" "} "def " * ":"
	FirstChar	'A-Za-z_'
	MiddleChars	'A-Za-z_0-9'
	_MarkWord	FirstChar {MiddleChars} {{White} "." {White} FirstChar {MiddleChars}}
        GoClass		"class" * CW * ":"
End

FoldParm1(ClassStart, ClassEnd, StartOfLine, case)
FoldParm2(MethodStart, MethodEnd, StartSpace, case)

SyntaxOptions
	SingleQuote	Yes
	DoubleQuote	Yes
	QuoteQuote	Yes
	SplitString	Yes
	HexPrefix	0x
End

SyntaxComment 1
	Type		OneLine
	StartWith	#
	EndWith		NL
End

SyntaxComment 2
	Type		MultiLine
	StartWith	"\"\"\""
	EndWith		"\"\"\""
End

# Control flow

SyntaxWords Group1 case
	if break continue elif else except finally assert
	for raise try while pass return import from
End

# Definitions

SyntaxWords Group2 case
	def class lambda global
End

# Expressions

SyntaxWords Group3 case
	and not or is in
End

SyntaxWords Group4 case
	None self
End

# Built-in functions / commands

SyntaxWords Group5 case
	abs apply callable chr cmp coerce compile complex delattr dir
	divmod eval execfile filter float getattr globals hasattr hash
	hex id input int intern isinstance issubclass len list locals
	long map max min oct open ord pow range raw_input reduce
	reload repr round setattr slice str tuple type vars xrange
	__import__ del
End

#----------------------------------------------------------

KeyList
End

#----------------------------------------------------------

Functions

	Icon	LoF
        Help	Hpy_lof
        Select	dbox_ListOfFound()

	Key	F2
	^Select	ListOfFound(Class,Text,Whole,,,Sort)

	^Adjust	ListOfFound(Class,All,Whole,,,Sort)

	Key	F3
	Select	ListOfFound(Method,Text,Whole,,,Sort)

	Adjust	ListOfFound(Method,All,Whole,,,Sort)

	Key	F10
	Menu	Save and run
	Icon	Run
	Help	Hpy_run
	Select	SetTmp() SaveRun("<StrongED$Tmp_FilePath>.<StrongED$Tmp_FileLeaf>")

	Key	^G
	Menu	Goto label/DEF PROC/FN
	Icon	goto
	Help	Hpy_go
	Select	Push GotoFound(GoClass,Text,Whole,Line,Case) Position(Top,5)

	Key	^G
	Adjust	Push GotoFound(GoClass,All,Whole,Line,Case)

	Key	^G 2
	Select	Pop

	Key	^G 2
	Adjust	Pop

	Menu	List of classes in this text F2
	Select	ListOfFound(Class,Text,Whole,,,Sort)

	Menu	List of methods in this text F3
	Select	ListOfFound(Method,Text,Whole,,,Sort)
End

Shortcuts
End
