endif
var line1 = getline(1)
-
- if line1 =~ '^\v%(\%|\\)'
- setf tex
- elseif line1[0] == '#' && line1 =~ 'rexx'
+ if line1 =~ '^#!.*\<\%(rexx\|regina\)\>'
setf rexx
+ return
elseif line1 == 'VERSION 1.0 CLASS'
setf vb
+ return
+ endif
+
+ var nonblank1 = getline(nextnonblank(1))
+ if nonblank1 =~ '^\v%(\%|\\)'
+ setf tex
+ elseif nonblank1 =~ '^\s*\%(/\*\|::\w\)'
+ setf rexx
else
setf st
endif
forth: [['#!/path/gforth']],
icon: [['#!/path/icon']],
crystal: [['#!/path/crystal']],
+ rexx: [['#!/path/rexx'],
+ ['#!/path/regina']],
}
enddef
" Rexx
- call writefile(['# rexx'], 'Xfile.cls')
+ call writefile(['#!/usr/bin/rexx'], 'Xfile.cls')
+ split Xfile.cls
+ call assert_equal('rexx', &filetype)
+ bwipe!
+
+ call writefile(['#!/usr/bin/regina'], 'Xfile.cls')
+ split Xfile.cls
+ call assert_equal('rexx', &filetype)
+ bwipe!
+
+ call writefile(['/* Comment */'], 'Xfile.cls')
+ split Xfile.cls
+ call assert_equal('rexx', &filetype)
+ bwipe!
+
+ call writefile(['::class Foo subclass Bar public'], 'Xfile.cls')
split Xfile.cls
call assert_equal('rexx', &filetype)
bwipe!