Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Mon, 24 Nov 2014 02:00:27 UTC Commit: 5793694134f21652d4191dc56e087fa32c413ffb https://github.com/geany/geany/commit/5793694134f21652d4191dc56e087fa32c413f...
Log Message: ----------- javascript: Add support for the `let` keyword
`let` is not yet part of the current ECMAScript standard but is part of the ECMAScript 6 draft and is supported by Mozilla, and people already use it in some contexts.
Also, the current ECMAScript standard marks `let` as a "considered reserved word" (7.6.1.2), so it is already a reserved keyword in strict mode.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements...
Modified Paths: -------------- tagmanager/ctags/js.c tests/ctags/Makefile.am tests/ctags/js-let.js tests/ctags/js-let.js.tags
Modified: tagmanager/ctags/js.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -58,6 +58,7 @@ typedef enum eKeywordId { KEYWORD_capital_object, KEYWORD_prototype, KEYWORD_var, + KEYWORD_let, KEYWORD_const, KEYWORD_new, KEYWORD_this, @@ -153,6 +154,7 @@ static const keywordDesc JsKeywordTable [] = { { "Object", KEYWORD_capital_object }, { "prototype", KEYWORD_prototype }, { "var", KEYWORD_var }, + { "let", KEYWORD_let }, { "const", KEYWORD_const }, { "new", KEYWORD_new }, { "this", KEYWORD_this }, @@ -1084,6 +1086,7 @@ static boolean parseBlock (tokenInfo *const token, tokenInfo *const orig_parent) vStringCopy(token->scope, saveScope); } else if (isKeyword (token, KEYWORD_var) || + isKeyword (token, KEYWORD_let) || isKeyword (token, KEYWORD_const)) { /* @@ -1299,6 +1302,7 @@ static boolean parseStatement (tokenInfo *const token, tokenInfo *const parent, * var can preceed an inner function */ if ( isKeyword(token, KEYWORD_var) || + isKeyword(token, KEYWORD_let) || isKeyword(token, KEYWORD_const) ) { is_const = isKeyword(token, KEYWORD_const);
Modified: tests/ctags/Makefile.am 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -162,6 +162,7 @@ test_sources = \ js-class-related-unterminated.js \ js-const.js \ js-implicit-semicolons.js \ + js-let.js \ js-scope.js \ js-signature.js \ js-sub-block-scope.js \
Modified: tests/ctags/js-let.js 8 lines changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +let a = 1; +let b = 0; +let group = { + x:1, + y:1, + z:1, +}; +let func = function(){}
Modified: tests/ctags/js-let.js.tags 8 lines changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +a�16384�0 +b�16384�0 +func�16�()�0 +group�16384�0 +x�64�group�0 +y�64�group�0 +z�64�group�0
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).