From 9a5c77fc01f610c201fe93a99206f0cca291d5af Mon Sep 17 00:00:00 2001 From: gittycat Date: Thu, 2 Jul 2015 13:22:43 +1000 Subject: [PATCH 1/2] Added better Jade support Jade allows //- for comments, which didn't work with the js rules. --- lib/regexrules.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/regexrules.js b/lib/regexrules.js index 193506c..1a5e7a1 100644 --- a/lib/regexrules.js +++ b/lib/regexrules.js @@ -61,6 +61,38 @@ module.exports = { end : "(?:[ \t]*)?(?://|/\\*)[ \t]*@endfor[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?" } }, + jade : { + echo : [ + "(?:/\\*)[ \t]*@echo[ \t]*([^\n]*?)[ \t]*(?:\\*(?:\\*|/))", + "(?://-)[ \t]*@echo[ \t]*([^\n]*)[ \t]*" + ], + exec : "(?://-|/\\*)[ \t]*@exec[ \t]*([^\n]*)[ \t]*\\(([^\n]*)\\)[ \t]*(?:\\*(?:\\*|/))?", + include : [ + "(.*)(?:/\\*)[ \t]*@include(?!-)[ \t]*([^\n]*?)[ \t]*(?:\\*(?:\\*|/))", + "(.*)(?://-)[ \t]*@include(?!-)[ \t]*([^\n]*)[ \t]*" + ], + 'include-static': [ + "(.*)(?:/\\*)[ \t]*@include-static[ \t]*([^\n]*?)[ \t]*(?:\\*(?:\\*|/))", + "(.*)(?://-)[ \t]*@include-static[ \t]*([^\n]*)[ \t]*" + ], + exclude : { + start : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@exclude[ \t]*([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n]+)?", + end : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@endexclude[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?" + }, + extend : { + start : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@extend(?!able)[ \t]*([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n]+)?", + end : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@endextend[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?" + }, + extendable : "(?:[ \t]*)(?://-|/\\*)[ \t]*@extendable[ \t]*([^\n*]*)[ \t]*(?:\\*/)?", + if : { + start : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@(ifndef|ifdef|if)[ \t]*([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n]+)?", + end : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@endif[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?" + }, + foreach : { + start : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@foreach[ \t]*([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n]+)?", + end : "(?:[ \t]*)?(?://-|/\\*)[ \t]*@endfor[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?" + } + }, coffee : { echo : "(?:[ \t]*)(?:#+)[ \t]*@echo[ \t]*([^\n]*)[ \t]*", exec : "(?:[ \t]*)(?:#+)[ \t]*@exec[ \t]*([^\n]*)[ \t]*\\(([^\n]*)\\)[ \t]*", @@ -103,7 +135,6 @@ module.exports.php = module.exports.js; module.exports.ts = module.exports.js; module.exports.peg = module.exports.js; module.exports.pegjs = module.exports.js; -module.exports.jade = module.exports.js; module.exports.styl = module.exports.js; module.exports.coffee = module.exports.coffee; From 05c2f055e34d77f9415a47777ca1f534cc0a011c Mon Sep 17 00:00:00 2001 From: gittycat Date: Thu, 2 Jul 2015 13:36:07 +1000 Subject: [PATCH 2/2] Updated to nimblic repo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de2b968..6245b84 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/jsoverson/preprocess.git" + "url": "git://github.com/Nimblic/preprocess.git" }, "bugs": { "url": "https://github.com/jsoverson/preprocess/issues"