Permalink
Browse files

see changelog

  • Loading branch information...
1 parent 2584cca commit 8db394b6000178440143c82dd097694b3c2a3874 @jeffsu committed Jun 22, 2012
View
@@ -1,3 +1,7 @@
+### 0.6.1
+
+ * arbitrary code after the initial heredoc declaration (see tests/heredocs.ms "test4")
+
### 0.6.0
* removed auto semicolon for heredoc
View
@@ -1 +1 @@
-0.6.0
+0.6.1
@@ -925,7 +925,7 @@ class Parser
OO.addMember("parse", function(tokens){var self=this;
- var beginning = tokens.match(/^<<(\w+)(?::(\w+))?\s*([;\)])*\n/);
+ var beginning = tokens.match(/^<<(\w+)(?::(\w+))?(.*?)\n/);
var terminator = beginning[1];
tokens.consume(beginning[0].length);
@@ -1,3 +1,3 @@
module Mochiscript
- VERSION = "0.6.0"
+ VERSION = "0.6.1"
end
@@ -892,7 +892,7 @@ RootParser.extend("HereDocParser", function(KLASS, OO){
OO.addMember("parse", function(tokens){var self=this;
- var beginning = tokens.match(/^<<(\w+)(?::(\w+))?\s*([;\)])*\n/);
+ var beginning = tokens.match(/^<<(\w+)(?::(\w+))?(.*?)\n/);
var terminator = beginning[1];
tokens.consume(beginning[0].length);
@@ -3,7 +3,7 @@
"description": "Javascript Dessert",
"keywords": [ "javascript", "language", "mochiscript", "compiler" ],
"author": "Jeff Su",
- "version": "0.6.0",
+ "version": "0.6.1",
"licenses": [ { "type": "MIT" }],
"engines": { "node": ">=0.4.0" },
"directories": { "lib": "./lib/mochiscript" },
View
@@ -361,7 +361,7 @@ class HereDocParser extends RootParser {
}
function parse(tokens) {
- var beginning = tokens.match(/^<<(\w+)(?::(\w+))?\s*([;\)])*\n/);
+ var beginning = tokens.match(/^<<(\w+)(?::(\w+))?(.*?)\n/);
var terminator = beginning[1];
tokens.consume(beginning[0].length);
View
@@ -14,7 +14,12 @@ var test3 = <<END;
hello{}=
END
+var test4 = <<END + " world";
+ hello
+END
+
$m.test(#{
$1.eq("hello\nworld", test1);
$1.eq("hello\nworld", test2);
+ $1.eq("hello world", test4);
});

0 comments on commit 8db394b

Please sign in to comment.