Skip to content

Updated Snippets fortran90.json #123

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

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 66 additions & 35 deletions snippets/fortran90.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"prefix": "program",
"body": [
"program ${1:name}",
"implicit none",
"",
"\timplicit none",
"\t${0}",
"end program ${1:name}"
],
"description": "Program Skeleton"
Expand All @@ -13,31 +13,31 @@
"prefix": "module",
"body": [
"module ${1:name}",
"implicit none",
"${2}",
"\timplicit none",
"\t${2}",
"contains",
"\t${0}",
"end module ${1:name}"
],
"description": "Create a new module"
},
"Do Loop": {
"prefix": "do",
"body": [
"do ${1:index} = ${2:start},${3:end}",
" !TODO_statement",
" ${4}",
"enddo"
"do ${1:index} = ${2:start}, ${3:end}",
"\t${0}",
"end do"
],
"description": "Create a do loop"
},
"Function": {
"prefix": "fun",
"body": [
"function ${1:func}(${2:arg}) result(${3:retval})",
"${4:type} :: ${2:arg}",
"${4:type} :: ${3:retval}",
" !TODO_add_body",
" ${5}",
"\timplicit none",
"\t${4:type} :: ${2:arg}",
"\t${4:type} :: ${3:retval}",
"\t${0}",
"end function ${1:func}"
],
"description": "Create a function"
Expand All @@ -46,35 +46,66 @@
"prefix": "sub",
"body": [
"subroutine ${1:routine}(${2:arg1}, ${3: arg2})",
"${4:type1},intent(in) :: ${2:arg1}",
"implicit none",
"${4:type1},intent(in) :: ${2:arg1}",
"${5:type2},intent(out) :: ${3:arg2}",
" !TODO_add_body",
" ${6}",
"${0}",
"end subroutine ${1:routine}"
],
"description": "Create a function"
"description": "Create a subroutine"
},
"ifs": {
"prefix": "if",
"body": [
"if ( ${1:condition} ) ${0}"
],
"description": "if (single line)"
},
"if": {
"prefix": "if",
"body": [
"if ( ${1:condition} ) then",
"\t${0}",
"end if"
],
"description": "if then"
},
"elif": {
"prefix": "el",
"body": [
"else if ( ${1:condition} ) then",
"\t${0}"
],
"description": "else if"
},
"imp": {
"prefix": "imp",
"body": [
"implicit none",
"${0}"
],
"description": "implicit none"
},
"Module documentation header": {
"prefix": "modoc" ,
"body": [ "!------------------------------------------------------------------------------",
"! ${1:Institution}, ${2:Affiliation}",
"!------------------------------------------------------------------------------",
"!",
"! MODULE: ${3: Module name}",
"!",
"!> @author",
"!> ${4:Author Name}}",
"!",
"! DESCRIPTION: ",
"!> ${5: Short module description}",
"!",
"! REVISION HISTORY:",
"! dd Mmm yyyy - Initial Version",
"! TODO_dd_mmm_yyyy - TODO_describe_appropriate_changes - TODO_name",
"!------------------------------------------------------------------------------"
"prefix": "modoc",
"body": [
"!------------------------------------------------------------------------------",
"! ${1:Institution}, ${2:Affiliation}",
"!------------------------------------------------------------------------------",
"!",
"! MODULE: ${3: Module name}",
"!",
"!> @author",
"!> ${4:Author Name}}",
"!",
"! DESCRIPTION: ",
"!> ${5: Short module description}",
"!",
"! REVISION HISTORY:",
"! dd Mmm yyyy - Initial Version",
"! TODO_dd_mmm_yyyy - TODO_describe_appropriate_changes - TODO_name",
"!------------------------------------------------------------------------------"
],
"description": "Add module documentation header"
}


}