我在网上搜了下,没有找到gfortran的errorformat样本。有个日本人曾经试着写过,但是不能成功捕捉%m。我试了半天,也是一样,也许你可以给维护fortran syntax file和compiler file的ajit(ajit @ unb . ca )发信,让他给g95写一个。我曾经为fortran的syntax file骚扰过他一次,因为他是加拿大的教授,所以还有些不大好意思。其实vim自己就带了几个fortran编译器的errorformat文件,在$VIMRUNTIME/compiler/下,大多是ajit写的。网上还有intel fortran compiler的errorformat,虽然是写给8.0的,但是我试过,同样适用于ifort 9.0。
把日本人的关于gfortran的errorformat的讨论贴在下面。
代码: 全选
From: Kamaraju Kusumanchi <kamaraju@...>
Date: Fri Apr 29, 2005 6:26 pm
Subject: error format for gfortran kamaraju@...
Send Email Send Email
Hi
I am struggling with writing an errorformat for gfortran (gcc
compiler for fortran). I am wondeing if anyone can help. Consider the
samecode
program welcome
implicit none
write(*,*) 'welcome'
some
end program welcome
I added the line some to produce an error message.
$gfortran welcome.f90
In file welcome.f90:5
some
1
Error: Unclassifiable statement at (1)
For this error I tried to write the compiler plugin with the
errorformat string set to
CompilerSet errorformat=
\%E\ In\ file\ %f:%l,
\%C\ %p%*[1],
\%CError:\ %m,
\%Z
But for some reason I am not able to catch that error message. Can
anyone help me please?
raju