mochiscript 0.4.6.pre1 → 0.4.6.pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mochiscript/core.rb +9 -1
- data/lib/mochiscript/version.rb +1 -1
- metadata +1 -1
data/lib/mochiscript/core.rb
CHANGED
@@ -1030,7 +1030,7 @@ RootParser.extend("ShorthandMapperParser", function(KLASS, OO){
|
|
1030
1030
|
args = "($1,$2,$3)";
|
1031
1031
|
}
|
1032
1032
|
|
1033
|
-
var body = new $c.
|
1033
|
+
var body = new $c.ReturnableCurlyParser();
|
1034
1034
|
body.parse(tokens);
|
1035
1035
|
|
1036
1036
|
this.out = [ '.', method, '(function', args, body, ')' ];
|
@@ -1111,6 +1111,14 @@ RootParser.extend("RegexParser", function(KLASS, OO){
|
|
1111
1111
|
|
1112
1112
|
});
|
1113
1113
|
|
1114
|
+
CurlyParser.extend("ReturnableCurlyParser", function(KLASS, OO){
|
1115
|
+
OO.addMember("toString", function(){
|
1116
|
+
var ret = this.$super();
|
1117
|
+
return ret.replace(/^{(\s*)(return)?/, '{$1return ');
|
1118
|
+
});
|
1119
|
+
});
|
1120
|
+
|
1121
|
+
|
1114
1122
|
CurlyParser.extend("ForeachParser", function(KLASS, OO){
|
1115
1123
|
OO.addMember("_TYPE", 'Foreach');
|
1116
1124
|
|
data/lib/mochiscript/version.rb
CHANGED