Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

// #endif is invalid unless it is followed by a new line #2

Closed
dahmian opened this issue Jun 14, 2013 · 2 comments
Closed

// #endif is invalid unless it is followed by a new line #2

dahmian opened this issue Jun 14, 2013 · 2 comments
Assignees

Comments

@dahmian
Copy link
Contributor

dahmian commented Jun 14, 2013

When I tried to run the following example from the readme, I get an error:

// #if 1==2
console.log("1==2");
// #elif 2==2
console.log("2==2");
// #endif

Error: Illegal #endif: // #endif...
at Preprocessor.process (/usr/local/lib/node_modules/preprocessor/Preprocessor.js:258:31)

But if I add in a new line after the #endif, then it works:

// #if 1==2
console.log("1==2");
// #elif 2==2
console.log("2==2");
// #endif

It looks like the unit test is also expecting a \n, so that's why it passes. https://github.com/dcodeIO/Preprocessor.js/blob/master/tests/suite.js#L33

@ghost ghost assigned dcodeIO Jun 14, 2013
@dcodeIO
Copy link
Owner

dcodeIO commented Jun 14, 2013

Thanks for reportings this! The issue has been fixed in 1.0.3 (also on NPM now).

@dahmian
Copy link
Contributor Author

dahmian commented Jun 14, 2013

Awesome, thanks for fixing it! I downloaded it from NPM and verified that it works.

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

No branches or pull requests

2 participants