SHEBANG method

Mode SHEBANG([
  1. Mode? opts
])

Implementation

Mode SHEBANG([Mode? opts]) {
  const beginShebang = r'^#![ ]*/';
  dynamic begin = beginShebang;
  if (opts?.binary != null) {
    begin = regex.concat(beginShebang, r'.*\b', opts!.binary!, r'\b.*');
  }
  return Mode(
    scope: 'meta',
    begin: begin,
    end: r'$',
    relevance: 0,
    onBegin: (RegExpMatch m, CallbackResponse resp) {
      if (m.start != 0) resp.ignoreMatch();
    },
  );
}