Skip to content

Commit

Permalink
Graphite query lexer change, can now handle regex parameters for alia…
Browse files Browse the repository at this point in the history
…sSub function (Fixes grafana#126)
  • Loading branch information
torkelo committed Jun 16, 2014
1 parent da451d0 commit 011e95b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
Use datasources config instead. panel_names removed from config.js. Use plugins.panels to add custom panels

#### Fixes
- Graphite query lexer change, can now handle regex parameters for aliasSub function (Fixes #126)
- Filter option loading when having muliple nested filters now works better.
Options are now reloaded correctly and there are no multiple renders/refresh inbetween (#447),
After an option is changed and a nested template param is also reloaded, if the current value
Expand Down
56 changes: 0 additions & 56 deletions src/app/services/graphite/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,62 +646,6 @@ define([
var jump = 1; // A length of a jump, after we're done
// parsing this character.

// Special treatment for some escaped characters.
if (char === "\\") {
this.skip();
char = this.peek();

switch (char) {
case "'":
break;
case "b":
char = "\b";
break;
case "f":
char = "\f";
break;
case "n":
char = "\n";
break;
case "r":
char = "\r";
break;
case "t":
char = "\t";
break;
case "0":
char = "\0";
break;
case "u":
char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16));
jump = 5;
break;
case "v":
char = "\v";
break;
case "x":
var x = parseInt(this.input.substr(1, 2), 16);
char = String.fromCharCode(x);
jump = 3;
break;
case "\\":
case "\"":
case "/":
break;
case "":
char = "";
break;
case "!":
if (value.slice(value.length - 2) === "<") {
break;
}

/*falls through */
default:
// Weird escaping.
}
}

value += char;
this.skip(jump);
}
Expand Down

0 comments on commit 011e95b

Please sign in to comment.