Merge pull request #507 from m-pilia/master

add GMGPL linking exception; add AWK snippets
This commit is contained in:
Louis Pilfold 2015-01-17 16:55:22 +00:00
commit de575a0f5c
4 changed files with 111 additions and 82 deletions

View File

@ -11,10 +11,6 @@ def ada_case(word):
out = out + word[i]
return out
def get_year():
import time
return time.strftime("%Y")
endglobal
snippet wi "with"
@ -281,44 +277,4 @@ snippet newline "Ada.Text_IO.New_Line"
Ada.Text_IO.New_Line(${1:1});$0
endsnippet
snippet gpl "GPL license header"
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU ${1}General Public License as published by
-- the Free Software Foundation; either version ${2:3} of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU $1General Public License for more details.
--
-- You should have received a copy of the GNU $1General Public License
-- along with this program; if not, see <http://www.gnu.org/licenses/>.
--
-- Copyright (C) ${3:Author}, ${4:`!p snip.rv = get_year()`}
$0
endsnippet
snippet gplf "GPL file license header"
-- This file is part of ${1:Program-Name}.
--
-- $1 is free software: you can redistribute it and/or modify
-- it under the terms of the GNU ${2}General Public License as published by
-- the Free Software Foundation, either version ${3:3} of the License, or
-- (at your option) any later version.
--
-- $1 is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU $2General Public License for more details.
--
-- You should have received a copy of the GNU $2General Public License
-- along with $1. If not, see <http://www.gnu.org/licenses/>.
--
-- Copyright (C) ${4:Author}, ${5:`!p snip.rv = get_year()`}
$0
endsnippet
# vim:ft=snippets:

View File

@ -102,6 +102,15 @@ snippet AGPL3
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
${0}
snippet GMGPL linking exception
As a special exception, if other files instantiate generics from
this unit, or you link this unit with other files to produce an
executable, this unit does not by itself cause the resulting
executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the
executable file might be covered by the GNU Public License.
${0}
snippet BSD2
${1:one line to give the program's name and a brief description}

View File

@ -215,41 +215,3 @@ snippet getl Ada.Text_IO.Get_Line
snippet newline Ada.Text_IO.New_Line
Ada.Text_IO.New_Line(${1:1});${0}
snippet gpl GPL license header
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU ${1}General Public License as published by
-- the Free Software Foundation; either version ${2:3} of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU $1General Public License for more details.
--
-- You should have received a copy of the GNU $1General Public License
-- along with this program; if not, see <http://www.gnu.org/licenses/>.
--
-- Copyright (C) ${3:Author}, ${4:`strftime("%Y")`}
${0}
snippet gplf GPL file license header
-- This file is part of ${1:Program-Name}.
--
-- $1 is free software: you can redistribute it and/or modify
-- it under the terms of the GNU ${2}General Public License as published by
-- the Free Software Foundation, either version ${3:3} of the License, or
-- (at your option) any later version.
--
-- $1 is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU $2General Public License for more details.
--
-- You should have received a copy of the GNU $2General Public License
-- along with $1. If not, see <http://www.gnu.org/licenses/>.
--
-- Copyright (C) ${4:Author}, ${5:`strftime("%Y")`}
${0}

102
snippets/awk.snippets Normal file
View File

@ -0,0 +1,102 @@
# cannot use /usr/bin/env because it does not support parameters (as -f)
snippet #! #!/usr/bin/awk -f
#!/usr/bin/awk -f
# @include is a gawk extension
snippet inc @include
@include "${1}"${0}
# @load is a gawk extension
snippet loa @load
@load "${1}"${0}
snippet beg BEGIN { ... }
BEGIN {
${0}
}
# BEGINFILE is a gawk extension
snippet begf BEGINFILE { ... }
BEGINFILE {
${0}
}
snippet end END { ... }
END {
${0}
}
# ENDFILE is a gawk extension
snippet endf ENDFILE { ... }
ENDFILE {
${0}
}
snippet pri print
print ${1:"${2}"}${0}
snippet printf printf
printf("${1:%s}\n", ${2})${0}
snippet ign IGNORECASE
IGNORECASE = ${1:1}
snippet if if {...}
if (${1}) {
${0}
}
snippet ife if ... else ...
if (${1}) {
${2}
} else {
${0}
}
snippet eif else if ...
else if (${1}) {
${0}
}
snippet el else {...}
else {
${0}
}
snippet wh while
while (${1}) {
${2}
}
snippet do do ... while
do {
${0}
} while (${1})
snippet for for
for (${2:i} = 0; i < ${1:n}; ${3:++i}) {
${0}
}
snippet fore for each
for (${1:i} in ${2:array}) {
${0}
}
# the switch is a gawk extension
snippet sw switch
switch (${1}) {
case ${2}:
${3}
break
default:
${0}
break
}
# the switch is a gawk extension
snippet case case
case ${1}:
${0}
break