" Vim syntax file
" Language:	Pascal
" Maintainer:	Mario Eusebio <bio@dq.fct.unl.pt>
" Last change:	1997 April 25

" Remove any old syntax stuff hanging around
syntax clear

syntax case ignore

syntax keyword pascalStatement		program begin end
syntax keyword pascalLabel		case goto
syntax keyword pascalConditional	if else then
syntax keyword pascalRepeat		do for while to until

syntax keyword pascalTodo contained	TODO

" String 
syntax region  pascalString	start=+'+  end=+'+

"syntax match  pascalIdentifier		"\<[a-zA-Z_][a-zA-Z0-9_]*\>"

"syntax match  pascalDelimiter		"[()]"

syntax match  pascalMatrixDelimiter	"[][]"

"if you prefer you can highlight the range
"syntax match  pascalMatrixDelimiter	"[[0-9]\+\.\.[0-9]\+]"

"syntax match  pascalNumber		"-\=\<[0-9]\+\.[0-9]\+[dD]-\=[0-9]\+\>"
"syntax match  pascalNumber		"-\=\<[0-9]\+\.[0-9]\+[eE]-\=[0-9]\+\>"
"syntax match  pascalNumber		"-\=\<[0-9]\+\.[0-9]\+\>"
syntax match  pascalNumber		"-\=\<[0-9]\+\>"
syntax match  pascalByte		"\$[0-9a-fA-F]\+\>"

" If you don't like tabs
"syntax match pascalShowTab "\t"
"syntax match pascalShowTabc "\t"

syntax region pascalComment	start="(\*"  end="\*)" contains pascalTodo
syntax region pascalComment	start="{"  end="}" contains pascalTodo

syntax keyword pascalOperator	and array boolean delete div downto
syntax keyword pascalOperator	false file get in input insert
syntax keyword pascalOperator	interactive keyboard label maxint
syntax keyword pascalOperator	mod new nil not of or output packed
syntax keyword pascalOperator	put read readln record repeat
syntax keyword pascalOperator	reset rewrite seek set
syntax keyword pascalOperator	with write writeln

syntax keyword pascalType	char const integer real text
syntax keyword pascalType	var type string

syntax keyword pascalFunction	procedure function

syntax sync lines=250

if !exists("did_pascal_syntax_inits")
  let did_pascal_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  highlight link pascalStatement		Statement
  highlight link pascalLabel			Label
  highlight link pascalConditional		Conditional
  highlight link pascalRepeat			Repeat
  highlight link pascalTodo			Todo
  highlight link pascalString			String
  highlight link pascalMatrixDelimiter		Identifier
  highlight link pascalNumber			Number
  highlight link pascalByte			Number
  highlight link pascalOperator			Operator
  highlight link pascalFunction			Function
  highlight link pascalType			Type
  highlight link pascalComment			Comment
  highlight link pascalStatement		Statement

"optional highlighting
  "highlight link pascalDelimiter		Identifier

  "highlight link pascalShowTab			Error
  "highlight link pascalShowTabc		Error

  "highlight link pascalIdentifier		Identifier
endif
