Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow @include within @ifdefs to conditionally include files #10

Open
smartt opened this issue Sep 12, 2012 · 1 comment
Open

Allow @include within @ifdefs to conditionally include files #10

smartt opened this issue Sep 12, 2012 · 1 comment

Comments

@smartt
Copy link
Owner

smartt commented Sep 12, 2012

No description provided.

@Skylark13
Copy link
Contributor

I think this requires the parsing to be rewritten to go line by line instead of how it is now. Consider for example:

//@define DEBUG 0

var foo = function() {
  //@if DEBUG
  // define inside if needs to work first, and is simpler to demonstrate.
  //@define FOO 1
  //@end

  var bar = "Hello World";

  //@if FOO
  alert('This.');
  alert('That.');
  //@end
};

The way the parsing works now, no matter how you order things, you will never get the expected result. If you parse defines first, you will always get FOO defined to 1, even if DEBUG is 0, and if you parse if/ifdef/else/end first, DEBUG will not have been defined yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants