Skip to content

Instantly share code, notes, and snippets.

@darwin
Created January 31, 2009 10:48
Show Gist options
  • Save darwin/55511 to your computer and use it in GitHub Desktop.
Save darwin/55511 to your computer and use it in GitHub Desktop.
{ name = 'area.dbg.marker.pagebout.js';
begin = '^(//)(#dbg)\s*$';
end = '^(//)(\2)\s*$';
beginCaptures = {
1 = { name = 'comment.line.punctuation.definition.comment.js'; };
2 = { name = 'active.dbg.token.open.pagebout.comment.line.js'; };
};
endCaptures = {
1 = { name = 'comment.line.punctuation.definition.comment.js'; };
2 = { name = 'active.dbg.token.close.pagebout.comment.line.js'; };
};
patterns = (
{ name = 'active.dbg.marker.pagebout.js';
begin = '^(?=.*//#dbg\s*$)';
end = '(//)(#dbg)\s*$\n';
endCaptures = {
1 = { name = 'comment.line.punctuation.definition.comment.js'; };
2 = { name = 'active.dbg.token.mark.pagebout.comment.line.js'; };
};
patterns = (
{ include = 'source.js.jquery'; },
{ include = 'source.js'; },
);
},
{ include = '$self'; },
);
},
some javascript line //#dbg <- not match
//#dbg <- opening #dbg block
some line //#dbg <- match, we are in opened #dbg block
other line //#xxx <- not match, we are not in opened #xxx block
//#dbg <- closing block
this line should not match //#dbg <- not match, not in open #dbg block
//#dbg <- and openging again
//#xxx <- opening xxx block inside dbg block
line1 //#dbg <- match
line2 //#xxx <- match
line3 //#other <- not match
//#xxx <- closing
//#dbg <-closing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment