const o = {
  builtinFunctions: /abs|acos|alertcondition|alma|asin|atan|atr|avg|barcolor|barssince|bgcolor|cci|ceil|change|cog|color|correlation|cos|cross|crossover|crossunder|cum|dayofmonth|dayofweek|dev|ema|exp|falling|fill|fixnan|floor|heikinashi|highest|highestbars|hline|hour|iff|input|kagi|linebreak|linreg|log|log10|lowest|lowestbars|macd|max|min|minute|mom|month|na|nz|offset|percentile_linear_interpolation|percentile_nearest_rank|percentrank|pivothigh|pivotlow|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|pointfigure|pow|renko|rising|rma|roc|round|rsi|sar|second|security|sign|sin|sma|sqrt|stdev|stoch|strategy|strategy\.cancel|strategy\.cancel_all|strategy\.close|strategy\.close_all|strategy\.entry|strategy\.exit|strategy\.order|strategy\.risk\.allow_entry_in|strategy\.risk\.max_cons_loss_days|strategy\.risk\.max_drawdown|strategy\.risk\.max_intraday_filled_orders|strategy\.risk\.max_intraday_loss|strategy\.risk\.max_position_size|study|sum|swma|tan|tickerid|time|timestamp|tostring|tr|tsi|valuewhen|variance|vwap|vwma|weekofyear|wma|year/,
  keywords: /and|break|by|continue|else|for|if|not|or|to/,
  tokenizer: {
    root: [
      [/\/\/\s*(?=@)/, "comment", "@comments"],
      [/\/\/.*(?!@).*/, "comment"],
      [/\'([^\'\\]|\\.)*$/, "string.invalid"],
      [/'([^'\\]|\\.)*$/, "string.invalid"],
      [/\"/, {
        token: "string",
        bracket: "@open",
        next: "@stringDouble"
      }],
      [/'/, {
        token: "string",
        bracket: "@open",
        next: "@stringSingle"
      }],
      [/(@builtinFunctions)(?=\s*\(|\s*<.*>)/, {
        token: "support.function",
        next: "@template"
      }],
      [/@punctuation/, {
        token: "punctuation.operator",
        next: "@property"
      }],
      [/^(\s*)\b(?!(?:series|simple|string|array|color|const|float|bool|int|continue|break|else|and|for|not|var|by|if|or|to)\b)([\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|break|else|and|for|not|var|by|if|or|to)\b)[\w\d_$]+)(\s+)(\=)/, [{
        token: "source"
      }, {
        token: "entity.name.type"
      }, {
        token: "paren"
      }, {
        token: "source"
      }, {
        token: "variable.other"
      }, {
        token: "source"
      }, {
        token: "keyword.equals"
      }]],
      [/[+-]?\d+\.\d*([eE][\-+]?\d+)?(?!\w+)/, "constant.numeric.float"],
      [/[+-]?\.\d+([eE][\-+]?\d+)?(?!\w+)/, "constant.numeric.float"],
      [/([+-]?(\d+))(?!\w+)(?!\w+)/, "constant.numeric.integer"],
      [/(?:true|false)\b/, "constant.other.boolean"],
      [/#[0-9a-fA-F]{6,8}\b/, "constant.other.color"],
      [/[\/%*+\-]|==|!=|<=|>=|=>|<|>|\?|\:=|\:|\,/, "keyword.operator"],
      [/\b(?:@keywords)\b/, "keyword"],
      [/^[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/, "entity.name.function"],
      [/[0-9]+\b/, "constant.numeric.integer"],
      [/=/, "keyword.equals"],
      [/\b(?:@builtinVariables)\b(?!\s*=\s*\w+)/, "support.variable"],
      [/[(|)|\[|\]]/, "paren"],
      [/[a-zA-Z_][a-zA-Z_0-9]*(?=\s*\()/, {
        token: "entity.name.method"
      }],
      [/\w+\b/, "variable.other"]
    ],
    comments: [[/@[A-Za-z]+(\s*=\s*)?$/, {
      token: "comment.annotation",
      next: "@pop"
    }], [/@[A-Za-z]+(\s*=\s*)?/, {
      token: "comment.annotation"
    }], [/(?!\s*@[A-Za-z]+).+$/, {
      token: "comment",
      next: "@pop"
    }]],
    stringDouble: [[/[^\\\"]+/, "string"], [/\\./, "string.invalid"], [/\"/, {
      token: "string.quote",
      bracket: "@close",
      next: "@pop"
    }]],
    stringSingle: [[/[^\\']+/, "string"], [/\\./, "string.invalid"], [/'/, {
      token: "string",
      bracket: "@close",
      next: "@pop"
    }]],
    template: [[/(\((?:\s+))?((?!(?:continue|series|simple|string|array|color|const|float|break|bool|else|int|and|for|not|by|if|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/, "entity.name.type"], [/\(|\)|\[|\]|\=|\>/, {
      token: "paren",
      next: "@pop"
    }], [/(\,)(\s+)/, ["keyword.operator", "source"]], [/(\,)/, {
      token: "keyword.operator"
    }], [/([\w.\d$]+)/, {
      token: "entity.name.type"
    }], [/(<|>)/, {
      token: "paren"
    }], [/\s(?=\w)|$/, {
      token: "source",
      next: "@pop"
    }]],
    property: [[/@punctuation/, {
      token: "punctuation.operator"
    }], [/[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/, {
      token: "entity.name.method",
      next: "@pop"
    }], [/[a-zA-Z0-9_]+/, {
      token: "variable.other.property",
      next: "@pop"
    }], [/@empty/, {
      token: "source",
      next: "@pop"
    }]]
  },
  builtinVariables: /adjustment\.dividends|adjustment\.none|adjustment\.splits|aqua|area|areabr|barmerge\.gaps_off|barmerge\.gaps_on|barmerge\.lookahead_off|barmerge\.lookahead_on|black|blue|bool|circles|columns|cross|currency\.AUD|currency\.CAD|currency\.CHF|currency\.EUR|currency\.GBP|currency\.HKD|currency\.JPY|currency\.NOK|currency\.NONE|currency\.NZD|currency\.RUB|currency\.SEK|currency\.SGD|currency\.TRY|currency\.USD|currency\.ZAR|dashed|dotted|float|friday|fuchsia|gray|green|histogram|integer|lime|line|linebr|location\.abovebar|location\.absolute|location\.belowbar|location\.bottom|location\.top|maroon|monday|navy|olive|orange|purple|red|resolution|saturday|scale\.left|scale\.none|scale\.right|session\.extended|session\.regular|session|shape\.arrowdown|shape\.arrowup|shape\.circle|shape\.cross|shape\.diamond|shape\.flag|shape\.labeldown|shape\.labelup|shape\.square|shape\.triangledown|shape\.triangleup|shape\.xcross|silver|size\.auto|size\.huge|size\.large|size\.normal|size\.small|size\.tiny|solid|source|stepline|strategy\.cash|strategy\.commission\.cash_per_contract|strategy\.commission\.cash_per_order|strategy\.commission\.percent|strategy\.direction\.all|strategy\.direction\.long|strategy\.direction\.short|strategy\.fixed|strategy\.long|strategy\.oca\.cancel|strategy\.oca\.none|strategy\.oca\.reduce|strategy\.percent_of_equity|strategy\.short|string|sunday|symbol|teal|thursday|tuesday|wednesday|white|yellow|accdist|barstate\.isconfirmed|barstate\.isfirst|barstate\.ishistory|barstate\.islast|barstate\.isnew|barstate\.isrealtime|close|dayofmonth|dayofweek|high|hl2|hlc3|hour|interval|isdaily|isdwm|isintraday|isminutes|ismonthly|isseconds|isweekly|low|minute|month|n|na|ohlc4|open|period|second|strategy\.closedtrades|strategy\.equity|strategy\.eventrades|strategy\.grossloss|strategy\.grossprofit|strategy\.initial_capital|strategy\.losstrades|strategy\.max_contracts_held_all|strategy\.max_contracts_held_long|strategy\.max_contracts_held_short|strategy\.max_drawdown|strategy\.netprofit|strategy\.openprofit|strategy\.opentrades|strategy\.position_avg_price|strategy\.position_entry_name|strategy\.position_size|strategy\.wintrades|syminfo\.mintick|syminfo\.pointvalue|syminfo\.prefix|syminfo\.root|syminfo\.session|syminfo\.timezone|ticker|tickerid|time|timenow|tr|volume|vwap|weekofyear|year/,
  punctuation: /[.](?![.])/,
  empty: /^$/
};
var t;
(function(e) {
  e[e.None = 0] = "None", e[e.Indent = 1] = "Indent", e[e.IndentOutdent = 2] = "IndentOutdent", e[e.Outdent = 3] = "Outdent";
})(t || (t = {}));
const n = {
  wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
  comments: {
    lineComment: "//",
    blockComment: ["/*", "*/"]
  },
  brackets: [["(", ")"], ["[", "]"]],
  folding: {
    markers: {
      start: /(\/\/#region)|(\/\/.*{($|\s))/,
      end: /(\/\/#endregion)|(\/\/.*}($|\s))/
    }
  },
  autoClosingPairs: [{
    open: "{",
    close: "}"
  }, {
    open: "[",
    close: "]"
  }, {
    open: "(",
    close: ")"
  }, {
    open: '"',
    close: '"'
  }, {
    open: "'",
    close: "'"
  }],
  surroundingPairs: [{
    open: "{",
    close: "}"
  }, {
    open: "[",
    close: "]"
  }, {
    open: "(",
    close: ")"
  }, {
    open: '"',
    close: '"'
  }, {
    open: "'",
    close: "'"
  }, {
    open: "<",
    close: ">"
  }],
  onEnterRules: [{
    beforeText: /\)\s*=>\s*$/,
    action: {
      indentAction: t.Indent
    }
  }, {
    beforeText: /if\s+.*\s*$/,
    action: {
      indentAction: t.Indent
    }
  }, {
    beforeText: /else/,
    action: {
      indentAction: t.Indent
    }
  }, {
    beforeText: /for\s+\S+\s*=\s*\S+\s+to\s+\S+(?:\s+by\s+\S+)?\s*$/,
    action: {
      indentAction: t.Indent
    }
  }, {
    beforeText: /^\s*$/,
    action: {
      indentAction: t.Outdent
    }
  }]
};
export {
  n as CONFIGURATION,
  o as LANGUAGE_MONARCH_TOKENS
};
