authorgravatar for ryan.saunderson88@gmail.comdimenus <ryan.saunderson88@gmail.com> 2017-11-03 16:25:00-05:00
committergravatar for ryan.saunderson88@gmail.comdimenus <ryan.saunderson88@gmail.com> 2017-11-03 16:29:49-05:00
log1ef6cb1b64e926a74db562401ebef3c673c3d7cf
treea3075ba6b2c5a48357271d4bd4f4eb98ba8f84ea
parent795703a39cfe0d59fcd9fff7a605a7efe9c5bdb2

Add support for windows line endings with c macros


1 files changed, 4 insertions(+), 1 deletions(-)

src/c_tokenizer.cpp+4-1
......@@ -91,6 +91,9 @@
9191 IDENT_START: \
9292 case DIGIT
9393
94#define LINE_ENDING \
95 '\r': \
96 case '\n'
9497
9598static void begin_token(CTokenize *ctok, CTokId id) {
9699 assert(ctok->cur_tok == nullptr);
......@@ -191,7 +194,7 @@ void tokenize_c_macro(CTokenize *ctok, const uint8_t *c) {
191194 case '\\':
192195 ctok->state = CTokStateBackslash;
193196 break;
194 case '\n':
197 case LINE_ENDING:
195198 goto found_end_of_macro;
196199 case IDENT_START:
197200 ctok->state = CTokStateIdentifier;