[geany/geany] 3ff01a: JavaScript: recognize assignation to a parenthesized expression
Colomban Wendling
git-noreply at xxxxx
Sun Aug 3 17:07:59 UTC 2014
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Sun, 03 Aug 2014 17:07:59 UTC
Commit: 3ff01aeeb30462fe8b9c82740cae4a2e419c9587
https://github.com/geany/geany/commit/3ff01aeeb30462fe8b9c82740cae4a2e419c9587
Log Message:
-----------
JavaScript: recognize assignation to a parenthesized expression
Modified Paths:
--------------
tagmanager/ctags/js.c
tests/ctags/bug2777310.js
tests/ctags/bug2777310.js.tags
Modified: tagmanager/ctags/js.c
4 lines changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -1433,6 +1433,8 @@ static boolean parseStatement (tokenInfo *const token, boolean is_inside_class)
/*
* Handle nameless functions
* this.method_name = () {}
+ * Also assignments starting with parentheses
+ * var foo = (1 + 2) * 3;
*/
skipArgumentList(token);
@@ -1446,6 +1448,8 @@ static boolean parseStatement (tokenInfo *const token, boolean is_inside_class)
}
else if (isType (token, TOKEN_CLOSE_CURLY))
is_terminated = FALSE;
+ else if (token->nestLevel == 0 && is_global)
+ makeJsTag (name, JSTAG_VARIABLE);
}
else if (isType (token, TOKEN_OPEN_CURLY))
{
Modified: tests/ctags/bug2777310.js
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -1,4 +1,6 @@
var x = 1;
var z = {};
var y = [];
+var a = (42 + 1) * 2;
+var b = 2 * (42 + 1);
Modified: tests/ctags/bug2777310.js.tags
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -1,4 +1,6 @@
# format=tagmanager
+a�16384�0
+b�16384�0
x�16384�0
y�16384�0
z�16384�0
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list