[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 3e08f78: Improve Lua support in etags
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 3e08f78: Improve Lua support in etags |
Date: |
Fri, 11 Dec 2015 10:08:06 +0000 |
branch: emacs-25
commit 3e08f784d1cb8ebd0bd4ff53c1948a65c4924d52
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Improve Lua support in etags
* lib-src/etags.c (Lua_functions): Skip spaces before looking for
"function".
* etc/NEWS: Mention improved Lua support by 'etags'.
* test/etags/lua-src/test.lua (test): Add tests for indented
function definitions.
* 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 the modified Lua tests.
---
etc/NEWS | 5 +++++
lib-src/etags.c | 1 +
test/etags/CTAGS.good | 4 ++++
test/etags/ETAGS.good_1 | 6 +++++-
test/etags/ETAGS.good_2 | 6 +++++-
test/etags/ETAGS.good_3 | 6 +++++-
test/etags/ETAGS.good_4 | 6 +++++-
test/etags/ETAGS.good_5 | 6 +++++-
test/etags/ETAGS.good_6 | 6 +++++-
test/etags/lua-src/test.lua | 21 +++++++++++++++++++++
10 files changed, 61 insertions(+), 6 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 0c9296a..c6b3374 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1466,6 +1466,11 @@ qualified names by hand.
Names of modules, classes, methods, and functions are tagged.
Overloaded operators are also tagged.
+*** Improved support for Lua
+
+Etags now tags functions even if the "function" keyword follows some
+whitespace at line beginning.
+
* Changes in Emacs 25.1 on Non-Free Operating Systems
diff --git a/lib-src/etags.c b/lib-src/etags.c
index cd49f71..3cb3968 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -4985,6 +4985,7 @@ Lua_functions (FILE *inf)
LOOP_ON_INPUT_LINES (inf, lb, bp)
{
+ bp = skip_spaces (bp);
if (bp[0] != 'f' && bp[0] != 'l')
continue;
diff --git a/test/etags/CTAGS.good b/test/etags/CTAGS.good
index 3186ff6..245f670 100644
--- a/test/etags/CTAGS.good
+++ b/test/etags/CTAGS.good
@@ -3425,6 +3425,8 @@ mcCSC cp-src/c.C 6
mcheck c-src/emacs/src/gmalloc.c /^mcheck (void (*func) (enum
mcheck_status))$/
mcheck_status c-src/emacs/src/gmalloc.c 283
mcheck_used c-src/emacs/src/gmalloc.c 2012
+me22b lua-src/test.lua /^ local function test.me22b (one)$/
+me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/
memalign c-src/emacs/src/gmalloc.c /^memalign (size_t alignment,
size_t size)$/
member prol-src/natded.prolog /^member(X,[X|_]).$/
memclear c-src/emacs/src/lisp.h /^memclear (void *p, ptrdiff_t nbytes)$/
@@ -4209,6 +4211,8 @@ test c-src/emacs/src/lisp.h 1871
test cp-src/c.C 86
test erl-src/gs_dialog.erl /^test() ->$/
test php-src/ptest.php /^test $/
+test.me22b lua-src/test.lua /^ local function test.me22b (one)$/
+test.me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/
test_undefined c-src/emacs/src/keyboard.c /^test_undefined (Lisp_Object
binding)$/
texttreelist prol-src/natded.prolog /^texttreelist([]).$/
this c-src/a/b/b.c 1
diff --git a/test/etags/ETAGS.good_1 b/test/etags/ETAGS.good_1
index 1c4664d..2ae4ec4 100644
--- a/test/etags/ETAGS.good_1
+++ b/test/etags/ETAGS.good_1
@@ -2336,7 +2336,7 @@ function MoveLayerBottom 223,5079
function MoveLayerBefore 236,5457
function MoveLayerAfter 258,6090
-lua-src/test.lua,291
+lua-src/test.lua,442
function Rectangle.getPos 2,15
function Rectangle.getPos getPos2,15
function Circle.getPos 6,61
@@ -2345,6 +2345,10 @@ function Cube.data.getFoo 10,102
function Cube.data.getFoo getFoo10,102
function Square.something:Bar 14,148
function Square.something:Bar Bar14,148
+ function test.me_22a(22,241
+ function test.me_22a(me_22a22,241
+ local function test.me22b 25,297
+ local function test.me22b me22b25,297
make-src/Makefile,1133
LATEST=1,0
diff --git a/test/etags/ETAGS.good_2 b/test/etags/ETAGS.good_2
index 5f82e8c..3ec5b21 100644
--- a/test/etags/ETAGS.good_2
+++ b/test/etags/ETAGS.good_2
@@ -2905,7 +2905,7 @@ function MoveLayerBottom 223,5079
function MoveLayerBefore 236,5457
function MoveLayerAfter 258,6090
-lua-src/test.lua,291
+lua-src/test.lua,442
function Rectangle.getPos 2,15
function Rectangle.getPos getPos2,15
function Circle.getPos 6,61
@@ -2914,6 +2914,10 @@ function Cube.data.getFoo 10,102
function Cube.data.getFoo getFoo10,102
function Square.something:Bar 14,148
function Square.something:Bar Bar14,148
+ function test.me_22a(22,241
+ function test.me_22a(me_22a22,241
+ local function test.me22b 25,297
+ local function test.me22b me22b25,297
make-src/Makefile,1156
LATEST=1,0
diff --git a/test/etags/ETAGS.good_3 b/test/etags/ETAGS.good_3
index 8ab9dc3..43b84ee 100644
--- a/test/etags/ETAGS.good_3
+++ b/test/etags/ETAGS.good_3
@@ -2653,7 +2653,7 @@ function MoveLayerBottom 223,5079
function MoveLayerBefore 236,5457
function MoveLayerAfter 258,6090
-lua-src/test.lua,291
+lua-src/test.lua,442
function Rectangle.getPos 2,15
function Rectangle.getPos getPos2,15
function Circle.getPos 6,61
@@ -2662,6 +2662,10 @@ function Cube.data.getFoo 10,102
function Cube.data.getFoo getFoo10,102
function Square.something:Bar 14,148
function Square.something:Bar Bar14,148
+ function test.me_22a(22,241
+ function test.me_22a(me_22a22,241
+ local function test.me22b 25,297
+ local function test.me22b me22b25,297
make-src/Makefile,1133
LATEST=1,0
diff --git a/test/etags/ETAGS.good_4 b/test/etags/ETAGS.good_4
index 39a2f6e..434fe13 100644
--- a/test/etags/ETAGS.good_4
+++ b/test/etags/ETAGS.good_4
@@ -2500,7 +2500,7 @@ function MoveLayerBottom 223,5079
function MoveLayerBefore 236,5457
function MoveLayerAfter 258,6090
-lua-src/test.lua,291
+lua-src/test.lua,442
function Rectangle.getPos 2,15
function Rectangle.getPos getPos2,15
function Circle.getPos 6,61
@@ -2509,6 +2509,10 @@ function Cube.data.getFoo 10,102
function Cube.data.getFoo getFoo10,102
function Square.something:Bar 14,148
function Square.something:Bar Bar14,148
+ function test.me_22a(22,241
+ function test.me_22a(me_22a22,241
+ local function test.me22b 25,297
+ local function test.me22b me22b25,297
make-src/Makefile,1133
LATEST=1,0
diff --git a/test/etags/ETAGS.good_5 b/test/etags/ETAGS.good_5
index a820d81..425e252 100644
--- a/test/etags/ETAGS.good_5
+++ b/test/etags/ETAGS.good_5
@@ -3386,7 +3386,7 @@ function MoveLayerBottom 223,5079
function MoveLayerBefore 236,5457
function MoveLayerAfter 258,6090
-lua-src/test.lua,291
+lua-src/test.lua,442
function Rectangle.getPos 2,15
function Rectangle.getPos getPos2,15
function Circle.getPos 6,61
@@ -3395,6 +3395,10 @@ function Cube.data.getFoo 10,102
function Cube.data.getFoo getFoo10,102
function Square.something:Bar 14,148
function Square.something:Bar Bar14,148
+ function test.me_22a(22,241
+ function test.me_22a(me_22a22,241
+ local function test.me22b 25,297
+ local function test.me22b me22b25,297
make-src/Makefile,1156
LATEST=1,0
diff --git a/test/etags/ETAGS.good_6 b/test/etags/ETAGS.good_6
index c305147..39522db 100644
--- a/test/etags/ETAGS.good_6
+++ b/test/etags/ETAGS.good_6
@@ -3386,7 +3386,7 @@ function MoveLayerBottom 223,5079
function MoveLayerBefore 236,5457
function MoveLayerAfter 258,6090
-lua-src/test.lua,291
+lua-src/test.lua,442
function Rectangle.getPos 2,15
function Rectangle.getPos getPos2,15
function Circle.getPos 6,61
@@ -3395,6 +3395,10 @@ function Cube.data.getFoo 10,102
function Cube.data.getFoo getFoo10,102
function Square.something:Bar 14,148
function Square.something:Bar Bar14,148
+ function test.me_22a(22,241
+ function test.me_22a(me_22a22,241
+ local function test.me22b 25,297
+ local function test.me22b me22b25,297
make-src/Makefile,1156
LATEST=1,0
diff --git a/test/etags/lua-src/test.lua b/test/etags/lua-src/test.lua
index 3bfa49c..405eb5f 100644
--- a/test/etags/lua-src/test.lua
+++ b/test/etags/lua-src/test.lua
@@ -13,3 +13,24 @@ end
Square = {}
function Square.something:Bar ()
end
+
+-- Comment line
+ -- Indented comment line
+
+test = {}
+
+ function test.me_22a(one, two)
+ print"me_22a"
+ end
+ local function test.me22b (one)
+ print"me_22b"
+ end
+
+
+ test.i_123 = function (x)
+ print"i_123"
+end
+
+
+test.me_12a(1,2)
+test.i_123(1)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 3e08f78: Improve Lua support in etags,
Eli Zaretskii <=