Add grammar (maybe?)
Signed-off-by: Levi Harrison <git@leviharrison.dev>
This commit is contained in:
		
							parent
							
								
									a283b52e8c
								
							
						
					
					
						commit
						e27ac3e7e4
					
				|  | @ -28,6 +28,7 @@ export const binOpTerms = [ | ||||||
|   { label: '<' }, |   { label: '<' }, | ||||||
|   { label: '<=' }, |   { label: '<=' }, | ||||||
|   { label: '!=' }, |   { label: '!=' }, | ||||||
|  |   { label: 'atan2' }, | ||||||
|   { label: 'and' }, |   { label: 'and' }, | ||||||
|   { label: 'or' }, |   { label: 'or' }, | ||||||
|   { label: 'unless' }, |   { label: 'unless' }, | ||||||
|  |  | ||||||
|  | @ -16,7 +16,8 @@ | ||||||
| 
 | 
 | ||||||
| @precedence { | @precedence { | ||||||
|   pow @right, |   pow @right, | ||||||
|   mul @left, |   mul @left | ||||||
|  |   atan2 @left, | ||||||
|   add @left, |   add @left, | ||||||
|   eql @left, |   eql @left, | ||||||
|   and @left, |   and @left, | ||||||
|  | @ -69,6 +70,7 @@ BinaryExpr { | ||||||
|   Expr !mul Mul    BinModifiers Expr | |   Expr !mul Mul    BinModifiers Expr | | ||||||
|   Expr !mul Div    BinModifiers Expr | |   Expr !mul Div    BinModifiers Expr | | ||||||
|   Expr !mul Mod    BinModifiers Expr | |   Expr !mul Mod    BinModifiers Expr | | ||||||
|  |   Expr !mul Atan2  BinModifiers Expr | | ||||||
|   Expr !add Add    BinModifiers Expr | |   Expr !add Add    BinModifiers Expr | | ||||||
|   Expr !add Sub    BinModifiers Expr | |   Expr !add Sub    BinModifiers Expr | | ||||||
|   Expr !eql Eql    BinModifiers Expr | |   Expr !eql Eql    BinModifiers Expr | | ||||||
|  | @ -333,6 +335,7 @@ NumberLiteral  { | ||||||
| // Contextual keywords | // Contextual keywords | ||||||
| 
 | 
 | ||||||
| @external extend {Identifier} extendIdentifier from "./tokens" { | @external extend {Identifier} extendIdentifier from "./tokens" { | ||||||
|  |   Atan2, | ||||||
|   Avg, |   Avg, | ||||||
|   Bottomk, |   Bottomk, | ||||||
|   Count, |   Count, | ||||||
|  |  | ||||||
|  | @ -40,7 +40,7 @@ export function promQLLanguage(top: LanguageType): LezerLanguage { | ||||||
|           'Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk': tags.operatorKeyword, |           'Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk': tags.operatorKeyword, | ||||||
|           'By Without Bool On Ignoring GroupLeft GroupRight Offset Start End': tags.modifier, |           'By Without Bool On Ignoring GroupLeft GroupRight Offset Start End': tags.modifier, | ||||||
|           'And Unless Or': tags.logicOperator, |           'And Unless Or': tags.logicOperator, | ||||||
|           'Sub Add Mul Mod Div Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At': tags.operator, |           'Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At': tags.operator, | ||||||
|           UnaryOp: tags.arithmeticOperator, |           UnaryOp: tags.arithmeticOperator, | ||||||
|           '( )': tags.paren, |           '( )': tags.paren, | ||||||
|           '[ ]': tags.squareBracket, |           '[ ]': tags.squareBracket, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue