Skip to content

Commit

Permalink
fixed different no-ops in regexps, most were described in #77.
Browse files Browse the repository at this point in the history
  • Loading branch information
BendingBender committed Jul 8, 2015
1 parent 72dbac0 commit 0d8ac8f
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions lib/regexrules.js
Original file line number Diff line number Diff line change
@@ -1,87 +1,87 @@

module.exports = {
simple : {
echo : "^@echo[ \t]*(.*)[ \t]*$",
exec : "^@exec[ \t]*([^\n]*)[ \t]*\\(([^\n]*)\\)[ \t]*$",
include : "^(.*)@include(?!-)[ \t]*([^\n]*)[ \t]*$", // allow prefix characters to specify the indent level of included file
'include-static' : "^(.*)@include-static[ \t]*([^\n]*)[ \t]*$"
echo : "^@echo[ \t]+(.*)[ \t]*$",
exec : "^@exec[ \t]+(.*)[ \t]*\\((.*)\\)[ \t]*$",
include : "^(.*)@include(?!-)[ \t]+(.*)[ \t]*$", // allow prefix characters to specify the indent level of included file
'include-static' : "^(.*)@include-static[ \t]+(.*)[ \t]*$"
},
html : {
echo : "<!--[ \t]*@echo[ \t]*([^\n]*?)[ \t]*(?:-->|!>)",
exec : "<!--[ \t]*@exec[ \t]*([^\n]*)[ \t]*\\(([^\n]*)\\)[ \t]*(?:-->|!>)",
include : "(.*)<!--[ \t]*@include(?!-)[ \t]*([^\n]*?)[ \t]*(?:-->|!>)",
'include-static' : "(.*)<!--[ \t]*@include-static[ \t]*([^\n]*)[ \t]*(?:-->|!>)",
echo : "<!--[ \t]*@echo[ \t]+(.*?)[ \t]*(?:-->|!>)",
exec : "<!--[ \t]*@exec[ \t]+(.*)[ \t]*\\((.*)\\)[ \t]*(?:-->|!>)",
include : "(.*)<!--[ \t]*@include(?!-)[ \t]+(.*?)[ \t]*(?:-->|!>)",
'include-static' : "(.*)<!--[ \t]*@include-static[ \t]+(.*?)[ \t]*(?:-->|!>)",
exclude : {
start : "(?:[ \t]*)?<!--[ \t]*@exclude[ \t]*([^\n]*?)[ \t]*(?:-->|!>)(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)?<!--[ \t]*@endexclude[ \t]*(?:-->|!>)(?:[ \t]*[\n])?"
start : "[ \t]*<!--[ \t]*@exclude[ \t]*(.*?)[ \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])?"
start : "[ \t]*<!--[ \t]*@extend(?!able)[ \t]+(.*?)[ \t]*(?:-->|!>)(?:[ \t]*\n+)?",
end : "[ \t]*<!--[ \t]*@endextend[ \t]*(?:-->|!>)(?:[ \t]*\n)?"
},
extendable : "<!--[ \t]*@extendable[ \t]*(?:-->|!>)",
if : {
start : "(?:[ \t]*)?<!--[ \t]*@(ifndef|ifdef|if)[ \t]*(.*?)[ \t]*(?:-->|!>)(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)?<!(?:--)?[ \t]*@endif[ \t]*(?:-->|!>)(?:[ \t]*[\n])?"
start : "[ \t]*<!--[ \t]*@(ifndef|ifdef|if)[ \t]+(.*?)[ \t]*(?:-->|!>)(?:[ \t]*\n+)?",
end : "[ \t]*<!(?:--)?[ \t]*@endif[ \t]*(?:-->|!>)(?:[ \t]*\n)?"
},
foreach : {
start : "(?:[ \t]*)?<!--[ \t]*@foreach[ \t]*(.*?)[ \t]*(?:-->|!>)(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)?<!(?:--)?[ \t]*@endfor[ \t]*(?:-->|!>)(?:[ \t]*[\n])?"
start : "[ \t]*<!--[ \t]*@foreach[ \t]+(.*?)[ \t]*(?:-->|!>)(?:[ \t]*\n+)?",
end : "[ \t]*<!(?:--)?[ \t]*@endfor[ \t]*(?:-->|!>)(?:[ \t]*\n)?"
}
},
js : {
echo : [
"(?:/\\*)[ \t]*@echo[ \t]*([^\n]*?)[ \t]*(?:\\*(?:\\*|/))",
"(?://)[ \t]*@echo[ \t]*([^\n]*)[ \t]*"
"/\\*[ \t]*@echo[ \t]+(.*?)[ \t]*\\*(?:\\*|/)",
"//[ \t]*@echo[ \t]+(.*)[ \t]*"
],
exec : "(?://|/\\*)[ \t]*@exec[ \t]*([^\n]*)[ \t]*\\(([^\n]*)\\)[ \t]*(?:\\*(?:\\*|/))?",
exec : "(?://|/\\*)[ \t]*@exec[ \t]+(.*)[ \t]*\\((.*)\\)[ \t]*(?:\\*(?:\\*|/))?",
include : [
"(.*)(?:/\\*)[ \t]*@include(?!-)[ \t]*([^\n]*?)[ \t]*(?:\\*(?:\\*|/))",
"(.*)(?://)[ \t]*@include(?!-)[ \t]*([^\n]*)[ \t]*"
"(.*)/\\*[ \t]*@include(?!-)[ \t]+(.*?)[ \t]*\\*(?:\\*|/)",
"(.*)//[ \t]*@include(?!-)[ \t]+(.*)[ \t]*"
],
'include-static': [
"(.*)(?:/\\*)[ \t]*@include-static[ \t]*([^\n]*?)[ \t]*(?:\\*(?:\\*|/))",
"(.*)(?://)[ \t]*@include-static[ \t]*([^\n]*)[ \t]*"
"(.*)/\\*[ \t]*@include-static[ \t]+(.*?)[ \t]*\\*(?:\\*|/)",
"(.*)//[ \t]*@include-static[ \t]+(.*)[ \t]*"
],
exclude : {
start : "(?:[ \t]*)?(?://|/\\*)[ \t]*@exclude[ \t]*([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)?(?://|/\\*)[ \t]*@endexclude[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?"
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])?"
start : "[ \t]*(?://|/\\*)[ \t]*@extend(?!able)[ \t]+([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*\n+)?",
end : "[ \t]*(?://|/\\*)[ \t]*@endextend[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*\n)?"
},
extendable : "(?:[ \t]*)(?://|/\\*)[ \t]*@extendable[ \t]*([^\n*]*)[ \t]*(?:\\*/)?",
extendable : "[ \t]*(?://|/\\*)[ \t]*@extendable[ \t]*(?:\\*/)?",
if : {
start : "(?:[ \t]*)?(?://|/\\*)[ \t]*@(ifndef|ifdef|if)[ \t]*([^\n*]*)[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)?(?://|/\\*)[ \t]*@endif[ \t]*(?:\\*(?:\\*|/))?(?:[ \t]*[\n])?"
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])?"
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]*",
include : "(.*?)(?:#+)[ \t]*@include(?!-)[ \t]*([^\n]*)[ \t]*",
'include-static' : "(.*?)(?:#+)[ \t]*@include-static[ \t]*([^\n]*)[ \t]*",
echo : "[ \t]*#+[ \t]*@echo[ \t]+(.*)[ \t]*",
exec : "[ \t]*#+[ \t]*@exec[ \t]+(.*)[ \t]*\\((.*)\\)[ \t]*",
include : "(.*?)#+[ \t]*@include(?!-)[ \t]+(.*)[ \t]*",
'include-static' : "(.*?)#+[ \t]*@include-static[ \t]+(.*)[ \t]*",
exclude : {
start : "(?:[ \t]*)(?:#+)[ \t]*@exclude[ \t]*([^\n*]*)[ \t]*(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)(?:#+)[ \t]*@endexclude[ \t]*(?:[ \t]*[\n])?"
start : "[ \t]*#+[ \t]*@exclude[ \t]*(.*)[ \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])?"
start : "[ \t]*#+[ \t]*@extend(?!able)[ \t]+(.*)[ \t]*(?:[ \t]*\n+)?",
end : "[ \t]*#+[ \t]*@endextend[ \t]*(?:[ \t]*\n)?"
},
extendable : "(?:[ \t]*)(?:#+)[ \t]*@extendable[ \t]*([^\n*]*)[ \t]*",
extendable : "[ \t]*#+[ \t]*@extendable[ \t]*",
if : {
start : "(?:[ \t]*)(?:#+)[ \t]*@(ifndef|ifdef|if)[ \t]*([^\n*]*)[ \t]*(?:[ \t]*[\n]+)?",
end : "(?:[ \t]*)(?:#+)[ \t]*@endif[ \t]*(?:[ \t]*[\n])?"
start : "[ \t]*#+[ \t]*@(ifndef|ifdef|if)[ \t]+(.*)[ \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])?"
start : "[ \t]*#+[ \t]*@foreach[ \t]+(.*)[ \t]*(?:[ \t]*\n+)?",
end : "[ \t]*#+[ \t]*@endfor[ \t]*(?:[ \t]*\n)?"
}
}
};
Expand Down

0 comments on commit 0d8ac8f

Please sign in to comment.