SHOETREE / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Fortran Syntax Highlighting #78

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
How hard would it be to do syntax highlighting for Fortran F90/F95 source code?

I have a google code project with mostly Fortran source code and syntax
highlighting would be nice.

I have attached a syntax highlighting file for F90 for test editor, textpad 
http://www.textpad.com/ 

as an example

Original issue reported on code.google.com by mark.th...@gmail.com on 26 May 2009 at 12:08

Attachments:

GoogleCodeExporter commented 8 years ago
I forget to say, if you could let me if it would be possible, I could try and 
do it
myself.
Mark

Original comment by mark.th...@gmail.com on 26 May 2009 at 12:09

GoogleCodeExporter commented 8 years ago
http://eli-project.sourceforge.net/fortran_html/Parse.html has a very large 
grammar
for Fortran 90.

If you want to take a stab, you can look at the lang-*.js files in the src 
directory.
 I'd start with a language that is lexically similar to Fortran 90 and go from there.

Original comment by mikesamuel@gmail.com on 14 Aug 2009 at 5:58

GoogleCodeExporter commented 8 years ago
I tried to use lang-*.js as a template but have run across the following 
problem :-

Fortran 77 reserves the first 7 characters of every line for special 
instructions such as 
comment indicators or continuations & or goto labels. 

I don't see an easy way of indicating those in the lang-*.js. Any suggestions?

Original comment by karajdaar@gmail.com on 5 Feb 2010 at 4:23

GoogleCodeExporter commented 8 years ago
Its not pretty, but I am attaching one here that mostly works.

Original comment by karajdaar@gmail.com on 6 Feb 2010 at 4:30

Attachments:

GoogleCodeExporter commented 8 years ago
How can I use the file you attached, since it does not seem to be included in 
prettify yet? 
(https://code.google.com/p/google-code-prettify/source/browse/trunk/src)

Original comment by jbndmi on 31 Jan 2014 at 9:10

GoogleCodeExporter commented 8 years ago
I figured it out, sorry for the spam. 

    <script src='path/to/lang-fortran.js'/>

But why is this not included? It works fine for my code.

Original comment by jbndmi on 31 Jan 2014 at 9:15

GoogleCodeExporter commented 8 years ago
how and whre could I edit to keep highlighting keywords folowing the comma 
punctuation?

ie:   real, dimension
      integer, allocatable 

Thanks for the help.

Original comment by zrh...@gmail.com on 13 Nov 2014 at 4:30