From edaefb7239a9359600f15e6a62d18a37e917452a Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Wed, 29 Apr 2020 13:20:50 -0400 Subject: [PATCH] shebang can include space before path --- src/lib/modes.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/modes.js b/src/lib/modes.js index d556dc2897..602141e78a 100644 --- a/src/lib/modes.js +++ b/src/lib/modes.js @@ -10,16 +10,17 @@ export const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b... export const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'; export const SHEBANG = (opts = {}) => { + const beginShebang = /^#![ ]*\//; if (opts.binary) { opts.begin = regex.concat( - /^#!\//, - /.*/, + beginShebang, + /.*\b/, opts.binary, /\b.*/); } return inherit({ className: 'meta', - begin: /^#!\//, + begin: beginShebang, end: /$/, relevance: 0, "on:begin": (m, resp) => {