Skip to content

Commit f5ba6cd

Browse files
Enrico Maria De Angelislpil
authored andcommitted
Corrections to Fortran snippets (honza#783)
* Some correction * Necessary corrections to if and do constructs I'm trying to make separate branches for commits related to different snippet files. This commit only affects fortra.snippets. * A modification to arr snippet Modified the arr snippets for array in such a way that the second tabstop can be used to remove the allocatable attribute. * Fixed the tabular snippet Corrected the tabular snippet (also the one in the table snippet) in order to get the correct number of ampersands even for a non-central first column
1 parent 38c06d1 commit f5ba6cd

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

UltiSnips/tex.snippets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endsnippet
1010

1111
snippet tab "tabular / array environment" b
1212
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
13-
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
13+
$0${2/(?<=.)(c|l|r)|./(?1: & )/g}
1414
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
1515
endsnippet
1616

@@ -20,7 +20,7 @@ snippet table "Table environment" b
2020
\caption{${2:caption}}
2121
\label{tab:${3:label}}
2222
\begin{${4:t}${4/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${5:c}}
23-
$0${5/((?<=.)c|l|r)|./(?1: & )/g}
23+
$0${5/(?<=.)(c|l|r)|./(?1: & )/g}
2424
\end{$4${4/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
2525
\end{table}
2626
endsnippet

snippets/fortran.snippets

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ snippet type
4949
snippet const
5050
${1:type}, parameter :: $2 = $0
5151
snippet arr
52-
${1:type}, allocatable, dimension(${2::}) :: $0
52+
${1:type}, ${2:allocatable, }dimension(${3::}) :: $0
5353
snippet intent
5454
${1:type}, intent(inout) :: $0
5555
# Array
5656
snippet /
5757
(/ $1 /) ${2:,&} $0
5858
snippet if
5959
if (${1:condition}) then
60-
$2
60+
$0
6161
end if
6262
snippet case
6363
select case (${1:expr})
@@ -66,8 +66,8 @@ snippet case
6666
$3
6767
end select $0
6868
snippet do
69-
do ${1:i} = ${2:start},${3:end}, ${4:incr}
70-
$4
69+
do ${1:i} = ${2:start}, ${3:end}, ${4:incr}
70+
$0
7171
end do
7272
snippet dow
7373
do while (${1:condition})
@@ -84,10 +84,10 @@ snippet func
8484
snippet pr
8585
write(*,*) $0
8686
snippet read
87-
read( unit = ${1:fp}, file = ${2:filename}${3:, iostat = IERR }) $0
87+
read(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) $0
8888
snippet write
89-
write( unit = ${1:fp}, file = ${2:filename}${3:, iostat = IERR }) $0
89+
write(unit = ${1:fp}, file = ${2:filename}, iostat = ${3:ierr}) $0
9090
snippet open
91-
open (unit = ${1:fp}, file = ${2:filename}, status = unknown${3:, iostat = IERR }) $0
91+
open(unit = ${1:fp}, file = ${2:filename}, status = ${3:unknown}, iostat = ${4:ierr}) $0
9292
snippet close
93-
close ( unit = ${1:fp} ) $0
93+
close(unit = ${1:fp}) $0

0 commit comments

Comments
 (0)