nedit & Fortran 90

Lester M Petrie petrielmjr at ornl.gov
Tue Sep 30 15:37:12 CEST 2008


On Tuesday 30 September 2008, Eric Germaneau wrote:
>    Arjan van Dijk wrote:
>
>    Dear nedit users,
>    I'm new in Fortran 90 and I'm looking for a nice syntax highlighting.
>    What do you use?
>
>
>
> I use:
>
  ...................................................................................
>
>
> I haven't checked yours, so maybe this is not any better.
> Try and see!
> Why did you choose for fortran-90?
>
> Regards,
>
>
> Arjan
>
>
>
>
>    Arjan,
>    It seems to be the same, I will live with this.
>    Thank you,
>                               Eric.
>

I took the existing Fortran and added some Fortran90 keywords.  This gave me

	Fortran90:2:0{\n\
		Comment:"^[*!]":"$"::Comment::\n\
		Bang Comment:"!":"$"::Comment::\n\
		String:"'":"'":"\\n([^ \\t]| [^ \\t]|  [^ \\t]|   [^ \\t]|    [^ \\t]|     [ 
\\t0]| *\\t[^1-9])":String::\n\
		QString:"""":"""":"\\n([^ \\t]| [^ \\t]|  [^ \\t]|   [^ \\t]|    [^ \\t]|     
[ \\t0]| *\\t[^1-9])":String1::\n\
		SubAString:"'":"'":"\\n([^ \\t]| [^ \\t]|  [^ \\t]|   [^ \\t]|    [^ \\t]|     
[ \\t0]| *\\t[^1-9])":String:QString:\n\
		String2:"""":"""":"\\n([^ \\t]| [^ \\t]|  [^ \\t]|   [^ \\t]|    [^ \\t]|     
[ \\t0]| *\\t[^1-9])":String2:String:\n\
		Keywords:"<(?iaccept|automatic|backspace|block|call|close|common|contains|
continue|data|decode|delete|dimension|do|else|elseif|encode|enddo|end *file|
endif|end|entry|equivalence|exit|external|format|function|go *to|if|implicit|
include|inquire|intrinsic|map|none|on|open|parameter|pause|pointer|print|
program|read|record|return|rewind|save|static|stop|structure|subroutine|
system|then|type|union|unlock|virtual|volatile|while|write)>":::Keyword::D\n\
		Data Types:"<(?ibyte|character|complex|double *complex|double *precision|
double|integer|logical|real)(\\*[0-9]+)?>":::Storage Type::D\n\
		F90 Keywords:"<(?iallocatable|allocate|case|case|cycle|deallocate|elemental|
elsewhere|endwhere|forall|module|namelist|null|nullify|private|public|pure|
recursive|rewrite|select|target|where|intent|optional|
interface)>":::Keyword::D\n\
		Continuation in string:"\\n(     [^ \\t0]|( |  |   |    )?
\\t[1-9])":::Flag:String:\n\
		F90 Continuation:"(^ *&|&\\n)":::Flag::\n\
		Numeric Const:"<(\\d+(\\.\\d*)?|\\d*\\.\\d+)([DEQdeq][-+]?\\d+)?
(_[\\d\\l]+)?>":::Numeric Const::D\n\
	}

The virtue of this is that its case independent.  The biggest complaint I have 
with this is that continued strings aren't treated correctly, but that hasn't 
been enough of a problem to try and figure out a fix.  I believe I have 
modified the Numeric Const also, but I don't remember quite what I did there. 
Sorry about the wrapping, but I haven't found out how to get kmail to not do 
that.

-- 
Lester M Petrie
Bldg 5700, MS 6170
Oak Ridge National Laboratory
Phone:	(865) 574-5259
Email:	petrielmjr at ornl.gov


More information about the Discuss mailing list