jsoverson / preprocess

Preprocess HTML, JavaScript, and other files with directives based off custom or ENV configuration
Other
366 stars 80 forks source link

Allow one line blocks #94

Open delapuente opened 9 years ago

delapuente commented 9 years ago

From time to time you simply need to remove or leave debug traces or performance marks. For these cases, an alternative syntax to make the directive affect only the next line or the next block would be great. I suggest extending syntax to allow affect next line (_) or block ({}):

// @ifdef DEBUG {}
function debug(msg) {
  console.log('[DEBUG] ' + msg)
}

// @ifdef DEBUG _
debug('A trace!');