jsoverson / preprocess

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

Asking for advace: ifdef #81

Open 9nix00 opened 9 years ago

9nix00 commented 9 years ago

Dear all:

I check the code and not found this feature,so I ask here.

Is there a plan for add feature like this:


//@ifdef (a && b)
//do something
//@endif

it's useful when we need do lot condition brach.

I know we can use
if (a && b) but if we forget define variable b before use it. this will cause an error. it's not a good practice.

Frizi commented 9 years ago

No plans as of now, as it would involve creating a complex parser. You can use multiple nested @ifdefs instead like

// @ifdef a
// @ifdef b
... your code
// @endif
// @endif
illumination517 commented 8 years ago

+1