# Define SciTE settings for Fortran files.

filter.fortran=Fortran (f for f90 f95 f2k)|*.f;*.for;*.f90;*.f95;*.f2k|

*filter.fortran=$(filter.fortran)

file.patterns.f95=*.f90;*.f95;*.f2k
file.patterns.f77=*.f;*.for
file.patterns.fortran=$(file.patterns.f95);$(file.patterns.f77)

lexer.$(file.patterns.f95)=fortran
lexer.$(file.patterns.f77)=f77

*language.fortran=&Fortran|f90||

# keywords and input/output specifiers
keywordclass.fortran=abstract access action advance all allocatable allocate \
apostrophe assign assignment associate asynchronous backspace \
bind blank block blockdata call case change character class classof close common codimension \
complex concurrent contains contiguous continue critical cycle data deallocate decimal delim \
default deferred delegate dimension direct do dowhile double doubleprecision elemental else \
elseif elsewhere encoding end endassociate endblock endblockdata endcritical endenum enddo \
endfile endforall endfunction endif endinterface endmodule endprocedure endprogram \
endselect endsubmodule endsubroutine endteam endtype endwhere entry enum enumeration enumerator eor equivalence \
err errmsg error event exist exit extends external fail final file flush fmt forall form format \
formatted function generic go goto id if im image images implicit import impure in include inout \
integer inquire intent interface intrinsic iomsg iolength \
iostat is kind len lock logical memory module name named namelist nextrec nml non_intrinsic non_overridable \
non_recursive none notify null nullify number only open opened operator optional out pad \
parameter pass new_line nopass pause pending pointer pos position post precision \
print private procedure program protected public pure quote rank re read readwrite \
real rec recl recursive reference result return rewind round save select \
selectcase selecttype sequence sequential sign size stat static status stop stream \
submodule subroutine sync target team then to type typeof unformatted unit unlock use value \
volatile wait where while write

keywords.$(file.patterns.f95)=$(keywordclass.fortran)
keywords.$(file.patterns.f77)=$(keywordclass.fortran)

# keywords2 is for highlighting intrinsic and extended functions
keywords2.$(file.patterns.fortran)=abs achar acos acosd acosh acospi adjustl adjustr \
aimag aimax0 aimin0 aint ajmax0 ajmin0 akmax0 akmin0 allocated alog \
alog10 amax0 amax1 amin0 amin1 amod anint any asin asind asinh asinpi associated \
atan atan2 atan2d atand atanh atanpi atomic_add atomic_and atomic_cas atomic_define \
atomic_fetch_add atomic_fetch_and atomic_fetch_or atomic_fetch_xor atomic_or atomic_ref \
atomic_xor bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn \
bge bgt ble blt bitest bitl bitlr bitrl bjtest bit_size bktest break \
btest c_sizeof cabs ccos cdabs cdcos cdexp cdlog cdsin cdsqrt ceiling cexp char \
clog cmplx co_broadcast co_max co_min co_reduce co_sum command_argument_count conjg \
cos cosd cosh coshape cospi count cpu_time cshift csin csqrt dabs \
dacos dacosd dasin dasind datan datan2 datan2d datand date \
date_and_time dble dcmplx dconjg dcos dcosd dcosh dcotan ddim dexp \
dfloat dflotk dfloti dflotj digits dim dimag dint dlog dlog10 dmax1 dmin1 \
dmod dnint dot_product dprod dreal dshiftl dshiftr dsign dsin dsind dsinh dsqrt dtan dtand \
dtanh eoshift epsilon erf erfc erfc_scaled errsns event_query execute_command_line \
exp exponent extends_type_of failed_images findloc float floati floatj floatk floor fraction \
free gamma get_command get_command_argument get_environment_variable get_team huge hypot \
iabs iachar iall iand iany ibclr ibits ibset ichar idate idim idint idnint ieor ifix \
iiabs iiand iibclr iibits iibset iidim iidint iidnnt iieor iifix iint iior iiqint iiqnnt iishft \
iishftc iisign ilen image_index image_status imax0 imax1 imin0 imin1 imod index inint inot \
 iparity iqint iqnint ior is_contiguous is_iostat_end is_iostat_eor ishft ishftc isign isnan izext jiand jibclr jibits jibset jidim jidint \
jidnnt jieor jifix jint jior jiqint jiqnnt jishft jishftc jisign jmax0 jmax1 jmin0 jmin1 \
jmod jnint jnot jzext kiabs kiand kibclr kibits kibset kidim kidint kidnnt kieor kifix \
kind kint kior kishft kishftc kisign kmax0 kmax1 kmin0 kmin1 kmod knint knot kzext \
lbound lcobound leadz len len_trim lenlge lge lgt lle llt log log_gamma log10 logical lshift malloc maskl maskr matmul \
max max0 max1 maxexponent maxloc maxval merge merge_bits min min0 min1 minexponent minloc \
minval mod modulo move_alloc mvbits nearest next nint norm2 not nworkers num_images number_of_processors out_of_range pack parity popcnt \
poppar precision present previous product radix random random_init random_number random_seed range real reduce \
repeat reshape rrspacing rshift same_type_as scale scan secnds selected_char_kind selected_int_kind selected_logical_kind \
selected_real_kind set_exponent shape shifta shiftl shiftr sign sin sind sinh sinpi size sizeof sngl snglq spacing \
split spread sqrt stopped_images storage_size sum system_clock tan tan2pi tand tanh tanpi team_number this_image \
tiny tokenize trailz transfer transpose trim ucobound ubound unpack verify

# keywords3 are nonstardard, extended and user defined functions
keywords3.$(file.patterns.fortran)=cdabs cdcos cdexp cdlog cdsin cdsqrt cotan cotand \
dcmplx dconjg dcotan dcotand decode dimag dll_export dll_import doublecomplex dreal \
dvchk encode find flen flush getarg getcharqq getcl getdat getenv gettim hfix ibchng \
identifier imag int1 int2 int4 intc intrup invalop iostat_msg isha ishc ishl jfix \
lacfar locking locnear map nargs nbreak ndperr ndpexc offset ovefl peekcharqq precfill \
prompt qabs qacos qacosd qasin qasind qatan qatand qatan2 qcmplx qconjg qcos qcosd \
qcosh qdim qexp qext qextd qfloat qimag qlog qlog10 qmax1 qmin1 qmod qreal qsign qsin \
qsind qsinh qsqrt qtan qtand qtanh ran rand randu rewrite segment setdat settim system \
timer undfl unlock union val virtual volatile zabs zcos zexp zlog zsin zsqrt

#fold.comment.fortran=1
#fold.quotes.fortran=1

comment.block.fortran=!~

# These setting do not work very well for FORTRAN, uncoment to use it
# statement.indent.$(file.patterns.fortran)=8 associate block blockdata case do enum \
# 	function interface module program subroutine then type where

# Fortran styles
# Default
style.fortran.0=fore:#808080
style.f77.0=fore:#808080
style.fortran.32=
style.f77.32=
# Comment
style.fortran.1=$(colour.code.comment.line),$(font.code.comment.line)
style.f77.1=$(colour.code.comment.line),$(font.code.comment.line)
# Number
style.fortran.2=$(colour.number)
style.f77.2=$(colour.number)
# Single quoted string
style.fortran.3=$(colour.string)
style.f77.3=$(colour.string)
# Double quoted string
style.fortran.4=$(colour.string)
style.f77.4=$(colour.string)
# End of line where string is not closed
style.fortran.5=fore:#000000,back:#E0C0E0,eolfilled
style.f77.5=fore:#000000,back:#E0C0E0,eolfilled
# Operators
style.fortran.6=$(colour.operator),bold
style.f77.6=$(colour.operator),bold
# Identifiers
style.fortran.7=
style.f77.7=
# Keywords
style.fortran.8=$(colour.keyword),case:u
style.f77.8=$(colour.keyword),case:u
# Keywords2
style.fortran.9=fore:#B00040
style.f77.9=fore:#B00040
# Keywords3
style.fortran.10=fore:#B04080
style.f77.10=fore:#B04080
# Preprocessor
style.fortran.11=$(colour.preproc)
style.f77.11=$(colour.preproc)
# Operators in .NAME. format
style.fortran.12=$(colour.operator),bold
style.f77.12=$(colour.operator),bold
# Labels
style.fortran.13=fore:#E0C0E0
style.f77.13=fore:#E0C0E0
# Continuation
style.fortran.14=fore:#000000,back:#F0E080
style.f77.14=fore:#000000,back:#F0E080
# Braces are matched in all cases
braces.fortran.style=0

if PLAT_WIN
	fc77=lf95 "$(FileNameExt)" -c -fix
	fc90=lf95 "$(FileNameExt)" -c
if PLAT_GTK
	fc77=f77 -c -o "$(FileName).o" "$(FileNameExt)"
	fc90=f90 -c -o "$(FileName).o" "$(FileNameExt)"

command.compile.*.f=$(fc77)
command.build.*.f=make
command.go.*.f="$(FileName)"

command.compile.*.for=$(fc77)
command.build.*.for=make
command.go.*.for="$(FileName)"

command.compile.*.f90=$(fc90)
command.build.*.f90=make
command.go.*.f90="$(FileName)"

command.compile.*.f95=$(fc90)
command.build.*.f95=make
command.go.*.f95="$(FileName)"

if PLAT_WIN
    api.$(file.patterns.fortran)=$(SciteDefaultHome)\fortran.api

autocomplete.fortran.ignorecase=1
autocomplete.f77.ignorecase=1
calltip.fortran.ignorecase=1
calltip.f77.ignorecase=1
