aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlu4nx2016-01-30 14:56:43 +0200
committerEli Zaretskii2016-01-30 14:56:43 +0200
commit40a85fba441aa69d47ef9efd645df3411e43ae21 (patch)
tree036fafebce750bb4083bbef7edf3ac0910c903c3
parent25b79d7bc71079cd6ebb2700623e7e3b76b03287 (diff)
downloademacs-40a85fba441aa69d47ef9efd645df3411e43ae21.tar.gz
emacs-40a85fba441aa69d47ef9efd645df3411e43ae21.zip
Support Go language in 'etags'
* lib-src/etags.c <Ruby_help>: Fix documentation of Ruby tags. <Go_help>: New help. <Go_suffixes>: New variable. (Go_functions): New function. <lang_names>: Add entry for Go. (Bug#22370) * doc/emacs/maintaining.texi (Tag Syntax): Document Go support. * doc/man/etags.1: Mention Go support. * etc/NEWS: Mention Go support. * test/etags/go-src/test.go: * test/etags/go-src/test1.go: New test files. * test/etags/Makefile (GOSRC): New variable. (SRCS): Add $(GOSRC). * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to addition of Go tests.
-rw-r--r--doc/emacs/maintaining.texi3
-rw-r--r--doc/man/etags.12
-rw-r--r--etc/NEWS4
-rw-r--r--lib-src/etags.c75
-rw-r--r--test/etags/CTAGS.good11
-rw-r--r--test/etags/ETAGS.good_112
-rw-r--r--test/etags/ETAGS.good_212
-rw-r--r--test/etags/ETAGS.good_315
-rw-r--r--test/etags/ETAGS.good_412
-rw-r--r--test/etags/ETAGS.good_515
-rw-r--r--test/etags/ETAGS.good_615
-rw-r--r--test/etags/Makefile7
-rw-r--r--test/etags/go-src/test.go11
-rw-r--r--test/etags/go-src/test1.go34
14 files changed, 223 insertions, 5 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 7039de63e53..3f1a9c07e91 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2218,6 +2218,9 @@ in the file.
2218In Fortran code, functions, subroutines and block data are tags. 2218In Fortran code, functions, subroutines and block data are tags.
2219 2219
2220@item 2220@item
2221In Go code, packages, functions, and types are tags.
2222
2223@item
2221In HTML input files, the tags are the @code{title} and the @code{h1}, 2224In HTML input files, the tags are the @code{title} and the @code{h1},
2222@code{h2}, @code{h3} headers. Also, tags are @code{name=} in anchors 2225@code{h2}, @code{h3} headers. Also, tags are @code{name=} in anchors
2223and all occurrences of @code{id=}. 2226and all occurrences of @code{id=}.
diff --git a/doc/man/etags.1 b/doc/man/etags.1
index d34063f23cd..fc247f758a3 100644
--- a/doc/man/etags.1
+++ b/doc/man/etags.1
@@ -50,7 +50,7 @@ format understood by
50.BR vi ( 1 )\c 50.BR vi ( 1 )\c
51\&. Both forms of the program understand 51\&. Both forms of the program understand
52the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang, 52the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
53Forth, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl, 53Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
54Ruby, PHP, PostScript, Python, Prolog, Scheme and 54Ruby, PHP, PostScript, Python, Prolog, Scheme and
55most assembler\-like syntaxes. 55most assembler\-like syntaxes.
56Both forms read the files specified on the command line, and write a tag 56Both forms read the files specified on the command line, and write a tag
diff --git a/etc/NEWS b/etc/NEWS
index 78dce166b43..d0415a22f95 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1834,6 +1834,10 @@ Names of modules, classes, methods, functions, and constants are
1834tagged. Overloaded operators are also tagged. 1834tagged. Overloaded operators are also tagged.
1835 1835
1836+++ 1836+++
1837*** New language Go
1838Names of packages, functions, and types are tagged.
1839
1840+++
1837*** Improved support for Lua 1841*** Improved support for Lua
1838 1842
1839Etags now tags functions even if the "function" keyword follows some 1843Etags now tags functions even if the "function" keyword follows some
diff --git a/lib-src/etags.c b/lib-src/etags.c
index adc08a23678..bdfced5bc9c 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -354,6 +354,7 @@ static void Cstar_entries (FILE *);
354static void Erlang_functions (FILE *); 354static void Erlang_functions (FILE *);
355static void Forth_words (FILE *); 355static void Forth_words (FILE *);
356static void Fortran_functions (FILE *); 356static void Fortran_functions (FILE *);
357static void Go_functions (FILE *);
357static void HTML_labels (FILE *); 358static void HTML_labels (FILE *);
358static void Lisp_functions (FILE *); 359static void Lisp_functions (FILE *);
359static void Lua_functions (FILE *); 360static void Lua_functions (FILE *);
@@ -641,6 +642,10 @@ static const char *Fortran_suffixes [] =
641static const char Fortran_help [] = 642static const char Fortran_help [] =
642"In Fortran code, functions, subroutines and block data are tags."; 643"In Fortran code, functions, subroutines and block data are tags.";
643 644
645static const char *Go_suffixes [] = {"go", NULL};
646static const char Go_help [] =
647 "In Go code, functions, interfaces and packages are tags.";
648
644static const char *HTML_suffixes [] = 649static const char *HTML_suffixes [] =
645 { "htm", "html", "shtml", NULL }; 650 { "htm", "html", "shtml", NULL };
646static const char HTML_help [] = 651static const char HTML_help [] =
@@ -727,7 +732,7 @@ static const char *Ruby_suffixes [] =
727 { "rb", "ruby", NULL }; 732 { "rb", "ruby", NULL };
728static const char Ruby_help [] = 733static const char Ruby_help [] =
729 "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\ 734 "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\
730a line generate a tag."; 735a line generate a tag. Constants also generate a tag.";
731 736
732/* Can't do the `SCM' or `scm' prefix with a version number. */ 737/* Can't do the `SCM' or `scm' prefix with a version number. */
733static const char *Scheme_suffixes [] = 738static const char *Scheme_suffixes [] =
@@ -794,6 +799,7 @@ static language lang_names [] =
794 { "erlang", Erlang_help, Erlang_functions, Erlang_suffixes }, 799 { "erlang", Erlang_help, Erlang_functions, Erlang_suffixes },
795 { "forth", Forth_help, Forth_words, Forth_suffixes }, 800 { "forth", Forth_help, Forth_words, Forth_suffixes },
796 { "fortran", Fortran_help, Fortran_functions, Fortran_suffixes }, 801 { "fortran", Fortran_help, Fortran_functions, Fortran_suffixes },
802 { "go", Go_help, Go_functions, Go_suffixes },
797 { "html", HTML_help, HTML_labels, HTML_suffixes }, 803 { "html", HTML_help, HTML_labels, HTML_suffixes },
798 { "java", Cjava_help, Cjava_entries, Cjava_suffixes }, 804 { "java", Cjava_help, Cjava_entries, Cjava_suffixes },
799 { "lisp", Lisp_help, Lisp_functions, Lisp_suffixes }, 805 { "lisp", Lisp_help, Lisp_functions, Lisp_suffixes },
@@ -4209,6 +4215,73 @@ Fortran_functions (FILE *inf)
4209 4215
4210 4216
4211/* 4217/*
4218 * Go language support
4219 * Original code by Xi Lu <lx@shellcodes.org> (2016)
4220 */
4221static void
4222Go_functions(FILE *inf)
4223{
4224 char *cp, *name;
4225
4226 LOOP_ON_INPUT_LINES(inf, lb, cp)
4227 {
4228 cp = skip_spaces (cp);
4229
4230 if (LOOKING_AT (cp, "package"))
4231 {
4232 name = cp;
4233 while (!notinname (*cp) && *cp != '\0')
4234 cp++;
4235 make_tag (name, cp - name, false, lb.buffer,
4236 cp - lb.buffer + 1, lineno, linecharno);
4237 }
4238 else if (LOOKING_AT (cp, "func"))
4239 {
4240 /* Go implementation of interface, such as:
4241 func (n *Integer) Add(m Integer) ...
4242 skip `(n *Integer)` part.
4243 */
4244 if (*cp == '(')
4245 {
4246 while (*cp != ')')
4247 cp++;
4248 cp = skip_spaces (cp+1);
4249 }
4250
4251 if (*cp)
4252 {
4253 name = cp;
4254
4255 while (!notinname (*cp))
4256 cp++;
4257
4258 make_tag (name, cp - name, true, lb.buffer,
4259 cp - lb.buffer + 1, lineno, linecharno);
4260 }
4261 }
4262 else if (members && LOOKING_AT (cp, "type"))
4263 {
4264 name = cp;
4265
4266 /* Ignore the likes of the following:
4267 type (
4268 A
4269 )
4270 */
4271 if (*cp == '(')
4272 return;
4273
4274 while (!notinname (*cp) && *cp != '\0')
4275 cp++;
4276
4277 make_tag (name, cp - name, false, lb.buffer,
4278 cp - lb.buffer + 1, lineno, linecharno);
4279 }
4280 }
4281}
4282
4283
4284/*
4212 * Ada parsing 4285 * Ada parsing
4213 * Original code by 4286 * Original code by
4214 * Philippe Waroquiers (1998) 4287 * Philippe Waroquiers (1998)
diff --git a/test/etags/CTAGS.good b/test/etags/CTAGS.good
index 86eb9f85cf3..846725ef713 100644
--- a/test/etags/CTAGS.good
+++ b/test/etags/CTAGS.good
@@ -947,6 +947,10 @@ MoveLayerAfter lua-src/allegro.lua /^function MoveLayerAfter (this_one)$/
947MoveLayerBefore lua-src/allegro.lua /^function MoveLayerBefore (this_one)$/ 947MoveLayerBefore lua-src/allegro.lua /^function MoveLayerBefore (this_one)$/
948MoveLayerBottom lua-src/allegro.lua /^function MoveLayerBottom ()$/ 948MoveLayerBottom lua-src/allegro.lua /^function MoveLayerBottom ()$/
949MoveLayerTop lua-src/allegro.lua /^function MoveLayerTop ()$/ 949MoveLayerTop lua-src/allegro.lua /^function MoveLayerTop ()$/
950Mtest.go go-src/test.go 1
951Mtest.go go-src/test.go /^func main() {$/
952Mtest1.go go-src/test1.go 1
953Mtest1.go go-src/test1.go /^func main() {$/
950Mx.cc cp-src/x.cc /^main(int argc, char *argv[])$/ 954Mx.cc cp-src/x.cc /^main(int argc, char *argv[])$/
951NAME y-src/cccp.c 8 955NAME y-src/cccp.c 8
952NATNUMP c-src/emacs/src/lisp.h /^NATNUMP (Lisp_Object x)$/ 956NATNUMP c-src/emacs/src/lisp.h /^NATNUMP (Lisp_Object x)$/
@@ -1077,6 +1081,8 @@ Pkg1_Proc2/p ada-src/waroquiers.ada /^ procedure Pkg1_Proc2 (I : Integer);$/
1077Pkg1_Proc2/p ada-src/waroquiers.ada /^ procedure Pkg1_Proc2 (I : Integer) is$/ 1081Pkg1_Proc2/p ada-src/waroquiers.ada /^ procedure Pkg1_Proc2 (I : Integer) is$/
1078PostControls pyt-src/server.py /^ def PostControls(self):$/ 1082PostControls pyt-src/server.py /^ def PostControls(self):$/
1079Pre_Call_State/t ada-src/2ataspri.ads /^ type Pre_Call_State is new System.Address;$/ 1083Pre_Call_State/t ada-src/2ataspri.ads /^ type Pre_Call_State is new System.Address;$/
1084PrintAdd go-src/test1.go /^func (s str) PrintAdd() {$/
1085PrintAdd go-src/test1.go /^func (n intNumber) PrintAdd() {$/
1080Private objc-src/Subprocess.m /^@interface Subprocess(Private)$/ 1086Private objc-src/Subprocess.m /^@interface Subprocess(Private)$/
1081Private_T/b ada-src/etags-test-for.ada /^ task body Private_T is$/ 1087Private_T/b ada-src/etags-test-for.ada /^ task body Private_T is$/
1082Private_T/b ada-src/waroquiers.ada /^ task body Private_T is$/ 1088Private_T/b ada-src/waroquiers.ada /^ task body Private_T is$/
@@ -3135,6 +3141,7 @@ instance_method_question? ruby-src/test.rb /^ def instance_method_questio
3135instr y-src/parse.y 80 3141instr y-src/parse.y 80
3136instr parse.y 80 3142instr parse.y 80
3137instruct c-src/etags.c 2527 3143instruct c-src/etags.c 2527
3144intNumber go-src/test1.go 13
3138integer c-src/emacs/src/lisp.h 2127 3145integer c-src/emacs/src/lisp.h 2127
3139integer cccp.y 113 3146integer cccp.y 113
3140integer y-src/cccp.y 112 3147integer y-src/cccp.y 112
@@ -3738,6 +3745,7 @@ plain_C_suffixes c-src/etags.c 643
3738plainc c-src/etags.c 2934 3745plainc c-src/etags.c 2934
3739plist c-src/emacs/src/lisp.h 697 3746plist c-src/emacs/src/lisp.h 697
3740plus cp-src/functions.cpp /^void Date::plus ( int days , int month , int year / 3747plus cp-src/functions.cpp /^void Date::plus ( int days , int month , int year /
3748plus go-src/test1.go 5
3741plusvalseq prol-src/natded.prolog /^plusvalseq([]) --> [].$/ 3749plusvalseq prol-src/natded.prolog /^plusvalseq([]) --> [].$/
3742pointer c-src/emacs/src/lisp.h 2125 3750pointer c-src/emacs/src/lisp.h 2125
3743poll_for_input c-src/emacs/src/keyboard.c /^poll_for_input (struct atimer *timer)$/ 3751poll_for_input c-src/emacs/src/keyboard.c /^poll_for_input (struct atimer *timer)$/
@@ -3950,6 +3958,7 @@ save_getcjmp c-src/emacs/src/keyboard.c /^save_getcjmp (sys_jmp_buf temp)$/
3950save_type c-src/emacs/src/lisp.h /^save_type (struct Lisp_Save_Value *v, int n)$/ 3958save_type c-src/emacs/src/lisp.h /^save_type (struct Lisp_Save_Value *v, int n)$/
3951savenstr c-src/etags.c /^savenstr (const char *cp, int len)$/ 3959savenstr c-src/etags.c /^savenstr (const char *cp, int len)$/
3952savestr c-src/etags.c /^savestr (const char *cp)$/ 3960savestr c-src/etags.c /^savestr (const char *cp)$/
3961say go-src/test.go /^func say(msg string) {$/
3953scan_separators c-src/etags.c /^scan_separators (char *name)$/ 3962scan_separators c-src/etags.c /^scan_separators (char *name)$/
3954scolonseen c-src/etags.c 2447 3963scolonseen c-src/etags.c 2447
3955scratch c-src/sysdep.h 56 3964scratch c-src/sysdep.h 56
@@ -4075,6 +4084,7 @@ step cp-src/clheir.hpp /^ virtual void step(void) { }$/
4075step_everybody cp-src/clheir.cpp /^void step_everybody(void)$/ 4084step_everybody cp-src/clheir.cpp /^void step_everybody(void)$/
4076stop_polling c-src/emacs/src/keyboard.c /^stop_polling (void)$/ 4085stop_polling c-src/emacs/src/keyboard.c /^stop_polling (void)$/
4077store_user_signal_events c-src/emacs/src/keyboard.c /^store_user_signal_events (void)$/ 4086store_user_signal_events c-src/emacs/src/keyboard.c /^store_user_signal_events (void)$/
4087str go-src/test1.go 9
4078strcaseeq c-src/etags.c /^#define strcaseeq(s,t) (assert ((s)!=NULL && (t)!=/ 4088strcaseeq c-src/etags.c /^#define strcaseeq(s,t) (assert ((s)!=NULL && (t)!=/
4079streq c-src/etags.c /^#define streq(s,t) (assert ((s)!=NULL || (t)!=NULL/ 4089streq c-src/etags.c /^#define streq(s,t) (assert ((s)!=NULL || (t)!=NULL/
4080string_intervals c-src/emacs/src/lisp.h /^string_intervals (Lisp_Object s)$/ 4090string_intervals c-src/emacs/src/lisp.h /^string_intervals (Lisp_Object s)$/
@@ -4217,6 +4227,7 @@ terminateInput objc-src/Subprocess.m /^- terminateInput$/
4217test c-src/emacs/src/lisp.h 1871 4227test c-src/emacs/src/lisp.h 1871
4218test cp-src/c.C 86 4228test cp-src/c.C 86
4219test erl-src/gs_dialog.erl /^test() ->$/ 4229test erl-src/gs_dialog.erl /^test() ->$/
4230test go-src/test1.go /^func test(p plus) {$/
4220test php-src/ptest.php /^test $/ 4231test php-src/ptest.php /^test $/
4221test.me22b lua-src/test.lua /^ local function test.me22b (one)$/ 4232test.me22b lua-src/test.lua /^ local function test.me22b (one)$/
4222test.me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/ 4233test.me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/
diff --git a/test/etags/ETAGS.good_1 b/test/etags/ETAGS.good_1
index 44ac091066b..c7b122111c4 100644
--- a/test/etags/ETAGS.good_1
+++ b/test/etags/ETAGS.good_1
@@ -2283,6 +2283,18 @@ constant (a-forth-constant(a-forth-constant38,628
2283code assemby-code-word 43,685 2283code assemby-code-word 43,685
2284: a-forth-word 50,870 2284: a-forth-word 50,870
2285 2285
2286go-src/test.go,48
2287package main1,0
2288func say(5,28
2289func main(9,72
2290
2291go-src/test1.go,119
2292package main1,0
2293func (s str) PrintAdd(17,136
2294func (n intNumber) PrintAdd(21,189
2295func test(25,248
2296func main(29,285
2297
2286html-src/softwarelibero.html,200 2298html-src/softwarelibero.html,200
2287Cos'è il software libero?4,38 2299Cos'è il software libero?4,38
2288Licenze d'uso di un programmalicenze65,2500 2300Licenze d'uso di un programmalicenze65,2500
diff --git a/test/etags/ETAGS.good_2 b/test/etags/ETAGS.good_2
index 8a93e3b0656..8d0f33824a4 100644
--- a/test/etags/ETAGS.good_2
+++ b/test/etags/ETAGS.good_2
@@ -2852,6 +2852,18 @@ constant (a-forth-constant(a-forth-constant38,628
2852code assemby-code-word 43,685 2852code assemby-code-word 43,685
2853: a-forth-word 50,870 2853: a-forth-word 50,870
2854 2854
2855go-src/test.go,48
2856package main1,0
2857func say(5,28
2858func main(9,72
2859
2860go-src/test1.go,119
2861package main1,0
2862func (s str) PrintAdd(17,136
2863func (n intNumber) PrintAdd(21,189
2864func test(25,248
2865func main(29,285
2866
2855html-src/softwarelibero.html,200 2867html-src/softwarelibero.html,200
2856Cos'è il software libero?4,38 2868Cos'è il software libero?4,38
2857Licenze d'uso di un programmalicenze65,2500 2869Licenze d'uso di un programmalicenze65,2500
diff --git a/test/etags/ETAGS.good_3 b/test/etags/ETAGS.good_3
index e575b40ab0d..060389c6232 100644
--- a/test/etags/ETAGS.good_3
+++ b/test/etags/ETAGS.good_3
@@ -2600,6 +2600,21 @@ constant (a-forth-constant(a-forth-constant38,628
2600code assemby-code-word 43,685 2600code assemby-code-word 43,685
2601: a-forth-word 50,870 2601: a-forth-word 50,870
2602 2602
2603go-src/test.go,48
2604package main1,0
2605func say(5,28
2606func main(9,72
2607
2608go-src/test1.go,172
2609package main1,0
2610type plus 5,28
2611type str 9,65
2612type intNumber 13,99
2613func (s str) PrintAdd(17,136
2614func (n intNumber) PrintAdd(21,189
2615func test(25,248
2616func main(29,285
2617
2603html-src/softwarelibero.html,200 2618html-src/softwarelibero.html,200
2604Cos'è il software libero?4,38 2619Cos'è il software libero?4,38
2605Licenze d'uso di un programmalicenze65,2500 2620Licenze d'uso di un programmalicenze65,2500
diff --git a/test/etags/ETAGS.good_4 b/test/etags/ETAGS.good_4
index 28258060517..40404f9fc6e 100644
--- a/test/etags/ETAGS.good_4
+++ b/test/etags/ETAGS.good_4
@@ -2447,6 +2447,18 @@ constant (a-forth-constant(a-forth-constant38,628
2447code assemby-code-word 43,685 2447code assemby-code-word 43,685
2448: a-forth-word 50,870 2448: a-forth-word 50,870
2449 2449
2450go-src/test.go,48
2451package main1,0
2452func say(5,28
2453func main(9,72
2454
2455go-src/test1.go,119
2456package main1,0
2457func (s str) PrintAdd(17,136
2458func (n intNumber) PrintAdd(21,189
2459func test(25,248
2460func main(29,285
2461
2450html-src/softwarelibero.html,200 2462html-src/softwarelibero.html,200
2451Cos'è il software libero?4,38 2463Cos'è il software libero?4,38
2452Licenze d'uso di un programmalicenze65,2500 2464Licenze d'uso di un programmalicenze65,2500
diff --git a/test/etags/ETAGS.good_5 b/test/etags/ETAGS.good_5
index 35bb353c767..432819d3b32 100644
--- a/test/etags/ETAGS.good_5
+++ b/test/etags/ETAGS.good_5
@@ -3333,6 +3333,21 @@ constant (a-forth-constant(a-forth-constant38,628
3333code assemby-code-word 43,685 3333code assemby-code-word 43,685
3334: a-forth-word 50,870 3334: a-forth-word 50,870
3335 3335
3336go-src/test.go,48
3337package main1,0
3338func say(5,28
3339func main(9,72
3340
3341go-src/test1.go,172
3342package main1,0
3343type plus 5,28
3344type str 9,65
3345type intNumber 13,99
3346func (s str) PrintAdd(17,136
3347func (n intNumber) PrintAdd(21,189
3348func test(25,248
3349func main(29,285
3350
3336html-src/softwarelibero.html,200 3351html-src/softwarelibero.html,200
3337Cos'è il software libero?4,38 3352Cos'è il software libero?4,38
3338Licenze d'uso di un programmalicenze65,2500 3353Licenze d'uso di un programmalicenze65,2500
diff --git a/test/etags/ETAGS.good_6 b/test/etags/ETAGS.good_6
index 8add300784f..4ad5d76db27 100644
--- a/test/etags/ETAGS.good_6
+++ b/test/etags/ETAGS.good_6
@@ -3333,6 +3333,21 @@ constant (a-forth-constant(a-forth-constant38,628
3333code assemby-code-word 43,685 3333code assemby-code-word 43,685
3334: a-forth-word 50,870 3334: a-forth-word 50,870
3335 3335
3336go-src/test.go,48
3337package main1,0
3338func say(5,28
3339func main(9,72
3340
3341go-src/test1.go,172
3342package main1,0
3343type plus 5,28
3344type str 9,65
3345type intNumber 13,99
3346func (s str) PrintAdd(17,136
3347func (n intNumber) PrintAdd(21,189
3348func test(25,248
3349func main(29,285
3350
3336html-src/softwarelibero.html,200 3351html-src/softwarelibero.html,200
3337Cos'è il software libero?4,38 3352Cos'è il software libero?4,38
3338Licenze d'uso di un programmalicenze65,2500 3353Licenze d'uso di un programmalicenze65,2500
diff --git a/test/etags/Makefile b/test/etags/Makefile
index 00d5b9f52b2..21a77eb0c5d 100644
--- a/test/etags/Makefile
+++ b/test/etags/Makefile
@@ -11,6 +11,7 @@ ELSRC=$(addprefix ./el-src/,TAGTEST.EL emacs/lisp/progmodes/etags.el)
11ERLSRC=$(addprefix ./erl-src/,gs_dialog.erl) 11ERLSRC=$(addprefix ./erl-src/,gs_dialog.erl)
12FORTHSRC=$(addprefix ./forth-src/,test-forth.fth) 12FORTHSRC=$(addprefix ./forth-src/,test-forth.fth)
13FSRC=$(addprefix ./f-src/,entry.for entry.strange_suffix entry.strange) 13FSRC=$(addprefix ./f-src/,entry.for entry.strange_suffix entry.strange)
14GOSRC=$(addprefix ./go-src/,test.go test1.go)
14HTMLSRC=$(addprefix ./html-src/,softwarelibero.html index.shtml algrthms.html software.html) 15HTMLSRC=$(addprefix ./html-src/,softwarelibero.html index.shtml algrthms.html software.html)
15#JAVASRC=$(addprefix ./java-src/, ) 16#JAVASRC=$(addprefix ./java-src/, )
16LUASRC=$(addprefix ./lua-src/,allegro.lua test.lua) 17LUASRC=$(addprefix ./lua-src/,allegro.lua test.lua)
@@ -27,9 +28,9 @@ RBSRC=$(addprefix ./ruby-src/,test.rb test1.ruby)
27TEXSRC=$(addprefix ./tex-src/,testenv.tex gzip.texi texinfo.tex nonewline.tex) 28TEXSRC=$(addprefix ./tex-src/,testenv.tex gzip.texi texinfo.tex nonewline.tex)
28YSRC=$(addprefix ./y-src/,parse.y parse.c atest.y cccp.c cccp.y) 29YSRC=$(addprefix ./y-src/,parse.y parse.c atest.y cccp.c cccp.y)
29SRCS=${ADASRC} ${ASRC} ${CSRC} ${CPSRC} ${ELSRC} ${ERLSRC} ${FSRC}\ 30SRCS=${ADASRC} ${ASRC} ${CSRC} ${CPSRC} ${ELSRC} ${ERLSRC} ${FSRC}\
30 ${FORTHSRC} ${HTMLSRC} ${JAVASRC} ${LUASRC} ${MAKESRC} ${OBJCSRC}\ 31 ${FORTHSRC} ${GOSRC} ${HTMLSRC} ${JAVASRC} ${LUASRC} ${MAKESRC}\
31 ${OBJCPPSRC} ${PASSRC} ${PHPSRC} ${PERLSRC} ${PSSRC} ${PROLSRC} ${PYTSRC}\ 32 ${OBJCSRC} ${OBJCPPSRC} ${PASSRC} ${PHPSRC} ${PERLSRC} ${PSSRC}\
32 ${RBSRC} ${TEXSRC} ${YSRC} 33 ${PROLSRC} ${PYTSRC} ${RBSRC} ${TEXSRC} ${YSRC}
33NONSRCS=./f-src/entry.strange ./erl-src/lists.erl ./cp-src/clheir.hpp.gz 34NONSRCS=./f-src/entry.strange ./erl-src/lists.erl ./cp-src/clheir.hpp.gz
34 35
35ETAGS_PROG=../../lib-src/etags 36ETAGS_PROG=../../lib-src/etags
diff --git a/test/etags/go-src/test.go b/test/etags/go-src/test.go
new file mode 100644
index 00000000000..6aea26ef210
--- /dev/null
+++ b/test/etags/go-src/test.go
@@ -0,0 +1,11 @@
1package main
2
3import "fmt"
4
5func say(msg string) {
6 fmt.Println(msg)
7}
8
9func main() {
10 say("Hello, Emacs!")
11}
diff --git a/test/etags/go-src/test1.go b/test/etags/go-src/test1.go
new file mode 100644
index 00000000000..6d1efaaa8a9
--- /dev/null
+++ b/test/etags/go-src/test1.go
@@ -0,0 +1,34 @@
1package main
2
3import "fmt"
4
5type plus interface {
6 PrintAdd()
7}
8
9type str struct {
10 a, b string
11}
12
13type intNumber struct {
14 a, b int
15}
16
17func (s str) PrintAdd() {
18 fmt.Println(s.a + s.b)
19}
20
21func (n intNumber) PrintAdd() {
22 fmt.Println(n.a + n.b)
23}
24
25func test(p plus) {
26 p.PrintAdd()
27}
28
29func main() {
30 s := str{a: "Hello,", b: "Emacs!"}
31 number := intNumber{a: 1, b: 2}
32 test(number)
33 test(s)
34}