mochiscript 0.4.6.pre1 → 0.4.6.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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