From 218141217aac4b9ad477a8b686f34c432d293082 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Tue, 6 Feb 2018 21:36:10 -0800 Subject: [PATCH] support *.mjs as JavaScript --- wakatime/packages/pygments/lexers/javascript.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wakatime/packages/pygments/lexers/javascript.py b/wakatime/packages/pygments/lexers/javascript.py index 862535c..42d68d3 100644 --- a/wakatime/packages/pygments/lexers/javascript.py +++ b/wakatime/packages/pygments/lexers/javascript.py @@ -37,7 +37,7 @@ class JavascriptLexer(RegexLexer): name = 'JavaScript' aliases = ['js', 'javascript'] - filenames = ['*.js', '*.jsm'] + filenames = ['*.js', '*.jsm', '*.mjs'] mimetypes = ['application/javascript', 'application/x-javascript', 'text/x-javascript', 'text/javascript'] @@ -1035,7 +1035,6 @@ class CoffeeScriptLexer(RegexLexer): filenames = ['*.coffee'] mimetypes = ['text/coffeescript'] - _operator_re = ( r'\+\+|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|' r'\|\||\\(?=\n)|' @@ -1464,6 +1463,7 @@ class EarlGreyLexer(RegexLexer): ], } + class JuttleLexer(RegexLexer): """ For `Juttle`_ source code.