#------------------------------------------------------------------------------#
#                                                                              #
#       Name    : Diff                                                         #
#       Purpose : Diff StrongED mode                                           #
#       Author  :  Philip Ludlam                                              #
#       Licence : Freeware                                                     #
#       Version : 0.05                                                         #
#       Date    : 13 June 2003                                                 #
#                                                                              #
#------------------------------------------------------------------------------#

SyntaxOptions
	SingleQuote	Yes
	DoubleQuote	Yes
	QuoteQuote	No
	SplitString	No
	HexPrefix	&
	Binprefix	%
	Numbers		flt
End

ID_FirstChar	A-Za-z
ID_Middle	A-Za-z_0-9./~+\-:;,?%@&#=*

Search
	header		< ("CVS RISC OS port by " | "CVS is ported " | "The SSH functions are based on the PuTTY ") * >
	status		< ["<CVS$BinDir>"] ".cvs diff: " * > 
	index		< "Index: " ** >
	filesep		< "===================================================================" >
	rcsfile		< "RCS file: /" ** >
	revision	< "retrieving revision " ** >
	diffcmnd	< "diff " ** >
	diffheader	< "--- " * NL "+++ " * NL "@@ " * " @@">
	diffcontent	< (" "|("+" ~"+")|("-" ~"-")) * >
	diff		diffcmnd NL diffheader NL {diffcontent NL}+
	file		index NL filesep NL rcsfile NL revision NL diff

	filesystem	"ADFS" | "CDFS" | "IZipFS" | "SCSI" | "IDEFS" | "Net" | ("Net#" AlphaNum) | "Pipe" | "RAM" | "Resources" | "LanMan" | ("LanMan#" AlphaNum) | "LanMan98" | ("LanMan98#" AlphaNum) | "DOOMFS"
	filename	(("/" filesystem "::") | (("Index: " | "*** " | "+++ " | "--- ")@0 )) {AlphaNum | Punct}+
End

ClickList s-Select2
	filename	SetTmp (_MarkWord, "tmp$temp") Run ("<tmp$mode>.Tools.LoadFile")
End

# header gumph (grey1)
SyntaxWords Group1 Case StartOfLine EndOfLine
	Diff files "CVS RISC OS port by" "CVS is ported ("
	"The SSH functions are based on the PuTTY ("
End

# Information (green)
# For CVS diff
SyntaxWords Group2 Case StartOfLine EndOfLine
	diff "retrieving revision" "RCS file: " "<CVS$BinDir>.cvs diff: " "cvs server: Diffing " "cvs diff: Diffing"
End

# Filenames (light blue)
SyntaxWords Group3 Case StartOfLine EndOfLine
	: Index:
End

# segment and sub-segment separators (yellow)
SyntaxWords Group4 Case StartOfLine EndOfLine
##	segment separators
#	diff
#	Num {Num|","}+ ("a"|"c"|"d") Num {Num|","}+ ?
#	diff -c
	***
#	diff -u
	@@
##	sub-segment separators
#	diff & diff -c
	---
	+++
End

# Removed lines (red)
SyntaxWords Group5 Case StartOfLine EndOfLine
#	diff
	<
#	diff -c & diff -u
	-
End

# Changed/modified lines (orange)
SyntaxWords Group6 Case StartOfLine EndOfLine
#	diff -c
	!
End

# Added lines (green)
SyntaxWords Group7 Case StartOfLine EndOfLine
#	diff
	>
#	diff -c & diff -u
	+
End

# file separators (purple)
SyntaxWords Group8 Case StartOfLine EndOfLine
#	diff, diff -c & diff -u
	===================================================================
End

# 'Command' lines (cream?)
#SyntaxWords Group9 Case StartOfLine EndOfLine
##	diff, diff -c & diff -u
#	"\ No newline at end of file"
#	"Binary files "
#	"? "
#	"Only in "
#End
