neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

simula.vim (3371B)


      1 " Vim syntax file
      2 " Language:	Simula
      3 " Maintainer:	Haakon Riiser <hakonrk@fys.uio.no>
      4 " URL:		http://folk.uio.no/hakonrk/vim/syntax/simula.vim
      5 " Last Change:	2001 May 15
      6 
      7 " quit when a syntax file was already loaded
      8 if exists("b:current_syntax")
      9    finish
     10 endif
     11 
     12 " No case sensitivity in Simula
     13 syn case	ignore
     14 
     15 syn match	simulaComment		"^%.*$" contains=simulaTodo
     16 syn region	simulaComment		start="!\|\<comment\>" end=";" contains=simulaTodo
     17 
     18 " Text between the keyword 'end' and either a semicolon or one of the
     19 " keywords 'end', 'else', 'when' or 'otherwise' is also a comment
     20 syn region	simulaComment		start="\<end\>"lc=3 matchgroup=Statement end=";\|\<\(end\|else\|when\|otherwise\)\>"
     21 
     22 syn match	simulaCharError		"'.\{-2,}'"
     23 syn match	simulaCharacter		"'.'"
     24 syn match	simulaCharacter		"'!\d\{-}!'" contains=simulaSpecialChar
     25 syn match	simulaString		'".\{-}"' contains=simulaSpecialChar,simulaTodo
     26 
     27 syn keyword	simulaBoolean		true false
     28 syn keyword	simulaCompound		begin end
     29 syn keyword	simulaConditional	else if otherwise then until when
     30 syn keyword	simulaConstant		none notext
     31 syn keyword	simulaFunction		procedure
     32 syn keyword	simulaOperator		eq eqv ge gt imp in is le lt ne new not qua
     33 syn keyword	simulaRepeat		while for
     34 syn keyword	simulaReserved		activate after at before delay go goto label prior reactivate switch to
     35 syn keyword	simulaStatement		do inner inspect step this
     36 syn keyword	simulaStorageClass	external hidden name protected value
     37 syn keyword	simulaStructure		class
     38 syn keyword	simulaType		array boolean character integer long real short text virtual
     39 syn match	simulaAssigned		"\<\h\w*\s*\((.*)\)\=\s*:\(=\|-\)"me=e-2
     40 syn match	simulaOperator		"[&:=<>+\-*/]"
     41 syn match	simulaOperator		"\<and\(\s\+then\)\=\>"
     42 syn match	simulaOperator		"\<or\(\s\+else\)\=\>"
     43 syn match	simulaReferenceType	"\<ref\s*(.\{-})"
     44 syn match	simulaSemicolon		";"
     45 syn match	simulaSpecial		"[(),.]"
     46 syn match	simulaSpecialCharErr	"!\d\{-4,}!" contained
     47 syn match	simulaSpecialCharErr	"!!" contained
     48 syn match	simulaSpecialChar	"!\d\{-}!" contains=simulaSpecialCharErr contained
     49 syn match	simulaTodo		"xxx\+" contained
     50 
     51 " Integer number (or float without `.')
     52 syn match	simulaNumber		"-\=\<\d\+\>"
     53 " Real with optional exponent
     54 syn match	simulaReal		"-\=\<\d\+\(\.\d\+\)\=\(&&\=[+-]\=\d\+\)\=\>"
     55 " Real starting with a `.', optional exponent
     56 syn match	simulaReal		"-\=\.\d\+\(&&\=[+-]\=\d\+\)\=\>"
     57 
     58 
     59 hi def link simulaAssigned		Identifier
     60 hi def link simulaBoolean		Boolean
     61 hi def link simulaCharacter		Character
     62 hi def link simulaCharError		Error
     63 hi def link simulaComment		Comment
     64 hi def link simulaCompound		Statement
     65 hi def link simulaConditional		Conditional
     66 hi def link simulaConstant		Constant
     67 hi def link simulaFunction		Function
     68 hi def link simulaNumber			Number
     69 hi def link simulaOperator		Operator
     70 hi def link simulaReal			Float
     71 hi def link simulaReferenceType		Type
     72 hi def link simulaRepeat			Repeat
     73 hi def link simulaReserved		Error
     74 hi def link simulaSemicolon		Statement
     75 hi def link simulaSpecial		Special
     76 hi def link simulaSpecialChar		SpecialChar
     77 hi def link simulaSpecialCharErr		Error
     78 hi def link simulaStatement		Statement
     79 hi def link simulaStorageClass		StorageClass
     80 hi def link simulaString			String
     81 hi def link simulaStructure		Structure
     82 hi def link simulaTodo			Todo
     83 hi def link simulaType			Type
     84 
     85 
     86 let b:current_syntax = "simula"
     87 " vim: sts=4 sw=4 ts=8