From 0c3e7c9e25f4990ef5d37a5b17a79c9c64363ed7 Mon Sep 17 00:00:00 2001 From: Michael Lass Date: Sat, 18 Jan 2020 23:32:38 +0100 Subject: [PATCH] Fix operator regex for ACME grammar (again) Currently, the regex causes the following error: Uncaught Error: target of repeat operator is not specified ``` At /usr/lib/atom/node_modules/first-mate/lib/scanner.js:31 Error: target of repeat operator is not specified at Scanner.module.exports.Scanner.createScanner (/usr/lib/atom/node_modules/first-mate/lib/scanner.js:31:24) at Scanner.module.exports.Scanner.getScanner (/usr/lib/atom/node_modules/first-mate/lib/scanner.js:37:31) at Scanner.module.exports.Scanner.findNextMatch (/usr/lib/atom/node_modules/first-mate/lib/scanner.js:56:22) at Rule.module.exports.Rule.findNextMatch (/usr/lib/atom/node_modules/first-mate/lib/rule.js:98:28) at Rule.module.exports.Rule.getNextTags (/usr/lib/atom/node_modules/first-mate/lib/rule.js:154:21) at Grammar.module.exports.Grammar.tokenizeLine (/usr/lib/atom/node_modules/first-mate/lib/grammar.js:162:44) at TextMateLanguageMode.buildTokenizedLineForRowWithText (/usr/lib/atom/src/text-mate-language-mode.js:503:46) at TextMateLanguageMode.buildTokenizedLineForRow (/usr/lib/atom/src/text-mate-language-mode.js:488:17) at TextMateLanguageMode.tokenizeNextChunk (/usr/lib/atom/src/text-mate-language-mode.js:340:41) at _.defer (/usr/lib/atom/src/text-mate-language-mode.js:324:57) at /usr/lib/atom/node_modules/underscore/underscore.js:768:19 ``` Fix the regex by applying the following modifications: * use double backslashes to escape special characters * insert missing * into regex While here, also give the pattern a .acme suffix as all the other have. --- grammars/acme.cson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/acme.cson b/grammars/acme.cson index 8415575..f89676b 100644 --- a/grammars/acme.cson +++ b/grammars/acme.cson @@ -124,8 +124,8 @@ repository: } # Operators { - match: '\!|\+|\-|\/|\|<<|>>|&|\||\^|=|<|>|\:' - name: 'keyword.operator' + match: '\\!|\\+|\\-|\\/|\\*|<<|>>|&|\\||\\^|=|<|>|\\:' + name: 'keyword.operator.acme' } # Operators II {