2c8595098c
git-svn-id: http://google-refine.googlecode.com/svn/trunk@883 7d457c2a-affb-35e4-300a-418c747d4874
23 lines
583 B
JavaScript
23 lines
583 B
JavaScript
var Scripting = {
|
|
languages: [ "gel", "jython", "clojure" ]
|
|
};
|
|
|
|
Scripting.parse = function(expression) {
|
|
var colon = expression.indexOf(":");
|
|
if (colon > 0) {
|
|
var l = expression.substring(0, colon);
|
|
for (var i = 0; i < Scripting.languages.length; i++) {
|
|
if (l == Scripting.languages[i]) {
|
|
return {
|
|
language: l,
|
|
expression: expression.substring(colon + 1)
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
return {
|
|
language: "gel",
|
|
expression: expression
|
|
};
|
|
}; |