From fa0534d18a7b0831389019ce4d0705baf8993e4a Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Thu, 13 Feb 2020 16:12:46 +0100 Subject: [PATCH 1/3] + chg: HTML JS VB: shared keyword-lists --- src/StyleLexers/EditLexer.h | 23 +++++++++++++++++++ src/StyleLexers/styleLexHTML.c | 12 ++-------- src/StyleLexers/styleLexJS.c | 5 +--- src/StyleLexers/styleLexVB.c | 11 +-------- .../StyleLexers/styleLexJS/codepen.js | 0 .../StyleLexers/styleLexJS/test_script.js | 7 ++++++ 6 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 test/test_files/StyleLexers/styleLexJS/codepen.js create mode 100644 test/test_files/StyleLexers/styleLexJS/test_script.js diff --git a/src/StyleLexers/EditLexer.h b/src/StyleLexers/EditLexer.h index 3d33378f5..a0ffd211a 100644 --- a/src/StyleLexers/EditLexer.h +++ b/src/StyleLexers/EditLexer.h @@ -137,6 +137,29 @@ extern EDITLEXER lexHTML; // Web Source Code extern EDITLEXER lexXML; // XML Document extern EDITLEXER lexYAML; // YAML +// ----------------------------------------------------------------------------- +// common defines +// ----------------------------------------------------------------------------- + +#define NP3_LEXER_JS_KEYWORD_LIST \ +"abstract as async await boolean break byte case catch char class const continue debugger default delete do double "\ +"each else enum export extends false final finally float for from function get goto if implements import in instanceof int "\ +"interface let long native new null of package private protected public return set short static super switch "\ +"synchronized this throw throws transient true try typeof var void volatile while with yield" + + +#define NP3_LEXER_VB_KEYWORD_LIST \ +"addhandler addressof alias and andalso ansi any as assembly attribute auto begin boolean byref byte byval "\ +"call case catch cbool cbyte cchar cdate cdbl cdec char cint class clng cobj compare const continue cshort csng cstr ctype currency "\ +"date decimal declare default delegate dim directcast do double each else elseif empty end enum eqv erase error event "\ +"exit explicit externalsource false finally for friend function get gettype global gosub goto handles if "\ +"imp implement implements imports in inherits integer interface is let lib like load long loop lset me mid mod module mustinherit "\ +"mustoverride mybase myclass namespace new next not nothing notinheritable notoverridable null object on option "\ +"optional or orelse overloads overridable overrides paramarray preserve private property protected public "\ +"raiseevent randomize readonly redim rem removehandler resume return rset select set shadows shared short "\ +"single static step stop strict string structure sub synclock then throw to true try type typeof unicode unload until "\ +"variant wend when while with withevents writeonly xor" + // ----------------------------------------------------------------------------- #endif // _EDIT_LEXER_H_ diff --git a/src/StyleLexers/styleLexHTML.c b/src/StyleLexers/styleLexHTML.c index 4cb8f87bc..8f57aa571 100644 --- a/src/StyleLexers/styleLexHTML.c +++ b/src/StyleLexers/styleLexHTML.c @@ -34,17 +34,9 @@ KEYWORDLIST KeyWords_HTML = { "translate tt type typemustmatch u ul usemap valign value valuetype var version video vlink vspace wbr " "width wrap xml xmlns", // JavaScript keywords (sync with lexJS::KeyWords_JS) -"abstract as async await boolean break byte case catch char class const continue debugger default delete do double " -"each else enum export extends false final finally float for from function get goto if implements import in instanceof int " -"interface let long native new null of package private protected public return set short static super switch " -"synchronized this throw throws transient true try typeof var void volatile while with yield", +NP3_LEXER_JS_KEYWORD_LIST, // VBScript keywords -"alias and as attribute begin boolean byref byte byval call case class compare const continue currency date " -"declare dim do double each else elseif empty end enum eqv erase error event exit explicit false for " -"friend function get global gosub goto if imp implement in integer is let lib load long loop lset me mid " -"mod module new next not nothing null object on option optional or preserve private property public " -"raiseevent redim rem resume return rset select set single static stop string sub then to true type unload " -"until variant wend while with withevents xor", +NP3_LEXER_VB_KEYWORD_LIST, // Python keywords "", // PHP keywords diff --git a/src/StyleLexers/styleLexJS.c b/src/StyleLexers/styleLexJS.c index 6ca24c330..4d6b44cea 100644 --- a/src/StyleLexers/styleLexJS.c +++ b/src/StyleLexers/styleLexJS.c @@ -4,10 +4,7 @@ // JavaScript keywords (sync with lexHTML::KeyWords_HTML for embedded JS) KEYWORDLIST KeyWords_JS = { -"abstract as async await boolean break byte case catch char class const continue debugger default delete do double " -"each else enum export extends false final finally float for from function get goto if implements import in instanceof int " -"interface let long native new null of package private protected public return set short static super switch " -"synchronized this throw throws transient true try typeof var void volatile while with yield", + NP3_LEXER_JS_KEYWORD_LIST, NULL, }; diff --git a/src/StyleLexers/styleLexVB.c b/src/StyleLexers/styleLexVB.c index d443891bd..1d4072d82 100644 --- a/src/StyleLexers/styleLexVB.c +++ b/src/StyleLexers/styleLexVB.c @@ -3,16 +3,7 @@ // ---------------------------------------------------------------------------- KEYWORDLIST KeyWords_VB = { -"addhandler addressof alias and andalso ansi any as assembly auto boolean byref byte byval call case catch " -"cbool cbyte cchar cdate cdbl cdec char cint class clng cobj compare const cshort csng cstr ctype date " -"decimal declare default delegate dim directcast do double each else elseif end enum erase error event " -"exit explicit externalsource false finally for friend function get gettype gosub goto handles if " -"implements imports in inherits integer interface is let lib like long loop me mid mod module mustinherit " -"mustoverride mybase myclass namespace new next not nothing notinheritable notoverridable object on option " -"optional or orelse overloads overridable overrides paramarray preserve private property protected public " -"raiseevent randomize readonly redim rem removehandler resume return select set shadows shared short " -"single static step stop strict string structure sub synclock then throw to true try typeof unicode until " -"variant when while with withevents writeonly xor", + NP3_LEXER_VB_KEYWORD_LIST, NULL, }; diff --git a/test/test_files/StyleLexers/styleLexJS/codepen.js b/test/test_files/StyleLexers/styleLexJS/codepen.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/test_files/StyleLexers/styleLexJS/test_script.js b/test/test_files/StyleLexers/styleLexJS/test_script.js new file mode 100644 index 000000000..f0d17af89 --- /dev/null +++ b/test/test_files/StyleLexers/styleLexJS/test_script.js @@ -0,0 +1,7 @@ +var x; +const y; +let z; + +for (let el of arr) { + console.log(el); +} From 86d74ff0ab55a2480b6c3b7746fedb4da3152a46 Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Thu, 13 Feb 2020 16:47:55 +0100 Subject: [PATCH 2/3] + chg: remove let from Web Source Code --- src/StyleLexers/styleLexHTML.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StyleLexers/styleLexHTML.c b/src/StyleLexers/styleLexHTML.c index 8f57aa571..a0f420432 100644 --- a/src/StyleLexers/styleLexHTML.c +++ b/src/StyleLexers/styleLexHTML.c @@ -15,7 +15,7 @@ KEYWORDLIST KeyWords_HTML = { "formaction formenctype formmethod formnovalidate formtarget frame frameborder frameset h1 h2 h3 h4 h5 h6 " "head header headers height hgroup hidden high hr href hreflang hspace html http-equiv i icon id iframe " "image img input ins integrity isindex ismap itemprop itemscope itemtype kbd keygen keytype kind label " -"lang language leftmargin legend let li link list longdesc loop low main manifest map marginheight marginwidth " +"lang language leftmargin legend li link list longdesc loop low main manifest map marginheight marginwidth " "mark max maxlength media mediagroup menu menuitem meta meter method min multiple muted name nav noframes " "nohref noresize noscript noshade novalidate nowrap object ol onabort onafterprint onbeforeprint " "onbeforeunload onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu " From 8d591865699bb9d5d4dbc8e5974762ffe0b25d29 Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Thu, 13 Feb 2020 16:51:38 +0100 Subject: [PATCH 3/3] + upd: version patch files --- Versions/build.txt | 2 +- res/Notepad3.exe.manifest.conf | 2 +- src/VersionEx.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Versions/build.txt b/Versions/build.txt index 1e8b31496..7f8f011eb 100644 --- a/Versions/build.txt +++ b/Versions/build.txt @@ -1 +1 @@ -6 +7 diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 52ac7d0bb..cf51c2dd6 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,7 +3,7 @@ Notepad3 RC1 diff --git a/src/VersionEx.h b/src/VersionEx.h index 1cbfec7bc..f0ea3ec95 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -9,7 +9,7 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 20 #define VERSION_REV 213 -#define VERSION_BUILD 6 +#define VERSION_BUILD 7 #define SCINTILLA_VER 430 #define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27