const T = {
  comments: {
    lineComment: "--",
    blockComment: ["/*", "*/"]
  },
  brackets: [
    ["{", "}"],
    ["[", "]"],
    ["(", ")"]
  ],
  autoClosingPairs: [
    { open: "{", close: "}" },
    { open: "[", close: "]" },
    { open: "(", close: ")" },
    { open: '"', close: '"' },
    { open: "'", close: "'" }
  ],
  surroundingPairs: [
    { open: "{", close: "}" },
    { open: "[", close: "]" },
    { open: "(", close: ")" },
    { open: '"', close: '"' },
    { open: "'", close: "'" }
  ]
}, E = {
  defaultToken: "",
  tokenPostfix: ".sql",
  ignoreCase: !0,
  brackets: [
    { open: "[", close: "]", token: "delimiter.square" },
    { open: "(", close: ")", token: "delimiter.parenthesis" }
  ],
  keywords: [
    // from https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#reserved_keywords
    "ALL",
    "AND",
    "ANY",
    "ARRAY",
    "AS",
    "ASC",
    "ASSERT_ROWS_MODIFIED",
    "AT",
    "BETWEEN",
    "BY",
    "CASE",
    "CAST",
    "COLLATE",
    "CONTAINS",
    "CREATE",
    "CROSS",
    "CUBE",
    "CURRENT",
    "DEFAULT",
    "DEFINE",
    "DESC",
    "DISTINCT",
    "ELSE",
    "END",
    "ENUM",
    "ESCAPE",
    "EXCEPT",
    "EXCLUDE",
    "EXISTS",
    "EXTRACT",
    "FALSE",
    "FETCH",
    "FOLLOWING",
    "FOR",
    "FROM",
    "FULL",
    "GROUP",
    "GROUPING",
    "GROUPS",
    "HASH",
    "HAVING",
    "IF",
    "IGNORE",
    "IN",
    "INNER",
    "INTERSECT",
    "INTERVAL",
    "INTO",
    "IS",
    "JOIN",
    "LATERAL",
    "LEFT",
    "LIKE",
    "LIMIT",
    "LOOKUP",
    "MERGE",
    "NATURAL",
    "NEW",
    "NO",
    "NOT",
    "NULL",
    "NULLS",
    "OF",
    "ON",
    "OR",
    "ORDER",
    "OUTER",
    "OVER",
    "PARTITION",
    "PRECEDING",
    "PROTO",
    "QUALIFY",
    "RANGE",
    "RECURSIVE",
    "RESPECT",
    "RIGHT",
    "ROLLUP",
    "ROWS",
    "SELECT",
    "SET",
    "SOME",
    "STRUCT",
    "TABLESAMPLE",
    "THEN",
    "TO",
    "TREAT",
    "TRUE",
    "UNBOUNDED",
    "UNION",
    "UNNEST",
    "USING",
    "WHEN",
    "WHERE",
    "WINDOW",
    "WITH",
    "WITHIN"
  ],
  operators: [
    "AND",
    "BETWEEN",
    "IN",
    "LIKE",
    "NOT",
    "OR",
    "IS",
    "NULL",
    "INTERSECT",
    "UNION",
    "INNER",
    "JOIN",
    "LEFT",
    "OUTER",
    "RIGHT",
    "GLOBAL"
  ],
  builtinFunctions: [
    // aggregate functions
    "ANY_VALUE",
    "ARRAY_AGG",
    "ARRAY_CONCAT_AGG",
    "AVG",
    "BIT_AND",
    "BIT_OR",
    "BIT_XOR",
    "COUNT",
    "COUNTIF",
    "LOGICAL_AND",
    "LOGICAL_OR",
    "MAX",
    "MIN",
    "STRING_AGG",
    "SUM",
    // statistical aggregate functions
    "CORR",
    "COVAR_POP",
    "COVAR_SAMP",
    "STDDEV_POP",
    "STDDEV_SAMP",
    "STDDEV",
    "VAR_POP",
    "VAR_SAMP",
    "VARIANCE",
    // approximate aggregate functions
    "APPROX_COUNT_DISTINCT",
    "APPROX_QUANTILES",
    "APPROX_TOP_COUNT",
    "APPROX_TOP_SUM",
    // hyperloglog++ functions
    "HLL_COUNT.INIT",
    "HLL_COUNT.MERGE",
    "HLL_COUNT.MERGE_PARTIAL",
    "HLL_COUNT.EXTRACT",
    // numbering functions
    "RANK",
    "DENSE_RANK",
    "PERCENT_RANK",
    "CUME_DIST",
    "NTILE",
    "ROW_NUMBER",
    // bit functions
    "BIT_COUNT",
    // conversion functions
    "CAST",
    "PARSE_BIGNUMERIC",
    "PARSE_NUMERIC",
    "SAFE_CAST",
    // mathematical functions
    "ABS",
    "SIGN",
    "IS_INF",
    "IS_NAN",
    "IEEE_DIVIDE",
    "RAND",
    "SQRT",
    "POW",
    "POWER",
    "EXP",
    "LN",
    "LOG",
    "LOG10",
    "GREATEST",
    "LEAST",
    "DIV",
    "SAFE_DIVIDE",
    "SAFE_MULTIPLY",
    "SAFE_NEGATE",
    "SAFE_ADD",
    "SAFE_SUBTRACT",
    "MOD",
    "ROUND",
    "TRUNC",
    "CEIL",
    "CEILING",
    "FLOOR",
    "COS",
    "COSH",
    "ACOS",
    "ACOSH",
    "SIN",
    "SINH",
    "ASIN",
    "ASINH",
    "TAN",
    "TANH",
    "ATAN",
    "ATANH",
    "ATAN2",
    "RANGE_BUCKET",
    // navigation functions
    "FIRST_VALUE",
    "LAST_VALUE",
    "NTH_VALUE",
    "LEAD",
    "LAG",
    "PERCENTILE_COUNT",
    "PERCENTILE_DISC",
    // aggregate analytic functions (functions are listed under other categories)
    // hash functions
    "FARM_FINGERPRINT",
    "MD5",
    "SHA1",
    "SHA256",
    "SHA512",
    // string functions
    "ASCII",
    "BYTE_LENGTH",
    "CHAR_LENGTH",
    "CHARACTER_LENGTH",
    "CHR",
    "CODE_POINTS_TO_BYTES",
    "CODE_POINTS_TO_STRING",
    "COLLATE",
    "CONCAT",
    "CONTAINS_SUBSTR",
    "ENDS_WITH",
    "FORMAT",
    "FROM_BASE32",
    "FROM_BASE64",
    "FROM_HEX",
    "INITCAP",
    "INSTR",
    "LEFT",
    "LENGTH",
    "LPAD",
    "LOWER",
    "LTRIM",
    "NORMALIZE",
    "NORMALIZE_AND_CASEFOLD",
    "OCTET_LENGTH",
    "REGEXP_CONTAINS",
    "REGEXP_EXTRACT",
    "REGEXP_EXTRACT_ALL",
    "REGEXP_INSTR",
    "REGEXP_REPLACE",
    "REGEXP_SUBSTR",
    "REPLACE",
    "REPEAT",
    "REVERSE",
    "RIGHT",
    "RPAD",
    "RTRIM",
    "SAFE_CONVERT_BYTES_TO_STRING",
    "SOUNDEX",
    "SPLIT",
    "STARTS_WITH",
    "STRPOS",
    "SUBSTR",
    "SUBSTRING",
    "TO_BASE32",
    "TO_BASE64",
    "TO_CODE_POINTS",
    "TO_HEX",
    "TRANSLATE",
    "TRIM",
    "UNICODE",
    "UPPER",
    // json functions
    "JSON_EXTRACT",
    "JSON_QUERY",
    "JSON_EXTRACT_SCALAR",
    "JSON_VALUE",
    "JSON_EXTRACT_ARRAY",
    "JSON_QUERY_ARRAY",
    "JSON_EXTRACT_STRING_ARRAY",
    "JSON_VALUE_ARRAY",
    "PARSE_JSON",
    "TO_JSON",
    "TO_JSON_STRING",
    "STRING",
    "BOOL",
    "INT64",
    "FLOAT64",
    "JSON_TYPE",
    // array functions
    "ARRAY",
    "ARRAY_CONCAT",
    "ARRAY_LENGTH",
    "ARRAY_TO_STRING",
    "GENERATE_ARRAY",
    "GENERATE_DATE_ARRAY",
    "GENERATE_TIMESTAMP_ARRAY",
    "ARRAY_REVERSE",
    // date functions
    "CURRENT_DATE",
    "EXTRACT",
    "DATE",
    "DATE_ADD",
    "DATE_SUB",
    "DATE_DIFF",
    "DATE_TRUNC",
    "DATE_FROM_UNIX_DATE",
    "FORMAT_DATE",
    "LAST_DAY",
    "PARSE_DATE",
    "UNIX_DATE",
    // datetime functions
    "CURRENT_DATETIME",
    "DATETIME",
    // 'EXTRACT', (duplicated above)
    "DATETIME_ADD",
    "DATETIME_SUB",
    "DATETIME_DIFF",
    "DATETIME_TRUNC",
    "FORMAT_DATETIME",
    // 'LAST_DAY', (duplicated above)
    "PARSE_DATETIME",
    // time functions
    "CURRENT_TIME",
    "TIME",
    // 'EXTRACT', (duplicated above)
    "TIME_ADD",
    "TIME_SUB",
    "TIME_DIFF",
    "TIME_TRUNC",
    "FORMAT_TIME",
    "PARSE_TIME",
    // timestamp functions
    "CURRENT_TIMESTAMP",
    // 'EXTRACT', (duplicated above)
    "STRING",
    "TIMESTAMP",
    "TIMESTAMP_ADD",
    "TIMESTAMP_SUB",
    "TIMESTAMP_DIFF",
    "TIMESTAMP_TRUNC",
    "FORMAT_TIMESTAMP",
    "PARSE_TIMESTAMP",
    "TIMESTAMP_SECONDS",
    "TIMESTAMP_MILLIS",
    "TIMESTAMP_MICROS",
    "UNIX_SECONDS",
    "UNIX_MILLIS",
    "UNIX_MICROS",
    // interval functions
    "MAKE_INTERVAL",
    // 'EXTRACT', (duplicated above)
    "JUSTIFY_DAYS",
    "JUSTIFY_HOURS",
    "JUSTIFY_INTERVAL",
    // geography functions
    "S2_CELLIDFROMPOINT",
    "S2_COVERINGCELLIDS",
    "ST_ANGLE",
    "ST_AREA",
    "ST_ASBINARY",
    "ST_ASGEOJSON",
    "ST_ASTEXT",
    "ST_AZIMUTH",
    "ST_BOUNDARY",
    "ST_BOUNDINGBOX",
    "ST_BUFFER",
    "ST_BUFFERWITHTOLERANCE",
    "ST_CENTROID",
    "ST_CENTROID_AGG",
    "ST_CLOSESTPOINT",
    "ST_CLUSTERDBSCAN",
    "ST_CONTAINS",
    "ST_CONVEXHULL",
    "ST_COVEREDBY",
    "ST_COVERS",
    "ST_DIFFERENCE",
    "ST_DIMENSION",
    "ST_DISJOINT",
    "ST_DISTANCE",
    "ST_DUMP",
    "ST_DWITHIN",
    "ST_ENDPOINT",
    "ST_EQUALS",
    "ST_EXTENT",
    "ST_EXTERIORRING",
    "ST_GEOGFROM",
    "ST_GEOGROMGEOJSON",
    "ST_GEOGFROMTEXT",
    "ST_GEOGFROMWKB",
    "ST_GEOPOINT",
    "ST_GEOPOINTFROMGEOHASH",
    "ST_GEOHASH",
    "ST_GEOMETRYTYPE",
    "ST_INTERIORRINGS",
    "ST_INTERSECTION",
    "ST_INTERSECTS",
    "ST_INTERSECTSBOX",
    "ST_ISCOLLECTION",
    "ST_ISEMPTY",
    "ST_LENGTH",
    "ST_MAKELINE",
    "ST_MAKEPOLYGON",
    "ST_MAKEPOLYGONORIENTED",
    "ST_MAXDISTANCE",
    "ST_NPOINTS",
    "ST_NUMGEOMETRIES",
    "ST_NUMPOINTS",
    "ST_PERIMETER",
    "ST_POINTN",
    "ST_SIMPLIFY",
    "ST_SNAPTOGRID",
    "ST_STARTPOINT",
    "ST_TOUCHES",
    "ST_UNION",
    "ST_UNION_AGG",
    "ST_WITHIN",
    "ST_X",
    "ST_Y",
    // security functions
    "SESSION_USER",
    // uuid functions
    "GENERATE_UUID",
    // net functions
    "NET.IP_FROM_STRING",
    "NET.SAFE_IP_FROM_STRING",
    "NET.IP_TO_STRING",
    "NET.IP_NET_MASK",
    "NET.IP_TRUNC",
    "NET.IPV4_FROM_INT64",
    "NET.IPV4_TO_INT64",
    "NET.HOST",
    "NET.PUBLIC_SUFFIX",
    "NET.REG_DOMAIN",
    // debugging functions
    "ERROR",
    // aead encryption functions
    "KEYS.NEW_KEYSET",
    "KEYS.ADD_KEY_FROM_RAW_BYTES",
    "AEAD.DECRYPT_BYTES",
    "AEAD.DECRYPT_STRING",
    "AEAD.ENCRYPT",
    "KEYS.KEYSET_CHAIN",
    "KEYS.KEYSET_FROM_JSON",
    "KEYS.KEYSET_TO_JSON",
    "KEYS.ROTATE_KEYSET",
    "KEYS.KEYSET_LENGTH"
  ],
  builtinVariables: [
    // NOT SUPPORTED
  ],
  pseudoColumns: [
    // NOT SUPPORTED
  ],
  tokenizer: {
    root: [
      { include: "@comments" },
      { include: "@whitespace" },
      { include: "@pseudoColumns" },
      { include: "@numbers" },
      { include: "@strings" },
      { include: "@complexIdentifiers" },
      { include: "@scopes" },
      [/[;,.]/, "delimiter"],
      [/[()]/, "@brackets"],
      [
        /[\w@#$]+/,
        {
          cases: {
            "@operators": "operator",
            "@builtinVariables": "predefined",
            "@builtinFunctions": "predefined",
            "@keywords": "keyword",
            "@default": "identifier"
          }
        }
      ],
      [/[<>=!%&+\-*/|~^]/, "operator"]
    ],
    whitespace: [[/\s+/, "white"]],
    comments: [
      [/--+.*/, "comment"],
      [/#+.*/, "comment"],
      [/\/\*/, { token: "comment.quote", next: "@comment" }]
    ],
    comment: [
      [/[^*/]+/, "comment"],
      // Not supporting nested comments, as nested comments seem to not be standard?
      // i.e. http://stackoverflow.com/questions/728172/are-there-multiline-comment-delimiters-in-sql-that-are-vendor-agnostic
      // [/\/\*/, { token: 'comment.quote', next: '@push' }],    // nested comment not allowed :-(
      [/\*\//, { token: "comment.quote", next: "@pop" }],
      [/./, "comment"]
    ],
    pseudoColumns: [
      [
        /[$][A-Za-z_][\w@#$]*/,
        {
          cases: {
            "@pseudoColumns": "predefined",
            "@default": "identifier"
          }
        }
      ]
    ],
    numbers: [
      [/0[xX][0-9a-fA-F]*/, "number"],
      [/[$][+-]*\d*(\.\d*)?/, "number"],
      [/((\d+(\.\d*)?)|(\.\d+))([eE][-+]?\d+)?/, "number"]
    ],
    strings: [
      [/'/, { token: "string", next: "@string" }],
      [/"/, { token: "string.double", next: "@stringDouble" }]
    ],
    string: [
      [/[^']+/, "string"],
      [/''/, "string"],
      [/'/, { token: "string", next: "@pop" }]
    ],
    stringDouble: [
      [/[^"]+/, "string.double"],
      [/""/, "string.double"],
      [/"/, { token: "string.double", next: "@pop" }]
    ],
    complexIdentifiers: [
      [/`/, { token: "identifier.quote", next: "@quotedIdentifier" }]
    ],
    quotedIdentifier: [
      [/[^`]+/, "identifier"],
      [/``/, "identifier"],
      [/`/, { token: "identifier.quote", next: "@pop" }]
    ],
    scopes: [
      // NOT SUPPORTED
    ]
  }
};
export {
  T as conf,
  E as language
};
//# sourceMappingURL=bigquery-Ch3EpP5O.mjs.map
