3
V'íck ã @ s^ d Z ddlmZmZmZmZ ddlmZmZm Z m
Z
mZmZm
Z
mZ dgZG dd deZdS )zÕ
pygments.lexers.promql
~~~~~~~~~~~~~~~~~~~~~~
Lexer for Prometheus Query Language.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é )Ú
RegexLexerÚbygroupsÚdefaultÚwords)ÚCommentÚKeywordÚNameÚNumberÚOperatorÚPunctuationÚStringÚ
WhitespaceÚPromQLLexerc 0 @ s8 e Zd ZdZdZdZdgZdgZededde fZ
edfdde fZedgdde jfZ
dKefdLefdMefe
ee
dNefdOejfdPejfdQejfdRefdSefdTejfdUejfdVeeeefdWedXfdYefdZed[fd\ed]fgd^ed_fdKefdLefdMefd`eejeeeeeefgdaed_fdNefgdYed_fdWedbfed_gdcZddS )hr z¦
For PromQL queries.
For details about the grammar see:
https://github.com/prometheus/prometheus/tree/master/promql/parser
.. versionadded: 2.7
ZPromQLz=https://prometheus.io/docs/prometheus/latest/querying/basics/Zpromqlz*.promqlÚboolÚbyÚ
group_leftÚgroup_rightÚignoringÚoffsetÚonÚwithoutz\b)ÚsuffixÚsumÚminÚmaxÚavgÚgroupÚstddevÚstdvarÚcountÚcount_valuesÚbottomkÚtopkÚquantileÚabsÚabsentÚabsent_over_timeÚ
avg_over_timeÚceilÚchangesÚ clamp_maxÚ clamp_minÚcount_over_timeÚday_of_monthÚday_of_weekÚ
days_in_monthÚdeltaÚderivÚexpÚfloorÚhistogram_quantileÚholt_wintersÚhourÚideltaÚincreaseÚirateÚ
label_joinÚ
label_replaceÚlnÚlog10Úlog2Ú
max_over_timeÚ
min_over_timeÚminuteÚmonthÚpredict_linearÚquantile_over_timeÚrateÚresetsÚroundÚscalarÚsortÚ sort_descÚsqrtÚstddev_over_timeÚstdvar_over_timeÚ
sum_over_timeÚtimeÚ timestampÚvectorÚyearz\nz\s+ú,z[1-9][0-9]*[smhdwy]z-?[0-9]+\.[0-9]+z-?[0-9]+z#.*?$z(\+|\-|\*|\/|\%|\^)z==|!=|>=|<=|<|>z
and|or|unlessz[_a-zA-Z][a-zA-Z0-9_]+z(["\'])(.*?)(["\'])z\(Úfunctionz\)z\{Úlabelsz\[Úrangez\}z#popzB([_a-zA-Z][a-zA-Z0-9_]*?)(\s*?)(=~|!=|=|!~)(\s*?)("|\')(.*?)("|\')z\]z#push)ÚrootrU rV rT N)r r r r r r r r )r r r r r r r r r r! r"