var variable_regex = /({)?[a-zA-Z0-9_]+(})?/;
function tokenString(e, t) {
  for (var n, r, i = false; !e.eol() && (n = e.next()) != t.pending; ) {
    if (n === "$" && r != "\\" && t.pending == '"') {
      i = true;
      break;
    }
    r = n;
  }
  return i && e.backUp(1), n == t.pending ? t.continueString = false : t.continueString = true, "string";
}
function tokenize(n, r) {
  var i = n.next();
  return i === "$" ? n.match(variable_regex) ? "variableName.special" : "variable" : r.continueString ? (n.backUp(1), tokenString(n, r)) : n.match(/(\s+)?\w+\(/) || n.match(/(\s+)?\w+\ \(/) ? (n.backUp(1), "def") : i == "#" ? (n.skipToEnd(), "comment") : i == "'" || i == '"' ? (r.pending = i, tokenString(n, r)) : i == "(" || i == ")" ? "bracket" : i.match(/[0-9]/) ? "number" : (n.eatWhile(/[\w-]/), null);
}
const cmake = {
  name: "cmake",
  startState: function() {
    var e = {};
    return e.inDefinition = false, e.inInclude = false, e.continueString = false, e.pending = false, e;
  },
  token: function(e, t) {
    return e.eatSpace() ? null : tokenize(e, t);
  }
};
export {
  cmake as t
};
