From 4330d41f5d132438a862550e4fbd552956e5e7aa Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Feb 2017 01:42:22 +0900 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E6=96=87=E5=AD=97=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/text/elements/code.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/text/elements/code.js b/src/common/text/elements/code.js index ccca5ab4a..6870f3023 100644 --- a/src/common/text/elements/code.js +++ b/src/common/text/elements/code.js @@ -25,7 +25,7 @@ function escape(text) { // 文字数が多い順にソートします // そうしないと、「function」という文字列が与えられたときに「func」が先にマッチしてしまう可能性があるためです -const keywords = [ +const _keywords = [ 'true', 'false', 'null', @@ -94,7 +94,12 @@ const keywords = [ 'extends', 'implements', 'constructor' -].sort((a, b) => b.length - a.length); +]; + +const keywords = _keywords + .concat(_keywords.map(k => k[0].toUpperCase() + k.substr(1))) + .concat(_keywords.map(k => k.toUpperCase())) + .sort((a, b) => b.length - a.length); const symbols = [ '=',