RandomSec/main/webapp/scripts/project/scripting.js
Stefano Mazzocchi 365868564f create 'main' and 'server'
git-svn-id: http://google-refine.googlecode.com/svn/branches/split-refactor@905 7d457c2a-affb-35e4-300a-418c747d4874
2010-05-30 16:52:50 +00:00

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
};
};