Skip to content

Commit 067233a

Browse files
Merge pull request #123 from JHenneberg/master
Updated Snippets fortran90.json
2 parents cc33516 + 1af7557 commit 067233a

File tree

1 file changed

+66
-35
lines changed

1 file changed

+66
-35
lines changed

snippets/fortran90.json

Lines changed: 66 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"prefix": "program",
44
"body": [
55
"program ${1:name}",
6-
"implicit none",
7-
"",
6+
"\timplicit none",
7+
"\t${0}",
88
"end program ${1:name}"
99
],
1010
"description": "Program Skeleton"
@@ -13,31 +13,31 @@
1313
"prefix": "module",
1414
"body": [
1515
"module ${1:name}",
16-
"implicit none",
17-
"${2}",
16+
"\timplicit none",
17+
"\t${2}",
1818
"contains",
19+
"\t${0}",
1920
"end module ${1:name}"
2021
],
2122
"description": "Create a new module"
2223
},
2324
"Do Loop": {
2425
"prefix": "do",
2526
"body": [
26-
"do ${1:index} = ${2:start},${3:end}",
27-
" !TODO_statement",
28-
" ${4}",
29-
"enddo"
27+
"do ${1:index} = ${2:start}, ${3:end}",
28+
"\t${0}",
29+
"end do"
3030
],
3131
"description": "Create a do loop"
3232
},
3333
"Function": {
3434
"prefix": "fun",
3535
"body": [
3636
"function ${1:func}(${2:arg}) result(${3:retval})",
37-
"${4:type} :: ${2:arg}",
38-
"${4:type} :: ${3:retval}",
39-
" !TODO_add_body",
40-
" ${5}",
37+
"\timplicit none",
38+
"\t${4:type} :: ${2:arg}",
39+
"\t${4:type} :: ${3:retval}",
40+
"\t${0}",
4141
"end function ${1:func}"
4242
],
4343
"description": "Create a function"
@@ -46,35 +46,66 @@
4646
"prefix": "sub",
4747
"body": [
4848
"subroutine ${1:routine}(${2:arg1}, ${3: arg2})",
49-
"${4:type1},intent(in) :: ${2:arg1}",
49+
"implicit none",
50+
"${4:type1},intent(in) :: ${2:arg1}",
5051
"${5:type2},intent(out) :: ${3:arg2}",
51-
" !TODO_add_body",
52-
" ${6}",
52+
"${0}",
5353
"end subroutine ${1:routine}"
5454
],
55-
"description": "Create a function"
55+
"description": "Create a subroutine"
56+
},
57+
"ifs": {
58+
"prefix": "if",
59+
"body": [
60+
"if ( ${1:condition} ) ${0}"
61+
],
62+
"description": "if (single line)"
63+
},
64+
"if": {
65+
"prefix": "if",
66+
"body": [
67+
"if ( ${1:condition} ) then",
68+
"\t${0}",
69+
"end if"
70+
],
71+
"description": "if then"
72+
},
73+
"elif": {
74+
"prefix": "el",
75+
"body": [
76+
"else if ( ${1:condition} ) then",
77+
"\t${0}"
78+
],
79+
"description": "else if"
80+
},
81+
"imp": {
82+
"prefix": "imp",
83+
"body": [
84+
"implicit none",
85+
"${0}"
86+
],
87+
"description": "implicit none"
5688
},
5789
"Module documentation header": {
58-
"prefix": "modoc" ,
59-
"body": [ "!------------------------------------------------------------------------------",
60-
"! ${1:Institution}, ${2:Affiliation}",
61-
"!------------------------------------------------------------------------------",
62-
"!",
63-
"! MODULE: ${3: Module name}",
64-
"!",
65-
"!> @author",
66-
"!> ${4:Author Name}}",
67-
"!",
68-
"! DESCRIPTION: ",
69-
"!> ${5: Short module description}",
70-
"!",
71-
"! REVISION HISTORY:",
72-
"! dd Mmm yyyy - Initial Version",
73-
"! TODO_dd_mmm_yyyy - TODO_describe_appropriate_changes - TODO_name",
74-
"!------------------------------------------------------------------------------"
90+
"prefix": "modoc",
91+
"body": [
92+
"!------------------------------------------------------------------------------",
93+
"! ${1:Institution}, ${2:Affiliation}",
94+
"!------------------------------------------------------------------------------",
95+
"!",
96+
"! MODULE: ${3: Module name}",
97+
"!",
98+
"!> @author",
99+
"!> ${4:Author Name}}",
100+
"!",
101+
"! DESCRIPTION: ",
102+
"!> ${5: Short module description}",
103+
"!",
104+
"! REVISION HISTORY:",
105+
"! dd Mmm yyyy - Initial Version",
106+
"! TODO_dd_mmm_yyyy - TODO_describe_appropriate_changes - TODO_name",
107+
"!------------------------------------------------------------------------------"
75108
],
76109
"description": "Add module documentation header"
77110
}
78-
79-
80111
}

0 commit comments

Comments
 (0)