From 1f14ed078dcb33063940e24d2a658fbac79c0027 Mon Sep 17 00:00:00 2001 From: nnnik Date: Fri, 30 Jun 2017 10:38:06 +0200 Subject: [PATCH 1/4] Update autohotkey.js --- src/languages/autohotkey.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js index 0f8fa41074..ce0d43f8b4 100644 --- a/src/languages/autohotkey.js +++ b/src/languages/autohotkey.js @@ -15,7 +15,7 @@ function(hljs) { aliases: [ 'ahk' ], keywords: { keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group', - literal: 'A|0 true false NOT AND OR', + literal: 'true false NOT AND OR', built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel', }, contains: [ @@ -33,23 +33,22 @@ function(hljs) { relevance: 0 }, { - className: 'subst', // FIXED - begin: '%(?=[a-zA-Z0-9#_$@])', end: '%', - illegal: '[^a-zA-Z0-9#_$@]' + className: 'variable', //subst would be the most accurate however fails the point of highlighting. variable is comparably the most accurate that actually has some effect + begin: '%[a-zA-Z0-9#_$@]+%' }, { className: 'built_in', - begin: '^\\s*\\w+\\s*,' + begin: '^\\s*\\w+\\s*(,|%)' //I don't really know if this is totally relevant }, { className: 'meta', - begin: '^\\s*#\w+', end:'$', + begin: '^\\s*#\\w+', end:'$', relevance: 0 }, { - className: 'symbol', - contains: [BACKTICK_ESCAPE], + className: 'title', //symbol would be most accurate however is higlighted just like built_in and that makes up a lot of AutoHotkey code + //meaning that it would fail to highlight anything variants: [ {begin: '^[^\\n";]+::(?!=)'}, {begin: '^[^\\n";]+:(?!=)', relevance: 0} // zero relevance as it catches a lot of things From a1264d444d3bffaf41028fc97c8020c23e386ada Mon Sep 17 00:00:00 2001 From: nnnik Date: Wed, 12 Jul 2017 11:09:51 +0200 Subject: [PATCH 2/4] Fixed order --- src/languages/autohotkey.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js index ce0d43f8b4..a8238da6bc 100644 --- a/src/languages/autohotkey.js +++ b/src/languages/autohotkey.js @@ -19,10 +19,6 @@ function(hljs) { built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel', }, contains: [ - { - className: 'built_in', - begin: 'A_[a-zA-Z0-9]+' - }, BACKTICK_ESCAPE, hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [BACKTICK_ESCAPE]}), hljs.COMMENT(';', '$', {relevance: 0}), @@ -41,11 +37,6 @@ function(hljs) { begin: '^\\s*\\w+\\s*(,|%)' //I don't really know if this is totally relevant }, - { - className: 'meta', - begin: '^\\s*#\\w+', end:'$', - relevance: 0 - }, { className: 'title', //symbol would be most accurate however is higlighted just like built_in and that makes up a lot of AutoHotkey code //meaning that it would fail to highlight anything @@ -55,6 +46,15 @@ function(hljs) { // followed by a single ':' in many languages ] }, + { + className: 'meta', + begin: '^\\s*#\\w+', end:'$', + relevance: 0 + }, + { + className: 'built_in', + begin: 'A_[a-zA-Z0-9]+' + }, { // consecutive commas, not for highlighting but just for relevance begin: ',\\s*,' From d89b8a864564dbcaca3712a63df171a196147413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 24 Jan 2019 16:18:59 +1100 Subject: [PATCH 3/4] Fix whitespace --- src/languages/autohotkey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js index a8238da6bc..85b7ad187d 100644 --- a/src/languages/autohotkey.js +++ b/src/languages/autohotkey.js @@ -51,7 +51,7 @@ function(hljs) { begin: '^\\s*#\\w+', end:'$', relevance: 0 }, - { + { className: 'built_in', begin: 'A_[a-zA-Z0-9]+' }, From d93c0f0de5760d8707aa90ccf3d9aa024b3e9e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Thu, 24 Jan 2019 16:19:32 +1100 Subject: [PATCH 4/4] Fix more white space --- src/languages/autohotkey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js index 85b7ad187d..5384f9d5a1 100644 --- a/src/languages/autohotkey.js +++ b/src/languages/autohotkey.js @@ -39,7 +39,7 @@ function(hljs) { }, { className: 'title', //symbol would be most accurate however is higlighted just like built_in and that makes up a lot of AutoHotkey code - //meaning that it would fail to highlight anything + //meaning that it would fail to highlight anything variants: [ {begin: '^[^\\n";]+::(?!=)'}, {begin: '^[^\\n";]+:(?!=)', relevance: 0} // zero relevance as it catches a lot of things