@prometheus-io/lezer-promql 0.307.2 → 0.308.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  // This file was generated by lezer-generator. You probably shouldn't edit it.
2
2
  export const
3
- inf = 163,
4
- nan = 164,
3
+ inf = 167,
4
+ nan = 168,
5
5
  Bool = 1,
6
6
  Ignoring = 2,
7
7
  On = 3,
@@ -30,133 +30,137 @@ export const
30
30
  Unless = 26,
31
31
  Start = 27,
32
32
  End = 28,
33
- LineComment = 29,
34
- PromQL = 30,
35
- AggregateExpr = 31,
36
- AggregateOp = 32,
37
- AggregateModifier = 33,
38
- GroupingLabels = 34,
39
- LabelName = 35,
40
- QuotedLabelName = 36,
41
- StringLiteral = 37,
42
- FunctionCallBody = 38,
43
- BinaryExpr = 39,
44
- Pow = 40,
45
- BoolModifier = 41,
46
- MatchingModifierClause = 42,
47
- Mul = 43,
48
- Div = 44,
49
- Mod = 45,
50
- Add = 46,
51
- Sub = 47,
52
- Eql = 48,
53
- Gte = 49,
54
- Gtr = 50,
55
- Lte = 51,
56
- Lss = 52,
57
- Neq = 53,
58
- FunctionCall = 54,
59
- FunctionIdentifier = 55,
60
- AbsentOverTime = 56,
61
- Identifier = 57,
62
- Absent = 58,
63
- Abs = 59,
64
- Acos = 60,
65
- Acosh = 61,
66
- Asin = 62,
67
- Asinh = 63,
68
- Atan = 64,
69
- Atanh = 65,
70
- AvgOverTime = 66,
71
- Ceil = 67,
72
- Changes = 68,
73
- Clamp = 69,
74
- ClampMax = 70,
75
- ClampMin = 71,
76
- Cos = 72,
77
- Cosh = 73,
78
- CountOverTime = 74,
79
- DaysInMonth = 75,
80
- DayOfMonth = 76,
81
- DayOfWeek = 77,
82
- DayOfYear = 78,
83
- Deg = 79,
84
- Delta = 80,
85
- Deriv = 81,
86
- Exp = 82,
87
- FirstOverTime = 83,
88
- Floor = 84,
89
- HistogramCount = 85,
90
- HistogramFraction = 86,
91
- HistogramQuantile = 87,
92
- HistogramStdDev = 88,
93
- HistogramStdVar = 89,
94
- HistogramSum = 90,
95
- HistogramAvg = 91,
96
- DoubleExponentialSmoothing = 92,
97
- Hour = 93,
98
- Idelta = 94,
99
- Increase = 95,
100
- Info = 96,
101
- Irate = 97,
102
- LabelReplace = 98,
103
- LabelJoin = 99,
104
- LastOverTime = 100,
105
- Ln = 101,
106
- Log10 = 102,
107
- Log2 = 103,
108
- MadOverTime = 104,
109
- MaxOverTime = 105,
110
- MinOverTime = 106,
111
- TsOfFirstOverTime = 107,
112
- TsOfMaxOverTime = 108,
113
- TsOfMinOverTime = 109,
114
- TsOfLastOverTime = 110,
115
- Minute = 111,
116
- Month = 112,
117
- Pi = 113,
118
- PredictLinear = 114,
119
- PresentOverTime = 115,
120
- QuantileOverTime = 116,
121
- Rad = 117,
122
- Rate = 118,
123
- Resets = 119,
124
- Round = 120,
125
- Scalar = 121,
126
- Sgn = 122,
127
- Sin = 123,
128
- Sinh = 124,
129
- Sort = 125,
130
- SortDesc = 126,
131
- SortByLabel = 127,
132
- SortByLabelDesc = 128,
133
- Sqrt = 129,
134
- StddevOverTime = 130,
135
- StdvarOverTime = 131,
136
- SumOverTime = 132,
137
- Tan = 133,
138
- Tanh = 134,
139
- Timestamp = 135,
140
- Time = 136,
141
- Vector = 137,
142
- Year = 138,
143
- MatrixSelector = 139,
144
- NumberDurationLiteralInDurationContext = 140,
145
- NumberDurationLiteral = 141,
146
- OffsetExpr = 142,
147
- ParenExpr = 143,
148
- SubqueryExpr = 144,
149
- UnaryExpr = 145,
150
- UnaryOp = 146,
151
- VectorSelector = 147,
152
- LabelMatchers = 148,
153
- UnquotedLabelMatcher = 149,
154
- MatchOp = 150,
155
- EqlSingle = 151,
156
- EqlRegex = 152,
157
- NeqRegex = 153,
158
- QuotedLabelMatcher = 154,
159
- StepInvariantExpr = 155,
160
- At = 156,
161
- AtModifierPreprocessors = 157,
162
- MetricName = 158
33
+ Smoothed = 29,
34
+ Anchored = 30,
35
+ LineComment = 31,
36
+ PromQL = 32,
37
+ AggregateExpr = 33,
38
+ AggregateOp = 34,
39
+ AggregateModifier = 35,
40
+ GroupingLabels = 36,
41
+ LabelName = 37,
42
+ QuotedLabelName = 38,
43
+ StringLiteral = 39,
44
+ FunctionCallBody = 40,
45
+ BinaryExpr = 41,
46
+ Pow = 42,
47
+ BoolModifier = 43,
48
+ MatchingModifierClause = 44,
49
+ Mul = 45,
50
+ Div = 46,
51
+ Mod = 47,
52
+ Add = 48,
53
+ Sub = 49,
54
+ Eql = 50,
55
+ Gte = 51,
56
+ Gtr = 52,
57
+ Lte = 53,
58
+ Lss = 54,
59
+ Neq = 55,
60
+ FunctionCall = 56,
61
+ FunctionIdentifier = 57,
62
+ AbsentOverTime = 58,
63
+ Identifier = 59,
64
+ Absent = 60,
65
+ Abs = 61,
66
+ Acos = 62,
67
+ Acosh = 63,
68
+ Asin = 64,
69
+ Asinh = 65,
70
+ Atan = 66,
71
+ Atanh = 67,
72
+ AvgOverTime = 68,
73
+ Ceil = 69,
74
+ Changes = 70,
75
+ Clamp = 71,
76
+ ClampMax = 72,
77
+ ClampMin = 73,
78
+ Cos = 74,
79
+ Cosh = 75,
80
+ CountOverTime = 76,
81
+ DaysInMonth = 77,
82
+ DayOfMonth = 78,
83
+ DayOfWeek = 79,
84
+ DayOfYear = 80,
85
+ Deg = 81,
86
+ Delta = 82,
87
+ Deriv = 83,
88
+ Exp = 84,
89
+ FirstOverTime = 85,
90
+ Floor = 86,
91
+ HistogramCount = 87,
92
+ HistogramFraction = 88,
93
+ HistogramQuantile = 89,
94
+ HistogramStdDev = 90,
95
+ HistogramStdVar = 91,
96
+ HistogramSum = 92,
97
+ HistogramAvg = 93,
98
+ DoubleExponentialSmoothing = 94,
99
+ Hour = 95,
100
+ Idelta = 96,
101
+ Increase = 97,
102
+ Info = 98,
103
+ Irate = 99,
104
+ LabelReplace = 100,
105
+ LabelJoin = 101,
106
+ LastOverTime = 102,
107
+ Ln = 103,
108
+ Log10 = 104,
109
+ Log2 = 105,
110
+ MadOverTime = 106,
111
+ MaxOverTime = 107,
112
+ MinOverTime = 108,
113
+ TsOfFirstOverTime = 109,
114
+ TsOfMaxOverTime = 110,
115
+ TsOfMinOverTime = 111,
116
+ TsOfLastOverTime = 112,
117
+ Minute = 113,
118
+ Month = 114,
119
+ Pi = 115,
120
+ PredictLinear = 116,
121
+ PresentOverTime = 117,
122
+ QuantileOverTime = 118,
123
+ Rad = 119,
124
+ Rate = 120,
125
+ Resets = 121,
126
+ Round = 122,
127
+ Scalar = 123,
128
+ Sgn = 124,
129
+ Sin = 125,
130
+ Sinh = 126,
131
+ Sort = 127,
132
+ SortDesc = 128,
133
+ SortByLabel = 129,
134
+ SortByLabelDesc = 130,
135
+ Sqrt = 131,
136
+ StddevOverTime = 132,
137
+ StdvarOverTime = 133,
138
+ SumOverTime = 134,
139
+ Tan = 135,
140
+ Tanh = 136,
141
+ Timestamp = 137,
142
+ Time = 138,
143
+ Vector = 139,
144
+ Year = 140,
145
+ MatrixSelector = 141,
146
+ NumberDurationLiteralInDurationContext = 142,
147
+ NumberDurationLiteral = 143,
148
+ OffsetExpr = 144,
149
+ AnchoredExpr = 145,
150
+ SmoothedExpr = 146,
151
+ ParenExpr = 147,
152
+ SubqueryExpr = 148,
153
+ UnaryExpr = 149,
154
+ UnaryOp = 150,
155
+ VectorSelector = 151,
156
+ LabelMatchers = 152,
157
+ UnquotedLabelMatcher = 153,
158
+ MatchOp = 154,
159
+ EqlSingle = 155,
160
+ EqlRegex = 156,
161
+ NeqRegex = 157,
162
+ QuotedLabelMatcher = 158,
163
+ StepInvariantExpr = 159,
164
+ At = 160,
165
+ AtModifierPreprocessors = 161,
166
+ MetricName = 162
@@ -31,6 +31,8 @@ expr[@isGroup=Expr] {
31
31
  MatrixSelector |
32
32
  NumberDurationLiteral |
33
33
  OffsetExpr |
34
+ AnchoredExpr |
35
+ SmoothedExpr |
34
36
  ParenExpr |
35
37
  StringLiteral |
36
38
  SubqueryExpr |
@@ -39,6 +41,14 @@ expr[@isGroup=Expr] {
39
41
  StepInvariantExpr
40
42
  }
41
43
 
44
+ AnchoredExpr {
45
+ expr Anchored
46
+ }
47
+
48
+ SmoothedExpr {
49
+ expr Smoothed
50
+ }
51
+
42
52
  AggregateExpr {
43
53
  AggregateOp AggregateModifier FunctionCallBody |
44
54
  AggregateOp FunctionCallBody AggregateModifier |
@@ -354,7 +364,9 @@ NumberDurationLiteralInDurationContext {
354
364
  Or,
355
365
  Unless,
356
366
  Start,
357
- End
367
+ End,
368
+ Smoothed,
369
+ Anchored
358
370
  }
359
371
 
360
372
  @external propSource promQLHighLight from "./highlight"
package/src/tokens.js CHANGED
@@ -42,6 +42,8 @@ import {
42
42
  Topk,
43
43
  Unless,
44
44
  Without,
45
+ Smoothed,
46
+ Anchored,
45
47
  } from './parser.terms.js';
46
48
 
47
49
  const keywordTokens = {
@@ -82,6 +84,8 @@ const contextualKeywordTokens = {
82
84
  unless: Unless,
83
85
  start: Start,
84
86
  end: End,
87
+ smoothed: Smoothed,
88
+ anchored: Anchored,
85
89
  };
86
90
 
87
91
  export const extendIdentifier = (value, stack) => {