integrated parser into graphite target editor

This commit is contained in:
Torkel Ödegaard 2013-12-24 12:59:21 +01:00
parent 042e2a208d
commit dd902d5a15
3 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,7 @@
define([ define([
'./lexer' './lexer'
], function (Lexer) { ], function (Lexer) {
'use strict';
var NodeTypes = { var NodeTypes = {
MetricExpression: 1, MetricExpression: 1,
@ -47,7 +48,7 @@ define([
type: 'segment', type: 'segment',
value: this.tokens[this.index].value value: this.tokens[this.index].value
}] }]
} };
this.index++; this.index++;
@ -59,7 +60,7 @@ define([
return null; return null;
} }
node.segments = node.segments.concat(rest.segments) node.segments = node.segments.concat(rest.segments);
} }
return node; return node;
@ -117,7 +118,7 @@ define([
return { return {
type: 'number', type: 'number',
value: parseInt(this.tokens[this.index-1].value) value: parseInt(this.tokens[this.index-1].value, 10)
}; };
}, },
@ -151,7 +152,7 @@ define([
match: function(token1, token2) { match: function(token1, token2) {
return this.matchToken(token1, 0) && return this.matchToken(token1, 0) &&
(!token2 || this.matchToken(token2, 1)) (!token2 || this.matchToken(token2, 1));
}, },
}; };

File diff suppressed because one or more lines are too long

View File

@ -147,6 +147,10 @@
} }
.grafana-target-func-panel { .grafana-target-func-panel {
background: #202020;
border-top: 1px solid black;
border-bottom: 1px solid black;
ul { ul {
list-style: none; list-style: none;
margin: 0; margin: 0;