Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMP lines are not recognized #12

Open
Rishoj opened this issue Nov 30, 2013 · 6 comments
Open

OMP lines are not recognized #12

Rishoj opened this issue Nov 30, 2013 · 6 comments

Comments

@Rishoj
Copy link

Rishoj commented Nov 30, 2013

OMP specific lines are not recognized. They begin with "!$" and are stylized like comments, which only start with "!".

OMP specific lines should be formatted differently than comments. Otherwise they are very hard to spot.

Is there anything I can do to fix the problem?

I have included an example of the problem below.

omp

@infininight
Copy link
Member

OMP lines would appear to be compiler instructions that would only apply to certain users. So the first step is to find a good specification of their structure so we can determine if they would conflict for people that weren't using that variant.

@Rishoj
Copy link
Author

Rishoj commented Dec 1, 2013

All Fortran compilers that supports OMP interprets the OMP lines as standard (you actually have to supply a compiler option to disable it) and would issue an error if a line starting with "!$" is not a valid OMP instruction.

@Rishoj
Copy link
Author

Rishoj commented Dec 1, 2013

Actually, i just noticed that 'subroutines' are not recognized either. In my opinion, subroutines should be recognized in exactly the same manner as functions.

@infininight
Copy link
Member

The biggest issue when I've had to edit the grammar in the past is finding the language specifications for various parts of the grammar, do you have any pointers to that for subroutines?

@Rishoj
Copy link
Author

Rishoj commented Dec 2, 2013

See, I'm not actually sure what you mean by grammar in this context.

If you mean how the syntax of a subroutine is, it is actually the same syntax as for functions, i.e., like the following:

subroutine subroutine_name(argument1,argument2,...,argumentn)
   ! Declarations here
   real, dimension(:) :: argument1
   integer :: argument2, ..., argumentn

   ! Code here
   argument2 = 2*argumentn
end subroutine

Where I use "..." to emphasize that there may be many arguments.

@infininight
Copy link
Member

Sorry for the gap here, don't get around to this bundle very often.

Subroutines appear to be highlighted correctly here best I can tell. (As you can tell from your code example as Github uses this grammar for matching.)

When I was talking about the language spec I was talking about the OMP lines, need some sort of language spec to know how to match them. Fortran is a very hard language to work on as there are several different and conflicting standards to deal with each time I update or change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants