Skip to content

Commit

Permalink
Merge 947c5fa into 704d289
Browse files Browse the repository at this point in the history
  • Loading branch information
kirly-af committed Apr 12, 2016
2 parents 704d289 + 947c5fa commit 888e933
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/regexrules.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ module.exports = {
}
},
coffee : {
echo : "#+[ \t]*@echo[ \t]+(.*?)[ \t]*$",
echo : [
"###+[ \t]*@echo[ \t]+(.*?)[ \t]###",
"#+[ \t]*@echo[ \t]+(.*?)[ \t]*$"
],
exec : "#+[ \t]*@exec[ \t]+(\\S+)[ \t]*\\((.*)\\)[ \t]*$",
include : "^(.*?)#+[ \t]*@include(?!-)[ \t]+(.*?)[ \t]*$",
'include-static' : "^(.*?)#+[ \t]*@include-static[ \t]+(.*?)[ \t]*$",
Expand Down
7 changes: 6 additions & 1 deletion test/echo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ describe('@echo directive shall be preprocessed', function () {
});

describe('in coffeescript', function () {
it('and resolve and echo variables', function () {
it('and resolve and echo variables (line)', function () {
input = "a\n# @echo FINGERPRINT\nc";
pp.preprocess(input, {FINGERPRINT: '0xDEADBEEF'}, 'coffee').should.equal("a\n0xDEADBEEF\nc");
});

it('and resolve and echo variables (block)', function () {
input = "a\n### @echo FINGERPRINT ###\nc";
pp.preprocess(input, {FINGERPRINT: '0xDEADBEEF'}, 'coffee').should.equal("a\n0xDEADBEEF\nc");
});

it('and resolve and echo variables (multiple hashes)', function () {
input = "a\n## @echo FINGERPRINT\nc";
pp.preprocess(input, {FINGERPRINT: '0xDEADBEEF'}, 'coffee').should.equal("a\n0xDEADBEEF\nc");
Expand Down

0 comments on commit 888e933

Please sign in to comment.