# JOE syntax highlight file for SKILL
# Based on the very rudimentary lisp syntax file
# Written by Joachim Fenkes <skill dot jsf at dojoe dot net> in 2005

=Idle
=Ident
=Comment
=Constant
=String 	+Constant
=StringEscape	+Escape +String
=Brace
=Symbol		+Atom +Constant +DefinedIdent
=Keyword
=Conditional	+Statement +Keyword
=Loop		+Statement +Keyword
=Number		+Constant
=Bad

:idle Idle
	*		idle
	";"		comment		recolor=-1
	"\""		string		recolor=-1
	"/"		slash
	"()[]{}"	bracket		recolor=-1
	"'"		maybe_symbol	recolor=-1
	"a-zA-Z_"	maybe_keyword	buffer recolor=-1
	"0-9"		number		recolor=-1

:maybe_keyword Ident
	*		idle		noeat	strings
	"list"		keyword
	"procedure"	keyword
	"while"		loop
	"foreach"	loop
	"if"		cond
	"for"		loop
	"when"		cond
	"unless"	cond
	"cond"		cond
	"defun"		keyword
	"let"		keyword
	"prog"		keyword
	"else"		cond
	"then"		cond
	"case"		cond
	"caseq"		cond
	"nil"		const
	"t"		keyword
done
	"0-9a-zA-Z_"	maybe_keyword

:number Number
	*		idle		noeat
	"0-9."		number

:slash Idle
	*		idle
	"/"		slash
	"*"		mcomment	recolor=-2

:comment Comment comment
	*		comment
	"BFHNTX"	comment		noeat call=comment_todo.comment_todo()
	"\n"		idle

:mcomment Comment comment
	*		mcomment
	"BFHNTX"	mcomment	noeat call=comment_todo.comment_todo()
	"*"		maybe_end_mcomment

:maybe_end_mcomment Comment comment
	*		mcomment	noeat
	"*"		maybe_end_mcomment
	"/"		idle

:string String string
	*		string
	"\""		idle
	"\\"		string_escape	recolor=-1

:string_escape StringEscape string
	*		string
	"\n"		string		recolor=-2

:bracket Brace
	*		idle		noeat

:maybe_symbol Idle
	*		symbol		recolor=-2
	"(){}"		bracket		recolor=-2

:symbol Symbol
	*		symbol
	" \t\n"		idle		recolor=-1
	")"		bracket		recolor=-1

:keyword Keyword
	*		idle		noeat

:cond Conditional
	*		idle		noeat

:loop Loop
	*		idle		noeat

:const Constant
	*		idle		noeat
